3 namespace Hub\Crawler\Task\Scanner\UploadedList;
5 // Import application-specific stuff
6 use Hub\Factory\Scanner\ScannerObjectFactory;
8 // Import framework stuff
9 use CoreFramework\Task\Taskable;
10 use CoreFramework\Visitor\Visitable;
13 * A UploadedList scanner task for crawlers
15 * @author Roland Haeder <webmaster@ship-simu.org>
17 * @copyright Copyright (c) 2014 Crawler Developer Team
18 * @license GNU GPL 3.0 or any newer version
19 * @link http://www.ship-simu.org
21 * This program is free software: you can redistribute it and/or modify
22 * it under the terms of the GNU General Public License as published by
23 * the Free Software Foundation, either version 3 of the License, or
24 * (at your option) any later version.
26 * This program is distributed in the hope that it will be useful,
27 * but WITHOUT ANY WARRANTY; without even the implied warranty of
28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 * GNU General Public License for more details.
31 * You should have received a copy of the GNU General Public License
32 * along with this program. If not, see <http://www.gnu.org/licenses/>.
34 class CrawlerUploadedListScannerTask extends BaseTask implements Taskable, Visitable {
36 * Protected constructor
40 protected function __construct () {
41 // Call parent constructor
42 parent::__construct(__CLASS__);
46 * Creates an instance of this class
48 * @return $taskInstance An instance of a Visitable class
50 public final static function createCrawlerUploadedListScannerTask () {
52 $taskInstance = new CrawlerUploadedListScannerTask();
54 // Return the prepared instance
59 * Accepts the visitor to process the visitor
61 * @param $visitorInstance An instance of a Visitor class
63 * @todo Maybe visit some sub-objects
65 public function accept (Visitor $visitorInstance) {
67 $visitorInstance->visitTask($this);
75 public function executeTask () {
76 // Call factory for a scanner instance and execute it
77 ScannerObjectFactory::createScannerInstance($this)->execute();
86 public function doShutdown () {
87 self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...');