]> git.mxchange.org Git - hub.git/commitdiff
Continued (WIP):
authorRoland Häder <roland@mxchange.org>
Sun, 26 Feb 2023 08:11:43 +0000 (09:11 +0100)
committerRoland Häder <roland@mxchange.org>
Sun, 26 Feb 2023 08:33:00 +0000 (09:33 +0100)
- moved UniversalNodeLocatorFactory to network/locator/
- introduced NetworkMessageFactory

application/hub/classes/factories/locator/class_UniversalNodeLocatorFactory.php [deleted file]
application/hub/classes/factories/network/locator/class_UniversalNodeLocatorFactory.php [new file with mode: 0644]
application/hub/classes/factories/network/message/class_NetworkMessageFactory.php [new file with mode: 0644]
application/hub/classes/handler/package/class_NetworkPackageHandler.php
application/hub/config.php

diff --git a/application/hub/classes/factories/locator/class_UniversalNodeLocatorFactory.php b/application/hub/classes/factories/locator/class_UniversalNodeLocatorFactory.php
deleted file mode 100644 (file)
index 102c85f..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-<?php
-// Own namespace
-namespace Org\Shipsimu\Hub\Factory\Network\Locator;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Factory\BaseFactory;
-use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
-use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
-
-// Import SPL stuff
-use \InvalidArgumentException;
-
-/**
- * A factory class for LocateableNode
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Hub Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class UniversalNodeLocatorFactory extends BaseFactory {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       private function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-       }
-
-       /**
-        * Returns a singleton (registry-based) LocateableNode instance
-        *
-        * @param       $unl    UNL address
-        * @return      $locatorInstance        An instance of a LocateableNode class
-        */
-       public static final function createUnlInstanceFromString (string $unl) {
-               // Validate parameter
-               //* NOISY-DEBUG: */ ObjectFactory::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('UNL-FACTORY: unl=%s - CALLED!', $unl));
-               if (empty($unl)) {
-                       // Throw IAE
-                       throw new InvalidArgumentException('Parameter "unl" is empty');
-               }
-
-               // If there is no handler?
-               if (ObjectRegistry::getRegistry('factory')->instanceExists('unl_' . $unl)) {
-                       // Get handler from registry
-                       $locatorInstance = ObjectRegistry::getRegistry('factory')->getInstance('unl_' . $unl);
-               } else {
-                       // Get the handler instance
-                       $locatorInstance = ObjectFactory::createObjectByConfiguredName('universal_node_locator_class');
-
-                       // Parse UNL string
-                       $locatorInstance->parseStringAsUnl($unl);
-
-                       // Add it to the registry
-                       ObjectRegistry::getRegistry('factory')->addInstance('unl_' . $unl, $locatorInstance);
-               }
-
-               // Trace message
-               //* NOISY-DEBUG: */ ObjectFactory::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('UNL-FACTORY: locatorInstance[]=%s - EXIT!', gettype($locatorInstance)));
-
-               // Return the instance
-               return $locatorInstance;
-       }
-
-       /**
-        * Creates a UNL instance from given array
-        *
-        * @param       $unlData        Array with valid UNL data
-        * @return      $locatorInstance        An instance of a LocateableNode class
-        */
-       public static final function createUnlInstanceFromArray (array $unlData) {
-               // No "caching" for now
-               $locatorInstance = ObjectFactory::createObjectByConfiguredName('universal_node_locator_class', array($unlData));
-
-               // Return it
-               return $locatorInstance;
-       }
-
-}
diff --git a/application/hub/classes/factories/network/locator/class_UniversalNodeLocatorFactory.php b/application/hub/classes/factories/network/locator/class_UniversalNodeLocatorFactory.php
new file mode 100644 (file)
index 0000000..102c85f
--- /dev/null
@@ -0,0 +1,96 @@
+<?php
+// Own namespace
+namespace Org\Shipsimu\Hub\Factory\Network\Locator;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Factory\BaseFactory;
+use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
+
+// Import SPL stuff
+use \InvalidArgumentException;
+
+/**
+ * A factory class for LocateableNode
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class UniversalNodeLocatorFactory extends BaseFactory {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       private function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Returns a singleton (registry-based) LocateableNode instance
+        *
+        * @param       $unl    UNL address
+        * @return      $locatorInstance        An instance of a LocateableNode class
+        */
+       public static final function createUnlInstanceFromString (string $unl) {
+               // Validate parameter
+               //* NOISY-DEBUG: */ ObjectFactory::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('UNL-FACTORY: unl=%s - CALLED!', $unl));
+               if (empty($unl)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "unl" is empty');
+               }
+
+               // If there is no handler?
+               if (ObjectRegistry::getRegistry('factory')->instanceExists('unl_' . $unl)) {
+                       // Get handler from registry
+                       $locatorInstance = ObjectRegistry::getRegistry('factory')->getInstance('unl_' . $unl);
+               } else {
+                       // Get the handler instance
+                       $locatorInstance = ObjectFactory::createObjectByConfiguredName('universal_node_locator_class');
+
+                       // Parse UNL string
+                       $locatorInstance->parseStringAsUnl($unl);
+
+                       // Add it to the registry
+                       ObjectRegistry::getRegistry('factory')->addInstance('unl_' . $unl, $locatorInstance);
+               }
+
+               // Trace message
+               //* NOISY-DEBUG: */ ObjectFactory::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('UNL-FACTORY: locatorInstance[]=%s - EXIT!', gettype($locatorInstance)));
+
+               // Return the instance
+               return $locatorInstance;
+       }
+
+       /**
+        * Creates a UNL instance from given array
+        *
+        * @param       $unlData        Array with valid UNL data
+        * @return      $locatorInstance        An instance of a LocateableNode class
+        */
+       public static final function createUnlInstanceFromArray (array $unlData) {
+               // No "caching" for now
+               $locatorInstance = ObjectFactory::createObjectByConfiguredName('universal_node_locator_class', array($unlData));
+
+               // Return it
+               return $locatorInstance;
+       }
+
+}
diff --git a/application/hub/classes/factories/network/message/class_NetworkMessageFactory.php b/application/hub/classes/factories/network/message/class_NetworkMessageFactory.php
new file mode 100644 (file)
index 0000000..58a92a4
--- /dev/null
@@ -0,0 +1,74 @@
+<?php
+// Own namespace
+namespace Org\Shipsimu\Hub\Factory\Network\Message;
+
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Network\Package\DeliverablePackage;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Factory\BaseFactory;
+use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
+
+/**
+ * A factory class for DeliverableMessage
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class NetworkMessageFactory extends BaseFactory {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       private function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Returns a singleton (registry-based) DeliverableMessage instance
+        *
+        * @param       $packageInstance        An instance of a DeliverablePackage class
+        * @return      $messageInstance        An instance of a DeliverableMessage class
+        */
+       public static final function createNetworkMessageInstanceFromPackage (DeliverablePackage $packageInstance) {
+               // If there is no handler?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-MESSAGE-FACTORY: packageInstance=%s - CALLED!', $packageInstance->__toString()));
+               if (ObjectRegistry::getRegistry('factory')->instanceExists('network_message')) {
+                       // Get handler from registry
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('NETWORK-MESSAGE-FACTORY: Getting messageInstance from registry ...');
+                       $messageInstance = ObjectRegistry::getRegistry('factory')->getInstance('network_message');
+               } else {
+                       // Get the handler instance
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('NETWORK-MESSAGE-FACTORY: Creating new messageInstance ...');
+                       $messageInstance = ObjectFactory::createObjectByConfiguredName('network_message_class');
+
+                       // Add it to the registry
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-MESSAGE-FACTORY: Adding messageInstance=%s to registy ...', $messageInstance->__toString()));
+                       ObjectRegistry::getRegistry('factory')->addInstance('network_message', $messageInstance);
+               }
+
+               // Return the instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-MESSAGE-FACTORY: messageInstance=%s - EXIT!', $messageInstance->__toString()));
+               return $messageInstance;
+       }
+
+}
index 849f1fd7905d9f090796fa3c77a4063bb89b2a7b..fa18fa497c4ff559be0e1a86da4845ec7611b624 100644 (file)
@@ -14,6 +14,7 @@ use Org\Shipsimu\Hub\Factory\FilterChain\Package\PackageFilterChainFactory;
 use Org\Shipsimu\Hub\Factory\Handler\Message\MessageTypeHandlerFactory;
 use Org\Shipsimu\Hub\Factory\Information\Connection\ConnectionInfoFactory;
 use Org\Shipsimu\Hub\Factory\Network\Locator\UniversalNodeLocatorFactory;
+use Org\Shipsimu\Hub\Factory\Network\Message\NetworkMessageFactory;
 use Org\Shipsimu\Hub\Factory\Node\NodeObjectFactory;
 use Org\Shipsimu\Hub\Generic\BaseHubSystem;
 use Org\Shipsimu\Hub\Handler\BaseHubHandler;
@@ -388,7 +389,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                $handlerInstance->setAssemblerInstance($assemblerInstance);
 
                // Get node instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Creating node instance ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('NETWORK-PACKAGE-HANDLER: Creating node instance ...');
                $nodeInstance = NodeObjectFactory::createNodeInstance();
 
                // Set it locally
@@ -453,24 +454,24 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        private function determineSenderPrivateKeyHash (DeliverablePackage $packageInstance) {
                // Get DHT instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance=%s - CALLED!', $packageInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance=%s - CALLED!', $packageInstance->__toString()));
                $dhtInstance = DhtObjectFactory::createDhtInstance('node');
 
                // Ask DHT for sender's id or address (both session id)
-               /* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: Finding local node data for packageInstance->senderId=%s ...', $packageInstance->getSenderId()));
+               /* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: Finding local node data for packageInstance->senderId=%s ...', $packageInstance->getSenderId()));
                $senderData = $dhtInstance->findNodeLocalBySessionId($packageInstance->getSenderId());
 
                // Is an entry found?
-               /* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: senderData()=%d', count($senderData)));
+               /* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: senderData()=%d', count($senderData)));
                //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: senderData=%s', __METHOD__, __LINE__, print_r($senderData, TRUE)));
                if (count($senderData) > 0 || !empty($senderData[NodeDistributedHashTableDatabaseFrontend::DB_COLUMN_PRIVATE_KEY_HASH])) {
                        // Return it
-                       /* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: Returning senderData[%s]=%s', NodeDistributedHashTableDatabaseFrontend::DB_COLUMN_PRIVATE_KEY_HASH, $senderData[NodeDistributedHashTableDatabaseFrontend::DB_COLUMN_PRIVATE_KEY_HASH]));
+                       /* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: Returning senderData[%s]=%s', NodeDistributedHashTableDatabaseFrontend::DB_COLUMN_PRIVATE_KEY_HASH, $senderData[NodeDistributedHashTableDatabaseFrontend::DB_COLUMN_PRIVATE_KEY_HASH]));
                        return $senderData[NodeDistributedHashTableDatabaseFrontend::DB_COLUMN_PRIVATE_KEY_HASH];
                }
 
                // There is no DHT entry so, accept the hash from decoded data
-               /* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: Returning packagheInstance->senderPrivateKeyHash=%s - EXIT!', $packageInstance->getSenderPrivateKeyHash()));
+               /* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: Returning packagheInstance->senderPrivateKeyHash=%s - EXIT!', $packageInstance->getSenderPrivateKeyHash()));
                return $packageInstance->getSenderPrivateKeyHash();
        }
 
@@ -482,7 +483,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        private function getHashFromContent ($content) {
                // Create the hash
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: content[md5]=%s - CALLED!', md5($content)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: content[md5]=%s - CALLED!', md5($content)));
                // @TODO md5() is very weak, but it needs to be fast
                $hash = md5(sprintf(self::CONTENT_CHECKSUM_MASK,
                        $content,
@@ -491,7 +492,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                ));
 
                // And return it
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: content[md5]=%s,sender=%s,hash=%s,compressor=%s - EXIT!', md5($content), $this->getNodeInstance()->getSessionId(), $hash, $this->getCompressorInstance()->getCompressorExtension()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: content[md5]=%s,sender=%s,hash=%s,compressor=%s - EXIT!', md5($content), $this->getNodeInstance()->getSessionId(), $hash, $this->getCompressorInstance()->getCompressorExtension()));
                return $hash;
        }
 
@@ -503,14 +504,14 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        private function isChecksumValid (DeliverablePackage $packageInstance) {
                // Get checksum
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance=%s - CALLED!', $packageInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance=%s - CALLED!', $packageInstance->__toString()));
                $checksum = $this->getHashFromPackageSessionId($packageInstance);
 
                // Is it the same?
                $isChecksumValid = ($checksum == $packageInstance->getContentChecksum());
 
                // Return it
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: isChecksumValid=%d - EXIT!', intval($isChecksumValid)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: isChecksumValid=%d - EXIT!', intval($isChecksumValid)));
                return $isChecksumValid;
        }
 
@@ -525,15 +526,15 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        private function changePackageStatus (DeliverablePackage $packageInstance, $stackerName, $newStatus) {
                // Skip this for empty stacks
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance=%s,stackerName=%s,newStatus=%s - CALLED!', $packageInstance->__toString(), $stackerName, $newStatus));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance=%s,stackerName=%s,newStatus=%s - CALLED!', $packageInstance->__toString(), $stackerName, $newStatus));
                if ($this->getStackInstance()->isStackEmpty($stackerName)) {
                        // This avoids an exception after all packages has failed
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: stackerName=%s is empty - EXIT!', $stackerName));
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: stackerName=%s is empty - EXIT!', $stackerName));
                        return;
                }
 
                // Pop the entry (it should be it)
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: Getting next stack from stackerName=%s ...', $stackerName));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: Getting next stack from stackerName=%s ...', $stackerName));
                $nextPackageInstance = $this->getStackInstance()->popNamed($stackerName);
 
                // Compare both hashes
@@ -544,15 +545,15 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                }
 
                // Temporary set the new status
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: Setting newStatus=%s ....', $newStatus));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: Setting newStatus=%s ....', $newStatus));
                $packageInstance->setPackageStatus($newStatus);
 
                // And push it again
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: Adding packageInstance=%s to stackerName=%s ...', $packageInstance->__toString(), $stackerName));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: Adding packageInstance=%s to stackerName=%s ...', $packageInstance->__toString(), $stackerName));
                $this->getStackInstance()->pushNamed($stackerName, $packageInstance);
 
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: EXIT!');
        }
 
        /**
@@ -564,7 +565,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        public function getHashFromPackageSessionId (DeliverablePackage $packageInstance) {
                // Is session id set?
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance=%s - CALLED!', $packageInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance=%s - CALLED!', $packageInstance->__toString()));
                /* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: packageInstance=%s', __METHOD__, __LINE__, print_r($packageInstance, TRUE)));
                if (empty($packageInstance->getSessionId())) {
                        // Throw exception
@@ -580,7 +581,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                ));
 
                // And return it
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: hash=%s - EXIT!', $hash));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: hash=%s - EXIT!', $hash));
                return $hash;
        }
 
@@ -601,7 +602,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                 * target because it causes an overload on the network and may be
                 * abused for attacking the network with large packages.
                 */
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance=%s - CALLED!', $packageInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance=%s - CALLED!', $packageInstance->__toString()));
                $discoveryInstance = PackageDiscoveryFactory::createPackageDiscoveryInstance();
 
                // Discover all recipients, this may throw an exception
@@ -622,14 +623,14 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                        $currentRecipient = $iteratorInstance->current();
 
                        // Set the recipient
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Setting recipient to ' . $currentRecipient . ',previous=' . $packageInstance->getRecipientUnl());
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('NETWORK-PACKAGE-HANDLER: Setting recipient to ' . $currentRecipient . ',previous=' . $packageInstance->getRecipientUnl());
                        $packageInstance->setRecipientUnl($currentRecipient);
 
                        // Push the declared package to the next stack.
                        $this->getStackInstance()->pushNamed(self::STACKER_NAME_DECLARED, $packageInstance);
 
                        // Skip to next entry
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Package declared for recipient ' . $currentRecipient);
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('NETWORK-PACKAGE-HANDLER: Package declared for recipient ' . $currentRecipient);
                        $iteratorInstance->next();
                }
 
@@ -638,11 +639,11 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                 * shall be delivered has already been added for all entries from the
                 * list.
                 */
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Invoking discoveryInstance->clearRecipients() ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: Invoking discoveryInstance->clearRecipients() ...');
                $discoveryInstance->clearRecipients();
 
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: EXIT!');
        }
 
        /**
@@ -667,48 +668,48 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                 * which (configurable!) protocol should be used for that type of
                 * package.
                 */
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance=%s - CALLED!', $packageInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance=%s - CALLED!', $packageInstance->__toString()));
                $discoveryInstance = SocketDiscoveryFactory::createSocketDiscoveryInstance();
 
                // Now discover the right socket instance from given package data
                $socketInstance = $discoveryInstance->discoverSocket($packageInstance, StorableSocket::CONNECTION_TYPE_OUTGOING);
 
                // Get the connection helper from registry
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Getting helperInstance for connection from registry ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('NETWORK-PACKAGE-HANDLER: Getting helperInstance for connection from registry ...');
                $helperInstance = ObjectRegistry::getRegistry('hub')->getInstance('connection');
 
                // Get connection info class
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: stateInstance=%s', $helperInstance->getStateInstance()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: stateInstance=%s', $helperInstance->getStateInstance()));
                $infoInstance = ConnectionInfoFactory::createConnectionInfoInstance($helperInstance->getProtocolName(), 'helper');
 
                // Will the info instance with connection helper data
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: Invoking infoInstance->fillWithConnectionHelperInformation(%s) ...', $helperInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: Invoking infoInstance->fillWithConnectionHelperInformation(%s) ...', $helperInstance->__toString()));
                $infoInstance->fillWithConnectionHelperInformation($helperInstance);
 
                // Is it not there?
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: socketInstance->isValidSocket()=%d', intval($socketInstance->isValidSocket())));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: socketInstance->isValidSocket()=%d', intval($socketInstance->isValidSocket())));
                if (($socketInstance->isValidSocket()) && (!$this->getRegistryInstance()->isSocketRegistered($infoInstance, $socketInstance))) {
                        // Then register it
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: Registering socket %s ...', $socketInstance));
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: Registering socket %s ...', $socketInstance));
                        $this->getRegistryInstance()->registerSocketInstance($infoInstance, $socketInstance);
                } elseif (!$helperInstance->getStateInstance()->isPeerStateConnected()) {
                        // Is not connected, then we cannot send
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: Unexpected peer state %s detected.', $helperInstance->getStateInstance()->__toString()));
+                       self::createDebugInstance(__CLASS__, __LINE__)->warningMessage(sprintf('NETWORK-PACKAGE-HANDLER: Unexpected peer state %s detected.', $helperInstance->getStateInstance()->__toString()));
 
                        // Shutdown the socket
                        $socketInstance->shutdownSocket();
                }
 
                // Make sure the connection is up
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Invoking helperInstance->stateInstance->validatePeerStateConnected() ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: Invoking helperInstance->stateInstance->validatePeerStateConnected() ...');
                $helperInstance->getStateInstance()->validatePeerStateConnected();
 
                // Enqueue it again on the out-going queue, the connection is up and working at this point
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: Invoking this->stackInstance->pushNamed(%s, %s) ...', self::STACKER_NAME_OUTGOING, $packageInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: Invoking this->stackInstance->pushNamed(%s, %s) ...', self::STACKER_NAME_OUTGOING, $packageInstance->__toString()));
                $this->getStackInstance()->pushNamed(self::STACKER_NAME_OUTGOING, $packageInstance);
 
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: EXIT!');
        }
 
        /**
@@ -719,15 +720,15 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        private function sendOutgoingRawPackageData (DeliverablePackage $packageInstance) {
                // Init sent bytes
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance=%s - CALLED!', $packageInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance=%s - CALLED!', $packageInstance->__toString()));
                $sentBytes = 0;
 
                // Get the right connection instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: Invoking this->registryInstance->determineInfoInstanceByPackageInstance(%s) ...', gettype($packageInstance)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: Invoking this->registryInstance->determineInfoInstanceByPackageInstance(%s) ...', gettype($packageInstance)));
                $infoInstance = $this->getRegistryInstance()->determineInfoInstanceByPackageInstance($packageInstance);
 
                // Test helper instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: infoInstance[]=%s', gettype($infoInstance)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: infoInstance[]=%s', gettype($infoInstance)));
                if (is_null($infoInstance)) {
                        // Throw NPE
                        throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
@@ -751,7 +752,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                $helperInstance->sendRawPackageData($packageInstance);
 
                // Debug message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: EXIT!');
        }
 
        /**
@@ -761,16 +762,16 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         * @param       $senderId       Sender id to generate a hash for
         * @return      $hash           Hash as hex-encoded string
         */
-       private function generatePackageHash ($content, $senderId) {
+       private function generatePackageHash (string $content, string $senderId) {
                // Assert on variables
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: content()=' . strlen($content) . ',senderId=' . $senderId . ' - CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: content()=' . strlen($content) . ',senderId=' . $senderId . ' - CALLED!');
                assert(!empty($content));
                assert(!empty($senderId));
 
                // Is the feature enabled?
                if (!FrameworkFeature::isFeatureAvailable('hubcoin_reward')) {
                        // Feature is not enabled
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Feature "hubcoin_reward" not available, not generating package hash. Returning NULL ...');
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: Feature "hubcoin_reward" not available, not generating package hash. Returning NULL ...');
                        return NULL;
                }
 
@@ -783,7 +784,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                $packageInstance->setSenderPrivateKeyHash($this->getNodeInstance()->getNodePrivateKeyHash());
 
                // Hash content and sender id together, use scrypt
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: senderId=' . $senderId . ',content()=' . strlen($content));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('NETWORK-PACKAGE-HANDLER: senderId=' . $senderId . ',content()=' . strlen($content));
                $hash = FrameworkFeature::callFeature('hubcoin_reward', 'generateHash', array(
                        sprintf('%s:%s:%s',
                                $senderId,
@@ -793,7 +794,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                ));
 
                // Return it
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: hash=' . $hash . ' - EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: hash=' . $hash . ' - EXIT!');
                return $hash;
        }
 
@@ -806,10 +807,10 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        private function isPackageContentHashValid (DeliverablePackage $packageInstance) {
                // Is the feature enabled?
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance=%s - CALLED!', $packageInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance=%s - CALLED!', $packageInstance->__toString()));
                if (!FrameworkFeature::isFeatureAvailable('hubcoin_reward')) {
                        // Feature is not enabled, so hashes are always valid
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Feature "hubcoin_reward" not available, not checking hash. Returning TRUE ...');
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: Feature "hubcoin_reward" not available, not checking hash. Returning TRUE ...');
                        return TRUE;
                } elseif (empty($packageInstance->getSenderId())) {
                        // Empty sender id
@@ -820,7 +821,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                }
 
                // Check validity
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance->senderId=%s,packageInstance->packageContent=%s,packageInstance->contentHash=%s', $packageInstance->getSenderId(), $packageInstance->getPackageContent(), $packageInstance->getContentHash()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance->senderId=%s,packageInstance->packageContent=%s,packageInstance->contentHash=%s', $packageInstance->getSenderId(), $packageInstance->getPackageContent(), $packageInstance->getContentHash()));
                //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: packageInstance=%s', __METHOD__, __LINE__, print_r($packageInstance, TRUE)));
                $isHashValid = FrameworkFeature::callFeature('hubcoin_reward', 'checkHash', [
                        sprintf('%s:%s:%s',
@@ -832,7 +833,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                ]);
 
                // Return it
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: isHashValid=%s - EXIT!', intval($isHashValid)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: isHashValid=%s - EXIT!', intval($isHashValid)));
                return $isHashValid;
        }
 
@@ -847,11 +848,11 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        public function enqueueRawDataFromTemplate (HubHelper $helperInstance) {
                // Get the raw content ...
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: helperInstance=' . $helperInstance->__toString() . ' - CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: helperInstance=' . $helperInstance->__toString() . ' - CALLED!');
                $rawTemplateData = $helperInstance->getTemplateInstance()->getRawTemplateData();
 
                // Should not be empty
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: rawTemplateData(%d)=%s', strlen($rawTemplateData), $rawTemplateData));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: rawTemplateData(%d)=%s', strlen($rawTemplateData), $rawTemplateData));
                if (empty($rawTemplateData)) {
                        // Abort here
                        throw new UnexpectedValueException('Variable "rawTemplateData" is unexpectly empty.');
@@ -861,7 +862,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                $compressed = $this->getCompressorInstance()->compressStream($rawTemplateData);
 
                // Add magic in front of it and hash behind it, including BASE64 encoding
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: compressed()=%d', strlen($compressed)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: compressed()=%d', strlen($compressed)));
                $packageContent = sprintf(self::PACKAGE_MASK,
                        // 1.) Compressor's extension
                        $this->getCompressorInstance()->getCompressorExtension(),
@@ -880,25 +881,25 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                );
 
                // Init package instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Enqueueing package for recipientType=' . $helperInstance->getRecipientType() . ' ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('NETWORK-PACKAGE-HANDLER: Enqueueing package for recipientType=' . $helperInstance->getRecipientType() . ' ...');
                $packageInstance = ObjectFactory::createObjectByConfiguredName('package_data_class');
 
                // Set all data
                $packageInstance->setSenderId($this->getNodeInstance()->getSessionId());
                $packageInstance->setRecipientId($helperInstance->getRecipientId());
                $packageInstance->setRecipientType($helperInstance->getRecipientType());
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: Setting packageContent=%s ...', $packageContent));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: Setting packageContent=%s ...', $packageContent));
                $packageInstance->setPackageContent($packageContent);
                $packageInstance->setPackageStatus(self::PACKAGE_STATUS_NEW);
                $packageInstance->setContentHash($this->generatePackageHash($rawTemplateData, $this->getNodeInstance()->getSessionId()));
                $packageInstance->setSenderPrivateKeyHash($this->getNodeInstance()->getNodePrivateKeyHash());
 
                // Now prepare the temporary array and push it on the 'undeclared' stack
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: Pushing packageInstance=%s to stack %s ...', $packageInstance->__toString(), self::STACKER_NAME_UNDECLARED));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: Pushing packageInstance=%s to stack %s ...', $packageInstance->__toString(), self::STACKER_NAME_UNDECLARED));
                $this->getStackInstance()->pushNamed(self::STACKER_NAME_UNDECLARED, $packageInstance);
 
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: EXIT!');
        }
 
        /**
@@ -908,7 +909,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        public function isPackageEnqueued () {
                // Check whether the stacker is not empty
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: CALLED!');
                $isEnqueued = (
                        ($this->getStackInstance()->isStackInitialized(self::STACKER_NAME_UNDECLARED)) &&
                        (!$this->getStackInstance()->isStackEmpty(self::STACKER_NAME_UNDECLARED))
@@ -916,7 +917,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
 
 
                // Return the result
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: isEnqueued=%d - EXIT!', intval($isEnqueued)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: isEnqueued=%d - EXIT!', intval($isEnqueued)));
                return $isEnqueued;
        }
 
@@ -927,14 +928,14 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        public function isPackageDeclared () {
                // Check whether the stacker is not empty
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: CALLED!');
                $isDeclared = (
                        ($this->getStackInstance()->isStackInitialized(self::STACKER_NAME_DECLARED)) &&
                        (!$this->getStackInstance()->isStackEmpty(self::STACKER_NAME_DECLARED))
                );
 
                // Return the result
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: isDeclared=%d - EXIT!', intval($isDeclared)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: isDeclared=%d - EXIT!', intval($isDeclared)));
                return $isDeclared;
        }
 
@@ -945,7 +946,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        public function isPackageWaitingForDelivery () {
                // Check whether the stacker is not empty
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: CALLED!');
                $isWaitingDelivery = (
                        (
                                $this->getStackInstance()->isStackInitialized(self::STACKER_NAME_OUTGOING)
@@ -955,7 +956,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                );
 
                // Return the result
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: isWaitingDelivery=%d - EXIT!', intval($isWaitingDelivery)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: isWaitingDelivery=%d - EXIT!', intval($isWaitingDelivery)));
                return $isWaitingDelivery;
        }
 
@@ -966,7 +967,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        public function isEncodedDataPending () {
                // Check whether the stacker is not empty
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: CALLED!');
                $isPending = (
                        (
                                $this->getStackInstance()->isStackInitialized(self::STACKER_NAME_OUTGOING_STREAM)
@@ -976,7 +977,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                );
 
                // Return the result
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: isPending=%d - EXIT!', intval($isPending)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: isPending=%d - EXIT!', intval($isPending)));
                return $isPending;
        }
 
@@ -992,10 +993,10 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        public function declareEnqueuedPackage () {
                // Make sure this method isn't working if there is no package enqueued
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: CALLED!');
                if (!$this->isPackageEnqueued()) {
                        // This is not fatal but should be avoided
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: No raw package data waiting declaration, but ' . __METHOD__ . ' has been called!');
+                       self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: No raw package data waiting declaration, but ' . __METHOD__ . ' has been called!');
                        return;
                }
 
@@ -1006,11 +1007,11 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                $packageInstance = $this->getStackInstance()->popNamed(self::STACKER_NAME_UNDECLARED);
 
                // Declare the raw package data for delivery
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance->recipientType=%s is undeclared, declaring now ...', $packageInstance->getRecipientType()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance->recipientType=%s is undeclared, declaring now ...', $packageInstance->getRecipientType()));
                $this->declareRawPackageData($packageInstance);
 
                // Debug message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: EXIT!');
        }
 
        /**
@@ -1022,12 +1023,12 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        public function processDeclaredPackage () {
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: CALLED!');
 
                // Sanity check if we have packages declared
                if (!$this->isPackageDeclared()) {
                        // This is not fatal but should be avoided
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: No package has been declared, but ' . __METHOD__ . ' has been called!');
+                       self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: No package has been declared, but ' . __METHOD__ . ' has been called!');
                        return;
                }
 
@@ -1043,14 +1044,14 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                        $this->getStackInstance()->popNamed(self::STACKER_NAME_DECLARED);
                } catch (UnexpectedStateException $e) {
                        // The state is not excepected (shall be 'connected')
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Caught ' . $e->__toString() . ',message=' . $e->getMessage());
+                       self::createDebugInstance(__CLASS__, __LINE__)->warningMessage('NETWORK-PACKAGE-HANDLER: Caught ' . $e->__toString() . ',message=' . $e->getMessage());
 
                        // Mark the package with status failed
                        $this->changePackageStatus($packageInstance, self::STACKER_NAME_DECLARED, self::PACKAGE_STATUS_FAILED);
                }
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: EXIT!');
        }
 
        /**
@@ -1060,13 +1061,11 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         * @throws      UnexpectedValueException        If $sessionId is empty
         */
        public function sendWaitingPackage () {
-               // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: CALLED!');
-
                // Sanity check if we have packages waiting for delivery
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: CALLED!');
                if (!$this->isPackageWaitingForDelivery()) {
                        // This is not fatal but should be avoided
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: No package is waiting for delivery, but ' . __METHOD__ . ' was called.');
+                       self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: No package is waiting for delivery, but ' . __METHOD__ . ' was called.');
                        return;
                }
 
@@ -1074,17 +1073,17 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                $packageInstance = $this->getStackInstance()->getNamed(self::STACKER_NAME_OUTGOING);
 
                // The UNL should be set but not recipientId
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: recipientUnl(%d)=%s,recipientId(%d)=%s', strlen($packageInstance->getRecipientUnl()), $packageInstance->getRecipientUnl(), strlen($packageInstance->getRecipientId()), $packageInstance->getRecipientId()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: recipientUnl(%d)=%s,recipientId(%d)=%s', strlen($packageInstance->getRecipientUnl()), $packageInstance->getRecipientUnl(), strlen($packageInstance->getRecipientId()), $packageInstance->getRecipientId()));
                if (!empty($packageInstance->getRecipientUnl()) && (empty($packageInstance->getRecipientId()) || $packageInstance->getRecipientId() == 'invalid')) {
                        // Need to resolve UNL -> session id ("recipient id"), so prepare UNL instance
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: recipientUnl=%s is being solved into a session id ...', $packageInstance->getRecipientUnl()));
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: recipientUnl=%s is being solved into a session id ...', $packageInstance->getRecipientUnl()));
                        $locatorInstance = UniversalNodeLocatorFactory::createUnlInstanceFromString($packageInstance->getRecipientUnl());
 
                        // Get session id and set it back
                        $sessionId = HubTools::resolveSessionIdByUniversalNodeLocator($locatorInstance);
 
                        // Is it empty?
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: sessionId[%s]=%s', gettype($sessionId), $sessionId));
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(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');
@@ -1102,14 +1101,14 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                        $this->getStackInstance()->popNamed(self::STACKER_NAME_OUTGOING);
                } catch (InvalidSocketException $e) {
                        // Output exception message
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Package was not delivered: ' . $e->getMessage());
+                       self::createDebugInstance(__CLASS__, __LINE__)->warningMessage('NETWORK-PACKAGE-HANDLER: Package was not delivered: ' . $e->getMessage());
 
                        // Mark package as failed
                        $this->changePackageStatus($packageInstance, self::STACKER_NAME_OUTGOING, self::PACKAGE_STATUS_FAILED);
                }
 
                // Debug message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: EXIT!');
        }
 
        /**
@@ -1123,7 +1122,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        public function sendEncodedData () {
                // Make sure there is pending encoded data
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: CALLED!');
                if (!$this->isEncodedDataPending()) {
                        // Throw exception
                        throw new BadMethodCallException('No encoded data is pending but this method was called.', FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
@@ -1133,7 +1132,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                $encodedDataArray = $this->getStackInstance()->popNamed(self::STACKER_NAME_OUTGOING_STREAM);
 
                // Init in this round sent bytes
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: encodedDataArray()=%d has been "popped" from stack %s.', count($encodedDataArray), self::STACKER_NAME_OUTGOING_STREAM));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: encodedDataArray()=%d has been "popped" from stack %s.', count($encodedDataArray), self::STACKER_NAME_OUTGOING_STREAM));
                $sentBytes = 0;
 
                // Check all conditions, throw exceptions if something unexpected happened
@@ -1153,21 +1152,21 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                $encodedDataArray[self::RAW_INDEX_SOCKET_INSTANCE] = NULL;
 
                // And deliver it
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: Invoking socketInstance->writeBufferToSocketByArray(%d,%d) ...', count($encodedDataArray), $sentBytes));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: Invoking socketInstance->writeBufferToSocketByArray(%d,%d) ...', count($encodedDataArray), $sentBytes));
                if (!$socketInstance->writeBufferToSocketByArray($encodedDataArray, $sentBytes)) {
                        // Something bad happened while writing to socket
                        $socketInstance->handleSocketError(__METHOD__, __LINE__);
                }
 
                // If there was an error, don't continue here
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: sentBytes[%s]=%d', gettype($sentBytes), $sentBytes));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: sentBytes[%s]=%d', gettype($sentBytes), $sentBytes));
                if (($sentBytes === 0) && (strlen($encodedDataArray[self::RAW_INDEX_ENCODED_DATA]) > 0)) {
                        // Nothing sent means all data has been sent
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: All sent! (LINE=' . __LINE__ . ')');
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: All sent! (LINE=' . __LINE__ . ')');
                        return;
                } elseif (strlen($encodedDataArray[self::RAW_INDEX_ENCODED_DATA]) == 0) {
                        // Abort here, all sent!
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: All sent! (LINE=' . __LINE__ . ')');
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: All sent! (LINE=' . __LINE__ . ')');
                        return;
                }
 
@@ -1175,11 +1174,11 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                $encodedDataArray[self::RAW_INDEX_SOCKET_INSTANCE] = $socketInstance;
 
                // Push array back in stack
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Pushing raw data back to stacker, as still some data is pending delivery.');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('NETWORK-PACKAGE-HANDLER: Pushing raw data back to stacker, as still some data is pending delivery.');
                $this->getStackInstance()->pushNamed(self::STACKER_NAME_OUTGOING_STREAM, $encodedDataArray);
 
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: EXIT!');
        }
 
        ///////////////////////////////////////////////////////////////////////////
@@ -1193,11 +1192,11 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        private function isRawDataPending () {
                // Just return whether the stack is not empty
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: CALLED!');
                $isPending = (!$this->getStackInstance()->isStackEmpty(self::STACKER_NAME_DECODED_INCOMING));
 
                // Return the status
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: isPending=%d - EXIT!', intval($isPending)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: isPending=%d - EXIT!', intval($isPending)));
                return $isPending;
        }
 
@@ -1208,14 +1207,14 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        public function isNewRawDataPending () {
                // Visit the pool. This monitors the pool for incoming raw data.
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: Invoking this->getListenerPoolInstance()->accept(%s) ... - CALLED!', $this->getVisitorInstance()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: Invoking this->getListenerPoolInstance()->accept(%s) ... - CALLED!', $this->getVisitorInstance()));
                $this->getListenerPoolInstance()->accept($this->getVisitorInstance());
 
                // Check for new data arrival
                $hasArrived = $this->isRawDataPending();
 
                // Return the status
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: hasArrived=%d - EXIT!', intval($hasArrived)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: hasArrived=%d - EXIT!', intval($hasArrived)));
                return $hasArrived;
        }
 
@@ -1232,14 +1231,14 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                 * This method should only be called if decoded raw data is pending,
                 * so check it again.
                 */
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: CALLED!');
                if (!$this->isRawDataPending()) {
                        // Should not be invoked anymore
                        throw new BadMethodCallException('No incoming decoded data on stack but method was called.', FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // "Pop" the next entry (the same array again) from the stack
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: Stacker size is %d entries.', $this->getStackInstance()->getStackCount(self::STACKER_NAME_DECODED_INCOMING)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: Stacker size is %d entries.', $this->getStackInstance()->getStackCount(self::STACKER_NAME_DECODED_INCOMING)));
                $packageInstance = $this->getStackInstance()->popNamed(self::STACKER_NAME_DECODED_INCOMING);
 
                /*
@@ -1247,19 +1246,19 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                 * only want to handle unhandled packages here.
                 */
                // Remove the last chunk SEPARATOR (because there is no need for it)
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: errorCode=%s/%s', $packageInstance->getErrorCode(), StorableSocket::SOCKET_ERROR_UNHANDLED));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: errorCode=%s/%s', $packageInstance->getErrorCode(), StorableSocket::SOCKET_ERROR_UNHANDLED));
                if (substr($packageInstance->getRawData(), -1, 1) == PackageFragmenter::CHUNK_SEPARATOR) {
                        // It is there and should be removed
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: Raw data contains CHUNK_SEPARATOR=%s - Removing ...', PackageFragmenter::CHUNK_SEPARATOR));
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: Raw data contains CHUNK_SEPARATOR=%s - Removing ...', PackageFragmenter::CHUNK_SEPARATOR));
                        $packageInstance->setRawData(substr($packageInstance->getRawData(), 0, -1));
                }
 
                // This package is "handled" and can be pushed on the next stack
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: Pushing %d(%s) bytes to stack %s ...', strlen($packageInstance->getRawData()), $packageInstance->getRawData(), self::STACKER_NAME_DECODED_HANDLED));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: Pushing %d(%s) bytes to stack %s ...', strlen($packageInstance->getRawData()), $packageInstance->getRawData(), self::STACKER_NAME_DECODED_HANDLED));
                $this->getStackInstance()->pushNamed(self::STACKER_NAME_DECODED_HANDLED, $packageInstance);
 
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: EXIT!');
        }
 
        /**
@@ -1273,15 +1272,15 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                 * Get the decoded data from the handler, this is an array with
                 * 'raw_data' and 'error_code' as elements.
                 */
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: handlerInstance=%s - CALLED!', $handlerInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: handlerInstance=%s - CALLED!', $handlerInstance->__toString()));
                $packageInstance = $handlerInstance->getNextPackageInstance();
 
                // And push it on our stack
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance->rawData()=%s', strlen($packageInstance->getRawData())));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance->rawData()=%s', strlen($packageInstance->getRawData())));
                $this->getStackInstance()->pushNamed(self::STACKER_NAME_DECODED_INCOMING, $packageInstance);
 
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: EXIT!');
        }
 
        /**
@@ -1331,7 +1330,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        public function handleAssemblerPendingData () {
                // Handle it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Invoking this->getAssemblerInstance()->handlePendingData() ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: Invoking this->getAssemblerInstance()->handlePendingData() ...');
                $this->getAssemblerInstance()->handlePendingData();
        }
 
@@ -1342,7 +1341,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        public function handleMultipleMessages () {
                // Handle it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Invoking this->getAssemblerInstance()->handleMultipleMessages() ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: Invoking this->getAssemblerInstance()->handleMultipleMessages() ...');
                $this->getAssemblerInstance()->handleMultipleMessages();
        }
 
@@ -1378,14 +1377,14 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        public function accept (Visitor $visitorInstance) {
                // Visit the package
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: ' . $visitorInstance->__toString() . ' has visited - CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: ' . $visitorInstance->__toString() . ' has visited - CALLED!');
                $visitorInstance->visitNetworkPackageHandler($this);
 
                // Then visit the assembler to handle multiple packages
                $this->getAssemblerInstance()->accept($visitorInstance);
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: ' . $visitorInstance->__toString() . ' has visited - EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: ' . $visitorInstance->__toString() . ' has visited - EXIT!');
        }
 
        /**
@@ -1398,7 +1397,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                $this->initStacks(TRUE);
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: All stacker have been re-initialized.');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: All stacker have been re-initialized.');
        }
 
        /**
@@ -1411,7 +1410,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        public function removeFirstFailedPackage () {
                // Get the package again
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: CALLED!');
                $packageInstance = $this->getStackInstance()->getNamed(self::STACKER_NAME_DECLARED);
 
                // Is the package status 'failed'?
@@ -1424,7 +1423,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                $this->getStackInstance()->popNamed(self::STACKER_NAME_DECLARED);
 
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: EXIT!');
        }
 
        /**
@@ -1436,7 +1435,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        public function decodeRawContent ($rawPackageContent) {
                // Check if no double seperator is found
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: rawPackageContent(%d)=%s - CALLED!', strlen($rawPackageContent), $rawPackageContent));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: rawPackageContent(%d)=%s - CALLED!', strlen($rawPackageContent), $rawPackageContent));
                if (strpos($rawPackageContent, self::PACKAGE_DATA_SEPARATOR . self::PACKAGE_DATA_SEPARATOR) !== FALSE) {
                        // Opps, should never happend
                        throw new InvalidArgumentException(sprintf('rawPackageContent=%s has 2x or more "%s" in it.', $rawPackageContent, self::PACKAGE_DATA_SEPARATOR));
@@ -1446,7 +1445,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                $decodedArray = explode(self::PACKAGE_DATA_SEPARATOR, $rawPackageContent);
 
                // Assert on count (should be always 6)
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: decodedArray()=%d', count($decodedArray)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: decodedArray()=%d', count($decodedArray)));
                //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: decodedArray=%s', __METHOD__, __LINE__, print_r($decodedArray, TRUE)));
                if (count($decodedArray) != self::DECODED_DATA_ARRAY_SIZE) {
                        // Count of array elements not expected
@@ -1472,7 +1471,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                $packageInstance->setSenderPrivateKeyHash($decodedArray[self::INDEX_PACKAGE_PRIVATE_KEY_HASH]);
 
                // And return it
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance=%s - EXIT!', $packageInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance=%s - EXIT!', $packageInstance->__toString()));
                return $packageInstance;
        }
 
@@ -1486,7 +1485,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        public function handleReceivedPackageInstance (DeliverablePackage $packageInstance) {
                // Is the package content set?
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance=%s - CALLED!', $packageInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance=%s - CALLED!', $packageInstance->__toString()));
                if (empty($packageInstance->getPackageContent())) {
                        // Package content is not set
                        throw new InvalidArgumentException(sprintf('Package with receipientId=%s,recipientType=%s has empty packageContent',
@@ -1503,7 +1502,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                $decodedContent = explode(self::PACKAGE_MASK_SEPARATOR, $packageInstance->getPackageContent());
 
                // Assert on array count for a very basic validation
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: decodedContent()=%d', count($decodedContent)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: decodedContent()=%d', count($decodedContent)));
                if (count($decodedContent) != self::PACKAGE_CONTENT_ARRAY_SIZE) {
                        // Not valid decoded content
                        throw new InvalidArgumentException(sprintf('decodedContent()=%d does not match expected %d. packageContent=%s',
@@ -1529,7 +1528,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                $this->getStackInstance()->pushNamed(self::STACKER_NAME_PACKAGE_DECOMPRESSED_XML, $packageInstance);
 
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: EXIT!');
        }
 
        /**
@@ -1539,11 +1538,11 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        public function isNewMessageArrived () {
                // Determine if the stack is not empty
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: CALLED!');
                $hasArrived = (!$this->getStackInstance()->isStackEmpty(self::STACKER_NAME_NEW_MESSAGE));
 
                // Return it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: hasArrived=%d - EXIT!', intval($hasArrived)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: hasArrived=%d - EXIT!', intval($hasArrived)));
                return $hasArrived;
        }
 
@@ -1554,11 +1553,11 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        public function isDecodedPackageXmlPending () {
                // Determine if the stack is not empty
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: CALLED!');
                $hasArrived = (!$this->getStackInstance()->isStackEmpty(self::STACKER_NAME_PACKAGE_DECOMPRESSED_XML));
 
                // Return it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: hasArrived=%d - EXIT!', intval($hasArrived)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: hasArrived=%d - EXIT!', intval($hasArrived)));
                return $hasArrived;
        }
 
@@ -1573,7 +1572,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        public function handleNewlyArrivedMessage () {
                // Make sure there is at least one message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: CALLED!');
                if (!$this->isNewMessageArrived()) {
                        // Bad method call
                        throw new BadMethodCallException('No new message arrived but this method has been called.', FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
@@ -1584,7 +1583,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
 
                // Generate the hash of comparing it
                /* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: messageInstance=%s', __METHOD__, __LINE__, print_r($messageInstance, TRUE)));
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: messageInstance=%s,senderId=%s,senderPrivateKeyHash=%s', $messageInstance->__toString(), $messageInstance->getSenderId(), $messageInstance->getSenderPrivateKeyHash()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: messageInstance=%s,senderId=%s,senderPrivateKeyHash=%s', $messageInstance->__toString(), $messageInstance->getSenderId(), $messageInstance->getSenderPrivateKeyHash()));
                if (empty($messageInstance->getSenderId())) {
                        // Invalid $messageInstance
                        throw new InvalidArgumentException('messageInstance does not contain senderId');
@@ -1612,7 +1611,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                $chainInstance->postProcessMessage($this);
 
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: EXIT!');
        }
 
        /**
@@ -1626,7 +1625,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        public function handleDecodedPackageXml () {
                // Make sure there is at least one package
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: CALLED!');
                if (!$this->isDecodedPackageXmlPending()) {
                        // Bad method call
                        throw new BadMethodCallException('No package waiting XML parsing', FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
@@ -1637,7 +1636,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
 
                // Generate the hash of comparing it
                //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: packageInstance=%s', __METHOD__, __LINE__, print_r($packageInstance, TRUE)));
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance=%s,senderId=%s,senderPrivateKeyHash=%s', $packageInstance->__toString(), $packageInstance->getSenderId(), $packageInstance->getSenderPrivateKeyHash()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance=%s,senderId=%s,senderPrivateKeyHash=%s', $packageInstance->__toString(), $packageInstance->getSenderId(), $packageInstance->getSenderPrivateKeyHash()));
                if (empty($packageInstance->getSenderId())) {
                        // Invalid $packageInstance
                        throw new InvalidArgumentException('packageInstance does not contain senderId');
@@ -1650,10 +1649,11 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                }
 
                // Parse package's XML into a message instance
+               $messageInstance = NetworkMessageFactory::createNetworkMessageInstanceFromPackage($packageInstance);
                /* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: packageInstance=%s', __METHOD__, __LINE__, print_r($packageInstance, TRUE)));
 
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: EXIT!');
        }
 
        /**
@@ -1663,11 +1663,11 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        public function isProcessedMessagePending () {
                // Check it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: CALLED!');
                $isPending = (!$this->getStackInstance()->isStackEmpty(self::STACKER_NAME_PROCESSED_MESSAGE));
 
                // Return it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: isPending=%d - EXIT!', intval($isPending)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: isPending=%d - EXIT!', intval($isPending)));
                return $isPending;
        }
 
@@ -1678,14 +1678,14 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        public function handleProcessedMessage () {
                // Get it from the stacker, it is the full array with the processed message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: CALLED!');
                $messageInstance = $this->getStackInstance()->popNamed(self::STACKER_NAME_PROCESSED_MESSAGE);
 
                // Add type for later easier handling
                $messageArray[self::MESSAGE_ARRAY_DATA][self::MESSAGE_ARRAY_TYPE] = $messageArray[self::MESSAGE_ARRAY_TYPE];
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: messageArray=' . print_r($messageArray, TRUE));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('NETWORK-PACKAGE-HANDLER: messageArray=' . print_r($messageArray, TRUE));
 
                // Create a handler instance from given message type
                $handlerInstance = MessageTypeHandlerFactory::createMessageTypeHandlerInstance($messageArray[self::MESSAGE_ARRAY_TYPE]);
@@ -1697,7 +1697,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                $handlerInstance->postHandleMessageData($messageArray, $this);
 
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('NETWORK-PACKAGE-HANDLER: EXIT!');
        }
 
        /**
@@ -1712,7 +1712,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
         */
        public function feedHashToMiner (DeliverableMessage $messageInstance) {
                // Is the feature enabled?
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: messageInstance=%s - CALLED!', $messageInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NETWORK-PACKAGE-HANDLER: messageInstance=%s - CALLED!', $messageInstance->__toString()));
                if (!FrameworkFeature::isFeatureAvailable('hubcoin_reward')) {
                        /*
                         * Feature is not enabled, don't feed the hash to the miner as it
@@ -1729,7 +1729,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                unset($messageData[self::MESSAGE_ARRAY_DATA]);
 
                // Resolve session id ('sender' is a session id) into node id
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: messageData=' . print_r($messageData, TRUE));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('NETWORK-PACKAGE-HANDLER: messageData=' . print_r($messageData, TRUE));
                $nodeId = HubTools::resolveNodeIdBySessionId($messageData[self::MESSAGE_ARRAY_SENDER]);
 
                // Is 'claim_reward' the message type?
index 713c2a136a0668997d1f748bb87901af83d1265f..e1dd4e3c79cc074ce8820f7f802efa8724bcb6fb 100644 (file)
@@ -720,6 +720,9 @@ $cfg->setConfigEntry('web_template_class', 'Org\Mxchange\CoreFramework\Template\
 // CFG: PACKAGE-DATA-CLASS
 $cfg->setConfigEntry('package_data_class', 'Org\Shipsimu\Hub\Network\Package\PackageData');
 
+// CFG: NETWORK-MESSAGE-CLASS
+$cfg->setConfigEntry('network_message_class', 'Org\Shipsimu\Hub\Network\Message\NetworkMessage');
+
 // CFG: NETWORK-PACKAGE-HANDLER-CLASS
 $cfg->setConfigEntry('network_package_handler_class', 'Org\Shipsimu\Hub\Handler\Package\NetworkPackageHandler');