From: <gem...@li...> - 2012-02-20 14:13:27
|
Revision: 502 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=502&view=rev Author: mennodekker Date: 2012-02-20 14:13:20 +0000 (Mon, 20 Feb 2012) Log Message: ----------- Updated docblocks Added keywords Modified Paths: -------------- trunk/library/classes/Gems/Controller/Action/Helper/BatchRunner.php trunk/library/classes/Gems/Event/TrackCompletedEventInterface.php trunk/library/classes/Gems/Task/CheckTokenCompletion.php trunk/library/classes/Gems/Task/CheckTrackTokens.php trunk/library/classes/Gems/Task/ProcessTokenCompletion.php trunk/library/classes/Gems/Task/TaskAbstract.php trunk/library/classes/Gems/Task/TaskInterface.php trunk/library/classes/Gems/Task/TaskRunnerBatch.php trunk/library/classes/Gems/Tracker.php trunk/library/classes/Gems/User/RadiusUserDefinition.php trunk/library/classes/Gems/Util/AccessLogActions.php Property Changed: ---------------- trunk/library/classes/Gems/Controller/Action/Helper/BatchRunner.php trunk/library/classes/Gems/Event/TrackCompletedEventInterface.php trunk/library/classes/Gems/Task/CheckTokenCompletion.php trunk/library/classes/Gems/Task/CheckTrackTokens.php trunk/library/classes/Gems/Task/ProcessTokenCompletion.php trunk/library/classes/Gems/Task/TaskAbstract.php trunk/library/classes/Gems/Task/TaskInterface.php trunk/library/classes/Gems/Task/TaskRunnerBatch.php trunk/library/classes/Gems/Tracker/Batch/ProcessTokensBatch.php trunk/library/classes/Gems/Tracker/Batch/RefreshTokenAttributesBatch.php trunk/library/classes/Gems/Tracker/Batch/SynchronizeSourcesBatch.php trunk/library/classes/Gems/Tracker/Snippets/EditTrackEngineSnippetGeneric.php trunk/library/classes/Gems/User/RadiusUserDefinition.php trunk/library/classes/Gems/Util/AccessLogActions.php Modified: trunk/library/classes/Gems/Controller/Action/Helper/BatchRunner.php =================================================================== --- trunk/library/classes/Gems/Controller/Action/Helper/BatchRunner.php 2012-02-20 12:19:38 UTC (rev 501) +++ trunk/library/classes/Gems/Controller/Action/Helper/BatchRunner.php 2012-02-20 14:13:20 UTC (rev 502) @@ -32,7 +32,7 @@ * @subpackage * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License - * @version $Id: Sample.php 215 2011-07-12 08:52:54Z michiel $ + * @version $Id$ */ /** Property changes on: trunk/library/classes/Gems/Controller/Action/Helper/BatchRunner.php ___________________________________________________________________ Added: svn:keywords + Id Rev Revision Date Author Modified: trunk/library/classes/Gems/Event/TrackCompletedEventInterface.php =================================================================== --- trunk/library/classes/Gems/Event/TrackCompletedEventInterface.php 2012-02-20 12:19:38 UTC (rev 501) +++ trunk/library/classes/Gems/Event/TrackCompletedEventInterface.php 2012-02-20 14:13:20 UTC (rev 502) @@ -29,7 +29,7 @@ * @subpackage Event * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License - * @version $Id: Sample.php 215 2011-07-12 08:52:54Z michiel $ + * @version $Id$ */ /** Property changes on: trunk/library/classes/Gems/Event/TrackCompletedEventInterface.php ___________________________________________________________________ Added: svn:keywords + Id Rev Revision Date Author Modified: trunk/library/classes/Gems/Task/CheckTokenCompletion.php =================================================================== --- trunk/library/classes/Gems/Task/CheckTokenCompletion.php 2012-02-20 12:19:38 UTC (rev 501) +++ trunk/library/classes/Gems/Task/CheckTokenCompletion.php 2012-02-20 14:13:20 UTC (rev 502) @@ -24,27 +24,25 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Short description of file * * @package Gems - * @subpackage + * @subpackage Task * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License - * @version $Id: Sample.php 215 2011-07-12 08:52:54Z michiel $ + * @version $Id$ */ /** - * Short description for ProcessTokens + * Check token completion in a batch job * - * Long description for class ProcessTokens (if any)... + * This task handles the token completion check, adding tasks to the queue + * when needed. * * @package Gems - * @subpackage Sample + * @subpackage Task * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License - * @since Class available since version 1.0 - * @deprecated Class deprecated since version 2.0 + * @since Class available since version 1.6 */ class Gems_Task_CheckTokenCompletion extends Gems_Task_TaskAbstract { Property changes on: trunk/library/classes/Gems/Task/CheckTokenCompletion.php ___________________________________________________________________ Added: svn:keywords + Id Rev Revision Date Author Modified: trunk/library/classes/Gems/Task/CheckTrackTokens.php =================================================================== --- trunk/library/classes/Gems/Task/CheckTrackTokens.php 2012-02-20 12:19:38 UTC (rev 501) +++ trunk/library/classes/Gems/Task/CheckTrackTokens.php 2012-02-20 14:13:20 UTC (rev 502) @@ -25,27 +25,22 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Short description of file * * @package Gems - * @subpackage + * @subpackage Task * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License - * @version $Id: Sample.php 215 2011-07-12 08:52:54Z michiel $ + * @version $Id$ */ /** - * Short description for CheckTrackTokens + * Checks a respondentTrack for changes, mostly started by Gems_Task_ProcessTokenCompletion * - * Long description for class CheckTrackTokens (if any)... - * * @package Gems - * @subpackage Sample + * @subpackage Task * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License - * @since Class available since version 1.0 - * @deprecated Class deprecated since version 2.0 + * @since Class available since version 1.6 */ class Gems_Task_CheckTrackTokens extends Gems_Task_TaskAbstract { Property changes on: trunk/library/classes/Gems/Task/CheckTrackTokens.php ___________________________________________________________________ Added: svn:keywords + Id Rev Revision Date Author Modified: trunk/library/classes/Gems/Task/ProcessTokenCompletion.php =================================================================== --- trunk/library/classes/Gems/Task/ProcessTokenCompletion.php 2012-02-20 12:19:38 UTC (rev 501) +++ trunk/library/classes/Gems/Task/ProcessTokenCompletion.php 2012-02-20 14:13:20 UTC (rev 502) @@ -25,27 +25,22 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Short description of file * * @package Gems - * @subpackage + * @subpackage Task * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License - * @version $Id: Sample.php 215 2011-07-12 08:52:54Z michiel $ + * @version $Id$ */ /** - * Short description for ProcessTokenCompletion + * Handles completion of a token, mostly started by Gems_Task_CheckTokenCompletion * - * Long description for class ProcessTokenCompletion (if any)... - * * @package Gems - * @subpackage Sample + * @subpackage Task * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License - * @since Class available since version 1.0 - * @deprecated Class deprecated since version 2.0 + * @since Class available since version 1.6 */ class Gems_Task_ProcessTokenCompletion extends Gems_Task_TaskAbstract { @@ -54,7 +49,6 @@ */ public $tracker; - public function execute($tokenData = null, $userId = null) { $this->tracker = $this->loader->getTracker(); Property changes on: trunk/library/classes/Gems/Task/ProcessTokenCompletion.php ___________________________________________________________________ Added: svn:keywords + Id Rev Revision Date Author Modified: trunk/library/classes/Gems/Task/TaskAbstract.php =================================================================== --- trunk/library/classes/Gems/Task/TaskAbstract.php 2012-02-20 12:19:38 UTC (rev 501) +++ trunk/library/classes/Gems/Task/TaskAbstract.php 2012-02-20 14:13:20 UTC (rev 502) @@ -25,27 +25,24 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Short description of file * * @package Gems - * @subpackage + * @subpackage Task * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License - * @version $Id: Sample.php 215 2011-07-12 08:52:54Z michiel $ + * @version $Id$ */ /** - * Short description for TaskAbstract + * Abstract class for easier implementation of the Gems_Task for usage with + * Gems_Task_TaskRunnerBatch providing some convenience methods to loading and + * translation. * - * Long description for class TaskAbstract (if any)... - * * @package Gems - * @subpackage Sample + * @subpackage Task * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License - * @since Class available since version 1.0 - * @deprecated Class deprecated since version 2.0 + * @since Class available since version 1.6 */ abstract class Gems_Task_TaskAbstract extends MUtil_Registry_TargetAbstract implements Gems_Task_TaskInterface { @@ -55,11 +52,6 @@ protected $_batch; /** - * @var array - */ - protected $_params; - - /** * @var Gems_Loader */ public $loader; @@ -73,4 +65,12 @@ { $this->_batch = $batch; } + + /** + * Should handle execution of the task, taking as much (optional) parameters as needed + * + * The parameters should be optional and failing to provide them should be handled by + * the task + */ + abstract public function execute(); } \ No newline at end of file Property changes on: trunk/library/classes/Gems/Task/TaskAbstract.php ___________________________________________________________________ Added: svn:keywords + Id Rev Revision Date Author Modified: trunk/library/classes/Gems/Task/TaskInterface.php =================================================================== --- trunk/library/classes/Gems/Task/TaskInterface.php 2012-02-20 12:19:38 UTC (rev 501) +++ trunk/library/classes/Gems/Task/TaskInterface.php 2012-02-20 14:13:20 UTC (rev 502) @@ -26,30 +26,37 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * Short description of file - * * @package Gems - * @subpackage + * @subpackage Task * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License - * @version $Id: Sample.php 215 2011-07-12 08:52:54Z michiel $ + * @version $Id$ */ /** - * Short description for TaskAbstract + * Describes the interface for a Gems_Task * - * Long description for class TaskAbstract (if any)... - * * @package Gems - * @subpackage Sample + * @subpackage Task * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License - * @since Class available since version 1.0 - * @deprecated Class deprecated since version 2.0 + * @since Class available since version 1.6 */ interface Gems_Task_TaskInterface { + /** + * Should handle execution of the task, taking as much (optional) parameters as needed + * + * The parameters should be optional and failing to provide them should be handled by + * the task + */ public function execute(); - + + /** + * Sets the batch this task belongs to + * + * This method will be called from the Gems_Task_TaskRunnerBatch upon execution of the + * task. It allows the task to communicate with the batch queue. + */ public function setBatch(Gems_Task_TaskRunnerBatch $batch); } \ No newline at end of file Property changes on: trunk/library/classes/Gems/Task/TaskInterface.php ___________________________________________________________________ Added: svn:keywords + Id Rev Revision Date Author Modified: trunk/library/classes/Gems/Task/TaskRunnerBatch.php =================================================================== --- trunk/library/classes/Gems/Task/TaskRunnerBatch.php 2012-02-20 12:19:38 UTC (rev 501) +++ trunk/library/classes/Gems/Task/TaskRunnerBatch.php 2012-02-20 14:13:20 UTC (rev 502) @@ -25,27 +25,27 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Short description of file * * @package Gems - * @subpackage + * @subpackage Task * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License - * @version $Id: Sample.php 215 2011-07-12 08:52:54Z michiel $ + * @version $Id$ */ /** - * Short description for TaskRunnerBatch + * Handles running tasks independent on the kind of task * - * Long description for class TaskRunnerBatch (if any)... + * Continues on the MUtil_Batch_BatchAbstract, exposing some methods to allow the task + * to interact with the batch queue. * + * Tasks added to the queue should be loadable via Gems_Loader and implement the Gems_Task_TaskInterface + * * @package Gems - * @subpackage Sample + * @subpackage Task * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License - * @since Class available since version 1.0 - * @deprecated Class deprecated since version 2.0 + * @since Class available since version 1.6 */ class Gems_Task_TaskRunnerBatch extends MUtil_Batch_BatchAbstract { Property changes on: trunk/library/classes/Gems/Task/TaskRunnerBatch.php ___________________________________________________________________ Added: svn:keywords + Id Rev Revision Date Author Property changes on: trunk/library/classes/Gems/Tracker/Batch/ProcessTokensBatch.php ___________________________________________________________________ Added: svn:keywords + Id Rev Revision Date Author Property changes on: trunk/library/classes/Gems/Tracker/Batch/RefreshTokenAttributesBatch.php ___________________________________________________________________ Added: svn:keywords + Id Rev Revision Date Author Property changes on: trunk/library/classes/Gems/Tracker/Batch/SynchronizeSourcesBatch.php ___________________________________________________________________ Added: svn:keywords + Id Rev Revision Date Author Property changes on: trunk/library/classes/Gems/Tracker/Snippets/EditTrackEngineSnippetGeneric.php ___________________________________________________________________ Added: svn:keywords + Id Rev Revision Date Author Modified: trunk/library/classes/Gems/Tracker.php =================================================================== --- trunk/library/classes/Gems/Tracker.php 2012-02-20 12:19:38 UTC (rev 501) +++ trunk/library/classes/Gems/Tracker.php 2012-02-20 14:13:20 UTC (rev 502) @@ -841,13 +841,15 @@ * @param string $batch_id A unique identifier for the current batch * @param Gems_Tracker_Token_TokenSelect Select statements selecting tokens * @param int $userId Id of the user who takes the action (for logging) - * @return Gems_Tracker_Batch_ProcessTokensBatch A batch to process the changes + * @return Gems_Task_TaskRunnerBatch A batch to process the changes */ protected function processTokensBatch($batch_id, Gems_Tracker_Token_TokenSelect $tokenSelect, $userId) { $where = implode(' ', $tokenSelect->getSelect()->getPart(Zend_Db_Select::WHERE)); $batch = $this->loader->getTaskRunnerBatch($batch_id); + //Now set the step duration + $batch->minimalStepDurationMs = 3000; if (! $batch->isLoaded()) { $statement = $tokenSelect->getSelect()->query(); @@ -859,18 +861,6 @@ } } - /* - $batch = $this->_loadClass('Batch_ProcessTokensBatch', true, array($batch_id)); - - if (! $batch->isLoaded()) { - $statement = $tokenSelect->getSelect()->query(); - //Process one row at a time to prevent out of memory errors for really big resultsets - while ($tokenData = $statement->fetch()) { - $batch->addToken($tokenData['gto_id_token'], $userId); - } - } - */ - return $batch; } @@ -917,7 +907,7 @@ * @param string $batch_id A unique identifier for the current batch * @param int $userId Id of the user who takes the action (for logging) * @param string $cond - * @return Gems_Tracker_Batch_ProcessTokensBatch A batch to process the changes + * @return Gems_Task_TaskRunnerBatch A batch to process the changes */ public function recalculateTokensBatch($batch_id, $userId = null, $cond = null) { Modified: trunk/library/classes/Gems/User/RadiusUserDefinition.php =================================================================== --- trunk/library/classes/Gems/User/RadiusUserDefinition.php 2012-02-20 12:19:38 UTC (rev 501) +++ trunk/library/classes/Gems/User/RadiusUserDefinition.php 2012-02-20 14:13:20 UTC (rev 502) @@ -29,7 +29,7 @@ * @subpackage User * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License - * @version $Id: RadiusUserDefinition.php 228 2011-12-21 09:39:34Z 175780 $ + * @version $Id$ */ /** Property changes on: trunk/library/classes/Gems/User/RadiusUserDefinition.php ___________________________________________________________________ Added: svn:keywords + Id Rev Revision Date Author Modified: trunk/library/classes/Gems/Util/AccessLogActions.php =================================================================== --- trunk/library/classes/Gems/Util/AccessLogActions.php 2012-02-20 12:19:38 UTC (rev 501) +++ trunk/library/classes/Gems/Util/AccessLogActions.php 2012-02-20 14:13:20 UTC (rev 502) @@ -30,7 +30,7 @@ * @subpackage Util * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License - * @version $Id: ReceptionCode.php 370 2011-12-19 09:27:19Z mennodekker $ + * @version $Id$ */ /** Property changes on: trunk/library/classes/Gems/Util/AccessLogActions.php ___________________________________________________________________ Added: svn:keywords + Id Rev Revision Date Author This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |