* 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
*
// 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;
}
$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]