]> git.mxchange.org Git - hub.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Thu, 3 Dec 2020 22:39:34 +0000 (23:39 +0100)
committerRoland Häder <roland@mxchange.org>
Thu, 3 Dec 2020 22:39:34 +0000 (23:39 +0100)
- renamed more $packageInstance to $handlerInstance when it is type of
  Receivable
- fixed handling of repeated node_data record creation
- removed bad 'invalid' default values
- updated core framework

Signed-off-by: Roland Häder <roland@mxchange.org>
33 files changed:
application/hub/classes/chains/class_PackageFilterChain.php
application/hub/classes/database/frontend/node_dht/class_NodeDistributedHashTableDatabaseFrontend.php
application/hub/classes/database/frontend/node_information/class_NodeInformationDatabaseFrontend.php
application/hub/classes/database/frontend/states/class_PeerStateLookupDatabaseFrontend.php
application/hub/classes/dht/class_BaseDht.php
application/hub/classes/dht/node/class_NodeDhtFacade.php
application/hub/classes/factories/package/assembler/class_PackageAssemblerFactory.php
application/hub/classes/filter/tags/answer/class_PackageAnnouncementAnswerTagFilter.php
application/hub/classes/filter/tags/answer/class_PackageDhtBootstrapAnswerTagFilter.php
application/hub/classes/filter/tags/answer/class_PackageRequestNodeListAnswerTagFilter.php
application/hub/classes/filter/tags/class_PackageAnnouncementTagFilter.php
application/hub/classes/filter/tags/class_PackageDhtBootstrapTagFilter.php
application/hub/classes/filter/tags/class_PackageRequestNodeListTagFilter.php
application/hub/classes/filter/tags/class_PackageSelfConnectTagFilter.php
application/hub/classes/handler/data/answer-status/announcement/class_NodeAnnouncementAnswerOkayHandler.php
application/hub/classes/handler/data/answer-status/requests/class_RequestNodeListAnswerOkayHandler.php
application/hub/classes/handler/data/message-types/announcement/class_NodeMessageAnnouncementHandler.php
application/hub/classes/handler/data/message-types/answer/class_NodeMessageDhtBootstrapAnswerHandler.php
application/hub/classes/handler/data/message-types/answer/class_NodeMessageRequestNodeListAnswerHandler.php
application/hub/classes/handler/data/message-types/class_BaseMessageHandler.php
application/hub/classes/handler/data/message-types/dht/class_NodeMessageDhtBootstrapHandler.php
application/hub/classes/handler/data/message-types/requests/class_NodeMessageRequestNodeListHandler.php
application/hub/classes/handler/data/message-types/self-connect/class_NodeMessageSelfConnectHandler.php
application/hub/classes/handler/package/class_NetworkPackageHandler.php
application/hub/classes/nodes/class_BaseHubNode.php
application/hub/classes/package/assembler/class_PackageAssembler.php
application/hub/classes/resolver/protocol/tcp/class_TcpProtocolResolver.php
application/hub/classes/tools/hub/class_HubTools.php
application/hub/interfaces/filter/class_FilterablePackage.php
application/hub/interfaces/handler/answer-status/class_HandleableAnswerStatus.php
application/hub/interfaces/handler/message-types/class_HandleableMessage.php
application/hub/interfaces/nodes/class_Node.php
core

index 6b02d776b8c8d65593922bc4270c9e30b9cc72f6..29e2c3429a88cf735d8209538202f377d646a570 100644 (file)
@@ -63,12 +63,12 @@ class PackageFilterChain extends FilterChain {
         * @return      void
         * @todo        This may be slow if a message with a lot tags arrived
         */
-       public function processMessage (DeliverableMessage $messageInstance, Receivable $packageInstance) {
+       public function processMessage (DeliverableMessage $messageInstance, Receivable $handlerInstance) {
                // Get all filters and "run" them
                foreach ($this->getFilters() as $filterInstance) {
                        // Try to process it
                        try {
-                               $filterInstance->processMessage($messageInstance, $packageInstance);
+                               $filterInstance->processMessage($messageInstance, $handlerInstance);
                        } catch (FilterChainException $e) {
                                // This exception can be thrown to just skip any further processing
                                self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Failed to execute lase filter ' . $filterInstance->__toString() . ': ' . $e->getMessage());
@@ -81,15 +81,15 @@ class PackageFilterChain extends FilterChain {
         * Post-processes the stacked message. Do not call popNamed() as then no
         * other class can process the message.
         *
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         */
-       public function postProcessMessage (Receivable $packageInstance) {
+       public function postProcessMessage (Receivable $handlerInstance) {
                // Get all filters and "run" them
                foreach ($this->getPostFilters() as $filterInstance) {
                        // Try to process it
                        try {
-                               $filterInstance->postProcessMessage($packageInstance);
+                               $filterInstance->postProcessMessage($handlerInstance);
                        } catch (FilterChainException $e) {
                                // This exception can be thrown to just skip any further processing
                                self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Failed to execute lase filter ' . $filterInstance->__toString() . ': ' . $e->getMessage());
@@ -97,7 +97,5 @@ class PackageFilterChain extends FilterChain {
                        }
                } // END - foreach
        }
-}
 
-// [EOF]
-?>
+}
index bf910e1731ac6ef5051acf682d9f214b58ec4129..b3ddc7baf2ec3e8364aca1178e5a9fd1cbe7d42c 100644 (file)
@@ -112,7 +112,7 @@ class NodeDistributedHashTableDatabaseFrontend extends BaseHubDatabaseFrontend i
         */
        public static final function getAllElements () {
                // Create array and ...
-               $elements = array(
+               $elements = [
                        self::DB_COLUMN_NODE_ID,
                        self::DB_COLUMN_SESSION_ID,
                        self::DB_COLUMN_EXTERNAL_ADDRESS,
@@ -120,7 +120,7 @@ class NodeDistributedHashTableDatabaseFrontend extends BaseHubDatabaseFrontend i
                        self::DB_COLUMN_NODE_MODE,
                        self::DB_COLUMN_ACCEPTED_OBJECTS,
                        self::DB_COLUMN_NODE_LIST
-               );
+               ];
 
                // ... return it
                return $elements;
index 9b971a68705c174622a1b518eab99b33a3912091..a4c8d6582e986196034481d4d838d4822361ebcb 100644 (file)
@@ -82,6 +82,7 @@ class NodeInformationDatabaseFrontend extends BaseHubDatabaseFrontend implements
         */
        public function findFirstNodeData () {
                // Is there cache?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-FRONTEND: CALLED!');
                if (!isset($GLOBALS[__METHOD__])) {
                        // Now get a search criteria instance
                        $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
@@ -95,10 +96,12 @@ class NodeInformationDatabaseFrontend extends BaseHubDatabaseFrontend implements
                        $resultInstance = $this->doSelectByCriteria($searchInstance);
 
                        // Is it valid?
-                       $GLOBALS[__METHOD__] = ($resultInstance->next() ? $resultInstance : NULL);
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FRONTEND: resultInstance->valid()=%d', intval($resultInstance->valid())));
+                       $GLOBALS[__METHOD__] = ($resultInstance->valid() ? $resultInstance : NULL);
                }
 
                // Return it
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FRONTEND: resultInstance[]=%s - EXIT!', gettype($GLOBALS[__METHOD__])));
                return $GLOBALS[__METHOD__];
        }
 
index 27e3c919742e7c9facb0ac233ed09f93085529c7..f059e94e627ed1047eb403ea5281b7b864b8f5a8 100644 (file)
@@ -250,7 +250,7 @@ class PeerStateLookupDatabaseFrontend extends BaseHubDatabaseFrontend implements
                $resultInstance = $this->doSelectByCriteria($searchInstance);
 
                // Do we have an entry? This should always the case
-               if (!$resultInstance->next()) {
+               if (!$resultInstance->valid()) {
                        // No next record!
                        throw new UnexpectedValueException(sprintf('resultInstance=%s,count()=%d has no next entry', $resultInstance->__toString(), $resultInstance->count()));
                }
index 9a634599586fcdaf86e61f9219f4a7fbb0109438..e3a6f01e5dda89a43150d15ab5233b04998252d3 100644 (file)
@@ -183,7 +183,7 @@ abstract class BaseDht extends BaseHubSystem implements Distributable {
                }
 
                // "Walk" through all entries
-               while ($resultInstance->next()) {
+               while ($resultInstance->valid()) {
                        // Get current entry
                        $current = $resultInstance->current();
 
@@ -194,6 +194,9 @@ abstract class BaseDht extends BaseHubSystem implements Distributable {
                        // ... and push it to the next stack
                        /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DHT: Pushing entry with ' . count($current) . ' elements to stack ' . self::STACKER_NAME_PENDING_PUBLISHING . ' ...');
                        $this->getStackInstance()->pushNamed(self::STACKER_NAME_PENDING_PUBLISHING, $current);
+
+                       // Advanced to next entry
+                       $resultInstance->next();
                }
 
                // Trace message
index 3a51a3a468d6164688d5d442664d0ce87767a96c..c44e1159ab5f8df0c903198531f1560f169824c0 100644 (file)
@@ -192,7 +192,7 @@ class NodeDhtFacade extends BaseDht implements DistributableNode, Registerable {
                assert($resultInstance instanceof SearchableResult);
 
                // Is the next entry valid?
-               if (($resultInstance->valid()) && ($resultInstance->next())) {
+               if ($resultInstance->valid()) {
                        /*
                         * Then load the first entry (more entries are being ignored and
                         * should not happen).
@@ -226,7 +226,7 @@ class NodeDhtFacade extends BaseDht implements DistributableNode, Registerable {
                assert($resultInstance instanceof SearchableResult);
 
                // Is the next entry valid?
-               if (($resultInstance->valid()) && ($resultInstance->next())) {
+               if ($resultInstance->valid()) {
                        /*
                         * Then load the first entry (more entries are being ignored and
                         * should not happen).
@@ -353,7 +353,7 @@ class NodeDhtFacade extends BaseDht implements DistributableNode, Registerable {
                $nodeList = [];
 
                // Get node list
-               while ($resultInstance->next()) {
+               while ($resultInstance->valid()) {
                        // Get current element (it should be an array, and have at least 1 entry)
                        $current = $resultInstance->current();
                        assert(is_array($current));
@@ -367,6 +367,9 @@ class NodeDhtFacade extends BaseDht implements DistributableNode, Registerable {
 
                        // Add this entry
                        array_push($nodeList, $current);
+
+                       // Advanced to next entry
+                       $resultInstance->next();
                }
 
                // Save last exception
@@ -431,13 +434,16 @@ class NodeDhtFacade extends BaseDht implements DistributableNode, Registerable {
                $recipients = [];
 
                // Search for all recipients
-               while ($resultInstance->next()) {
+               while ($resultInstance->valid()) {
                        // Get current entry
                        $current = $resultInstance->current();
 
                        // Add instance to recipient list
                        /* PRINTR-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-DHT-FACADE: current=%s', print_r($current, TRUE)));
                        array_push($recipients, $current);
+
+                       // Advanced to next entry
+                       $resultInstance->next();
                }
 
                // Return filled array
@@ -480,13 +486,16 @@ class NodeDhtFacade extends BaseDht implements DistributableNode, Registerable {
                $recipients = [];
 
                // "Walk" through all entries
-               while ($resultInstance->next()) {
+               while ($resultInstance->valid()) {
                        // Get current entry
                        $current = $resultInstance->current();
 
                        // Add instance to recipient list
                        /* PRINTR-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-DHT-FACADE: current=%s', print_r($current, TRUE)));
                        array_push($recipients, $current);
+
+                       // Advanced to next entry
+                       $resultInstance->next();
                }
 
                // Return filled array
index ff6fc5e9b667c9cb680bcbc00f729c3012e829dd..3b3a46d7e11a65fcd828ffb995d25d0471812a9e 100644 (file)
@@ -50,14 +50,14 @@ class PackageAssemblerFactory extends ObjectFactory {
         * @param       $packageInstance        An instance of a Receivable instance
         * @return      $assemblerInstance      An instance of a Assembler instance
         */
-       public static final function createAssemblerInstance (Receivable $packageInstance) {
+       public static final function createAssemblerInstance (Receivable $handlerInstance) {
                // If there is no assembler?
                if (GenericRegistry::getRegistry()->instanceExists('package_assembler')) {
                        // Get assembler from registry
                        $assemblerInstance = GenericRegistry::getRegistry()->getInstance('package_assembler');
                } else {
                        // Get the assembler instance
-                       $assemblerInstance = self::createObjectByConfiguredName('package_assembler_class', array($packageInstance));
+                       $assemblerInstance = self::createObjectByConfiguredName('package_assembler_class', array($handlerInstance));
 
                        // Add it to the registry
                        GenericRegistry::getRegistry()->addInstance('package_assembler', $assemblerInstance);
index 77158e47071b2583f234b2acd92e8391cac14ab9..509f40f51f972ac3864613ba74b2949baa89c146 100644 (file)
@@ -90,23 +90,23 @@ class PackageAnnouncementAnswerTagFilter extends BaseNodeFilter implements Filte
         * may throw (not the method itself) several exceptions:
         *
         * @param       $messageInstance        An instance of a DeliverableMessage class
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         */
-       public function processMessage (DeliverableMessage $messageInstance, Receivable $packageInstance) {
+       public function processMessage (DeliverableMessage $messageInstance, Receivable $handlerInstance) {
                // Process message in generic way
-               $this->genericProcessMessage('announcement_answer', $messageInstance, $packageInstance);
+               $this->genericProcessMessage('announcement_answer', $messageInstance, $handlerInstance);
        }
 
        /**
         * Post-processes the stacked message. Do not call popNamed() as then no
         * other class can process the message.
         *
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         * @throws      UnsupportedOperationException   If this method is called, please use processMessage() instead!
         */
-       public function postProcessMessage (Receivable $packageInstance) {
+       public function postProcessMessage (Receivable $handlerInstance) {
                // Please don't call this method
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
index 0adce52318f07b927ba96175a1a6c8ba1a45bd2f..16693c9b3d46943afc631acee6b46e7674c2da1f 100644 (file)
@@ -87,23 +87,23 @@ class PackageDhtBootstrapAnswerTagFilter extends BaseNodeFilter implements Filte
         * may throw (not the method itself) several exceptions:
         *
         * @param       $messageInstance        An instance of a DeliverableMessage class
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         */
-       public function processMessage (DeliverableMessage $messageInstance, Receivable $packageInstance) {
+       public function processMessage (DeliverableMessage $messageInstance, Receivable $handlerInstance) {
                // Process message in generic way
-               $this->genericProcessMessage('dht_bootstrap_answer', $messageInstance, $packageInstance);
+               $this->genericProcessMessage('dht_bootstrap_answer', $messageInstance, $handlerInstance);
        }
 
        /**
         * Post-processes the stacked message. Do not call popNamed() as then no
         * other class can process the message.
         *
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         * @throws      UnsupportedOperationException   If this method is called, please use processMessage() instead!
         */
-       public function postProcessMessage (Receivable $packageInstance) {
+       public function postProcessMessage (Receivable $handlerInstance) {
                // Please don't call this method
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
index cbb8932d57e0740f1e40c915759b0a8096fa10f0..d13c260cb9b611dbd0088e06035211a1e0346157 100644 (file)
@@ -87,23 +87,23 @@ class PackageRequestNodeListAnswerTagFilter extends BaseNodeFilter implements Fi
         * may throw (not the method itself) several exceptions:
         *
         * @param       $messageInstance        An instance of a DeliverableMessage class
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         */
-       public function processMessage (DeliverableMessage $messageInstance, Receivable $packageInstance) {
+       public function processMessage (DeliverableMessage $messageInstance, Receivable $handlerInstance) {
                // Process message in generic way
-               $this->genericProcessMessage('request_node_list_answer', $messageInstance, $packageInstance);
+               $this->genericProcessMessage('request_node_list_answer', $messageInstance, $handlerInstance);
        }
 
        /**
         * Post-processes the stacked message. Do not call popNamed() as then no
         * other class can process the message.
         *
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         * @throws      UnsupportedOperationException   If this method is called, please use processMessage() instead!
         */
-       public function postProcessMessage (Receivable $packageInstance) {
+       public function postProcessMessage (Receivable $handlerInstance) {
                // Please don't call this method
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
index d832eef11c82f6371dd1093d300c2816f498c651..ebf86067f8b15fbd77afba7302f2e93a99279cfb 100644 (file)
@@ -96,23 +96,23 @@ class PackageAnnouncementTagFilter extends BaseNodeFilter implements FilterableP
         *                            well-formed
         *
         * @param       $messageInstance        An instance of a DeliverableMessage class
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         */
-       public function processMessage (DeliverableMessage $messageInstance, Receivable $packageInstance) {
+       public function processMessage (DeliverableMessage $messageInstance, Receivable $handlerInstance) {
                // Process message generic
-               $this->genericProcessMessage('announcement', $messageInstance, $packageInstance);
+               $this->genericProcessMessage('announcement', $messageInstance, $handlerInstance);
        }
 
        /**
         * Post-processes the stacked message. Do not call popNamed() as then no
         * other class can process the message.
         *
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         * @throws      UnsupportedOperationException   If this method is called, please use processMessage() instead!
         */
-       public function postProcessMessage (Receivable $packageInstance) {
+       public function postProcessMessage (Receivable $handlerInstance) {
                // Please don't call this method
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
index 06b98f6760fc6ea9816b3a0b247c087fcca889a9..f8fbed98b6c9955dacea76d4f9389705a497a156 100644 (file)
@@ -95,23 +95,23 @@ class PackageDhtBootstrapTagFilter extends BaseNodeFilter implements FilterableP
         *                            well-formed
         *
         * @param       $messageInstance        An instance of a DeliverableMessage class
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         */
-       public function processMessage (DeliverableMessage $messageInstance, Receivable $packageInstance) {
+       public function processMessage (DeliverableMessage $messageInstance, Receivable $handlerInstance) {
                // Process message generic
-               $this->genericProcessMessage('dht_bootstrap', $messageInstance, $packageInstance);
+               $this->genericProcessMessage('dht_bootstrap', $messageInstance, $handlerInstance);
        }
 
        /**
         * Post-processes the stacked message. Do not call popNamed() as then no
         * other class can process the message.
         *
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         * @throws      UnsupportedOperationException   If this method is called, please use processMessage() instead!
         */
-       public function postProcessMessage (Receivable $packageInstance) {
+       public function postProcessMessage (Receivable $handlerInstance) {
                // Please don't call this method
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
index 93525df2c49150defa4bd659c1250fdf4b18517f..b58cd26f41d03a6a3a381ed462358f7a8560f67f 100644 (file)
@@ -84,23 +84,23 @@ class PackageRequestNodeListTagFilter extends BaseNodeFilter implements Filterab
         * Processes the given raw message content.
         *
         * @param       $messageInstance        An instance of a DeliverableMessage class
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         */
-       public function processMessage (DeliverableMessage $messageInstance, Receivable $packageInstance) {
+       public function processMessage (DeliverableMessage $messageInstance, Receivable $handlerInstance) {
                // Process messasge generic
-               $this->genericProcessMessage('request_node_list', $messageInstance, $packageInstance);
+               $this->genericProcessMessage('request_node_list', $messageInstance, $handlerInstance);
        }
 
        /**
         * Post-processes the stacked message. Do not call popNamed() as then no
         * other class can process the message.
         *
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         * @throws      UnsupportedOperationException   If this method is called
         */
-       public function postProcessMessage (Receivable $packageInstance) {
+       public function postProcessMessage (Receivable $handlerInstance) {
                // Please don't call this method
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
index bc373090ff517cd72efedb377a7841e702caacb1..829f1c0c402fbe39c8161cb18ccb4cb8eb3cf74c 100644 (file)
@@ -93,23 +93,23 @@ class PackageSelfConnectTagFilter extends BaseNodeFilter implements FilterablePa
         *                            well-formed
         *
         * @param       $messageInstance        An instance of a DeliverableMessage class
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         */
-       public function processMessage (DeliverableMessage $messageInstance, Receivable $packageInstance) {
+       public function processMessage (DeliverableMessage $messageInstance, Receivable $handlerInstance) {
                // Process generic
-               $this->genericProcessMessage(Tagable::TAG_SELF_CONNECT, $messageInstance, $packageInstance);
+               $this->genericProcessMessage(Tagable::TAG_SELF_CONNECT, $messageInstance, $handlerInstance);
        }
 
        /**
         * Post-processes the stacked message. Do not call popNamed() as then no
         * other class can process the message.
         *
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         * @throws      UnsupportedOperationException   If this method is called, please use processMessage() instead!
         */
-       public function postProcessMessage (Receivable $packageInstance) {
+       public function postProcessMessage (Receivable $handlerInstance) {
                // Please don't call this method
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
index 21089bf5610323a2a22c3f6552d01f0e3a8cfe1e..8face50262efd094ed9edd510d3699e14e1038b7 100644 (file)
@@ -76,11 +76,11 @@ class NodeAnnouncementAnswerOkayHandler extends BaseAnswerStatusHandler implemen
         * Handles given message data array
         *
         * @param       $messageInstance        An instance of a DeliverableMessage class
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         * @todo        Do some more here: Handle karma, et cetera?
         */
-       public function handleAnswerMessageData (DeliverableMessage $messageInstance, Receivable $packageInstance) {
+       public function handleAnswerMessageData (DeliverableMessage $messageInstance, Receivable $handlerInstance) {
                /*
                 * Query DHT and force update (which will throw an exception if the
                 * node is not found).
@@ -104,7 +104,7 @@ class NodeAnnouncementAnswerOkayHandler extends BaseAnswerStatusHandler implemen
                $nodeInstance->getStateInstance()->nodeAnnouncementSuccessful();
 
                // Prepare next message
-               $this->prepareNextMessage($messageInstance, $packageInstance);
+               $this->prepareNextMessage($messageInstance, $handlerInstance);
        }
 
        /**
index 4977bac570499f038b3feaa2c349dcc467584ece..c0bcab027742b2f5d58f6397797fdf827178197a 100644 (file)
@@ -70,12 +70,12 @@ class RequestNodeListAnswerOkayHandler extends BaseAnswerStatusHandler implement
         * Handles given message data array
         *
         * @param       $messageInstance        An instance of a DeliverableMessage class
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         * @throws      NodeSessionIdVerficationException       If the provided session id is not matching
         * @todo        Do some more here: Handle karma, et cetera?
         */
-       public function handleAnswerMessageData (DeliverableMessage $messageInstance, Receivable $packageInstance) {
+       public function handleAnswerMessageData (DeliverableMessage $messageInstance, Receivable $handlerInstance) {
                // Save node list
                $nodeList = json_decode(base64_decode($messageData[XmlRequestNodeListAnswerTemplateEngine::REQUEST_DATA_NODE_LIST]));
 
@@ -95,7 +95,7 @@ class RequestNodeListAnswerOkayHandler extends BaseAnswerStatusHandler implement
                DhtObjectFactory::createDhtInstance('node')->registerNodeByMessageInstance($messageInstance, $this, TRUE);
 
                // Prepare next message ("hello" message to all returned nodes)
-               // @TODO $this->prepareNextMessage($messageInstance, $packageInstance);
+               // @TODO $this->prepareNextMessage($messageInstance, $handlerInstance);
        }
 
        /**
index 2cfd2a8e12e89f36f292134adef7eb8baef6e030..f8718cde1ddb079f9b9bd9f8cafbb9c6f761e822 100644 (file)
@@ -105,11 +105,11 @@ class NodeMessageAnnouncementHandler extends BaseMessageHandler implements Handl
         * Handles data array of the message
         *
         * @param       $messageInstance        An instance of a DeliverableMessage class
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         * @throws      AnnouncementNotAcceptedException        If this node does not accept announcements
         */
-       public function handleMessageData (DeliverableMessage $messageInstance, Receivable $packageInstance) {
+       public function handleMessageData (DeliverableMessage $messageInstance, Receivable $handlerInstance) {
                // Get node instance
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-MESSAGE-HANDLER: Creating node instance ...');
                $nodeInstance = NodeObjectFactory::createNodeInstance();
@@ -127,7 +127,7 @@ class NodeMessageAnnouncementHandler extends BaseMessageHandler implements Handl
                $this->registerNodeByMessageInstance($messageInstance);
 
                // Prepare answer message to be delivered back to the other node
-               $this->prepareAnswerMessage($messageInstance, $packageInstance);
+               $this->prepareAnswerMessage($messageInstance, $handlerInstance);
        }
 
        /**
index 1f89332a9d3d5ee86e76465e54729cd145ffaa90..587c1701e113401df05b2e831abd88b8c08ba554 100644 (file)
@@ -103,12 +103,12 @@ class NodeMessageDhtBootstrapAnswerHandler extends BaseMessageHandler implements
         * Handles data array of the message
         *
         * @param       $messageInstance        An instance of a DeliverableMessage class
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         * @throws      NoDhtBootstrapAttemptedException        If this DHT has not attempted to bootstrap
         * @todo        ~30% done
         */
-       public function handleMessageData (DeliverableMessage $messageInstance, Receivable $packageInstance) {
+       public function handleMessageData (DeliverableMessage $messageInstance, Receivable $handlerInstance) {
                // Get DHT instance
                $dhtInstance = DhtObjectFactory::createDhtInstance('node');
 
index dbc65a5a11f5baee09d88ca159bbbc9093541c6a..d18f99fc3011dc57980028afac512ae6f11fc55c 100644 (file)
@@ -89,11 +89,11 @@ class NodeMessageRequestNodeListAnswerHandler extends BaseMessageHandler impleme
         * Handles data array of the message
         *
         * @param       $messageInstance        An instance of a DeliverableMessage class
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         * @throws      NoRequestNodeListAttemptedException     If this node has not attempted to announce itself
         */
-       public function handleMessageData (DeliverableMessage $messageInstance, Receivable $packageInstance) {
+       public function handleMessageData (DeliverableMessage $messageInstance, Receivable $handlerInstance) {
                // Get node instance
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-MESSAGE-HANDLER: Creating node instance ...');
                $nodeInstance = NodeObjectFactory::createNodeInstance();
@@ -111,7 +111,7 @@ class NodeMessageRequestNodeListAnswerHandler extends BaseMessageHandler impleme
                $this->registerNodeByMessageInstance($messageInstance);
 
                // Handle the answer status element
-               $nodeInstance->handleAnswerStatusByMessageInstance($messageInstance, $packageInstance);
+               $nodeInstance->handleAnswerStatusByMessageInstance($messageInstance, $handlerInstance);
        }
 
        /**
index 463a7c96349faea302601aaf60b3dfc3a68085cc..be36b09f6ee238ecdd897cf0fb5158d128c12aa4 100644 (file)
@@ -89,15 +89,15 @@ abstract class BaseMessageHandler extends BaseDataHandler {
         * Posty-handles data array of the message
         *
         * @param       $messageInstance        An instance of a DeliverableMessage class
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         */
-       public function postHandleMessageData (DeliverableMessage $messageInstance, Receivable $packageInstance) {
+       public function postHandleMessageData (DeliverableMessage $messageInstance, Receivable $handlerInstance) {
                /*
                 * Feed hash to miner by handling over the whole array as also the
                 * sender and tags are needed.
                 */
-               $packageInstance->feedHashToMiner($messageInstance);
+               $handlerInstance->feedHashToMiner($messageInstance);
        }
 
 }
index 97373cff78972634b3eea9c5fa59fdc1c0b3b872..37fc745eb542e901fe385aac7c0432f2a8e1364f 100644 (file)
@@ -100,11 +100,11 @@ class NodeMessageDhtBootstrapHandler extends BaseMessageHandler implements Handl
         * Handles data array of the message
         *
         * @param       $messageInstance        An instance of a DeliverableMessage class
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         * @throws      DhtBootstrapNotAcceptedException        If this node does not accept DHT bootstrap requests
         */
-       public function handleMessageData (DeliverableMessage $messageInstance, Receivable $packageInstance) {
+       public function handleMessageData (DeliverableMessage $messageInstance, Receivable $handlerInstance) {
                // Is this node accepting DHT bootstrap requests?
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-MESSAGE-HANDLER: Creating node instance ...');
                if (!NodeObjectFactory::createNodeInstance()->isAcceptingDhtBootstrap()) {
@@ -118,7 +118,7 @@ class NodeMessageDhtBootstrapHandler extends BaseMessageHandler implements Handl
                $this->registerNodeByMessageInstance($messageInstance);
 
                // Prepare answer message to be delivered back to the other node
-               $this->prepareAnswerMessage($messageInstance, $packageInstance);
+               $this->prepareAnswerMessage($messageInstance, $handlerInstance);
        }
 
        /**
index 936a9dea0ba9df4c5ffffd1702d8a1596ddd046d..52b13ac86138565a133af3252b3669131fc54c31 100644 (file)
@@ -85,11 +85,11 @@ class NodeMessageRequestNodeListHandler extends BaseMessageHandler implements Ha
         * Handles data array of the message
         *
         * @param       $messageInstance        An instance of a DeliverableMessage class
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         * @throws      RequestNotAcceptedException             If this node does not accept this request
         */
-       public function handleMessageData (DeliverableMessage $messageInstance, Receivable $packageInstance) {
+       public function handleMessageData (DeliverableMessage $messageInstance, Receivable $handlerInstance) {
                // Get node instance
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-MESSAGE-HANDLER: Creating node instance ...');
                $nodeInstance = NodeObjectFactory::createNodeInstance();
@@ -107,7 +107,7 @@ class NodeMessageRequestNodeListHandler extends BaseMessageHandler implements Ha
                $this->registerNodeByMessageInstance($messageInstance);
 
                // Prepare answer message to be delivered back to the other node
-               $this->prepareAnswerMessage($messageInstance, $packageInstance);
+               $this->prepareAnswerMessage($messageInstance, $handlerInstance);
        }
 
        /**
index f7981a76366eb92889b4ab289a55eca96cb378a6..34a5bceb0a6d9605144f87f000388d8a2d42db3c 100644 (file)
@@ -68,10 +68,10 @@ class NodeMessageSelfConnectHandler extends BaseMessageHandler implements Handle
         * Handles data array of the message
         *
         * @param       $messageInstance        An instance of a DeliverableMessage class
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         */
-       public function handleMessageData (DeliverableMessage $messageInstance, Receivable $packageInstance) {
+       public function handleMessageData (DeliverableMessage $messageInstance, Receivable $handlerInstance) {
                // Get node instance
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-MESSAGE-HANDLER: Creating node instance ...');
                $nodeInstance = NodeObjectFactory::createNodeInstance();
index d10df7a57874e710ccfd24e9c07d1f9619aa4f32..b7e537db73b4b8b1e93243b0e61321a640abda92 100644 (file)
@@ -1041,6 +1041,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         * Sends waiting packages out for delivery
         *
         * @return      void
+        * @throws      UnexpectedValueException        If $sessionId is empty
         */
        public function sendWaitingPackage () {
                // Debug message
@@ -1065,7 +1066,15 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
 
                        // Get session id and set it back
                        $sessionId = HubTools::resolveSessionIdByUniversalNodeLocator($locatorInstance);
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: sessionId=%s found, setting ...', $sessionId));
+
+                       // Is it empty?
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: sessionId[%s]=%s', gettype($sessionId), $sessionId));
+                       if (empty($sessionId)) {
+                               // HubTools was not able to resolve this
+                               throw new UnexpectedValueException('sessionId is empty');
+                       }
+
+                       // Set it
                        $packageInstance->setRecipientId($sessionId);
                }
 
index b2e818f00d52f97f5bcd1769491bfb798434a6f5..961eb18060941cca4042df11bc56002d7609f55d 100644 (file)
@@ -36,6 +36,10 @@ use Org\Mxchange\CoreFramework\Traits\Crypto\CryptoTrait;
 use Org\Mxchange\CoreFramework\Traits\Database\Frontend\DatabaseFrontendTrait;
 use Org\Mxchange\CoreFramework\Traits\State\StateableTrait;
 
+// Import SPL stuff
+use \InvalidArgumentException;
+use \UnexpectedValueException;
+
 /**
  * A general hub node class
  *
@@ -117,22 +121,22 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
        /**
         * Node id
         */
-       private $nodeId = 'invalid';
+       private $nodeId = '';
 
        /**
         * Private key
         */
-       private $privateKey = 'invalid';
+       private $privateKey = '';
 
        /**
         * Node's private-key hash
         */
-       private $nodePrivateKeyHash = 'invalid';
+       private $nodePrivateKeyHash = '';
 
        /**
         * Session id
         */
-       private $sessionId = 'invalid';
+       private $sessionId = '';
 
        /**
         * Protected constructor
@@ -269,7 +273,7 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
                                // Stop further searching
                                break;
                        }
-               } // END - foreach
+               }
 
                // Return the result
                return $isFound;
@@ -290,7 +294,7 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
                        if (NULL == $locatorInstance) {
                                // Throw NPE
                                throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
-                       } // END - if
+                       }
 
                        // There are 2 UNLs, internal and external.
                        if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('allow_publish_internal_address') == 'N') {
@@ -300,7 +304,7 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
                                // Non-public "internal" UNL address
                                $GLOBALS[__METHOD__] = $locatorInstance->getInternalUnl();
                        }
-               } // END - if
+               }
 
                // Return it
                return $GLOBALS[__METHOD__];
@@ -338,17 +342,19 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
         */
        public function bootstrapAcquireNodeId (Requestable $requestInstance, Responseable $responseInstance) {
                // Find node by id
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HUB-NODE: requestInstance=%s,responseInstance=%s - CALLED!', $requestInstance->__toString(), $responseInstance->__toString()));
                $resultInstance = $this->getFrontendInstance()->findFirstNodeData();
 
                // Is there a node id?
-               /* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: resultInstance=%s', __METHOD__, __LINE__, print_r($resultInstance, TRUE)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HUB-NODE: resultInstance[]=%s', gettype($resultInstance)));
+               //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: resultInstance=%s', __METHOD__, __LINE__, print_r($resultInstance, TRUE)));
                if ($resultInstance instanceof SearchableResult && $resultInstance->valid()) {
                        // Get current record
                        $nodeData = $resultInstance->current();
 
                        // Get the node id from result and set it
-                       /* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: nodeData=%s', __METHOD__, __LINE__, print_r($nodeData, TRUE)));
-                       $this->setNodeId($resultInstance->getField(NodeInformationDatabaseFrontend::DB_COLUMN_NODE_ID));
+                       //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: nodeData=%s', __METHOD__, __LINE__, print_r($nodeData, TRUE)));
+                       $this->setNodeId($nodeData[NodeInformationDatabaseFrontend::DB_COLUMN_NODE_ID]);
 
                        // Output message
                        self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BOOTSTRAP: Re-using found node-id: %s', $this->getNodeId()));
@@ -368,6 +374,9 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
                        // Output message
                        self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BOOTSTRAP: Created new node-id: %s', $this->getNodeId()));
                }
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HUB-NODE: EXIT!');
        }
 
        /**
@@ -377,6 +386,7 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
         */
        public function bootstrapGenerateSessionId () {
                // Now get a search criteria instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HUB-NODE: CALLED!');
                $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
 
                // Search for the node number one which is hard-coded the default
@@ -402,21 +412,31 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
 
                // Change the state because the node has aquired a session id
                $this->getStateInstance()->nodeGeneratedSessionId();
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HUB-NODE: EXIT!');
        }
 
        /**
         * Generate a private key for en-/decryption
         *
         * @return      void
+        * @throws      UnexpectedValueException        If private_key_hash is "invalid"
         */
        public function bootstrapGeneratePrivateKey () {
                // Find node by id
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HUB-NODE: CALLED!');
                $resultInstance = $this->getFrontendInstance()->findFirstNodeData();
 
                // Is it valid?
-               if ($resultInstance->valid()) {
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HUB-NODE: resultInstance[]=%s', gettype($resultInstance)));
+               //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: resultInstance=%s', __METHOD__, __LINE__, print_r($resultInstance, TRUE)));
+               if ($resultInstance instanceof SearchableResult && $resultInstance->valid()) {
+                       // Get current element
+                       $current = $resultInstance->current();
+
                        // Is the element set?
-                       if (is_null($this->getFrontendInstance()->getField(NodeInformationDatabaseFrontend::DB_COLUMN_PRIVATE_KEY))) {
+                       if (is_null($current[NodeInformationDatabaseFrontend::DB_COLUMN_PRIVATE_KEY])) {
                                /*
                                 * Auto-generate the private key for e.g. out-dated database
                                 * "tables". This allows a smooth update for the underlaying
@@ -425,8 +445,8 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
                                $this->generatePrivateKeyAndHash($this->getSearchInstance());
                        } else {
                                // Get the node id from result and set it
-                               $this->setPrivateKey(base64_decode($this->getFrontendInstance()->getField(NodeInformationDatabaseFrontend::DB_COLUMN_PRIVATE_KEY)));
-                               $this->setNodePrivateKeyHash($this->getFrontendInstance()->getField(NodeInformationDatabaseFrontend::DB_COLUMN_PRIVATE_KEY_HASH));
+                               $this->setPrivateKey(base64_decode($current[NodeInformationDatabaseFrontend::DB_COLUMN_PRIVATE_KEY]));
+                               $this->setNodePrivateKeyHash($current[NodeInformationDatabaseFrontend::DB_COLUMN_PRIVATE_KEY_HASH]);
 
                                // Output message
                                self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: Re-using found private key hash: ' . $this->getNodePrivateKeyHash() . '');
@@ -438,6 +458,9 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
                         */
                        $this->generatePrivateKeyAndHash($this->getSearchInstance());
                }
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HUB-NODE: EXIT!');
        }
 
        /**
@@ -448,29 +471,31 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
         */
        public function addElementsToDataSet (StoreableCriteria $criteriaInstance) {
                // Get request instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HUB-NODE: criteriaInstance=%s - CALLED!', $criteriaInstance->__toString()));
                $requestInstance = FrameworkBootstrap::getRequestInstance();
 
                // Add node number and type
                $criteriaInstance->addCriteria(NodeInformationDatabaseFrontend::DB_COLUMN_NODE_NR  , 1);
                $criteriaInstance->addCriteria(NodeInformationDatabaseFrontend::DB_COLUMN_NODE_MODE, $requestInstance->getRequestElement('mode'));
-
-               // Add the node id
-               $criteriaInstance->addCriteria(NodeInformationDatabaseFrontend::DB_COLUMN_NODE_ID, $this->getNodeId());
+               $criteriaInstance->addCriteria(NodeInformationDatabaseFrontend::DB_COLUMN_NODE_ID  , $this->getNodeId());
 
                // Add the session id if acquired
-               if ($this->getSessionId() != '') {
+               if (!empty($this->getSessionId())) {
                        $criteriaInstance->addCriteria(NodeInformationDatabaseFrontend::DB_COLUMN_SESSION_ID, $this->getSessionId());
-               } // END - if
+               }
 
                // Add the private key if acquired
-               if ($this->getPrivateKey() != '') {
-                       $criteriaInstance->addCriteria(NodeInformationDatabaseFrontend::DB_COLUMN_PRIVATE_KEY, base64_encode($this->getPrivateKey()));
+               if (!empty($this->getPrivateKey())) {
+                       $criteriaInstance->addCriteria(NodeInformationDatabaseFrontend::DB_COLUMN_PRIVATE_KEY     , base64_encode($this->getPrivateKey()));
                        $criteriaInstance->addCriteria(NodeInformationDatabaseFrontend::DB_COLUMN_PRIVATE_KEY_HASH, $this->getNodePrivateKeyHash());
-               } // END - if
+               }
 
                // Add own external and internal addresses as UNLs
                $criteriaInstance->addCriteria(NodeInformationDatabaseFrontend::DB_COLUMN_INTERNAL_UNL, HubTools::determineOwnInternalAddress());
                $criteriaInstance->addCriteria(NodeInformationDatabaseFrontend::DB_COLUMN_EXTERNAL_UNL, HubTools::determineOwnExternalAddress());
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HUB-NODE: EXIT!');
        }
 
        /**
@@ -524,10 +549,11 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
         */
        public function announceToUpperNodes (Taskable $taskInstance) {
                // Is this hub node announced?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HUB-NOCE: taskInstance=%s - CALLED!', $taskInstance->__toString()));
                if ($this->hubIsAnnounced === TRUE) {
                        // Already announced!
                        throw new NodeAlreadyAnnouncedException($this, self::EXCEPTION_HUB_ALREADY_ANNOUNCED);
-               } // END - if
+               }
 
                // Debug output
                self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HUB-Announcement: START (taskInstance=' . $taskInstance->__toString(). ')');
@@ -562,7 +588,7 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
         */
        public function doSelfConnection (Taskable $taskInstance) {
                // Debug output
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE: Self Connection: START (taskInstance=' . $taskInstance->__toString(). ')');
+               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HUB-NODE: Self Connection: START (taskInstance=' . $taskInstance->__toString(). ')');
 
                // Get a helper instance
                $helperInstance = ObjectFactory::createObjectByConfiguredName('node_self_connect_helper_class', array($this));
@@ -578,7 +604,7 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
                $helperInstance->sendPackage($this);
 
                // Debug output
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE: Self Connection: FINISHED');
+               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HUB-NODE: Self Connection: FINISHED');
        }
 
        /**
@@ -595,7 +621,7 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
                if (($this->determineIfListenerIsActive()) && ($this->isNodeActive())) {
                        // Shutdown them down before they can hurt anything
                        $this->shutdownListenerPool();
-               } // END - if
+               }
 
                // Get the controller here
                $controllerInstance = GenericRegistry::getRegistry()->getInstance('controller');
@@ -616,7 +642,7 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
         */
        public function initializeListenerPool () {
                // Debug output
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE: Initialize listener: START');
+               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HUB-NODE: Initialize listener: START');
 
                // Get a new pool instance
                $this->setListenerPoolInstance(ObjectFactory::createObjectByConfiguredName('listener_pool_class', array($this)));
@@ -688,7 +714,7 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
                $this->getListenerPoolInstance()->addListener($decoratorInstance);
 
                // Debug output
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE: Initialize listener: FINISHED.');
+               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HUB-NODE: Initialize listener: FINISHED.');
        }
 
        /**
@@ -727,7 +753,7 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
         * @return      void
         */
        public final function enableAcceptDhtBootstrap (bool $acceptDhtBootstrap = TRUE) {
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE: Enabling DHT bootstrap requests ...');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HUB-NODE: Enabling DHT bootstrap requests ...');
                $this->acceptDhtBootstrap = $acceptDhtBootstrap;
        }
 
@@ -852,9 +878,11 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
         */
        public final function isAcceptingAnnouncements () {
                // Check it (this node must be active and not shutdown!)
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HUB-NODE: CALLED!');
                $acceptAnnouncements = (($this->acceptAnnouncements === TRUE) && ($this->isNodeActive()));
 
                // Return it
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HUB-NODE: acceptAnnouncements=%d - EXIT!', intval($acceptAnnouncements)));
                return $acceptAnnouncements;
        }
 
@@ -865,9 +893,11 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
         */
        public final function isAcceptingDhtBootstrap () {
                // Check it (this node must be active and not shutdown!)
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HUB-NODE: CALLED!');
                $acceptDhtBootstrap = (($this->acceptDhtBootstrap === TRUE) && ($this->isNodeActive()));
 
                // Return it
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HUB-NODE: acceptDhtBootstrap=%d - EXIT!', intval($acceptDhtBootstrap)));
                return $acceptDhtBootstrap;
        }
 
@@ -878,16 +908,12 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
         * @todo        Add checking if this node has been announced to the sender node
         */
        public function ifNodeIsAnnouncing () {
-               // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE: ifNodeIsAnnouncing(): state=' . $this->getStateInstance()->getStateName());
-
                // Simply check the state of this node
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HUB-NODE: state=' . $this->getStateInstance()->getStateName());
                $hasAnnounced = ($this->getStateInstance() instanceof NodeAnnouncingState);
 
-               // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE: ifNodeIsAnnouncing(): hasAnnounced=' . intval($hasAnnounced));
-
                // Return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HUB-NODE: hasAnnounced=' . intval($hasAnnounced));
                return $hasAnnounced;
        }
 
@@ -898,16 +924,12 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
         * @todo        Add checking if this node has been announced to the sender node
         */
        public function ifNodeHasAnnouncementCompleted () {
-               // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE: ifNodeHasAnnouncementCompleted(): state=' . $this->getStateInstance()->getStateName());
-
                // Simply check the state of this node
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HUB-NODE: state=' . $this->getStateInstance()->getStateName());
                $hasAnnouncementCompleted = ($this->getStateInstance() instanceof NodeAnnouncementCompletedState);
 
-               // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE: ifNodeHasAnnouncementCompleted(): hasAnnouncementCompleted=' . intval($hasAnnouncementCompleted));
-
                // Return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HUB-NODE: hasAnnouncementCompleted=' . intval($hasAnnouncementCompleted));
                return $hasAnnouncementCompleted;
        }
 
@@ -922,9 +944,11 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
                 * HubRegularNode is faster, but if e.g. HubRegularI2PNode will be
                 * added then the next check will be TRUE.
                 */
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HUB-NODE: CALLED!');
                $acceptsRequest = ((!$this instanceof HubRegularNode) && (FrameworkBootstrap::getRequestInstance()->getRequestElement('mode') != self::NODE_TYPE_REGULAR));
 
                // Return it
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HUB-NODE: acceptsRequests=%d - EXIT!', intval($hasAnnouncementCompleted)));
                return $acceptsRequest;
        }
 
@@ -934,10 +958,8 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
         * @return      $locatorInstance        An instance of a LocateableNode class for this node
         */
        public function determineUniversalNodeLocator () {
-               // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE: CALLED!');
-
                // Is there cache?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HUB-NODE: CALLED!');
                if (!isset($GLOBALS[__METHOD__])) {
                        // Determine UNL based on this node:
                        // 1) Get discovery class
@@ -945,10 +967,10 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
 
                        // 2) "Determine" it
                        $GLOBALS[__METHOD__] = $discoveryInstance->discoverUniversalNodeLocatorByNode($this);
-               } // END - if
+               }
 
                // Return it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE: locatorInstance= ' . $GLOBALS[__METHOD__]->__toString() . ' - EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HUB-NODE: locatorInstance= ' . $GLOBALS[__METHOD__]->__toString() . ' - EXIT!');
                return $GLOBALS[__METHOD__];
        }
 
@@ -967,19 +989,23 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
         * Handles message answer by given data array
         *
         * @param       $messageInstance        An instance of a DeliverableMessage class
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         * @todo        Handle thrown exception
         */
-       public function handleAnswerStatusByMessageInstance (DeliverableMessage $messageInstance, Receivable $packageInstance) {
+       public function handleAnswerStatusByMessageInstance (DeliverableMessage $messageInstance, Receivable $handlerInstance) {
                // Construct configuration entry for handling class' name
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HUB-NODE: messageInstance=%s,handlerInstance=%s - CALLED!', $messageInstance->__toString(), $handlerInstance->__toString()));
                $classConfigEntry = strtolower($messageData[NetworkPackageHandler::MESSAGE_ARRAY_TYPE] . '_status_' . $messageData[BaseXmlAnswerTemplateEngine::ANSWER_STATUS]) . '_handler_class';
 
                // Try to get a class
-               $handlerInstance = ObjectFactory::createObjectByConfiguredName($classConfigEntry);
+               $statusHandlerInstance = ObjectFactory::createObjectByConfiguredName($classConfigEntry);
 
                // Handle it there
-               $handlerInstance->handleAnswerMessageData($messageInstance, $packageInstance);
+               $statusHandlerInstance->handleAnswerMessageData($messageInstance, $handlerInstance);
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HUB-NODE: EXIT!');
        }
 
        /**
@@ -989,12 +1015,14 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
         */
        public function getListFromAcceptedObjectTypes () {
                // Get registry instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HUB-NODE: CALLED!');
                $objectRegistryInstance = ObjectTypeRegistryFactory::createObjectTypeRegistryInstance();
 
                // Get all entries
                $objectList = $objectRegistryInstance->getEntries(XmlObjectRegistryTemplateEngine::OBJECT_TYPE_DATA_NAME);
 
                // ... and return it
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HUB-NODE: objectList()=%d - EXIT!', count($objectList)));
                return $objectList;
        }
 
@@ -1004,19 +1032,32 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
         * @param       $dataSetInstance        An instance of a StoreableCriteria class
         * @param       $nodeData                       An array with valid node data
         * @return      void
+        * @throws      InvalidArgumentException        If $nodeData is empty
         */
        public function addArrayToDataSet (StoreableCriteria $dataSetInstance, array $nodeData) {
+               // Validate parameter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HUB-NODE: dataSetInstance=%s,nodeData()=%d - EXIT!', $dataSetInstance->__toString(), count($nodeData)));
+               if (count($nodeData) == 0) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('nodeData array is empty');
+               }
+
                // Add all data the array provides
                foreach (NodeDistributedHashTableDatabaseFrontend::getAllElements() as $element) {
                        // Is the element there?
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HUB-NODE: element=%s', $element));
                        if (isset($nodeData[$element])) {
                                // Add it
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HUB-NODE: Adding element=%s ...', $element));
                                $dataSetInstance->addCriteria($element, $nodeData[$element]);
                        } else {
                                // Output warning message
-                               /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE: addArrayToDataSet(): Element ' . $element . ' not found in nodeData array.');
+                               /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HUB-NODE: Element %s not found in nodeData array.', $element));
                        }
-               } // END - foreac
+               }
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HUB-NODE: EXIT!');
        }
 
        /**
@@ -1026,32 +1067,32 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
         */
        public function createNodeDataArray () {
                // Get request instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HUB-NODE: CALLED!');
                $requestInstance = FrameworkBootstrap::getRequestInstance();
 
                // Create array with all available data
-               $nodeData = array(
-                       NodeInformationDatabaseFrontend::DB_COLUMN_NODE_NR => NULL,
-                       NodeInformationDatabaseFrontend::DB_COLUMN_NODE_MODE => $requestInstance->getRequestElement('mode'),
-                       NodeInformationDatabaseFrontend::DB_COLUMN_NODE_ID => $this->getNodeId(),
+               $nodeData = [
+                       NodeInformationDatabaseFrontend::DB_COLUMN_NODE_NR      => NULL,
+                       NodeInformationDatabaseFrontend::DB_COLUMN_NODE_MODE    => $requestInstance->getRequestElement('mode'),
+                       NodeInformationDatabaseFrontend::DB_COLUMN_NODE_ID      => $this->getNodeId(),
                        NodeInformationDatabaseFrontend::DB_COLUMN_INTERNAL_UNL => HubTools::determineOwnInternalAddress(),
                        NodeInformationDatabaseFrontend::DB_COLUMN_EXTERNAL_UNL => HubTools::determineOwnExternalAddress(),
-               );
+               ];
 
                // Add the session id if acquired
-               if ($this->getSessionId() != '') {
+               if (!empty($this->getSessionId())) {
                        $nodeData[NodeInformationDatabaseFrontend::DB_COLUMN_SESSION_ID] = $this->getSessionId();
-               } // END - if
+               }
 
                // Add the private key if acquired
-               if ($this->getPrivateKey() != '') {
+               if (!empty($this->getPrivateKey())) {
                        $nodeData[NodeInformationDatabaseFrontend::DB_COLUMN_PRIVATE_KEY] = base64_encode($this->getPrivateKey());
                        $nodeData[NodeInformationDatabaseFrontend::DB_COLUMN_PRIVATE_KEY_HASH] = $this->getNodePrivateKeyHash();
-               } // END - if
-
-               // Debugging:
-               //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: nodeData=%s', __METHOD__, __LINE__, print_r($nodeData, TRUE)));
+               }
 
                // Return it
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HUB-NODE: nodeData()=%d - EXIT!', count($nodeData)));
+               //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: nodeData=%s', __METHOD__, __LINE__, print_r($nodeData, TRUE)));
                return $nodeData;
        }
 
index eb73d2cb7a27997807e01fcd5bbb7b43c80c9d0c..f5662d608e83df45308b03e7c5662f5f05e670ab 100644 (file)
@@ -91,15 +91,15 @@ class PackageAssembler extends BaseHubSystem implements Assembler, Registerable,
        /**
         * Creates an instance of this class
         *
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      $assemblerInstance      An instance of an Assembler class
         */
-       public static final function createPackageAssembler (Receivable $packageInstance) {
+       public static final function createPackageAssembler (Receivable $handlerInstance) {
                // Get new instance
                $assemblerInstance = new PackageAssembler();
 
                // Set package instance here
-               $assemblerInstance->setPackageHandlerInstance($packageInstance);
+               $assemblerInstance->setPackageHandlerInstance($handlerInstance);
 
                // Create an instance of a raw data input stream
                $streamInstance = ObjectFactory::createObjectByConfiguredName('node_raw_data_input_stream_class');
index 87fd7e20703973b3d4e6568a1231ac77e2dc9658..7b2a4fdb1d9ed51b824545372163732204d81239 100644 (file)
@@ -84,7 +84,7 @@ class TcpProtocolResolver extends BaseProtocolResolver implements ProtocolResolv
                $resultInstance = $nodeInstance->getFrontendInstance()->doSelectByCriteria($searchInstance);
 
                // Is the result valid?
-               if ((!$resultInstance->valid()) || (!$resultInstance->next())) {
+               if ((!$resultInstance->valid()) || (!$resultInstance->valid())) {
                        /*
                         * Node not found in database, this happens on first startup. So
                         * let's get a prepared array from the node instance.
index 5f6b4af51c83668b6b5c3d04001eb3867374393e..a4f4985ecfef4134013dc3ab8877c058a507c2f2 100644 (file)
@@ -199,7 +199,7 @@ class HubTools extends BaseHubSystem {
                }
 
                // Return result
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HUB-TOOLS: sessionId=%s - EXIT!', $sessionId));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HUB-TOOLS: sessionId[%s]=%s - EXIT!', gettype($sessionId), $sessionId));
                return $sessionId;
        }
 
index fd27add6944fac3dfd7e44fac544c4356d1aa652..48123bcf70ea85704ee129e46a080bc3cc9c430b 100644 (file)
@@ -36,18 +36,18 @@ interface FilterablePackage extends Filterable {
         * Processes the given raw message content.
         *
         * @param       $messageData            Raw message data array
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         */
-       function processMessage (DeliverableMessage $messageInstance, Receivable $packageInstance);
+       function processMessage (DeliverableMessage $messageInstance, Receivable $handlerInstance);
 
        /**
         * Post-processes the stacked message. Do not call popNamed() as then no
         * other class can process the message.
         *
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         */
-       function postProcessMessage (Receivable $packageInstance);
+       function postProcessMessage (Receivable $handlerInstance);
 
 }
index 58c94f3839e4d902616cc78b781e0d53ecff75e4..4232e8eb5088e94a6e202a3cc43b18d4a1eda933 100644 (file)
@@ -38,10 +38,10 @@ interface HandleableAnswerStatus extends HandleableDataSet, HubInterface {
         * Handles given message data array
         *
         * @param       $messageData            An array of message data
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         */
-       function handleAnswerMessageData (DeliverableMessage $messageInstance, Receivable $packageInstance);
+       function handleAnswerMessageData (DeliverableMessage $messageInstance, Receivable $handlerInstance);
 
        /**
         * Adds all required elements from given array into data set instance
index 74042102ba458a35e2f49bfea431e4410bfdc9a8..582edef0b6579bd42f47be4600e0154ec4590559 100644 (file)
@@ -37,18 +37,18 @@ interface HandleableMessage extends HandleableDataSet, HubInterface {
         * Handles data array of the message
         *
         * @param       $messageData            An instance of a DeliverableMessage class
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         */
-       function handleMessageData (DeliverableMessage $messageInstance, Receivable $packageInstance);
+       function handleMessageData (DeliverableMessage $messageInstance, Receivable $handlerInstance);
 
        /**
         * Posty-handles data array of the message
         *
         * @param       $messageData            An instance of a DeliverableMessage class
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         */
-       function postHandleMessageData (DeliverableMessage $messageInstance, Receivable $packageInstance);
+       function postHandleMessageData (DeliverableMessage $messageInstance, Receivable $handlerInstance);
 
 }
index b736abbf9a000891b3841710ee9c4190a6c77500..9d6af7613da0882fd69dfb33ed59ca98a61450d9 100644 (file)
@@ -169,10 +169,10 @@ interface Node extends FrameworkInterface {
         * Handles message answer by given data array
         *
         * @param       $messageData            A valid answer message data array
-        * @param       $packageInstance        An instance of a Receivable class
+        * @param       $handlerInstance        An instance of a Receivable class
         * @return      void
         */
-       function handleAnswerStatusByMessageInstance (DeliverableMessage $messageInstance, Receivable $packageInstance);
+       function handleAnswerStatusByMessageInstance (DeliverableMessage $messageInstance, Receivable $handlerInstance);
 
        /**
         * "Getter" for an array of all accepted object types
diff --git a/core b/core
index 0a198892c079422ef72d679321caad9310b417f4..ddbb50472e5383629958295be9f063cf8124b41f 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit 0a198892c079422ef72d679321caad9310b417f4
+Subproject commit ddbb50472e5383629958295be9f063cf8124b41f