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;
11 use CoreFramework\Visitor\Visitor;
14 * A UploadedList scanner task for crawlers
16 * @author Roland Haeder <webmaster@ship-simu.org>
18 * @copyright Copyright (c) 2014 Crawler Developer Team
19 * @license GNU GPL 3.0 or any newer version
20 * @link http://www.ship-simu.org
22 * This program is free software: you can redistribute it and/or modify
23 * it under the terms of the GNU General Public License as published by
24 * the Free Software Foundation, either version 3 of the License, or
25 * (at your option) any later version.
27 * This program is distributed in the hope that it will be useful,
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 * GNU General Public License for more details.
32 * You should have received a copy of the GNU General Public License
33 * along with this program. If not, see <http://www.gnu.org/licenses/>.
35 class CrawlerUploadedListScannerTask extends BaseTask implements Taskable, Visitable {
37 * Protected constructor
41 protected function __construct () {
42 // Call parent constructor
43 parent::__construct(__CLASS__);
47 * Creates an instance of this class
49 * @return $taskInstance An instance of a Visitable class
51 public final static function createCrawlerUploadedListScannerTask () {
53 $taskInstance = new CrawlerUploadedListScannerTask();
55 // Return the prepared instance
60 * Accepts the visitor to process the visitor
62 * @param $visitorInstance An instance of a Visitor class
64 * @todo Maybe visit some sub-objects
66 public function accept (Visitor $visitorInstance) {
68 $visitorInstance->visitTask($this);
76 public function executeTask () {
77 // Call factory for a scanner instance and execute it
78 ScannerObjectFactory::createScannerInstance($this)->execute();
87 public function doShutdown () {
88 self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...');