]> git.mxchange.org Git - hub.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Tue, 27 Oct 2020 10:00:27 +0000 (11:00 +0100)
committerRoland Häder <roland@mxchange.org>
Tue, 27 Oct 2020 10:00:27 +0000 (11:00 +0100)
- renamed NETWORK_TARGET_* to RECIPIENT_TYPE_*

Signed-off-by: Roland Häder <roland@mxchange.org>
application/hub/classes/handler/package/class_NetworkPackageHandler.php
application/hub/classes/helper/dht/class_DhtBootstrapHelper.php
application/hub/classes/helper/dht/class_DhtPublishEntryHelper.php
application/hub/classes/helper/node/announcement/class_NodeAnnouncementHelper.php
application/hub/classes/helper/node/answer/announcement/class_NodeAnnouncementMessageAnswerHelper.php
application/hub/classes/helper/node/answer/dht/class_NodeDhtBootstrapMessageAnswerHelper.php
application/hub/classes/helper/node/answer/requests/class_NodeRequestNodeListMessageAnswerHelper.php
application/hub/classes/helper/node/connection/class_NodeSelfConnectHelper.php
application/hub/classes/helper/node/requests/class_NodeRequestNodeListHelper.php
application/hub/classes/recipient/dht/class_DhtRecipient.php
application/hub/classes/recipient/upper/class_UpperRecipient.php

index 434b64839633c1028d142c23fe702a4770a30d3d..788ba76f35d2b3075a3e35e378130cc56e301333 100644 (file)
@@ -176,24 +176,24 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
        const PACKAGE_RECIPIENT_SEPARATOR = ':';
 
        /**
-        * Network target (alias): 'upper nodes'
+        * Recipient type 'upper nodes'
         */
-       const NETWORK_TARGET_UPPER = 'upper';
+       const RECIPIENT_TYPE_UPPER = 'upper';
 
        /**
-        * Network target (alias): 'self'
+        * Recipient type 'self'
         */
-       const NETWORK_TARGET_SELF = 'self';
+       const RECIPIENT_TYPE_SELF = 'self';
 
        /**
-        * Network target (alias): 'dht'
+        * Recipient type 'dht'
         */
-       const NETWORK_TARGET_DHT = 'dht';
+       const RECIPIENT_TYPE_DHT = 'dht';
 
        /**
-        * Network target (alias): 'direct'
+        * Recipient type 'direct'
         */
-       const NETWORK_TARGET_DIRECT = 'direct';
+       const RECIPIENT_TYPE_DIRECT = 'direct';
 
        /**
         * TCP package size in bytes
@@ -1378,7 +1378,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                $packageInstance->setSenderAddress($decodedArray[self::INDEX_PACKAGE_SENDER_ADDRESS]);
                $packageInstance->setSenderPort($decodedArray[self::INDEX_PACKAGE_SENDER_PORT]);
                $packageInstance->setRecipientId($decodedArray[self::INDEX_PACKAGE_RECIPIENT]);
-               $packageInstance->setRecipientType(self::NETWORK_TARGET_DIRECT);
+               $packageInstance->setRecipientType(self::RECIPIENT_TYPE_DIRECT);
                $packageInstance->setPackageContent($decodedArray[self::INDEX_PACKAGE_CONTENT]);
                $packageInstance->setStatus(self::PACKAGE_STATUS_DECODED);
                $packageInstance->setContentHash($decodedArray[self::INDEX_PACKAGE_HASH]);
index d16ddfd1a31d08973c4150ae7b2bb70a36fdeb16..ac9d605afebdf0c482f26fadd7ec799340311340 100644 (file)
@@ -48,7 +48,7 @@ class DhtBootstrapHelper extends BaseHubSystemHelper implements HelpableDht {
                parent::__construct(__CLASS__);
 
                // Set recipient type
-               $this->setRecipientType(NetworkPackageHandler::NETWORK_TARGET_DHT);
+               $this->setRecipientType(NetworkPackageHandler::RECIPIENT_TYPE_DHT);
 
                // Set package tags
                $this->setPackageTags(array('dht_bootstrap'));
index cc7dcbb5c2d7f89565490744c4dc2814b59a398a..b1006a862d8e8ed664481945086e5749285cf4b2 100644 (file)
@@ -48,7 +48,7 @@ class DhtPublishEntryHelper extends BaseHubSystemHelper implements HelpableDht {
                parent::__construct(__CLASS__);
 
                // Set recipient type
-               $this->setRecipientType(NetworkPackageHandler::NETWORK_TARGET_DHT);
+               $this->setRecipientType(NetworkPackageHandler::RECIPIENT_TYPE_DHT);
 
                // Set package tags
                $this->setPackageTags(array('dht_publish_entry'));
index f9492ca265213678630180009338477a0cb9a206..7be34491fda57ece0d3b8264f981a1c509c6f319 100644 (file)
@@ -47,7 +47,7 @@ class NodeAnnouncementHelper extends BaseNodeHelper implements HelpableNode {
                parent::__construct(__CLASS__);
 
                // Set recipient type
-               $this->setRecipientType(NetworkPackageHandler::NETWORK_TARGET_UPPER);
+               $this->setRecipientType(NetworkPackageHandler::RECIPIENT_TYPE_UPPER);
 
                // Set package tags
                $this->setPackageTags(array('announcement'));
index 49cb9191167aea5854e1836332ac6c95b24164c9..94bc6648df31e873afedef659cc91dd8d5e47d0f 100644 (file)
@@ -61,7 +61,7 @@ class NodeAnnouncementMessageAnswerHelper extends BaseHubAnswerHelper implements
                $helperInstance = new NodeAnnouncementMessageAnswerHelper();
 
                // Set session id of other peer as recipient
-               $helperInstance->setRecipientType(NetworkPackageHandler::NETWORK_TARGET_DIRECT);
+               $helperInstance->setRecipientType(NetworkPackageHandler::RECIPIENT_TYPE_DIRECT);
                $helperInstance->setRecipientId($messageData[XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID]);
 
                // Set message data
index 0b3520e1044686778f00548731179553fd50211f..d31748f88873fdf86b42ccd420c59f5faa996694 100644 (file)
@@ -61,7 +61,7 @@ class NodeDhtBootstrapMessageAnswerHelper extends BaseHubAnswerHelper implements
                $helperInstance = new NodeDhtBootstrapMessageAnswerHelper();
 
                // Set session id of other peer as recipient
-               $helperInstance->setRecipientType(NetworkPackageHandler::NETWORK_TARGET_DIRECT);
+               $helperInstance->setRecipientType(NetworkPackageHandler::RECIPIENT_TYPE_DIRECT);
                $helperInstance->setRecipientId($messageData[XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_SESSION_ID]);
 
                // Set message data
index 77a7e86507d6fb7c7972b38edd4d8cafb27fddd1..eeac765d1012c9b1e394b6b0681469da353024c5 100644 (file)
@@ -61,7 +61,7 @@ class NodeRequestNodeListMessageAnswerHelper extends BaseHubAnswerHelper impleme
                $helperInstance = new NodeRequestNodeListMessageAnswerHelper();
 
                // Set session id of other peer as recipient
-               $helperInstance->setRecipientType(NetworkPackageHandler::NETWORK_TARGET_DIRECT);
+               $helperInstance->setRecipientType(NetworkPackageHandler::RECIPIENT_TYPE_DIRECT);
                $helperInstance->setRecipientId($messageData[XmlRequestNodeListTemplateEngine::REQUEST_DATA_SESSION_ID]);
 
                // Set message data
index 65b978c2602d21272b7d30c14c54c3203426cc2a..a1dbc2987db03a307c27ca460d238ae918e8c1a3 100644 (file)
@@ -48,7 +48,7 @@ class NodeSelfConnectHelper extends BaseNodeHelper implements HelpableNode {
                parent::__construct(__CLASS__);
 
                // Set recipient type
-               $this->setRecipientType(NetworkPackageHandler::NETWORK_TARGET_SELF);
+               $this->setRecipientType(NetworkPackageHandler::RECIPIENT_TYPE_SELF);
 
                // Set package tags
                $this->setPackageTags(array(Tagable::TAG_SELF_CONNECT));
index 64d27d2937588d18fa1cdd48913937cbd52b7853..b07ab99821d4bf866cdc0b29eca0b96cf1511758 100644 (file)
@@ -47,7 +47,7 @@ class NodeRequestNodeListHelper extends BaseNodeHelper implements HelpableNode {
                parent::__construct(__CLASS__);
 
                // Set recipient type
-               $this->setRecipientType(NetworkPackageHandler::NETWORK_TARGET_UPPER);
+               $this->setRecipientType(NetworkPackageHandler::RECIPIENT_TYPE_UPPER);
 
                // Set package tags
                $this->setPackageTags(array('request_node_list'));
index cb043fe35ceabf71c8cc3df55572fe46da92d60f..83fb357c9864b50b6b306a2156040d3748993a9c 100644 (file)
@@ -77,7 +77,7 @@ class DhtRecipient extends BaseRecipient implements Recipient {
 
                // Make sure the recipient is valid
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-RECIPIENT: recipientUnl=' . $recipientUnl);
-               assert($recipientUnl == NetworkPackageHandler::NETWORK_TARGET_DHT);
+               assert($recipientUnl == NetworkPackageHandler::RECIPIENT_TYPE_DHT);
 
                // Get recipient discovery instance
                $discoverInstance = ObjectFactory::createObjectByConfiguredName('dht_recipient_discovery_class');
index c12a771e7793bd38befd12a3bfbb3c711efbbfe3..ade3da627b3e743b08c9a889ca4fbf0aa2c1a729 100644 (file)
@@ -76,7 +76,7 @@ class UpperRecipient extends BaseRecipient implements Recipient {
 
                // Check recipient UNL
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('UPPER-RECIPIENT: recipientUnl=' . $recipientUnl);
-               assert($recipientUnl == NetworkPackageHandler::NETWORK_TARGET_UPPER);
+               assert($recipientUnl == NetworkPackageHandler::RECIPIENT_TYPE_UPPER);
 
                // Get all bootstrap nodes
                foreach (explode(BaseHubSystem::BOOTSTRAP_NODES_SEPARATOR, $this->getConfigInstance()->getConfigEntry('hub_bootstrap_nodes')) as $unlData) {