X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=application%2Fhub%2Finterfaces%2Fpackage%2Fclass_Deliverable.php;h=a8f6b791494f363146cb90e6016158793a590c9d;hb=82e419f6038e405ebe5106db8f37ea593a5d6562;hp=a97c93fc4ff543bf55262dafe6bca6f3430de1c0;hpb=aa4ac5d61eab8540e9902396998f3f53718eeaf5;p=hub.git diff --git a/application/hub/interfaces/package/class_Deliverable.php b/application/hub/interfaces/package/class_Deliverable.php index a97c93fc4..a8f6b7914 100644 --- a/application/hub/interfaces/package/class_Deliverable.php +++ b/application/hub/interfaces/package/class_Deliverable.php @@ -2,11 +2,11 @@ /** * An interface for package delivery boys... ;-) * - * @author Roland Haeder + * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org + * @link http://www.shipsimu.org * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,15 +23,86 @@ */ interface Deliverable extends FrameworkInterface { /** - * "Queues" raw content into this delivery class by reading the raw content - * from given template instance. + * "Enqueues" raw content into this delivery class by reading the raw content + * from given helper's template instance and pushing it on the 'undeclared' + * stack. * - * @param $templateInstance A CompileableTemplate instance + * @param $helperInstance An instance of a Helper class + * @param $protocol Name of used protocol (TCP/UDP) * @return void */ - function queueRawDataFromTemplate (CompileableTemplate $templateInstance); + function enqueueRawDataFromTemplate (Helper $helperInstance, $protocol); + + /** + * Checks whether a package has been enqueued for delivery. + * + * @return $isEnqueued Whether a package is enqueued + */ + function isPackageEnqueued (); + + /** + * Checks whether a package has been declared + * + * @return $isDeclared Whether a package is declared + */ + function isPackageDeclared (); + + /** + * Checks whether a package should be sent out + * + * @return $isWaitingDelivery Whether a package is waiting for delivery + */ + function isPackageWaitingForDelivery (); + + /** + * Checks whether encoded (raw) data is pending + * + * @return $isPending Whether encoded data is pending + */ + function isEncodedDataPending (); + + /** + * Delivers an enqueued package to the stated destination. If a non-session + * id is provided, recipient resolver is being asked (and instanced once). + * This allows that a single package is being delivered to multiple targets + * without enqueueing it for every target. If no target is provided or it + * can't be determined a NoTargetException is being thrown. + * + * @return void + * @throws NoTargetException If no target can't be determined + */ + function declareEnqueuedPackage (); + + /** + * Processes the next declared package. Only one package per time will be + * processed because this may take time and slows down the whole delivery + * infrastructure. + * + * @return void + */ + function processDeclaredPackage (); + + /** + * Sends waiting packages out for delivery + * + * @return void + */ + function sendWaitingPackage (); + + /** + * Sends pending encoded (raw) data + * + * @return void + */ + function sendEncodedData (); + + /** + * Clears all stacks + * + * @return void + */ + function clearAllStacks (); } // [EOF] ?> -