]> git.mxchange.org Git - hub.git/blob
62f98244e3e824423ae6e6119fae36f3cd29bb76
[hub.git] /
1 <?php
2 // Own namespace
3 namespace Hub\Crawler\Task\Scanner\UploadedList;
4
5 // Import application-specific stuff
6 use Hub\Factory\Scanner\ScannerObjectFactory;
7
8 // Import framework stuff
9 use CoreFramework\Task\Taskable;
10 use CoreFramework\Visitor\Visitable;
11 use CoreFramework\Visitor\Visitor;
12
13 /**
14  * A UploadedList scanner task for crawlers
15  *
16  * @author              Roland Haeder <webmaster@ship-simu.org>
17  * @version             0.0.0
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
21  *
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.
26  *
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.
31  *
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/>.
34  */
35 class CrawlerUploadedListScannerTask extends BaseTask implements Taskable, Visitable {
36         /**
37          * Protected constructor
38          *
39          * @return      void
40          */
41         protected function __construct () {
42                 // Call parent constructor
43                 parent::__construct(__CLASS__);
44         }
45
46         /**
47          * Creates an instance of this class
48          *
49          * @return      $taskInstance   An instance of a Visitable class
50          */
51         public final static function createCrawlerUploadedListScannerTask () {
52                 // Get new instance
53                 $taskInstance = new CrawlerUploadedListScannerTask();
54
55                 // Return the prepared instance
56                 return $taskInstance;
57         }
58
59         /**
60          * Accepts the visitor to process the visitor
61          *
62          * @param       $visitorInstance        An instance of a Visitor class
63          * @return      void
64          * @todo        Maybe visit some sub-objects
65          */
66         public function accept (Visitor $visitorInstance) {
67                 // Visit this task
68                 $visitorInstance->visitTask($this);
69         }
70
71         /**
72          * Executes the task
73          *
74          * @return      void
75          */
76         public function executeTask () {
77                 // Call factory for a scanner instance and execute it
78                 ScannerObjectFactory::createScannerInstance($this)->execute();
79         }
80
81         /**
82          * Shuts down the task
83          *
84          * @return      void
85          * @todo        0% done
86          */
87         public function doShutdown () {
88                 self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK: Shutting down...');
89         }
90 }
91
92 // [EOF]
93 ?>