From e3a8c97d59d1307137da222354d6359121323044 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Roland=20H=C3=A4der?= <roland@mxchange.org>
Date: Thu, 21 Feb 2013 23:32:43 +0000
Subject: [PATCH] Added noisy debug lines, used constants defined in
 NetworkPackage instead of direct 'foo', 'bar' et cetera

---
 application/hub/main/recipient/dht/class_DhtRecipient.php      | 3 ++-
 .../hub/main/recipient/direct/class_DirectRecipient.php        | 3 +++
 application/hub/main/recipient/self/class_SelfRecipient.php    | 3 ++-
 application/hub/main/recipient/upper/class_UpperRecipient.php  | 3 ++-
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/application/hub/main/recipient/dht/class_DhtRecipient.php b/application/hub/main/recipient/dht/class_DhtRecipient.php
index baef26385..c8d31c985 100644
--- a/application/hub/main/recipient/dht/class_DhtRecipient.php
+++ b/application/hub/main/recipient/dht/class_DhtRecipient.php
@@ -57,7 +57,8 @@ class DhtRecipient extends BaseRecipient implements Recipient {
 	 */
 	public function resolveRecipient ($recipient, Listable $listInstance) {
 		// Make sure the recipient is valid
-		assert($recipient == 'dht');
+		/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-RECIPIENT: recipient=' . $recipient);
+		assert($recipient == NetworkPacke::PACKAGE_RECIPIENT_DHT);
 		$this->partialStub('Please implement this method. recipient=' . $recipient);
 	}
 }
diff --git a/application/hub/main/recipient/direct/class_DirectRecipient.php b/application/hub/main/recipient/direct/class_DirectRecipient.php
index 1fafba533..a6089b093 100644
--- a/application/hub/main/recipient/direct/class_DirectRecipient.php
+++ b/application/hub/main/recipient/direct/class_DirectRecipient.php
@@ -55,6 +55,9 @@ class DirectRecipient extends BaseRecipient implements Recipient {
 	 * @throws	FrameworkException	Could throw different exceptions depending on implementation
 	 */
 	public function resolveRecipient ($recipient, Listable $listInstance = NULL) {
+		// Debug message
+		/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DIRECT-RECIPIENT: recipient=' . $recipient);
+
 		// "Explode" all recipients
 		$recipients = explode(NetworkPackage::PACKAGE_RECIPIENT_SEPARATOR, $recipient);
 
diff --git a/application/hub/main/recipient/self/class_SelfRecipient.php b/application/hub/main/recipient/self/class_SelfRecipient.php
index 307f29997..10c0bb1f0 100644
--- a/application/hub/main/recipient/self/class_SelfRecipient.php
+++ b/application/hub/main/recipient/self/class_SelfRecipient.php
@@ -56,7 +56,8 @@ class SelfRecipient extends BaseRecipient implements Recipient {
 	 */
 	public function resolveRecipient ($recipient, Listable $listInstance) {
 		// Make sure the recipient is valid
-		assert($recipient == 'self');
+		/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SELF-RECIPIENT: recipient=' . $recipient);
+		assert($recipient == NetworkPackage::NETWORK_TARGET_SELF);
 
 		// Determine own port
 		$port = $this->getConfigInstance()->getConfigEntry('node_listen_port');
diff --git a/application/hub/main/recipient/upper/class_UpperRecipient.php b/application/hub/main/recipient/upper/class_UpperRecipient.php
index 408c62609..db6cb2643 100644
--- a/application/hub/main/recipient/upper/class_UpperRecipient.php
+++ b/application/hub/main/recipient/upper/class_UpperRecipient.php
@@ -56,7 +56,8 @@ class UpperRecipient extends BaseRecipient implements Recipient {
 	 */
 	public function resolveRecipient ($recipient, Listable $listInstance) {
 		// Make sure the recipient is valid
-		assert($recipient == 'upper');
+		/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('UPPER-RECIPIENT: recipient=' . $recipient);
+		assert($recipient == NetworkPackage::PACKAGE_RECIPIENT_UPPER);
 
 		// Get all bootstrap nodes
 		foreach (explode(BaseHubSystem::BOOTSTRAP_NODES_SEPARATOR, $this->getConfigInstance()->getConfigEntry('hub_bootstrap_nodes')) as $ipPort) {
-- 
2.39.5