]> git.mxchange.org Git - hub.git/commitdiff
Try to assert on all virtual recipients
authorRoland Häder <roland@mxchange.org>
Mon, 18 Feb 2013 06:02:20 +0000 (06:02 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 18 Feb 2013 06:02:20 +0000 (06:02 +0000)
application/hub/interfaces/recipient/class_Recipient.php
application/hub/main/recipient/class_
application/hub/main/recipient/dht/class_DhtRecipient.php
application/hub/main/recipient/direct/class_DirectRecipient.php
application/hub/main/recipient/self/class_SelfRecipient.php
application/hub/main/recipient/upper/class_UpperRecipient.php

index 96e779665167ea6ae104b620de2c96f95ce9dd3a..6d77256cc83cff97fc9ec7f7a0377bb218fb5c6e 100644 (file)
@@ -29,7 +29,7 @@ interface Recipient extends FrameworkInterface {
         * @param       $recipient              Recipient to resolve (e.g. could be a virtual recipient or direct session id)
         * @param       $listInstance   An instance of a Listable class
         * @return      $resolved               Resolved recipient or VOID if only the set list has been filled
-        * @throws      FrameworkException      Could throw different exceptions back depending on implementation
+        * @throws      FrameworkException      Could throw different exceptions depending on implementation
         */
        function resolveRecipient ($recipient, Listable $listInstance);
 }
index 7669560cf80f4de5c36a9760b1b814d1989793ab..83d6bf0e02669c1858d1a9a44283636a7bbf2948 100644 (file)
@@ -56,6 +56,8 @@ class ???Recipient extends BaseRecipient implements Recipient {
         * @todo        0% done
         */
        public function resolveRecipient ($recipient, Listable $listInstance) {
+               // Make sure the recipient is valid
+               assert($recipient == '|||');
                $this->partialStub('Please implement this method. recipient=' . $recipient);
        }
 }
index 328de547ba06162fd220f2a6af954e8d7952298e..baef263859152d8f7410cb8bc86fa7bc253baada 100644 (file)
@@ -52,10 +52,12 @@ class DhtRecipient extends BaseRecipient implements Recipient {
         * @param       $recipient              Recipient to resolve (e.g. could be a virtual recipient or direct session id)
         * @param       $listInstance   An instance of a Listable class
         * @return      $resolved               Resolved recipient or VOID if only the set list has been filled
-        * @throws      FrameworkException      Could throw different exceptions back depending on implementation
+        * @throws      FrameworkException      Could throw different exceptions depending on implementation
         * @todo        0% done
         */
        public function resolveRecipient ($recipient, Listable $listInstance) {
+               // Make sure the recipient is valid
+               assert($recipient == 'dht');
                $this->partialStub('Please implement this method. recipient=' . $recipient);
        }
 }
index e3be9d85678c38ab00d7753759074dc7e54c1a07..1fafba533d3756e6dedf05b1079690fffc2ba7fc 100644 (file)
@@ -52,7 +52,7 @@ class DirectRecipient extends BaseRecipient implements Recipient {
         * @param       $recipient              Recipient to resolve (e.g. could be a virtual recipient or direct session id)
         * @param       $listInstance   An instance of a Listable class
         * @return      $resolved               Resolved recipient or VOID if only the set list has been filled
-        * @throws      FrameworkException      Could throw different exceptions back depending on implementation
+        * @throws      FrameworkException      Could throw different exceptions depending on implementation
         */
        public function resolveRecipient ($recipient, Listable $listInstance = NULL) {
                // "Explode" all recipients
index 5839a2f2544aada4d262cb4d168fe29e2a1b08ac..307f299973c10ad208a7c59ee931ef62de42058a 100644 (file)
@@ -52,9 +52,12 @@ class SelfRecipient extends BaseRecipient implements Recipient {
         * @param       $recipient              Recipient to resolve (e.g. could be a virtual recipient or direct session id)
         * @param       $listInstance   An instance of a Listable class
         * @return      $resolved               Resolved recipient or VOID if only the set list has been filled
-        * @throws      FrameworkException      Could throw different exceptions back depending on implementation
+        * @throws      FrameworkException      Could throw different exceptions depending on implementation
         */
        public function resolveRecipient ($recipient, Listable $listInstance) {
+               // Make sure the recipient is valid
+               assert($recipient == 'self');
+
                // Determine own port
                $port = $this->getConfigInstance()->getConfigEntry('node_listen_port');
 
index e0cc719c63541f752af0bb6caae67aa544772dc7..408c62609bfd969fc27f52dde491deb86bbb47d9 100644 (file)
@@ -52,9 +52,12 @@ class UpperRecipient extends BaseRecipient implements Recipient {
         * @param       $recipient              Recipient to resolve (e.g. could be a virtual recipient or direct session id)
         * @param       $listInstance   An instance of a Listable class
         * @return      $resolved               Resolved recipient or VOID if only the set list has been filled
-        * @throws      FrameworkException      Could throw different exceptions back depending on implementation
+        * @throws      FrameworkException      Could throw different exceptions depending on implementation
         */
        public function resolveRecipient ($recipient, Listable $listInstance) {
+               // Make sure the recipient is valid
+               assert($recipient == 'upper');
+
                // Get all bootstrap nodes
                foreach (explode(BaseHubSystem::BOOTSTRAP_NODES_SEPARATOR, $this->getConfigInstance()->getConfigEntry('hub_bootstrap_nodes')) as $ipPort) {
                        // Is maximum reached?