]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/discovery/class_BaseNodeDiscovery.php
Continued on rewrite:
[hub.git] / application / hub / main / discovery / class_BaseNodeDiscovery.php
index 2e5ff6a529203b5277be669191725455d7914487..9a8db0a27f39f2b9c7405d86d315d3789d7adabc 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * A PackageRecipient discovery class
+ * A general node discovery class
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
@@ -31,73 +31,6 @@ class BaseNodeDiscovery extends BaseDiscovery implements Discoverable {
        protected function __construct ($className) {
                // Call parent constructor
                parent::__construct($className);
-
-               /*
-                * Get recipients list instance and set it here for all discovery
-                * implementations.
-                */
-               $listInstance = RecipientListFactory::createRecipientListInstance();
-               $this->setListInstance($listInstance);
-       }
-
-       /**
-        * Determines the protoctol name
-        *
-        * @param       $packageData            Valid package data
-        * @return      $protocolInstance       An instance of a ProtocolHandler class
-        */
-       protected function determineProtocolByPackageData (array $packageData) {
-               // First we need a tags instance
-               $tagsInstance = PackageTagsFactory::createPackageTagsInstance();
-
-               /*
-                * We need to decide here which socket (TCP or UDP) should be used for
-                * the actual data transmission. In this process we will find out if
-                * the recipient of this package has already a known (registered) socket
-                * and if so we can re-use it. If there is no socket registered, we try
-                * to make a new connection to the given universal node locator.
-                */
-               $protocolInstance = $tagsInstance->chooseProtocolFromPackageData($packageData);
-
-               // Return it
-               return $protocolInstance;
-       }
-
-       /**
-        * "Getter" for recipient iterator
-        *
-        * @return$iteratorInstance An instance of a Iterateable object
-        */
-       public final function getIterator () {
-               // Get iterator from it
-               $iteratorInstance = $this->getListInstance()->getIterator();
-
-               // Return it
-               return $iteratorInstance;
-       }
-
-       /**
-        * Clears all recipients for e.g. another package to deliver. This method
-        * simply clears the inner list instance.
-        *
-        * @return      void
-        */
-       public final function clearRecipients () {
-               // Clear the list
-               $this->getListInstance()->clearList();
-       }
-
-       /**
-        * Checks whether the recipient list is empty
-        *
-        * @return      $isEmpty        Whether the recipient list is empty
-        */
-       public final function isRecipientListEmpty () {
-               // Check it ...
-               $isEmpty = ($this->getListInstance()->count() == 0);
-
-               // Return it
-               return $isEmpty;
        }
 }