]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/discovery/package/class_PackageRecipientDiscovery.php
Some improvements:
[hub.git] / application / hub / main / discovery / package / class_PackageRecipientDiscovery.php
index d775e9995ac831fc5c40f5d51365b0df3d07db21..bfbde19d85082d32a24f60791214024feb149235 100644 (file)
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class PackageRecipientDiscovery extends BaseHubDiscovery implements DiscoverableNodeRecipient, Registerable {
+class PackageRecipientDiscovery extends BaseNodeDiscovery implements DiscoverableNodeRecipient, Registerable {
        /**
         * Protected constructor
         *
@@ -41,13 +41,6 @@ class PackageRecipientDiscovery extends BaseHubDiscovery implements Discoverable
                // Get an instance of this class
                $discoveryInstance = new PackageRecipientDiscovery();
 
-               // Get recipients list instance and set it
-               $listInstance = RecipientListFactory::createRecipientListInstance();
-               $discoveryInstance->setListInstance($listInstance);
-
-               // Output debug message
-               self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-DISCOVERY[' . __LINE__ . ']: Initialized.');
-
                // Return the prepared instance
                return $discoveryInstance;
        }
@@ -121,43 +114,6 @@ class PackageRecipientDiscovery extends BaseHubDiscovery implements Discoverable
                        $this->getListInstance()->addEntry('ip_port', $decodedData[NetworkPackage::PACKAGE_DATA_RECIPIENT]);
                }
        }
-
-       /**
-        * "Getter" for recipient iterator
-        *
-        * @return      $iteratorInstance       An instance of a Iterateable object
-        */
-       public function getIterator () {
-               // Get iterator from it
-               $iteratorInstance = $this->getListInstance()->getIterator();
-
-               // Return it
-               return $iteratorInstance;
-       }
-
-       /**
-        * Checks whether the recipient list is empty
-        *
-        * @return      $isEmpty        Whether the recipient list is empty
-        */
-       public function isRecipientListEmpty () {
-               // Check it ...
-               $isEmpty = ($this->getListInstance()->count() == 0);
-
-               // Return it
-               return $isEmpty;
-       }
-
-       /**
-        * Clears all recipients for e.g. another package to deliver. This method
-        * simply clears the inner list instance.
-        *
-        * @return      void
-        */
-       public function clearRecipients () {
-               // Clear the list
-               $this->getListInstance()->clearList();
-       }
 }
 
 // [EOF]