From: Roland Häder Date: Tue, 27 Oct 2020 10:00:27 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=18efe0884416a8f07deb17dd91823e8ad69c3b22;p=hub.git Continued: - renamed NETWORK_TARGET_* to RECIPIENT_TYPE_* Signed-off-by: Roland Häder --- diff --git a/application/hub/classes/handler/package/class_NetworkPackageHandler.php b/application/hub/classes/handler/package/class_NetworkPackageHandler.php index 434b64839..788ba76f3 100644 --- a/application/hub/classes/handler/package/class_NetworkPackageHandler.php +++ b/application/hub/classes/handler/package/class_NetworkPackageHandler.php @@ -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]); diff --git a/application/hub/classes/helper/dht/class_DhtBootstrapHelper.php b/application/hub/classes/helper/dht/class_DhtBootstrapHelper.php index d16ddfd1a..ac9d605af 100644 --- a/application/hub/classes/helper/dht/class_DhtBootstrapHelper.php +++ b/application/hub/classes/helper/dht/class_DhtBootstrapHelper.php @@ -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')); diff --git a/application/hub/classes/helper/dht/class_DhtPublishEntryHelper.php b/application/hub/classes/helper/dht/class_DhtPublishEntryHelper.php index cc7dcbb5c..b1006a862 100644 --- a/application/hub/classes/helper/dht/class_DhtPublishEntryHelper.php +++ b/application/hub/classes/helper/dht/class_DhtPublishEntryHelper.php @@ -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')); diff --git a/application/hub/classes/helper/node/announcement/class_NodeAnnouncementHelper.php b/application/hub/classes/helper/node/announcement/class_NodeAnnouncementHelper.php index f9492ca26..7be34491f 100644 --- a/application/hub/classes/helper/node/announcement/class_NodeAnnouncementHelper.php +++ b/application/hub/classes/helper/node/announcement/class_NodeAnnouncementHelper.php @@ -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')); diff --git a/application/hub/classes/helper/node/answer/announcement/class_NodeAnnouncementMessageAnswerHelper.php b/application/hub/classes/helper/node/answer/announcement/class_NodeAnnouncementMessageAnswerHelper.php index 49cb91911..94bc6648d 100644 --- a/application/hub/classes/helper/node/answer/announcement/class_NodeAnnouncementMessageAnswerHelper.php +++ b/application/hub/classes/helper/node/answer/announcement/class_NodeAnnouncementMessageAnswerHelper.php @@ -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 diff --git a/application/hub/classes/helper/node/answer/dht/class_NodeDhtBootstrapMessageAnswerHelper.php b/application/hub/classes/helper/node/answer/dht/class_NodeDhtBootstrapMessageAnswerHelper.php index 0b3520e10..d31748f88 100644 --- a/application/hub/classes/helper/node/answer/dht/class_NodeDhtBootstrapMessageAnswerHelper.php +++ b/application/hub/classes/helper/node/answer/dht/class_NodeDhtBootstrapMessageAnswerHelper.php @@ -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 diff --git a/application/hub/classes/helper/node/answer/requests/class_NodeRequestNodeListMessageAnswerHelper.php b/application/hub/classes/helper/node/answer/requests/class_NodeRequestNodeListMessageAnswerHelper.php index 77a7e8650..eeac765d1 100644 --- a/application/hub/classes/helper/node/answer/requests/class_NodeRequestNodeListMessageAnswerHelper.php +++ b/application/hub/classes/helper/node/answer/requests/class_NodeRequestNodeListMessageAnswerHelper.php @@ -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 diff --git a/application/hub/classes/helper/node/connection/class_NodeSelfConnectHelper.php b/application/hub/classes/helper/node/connection/class_NodeSelfConnectHelper.php index 65b978c26..a1dbc2987 100644 --- a/application/hub/classes/helper/node/connection/class_NodeSelfConnectHelper.php +++ b/application/hub/classes/helper/node/connection/class_NodeSelfConnectHelper.php @@ -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)); diff --git a/application/hub/classes/helper/node/requests/class_NodeRequestNodeListHelper.php b/application/hub/classes/helper/node/requests/class_NodeRequestNodeListHelper.php index 64d27d293..b07ab9982 100644 --- a/application/hub/classes/helper/node/requests/class_NodeRequestNodeListHelper.php +++ b/application/hub/classes/helper/node/requests/class_NodeRequestNodeListHelper.php @@ -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')); diff --git a/application/hub/classes/recipient/dht/class_DhtRecipient.php b/application/hub/classes/recipient/dht/class_DhtRecipient.php index cb043fe35..83fb357c9 100644 --- a/application/hub/classes/recipient/dht/class_DhtRecipient.php +++ b/application/hub/classes/recipient/dht/class_DhtRecipient.php @@ -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'); diff --git a/application/hub/classes/recipient/upper/class_UpperRecipient.php b/application/hub/classes/recipient/upper/class_UpperRecipient.php index c12a771e7..ade3da627 100644 --- a/application/hub/classes/recipient/upper/class_UpperRecipient.php +++ b/application/hub/classes/recipient/upper/class_UpperRecipient.php @@ -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) {