]> git.mxchange.org Git - hub.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Wed, 3 Jan 2018 23:44:41 +0000 (00:44 +0100)
committerRoland Häder <roland@mxchange.org>
Fri, 21 Aug 2020 16:50:11 +0000 (18:50 +0200)
- ported crawler sub project to new 'core' framework
- had to copy some setter/getter to base classes where BaseHubSystem was not
  inherited from

Signed-off-by: Roland Häder <roland@mxchange.org>
42 files changed:
application/hub/classes/class_BaseHubSystem.php
application/hub/classes/communicator/class_BaseCommunicator.php
application/hub/classes/communicator/crawler/class_CrawlerNodeCommunicator.php
application/hub/classes/communicator/miner/class_MinerNodeCommunicator.php
application/hub/classes/crawler/class_
application/hub/classes/crawler/class_BaseNodeCrawler.php
application/hub/classes/crawler/console/class_NodeConsoleCrawler.php
application/hub/classes/factories/communicator/class_CommunicatorFactory.php
application/hub/classes/factories/source/units/class_UnitSourceFactory.php
application/hub/classes/factories/source/url/class_UrlSourceObjectFactory.php
application/hub/classes/factories/states/communicator/class_CommunicatorStateFactory.php
application/hub/classes/factories/states/crawler/class_CrawlerStateFactory.php
application/hub/classes/filter/task/crawler/class_CrawlerTaskHandlerInitializerFilter.php
application/hub/classes/scanner/class_BaseScanner.php
application/hub/classes/scanner/crawler/uploaded_list/class_CrawlerUploadedListScanner.php
application/hub/classes/source/class_BaseSource.php
application/hub/classes/source/class_BaseUrlSource.php
application/hub/classes/source/units/class_TestUnitSource.php
application/hub/classes/source/urls/class_CrawlerFoundRssUrlSource.php
application/hub/classes/source/urls/class_CrawlerLocalStartUrlSource.php
application/hub/classes/source/urls/class_CrawlerRssStartUrlSource.php
application/hub/classes/source/urls/class_CrawlerUploadedListUrlSource.php
application/hub/classes/states/communicator/active/class_CommunicatorActiveState.php
application/hub/classes/states/communicator/class_BaseCommunicatorState.php
application/hub/classes/states/communicator/init/class_CommunicatorInitState.php
application/hub/classes/states/crawler/active/class_CrawlerActiveState.php
application/hub/classes/states/crawler/booting/class_CrawlerBootingState.php
application/hub/classes/states/crawler/init/class_CrawlerInitState.php
application/hub/classes/tasks/crawler/class_BaseUrlSourceTask.php
application/hub/classes/tasks/crawler/communicator/class_CrawlerNodeCommunicatorTask.php
application/hub/classes/tasks/crawler/ping/class_CrawlerPingTask.php
application/hub/classes/tasks/crawler/url_source/class_CrawlerUrlSourceFoundRssTask.php
application/hub/classes/tasks/crawler/url_source/class_CrawlerUrlSourceLocalStartTask.php
application/hub/classes/tasks/crawler/url_source/class_CrawlerUrlSourceRssStartTask.php
application/hub/classes/tasks/crawler/url_source/class_CrawlerUrlSourceUploadedListTask.php
application/hub/classes/tasks/miner/communicator/class_MinerNodeCommunicatorTask.php
application/hub/config.php
application/hub/interfaces/scanner/class_Scanner.php
application/hub/interfaces/source/class_Source.php
application/hub/interfaces/source/units/class_UnitSource.php
application/hub/interfaces/source/urls/class_UrlSource.php
core

index 2129629d1f8471b8e7f1197cc4771532c9a47fe2..db93dde0294ec1e428a415ca5d00737378623fde 100644 (file)
@@ -3,7 +3,11 @@
 namespace Org\Shipsimu\Hub\Generic;
 
 // Import application-specific stuff
+use Org\ShipSimu\Hub\Communicator\Communicator;
 use Org\Shipsimu\Hub\Container\Socket\StorableSocket;
+use Org\Shipsimu\Hub\Crawler\Crawler;
+use Org\Shipsimu\Hub\Crawler\Source\Source;
+use Org\Shipsimu\Hub\Crawler\Source\Url\UrlSource;
 use Org\Shipsimu\Hub\Handler\Protocol\HandleableProtocol;
 use Org\Shipsimu\Hub\Handler\Network\RawData\HandleableRawData;
 use Org\Shipsimu\Hub\Information\ShareableInfo;
@@ -119,6 +123,26 @@ abstract class BaseHubSystem extends BaseFrameworkSystem implements HubInterface
         */
        private $universalNodeLocatorInstance = NULL;
 
+       /**
+        * An instance of a communicator
+        */
+       private $communicatorInstance = NULL;
+
+       /**
+        * An instance of a Source class
+        */
+       private $sourceInstance = NULL;
+
+       /**
+        * An instance of a UrlSource class
+        */
+       private $urlSourceInstance = NULL;
+
+       /**
+        * An instance of a Crawler class
+        */
+       private $crawlerInstance = NULL;
+
        /**
         * Name of used protocol
         */
@@ -445,4 +469,80 @@ abstract class BaseHubSystem extends BaseFrameworkSystem implements HubInterface
                return $this->universalNodeLocatorInstance;
        }
 
+       /**
+        * Getter for communicator instance
+        *
+        * @return      $communicatorInstance   An instance of a Communicator class
+        */
+       public final function getCommunicatorInstance () {
+               return $this->communicatorInstance;
+       }
+
+       /**
+        * Setter for communicator instance
+        *
+        * @param       $communicatorInstance   An instance of a Communicator class
+        * @return      void
+        */
+       protected final function setCommunicatorInstance (Communicator $communicatorInstance) {
+               $this->communicatorInstance = $communicatorInstance;
+       }
+
+       /**
+        * Setter for a Source instance
+        *
+        * @param       $sourceInstance         An instance of a Source class
+        * @return      void
+        */
+       protected final function setSourceInstance (Source $sourceInstance) {
+               $this->sourceInstance = $sourceInstance;
+       }
+
+       /**
+        * Getter for a Source instance
+        *
+        * @return      $sourceInstance         An instance of a Source class
+        */
+       protected final function getSourceInstance () {
+               return $this->sourceInstance;
+       }
+
+       /**
+        * Setter for a UrlSource instance
+        *
+        * @param       $urlSourceInstance              An instance of a UrlSource class
+        * @return      void
+        */
+       public final function setUrlSourceInstance (UrlSource $urlSourceInstance) {
+               $this->urlSourceInstance = $urlSourceInstance;
+       }
+
+       /**
+        * Getter for a UrlSource instance
+        *
+        * @return      $urlSourceInstance              An instance of a UrlSource class
+        */
+       public final function getUrlSourceInstance () {
+               return $this->urlSourceInstance;
+       }
+
+       /**
+        * Setter for a Crawler instance
+        *
+        * @param       $crawlerInstance                An instance of a Crawler class
+        * @return      void
+        */
+       protected final function setCrawlerInstance (Crawler $crawlerInstance) {
+               $this->crawlerInstance = $crawlerInstance;
+       }
+
+       /**
+        * Getter for a Crawler instance
+        *
+        * @return      $crawlerInstance                An instance of a Crawler class
+        */
+       protected final function getCrawlerInstance () {
+               return $this->crawlerInstance;
+       }
+
 }
index 7fc14d84aa16ee0b0be7539f7cd96ec0b20edecf..242a32c749944abcb241dc3d894761b18c84ff31 100644 (file)
@@ -3,6 +3,7 @@
 namespace Org\Shipsimu\Hub\Communicator;
 
 // Import application-specific stuff
+use Org\Shipsimu\Hub\Factory\State\Communicator\CommunicatorStateFactory;
 use Org\Shipsimu\Hub\Generic\BaseHubSystem;
 
 // Import framework stuff
index 9f9583e9505c5f8839d8a2e3afd928171325e0bd..ac1cdd8a977a6e9b451e8af71d92f229219ede4a 100644 (file)
@@ -2,6 +2,10 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Crawler\Communicator\Node;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Communicator\BaseCommunicator;
+use Org\ShipSimu\Hub\Communicator\Communicator;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 
index e392d667691065e104d8ce307f9c80389efd4109..cc6e29caa77343ae3d8aaf99be2e62e09cdd390f 100644 (file)
@@ -2,6 +2,10 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Miner\Communicator\Node;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Communicator\BaseCommunicator;
+use Org\ShipSimu\Hub\Communicator\Communicator;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 
index 3c1267a8559afc6ef3efe35ad9b6ae9168c2de45..c4b09bcc432a2a4a6c39ace4ddae9d93ee31b2de 100644 (file)
@@ -82,7 +82,5 @@ class Node???Crawler extends BaseNodeCrawler implements Crawler {
        public function addExtraFilters (Controller $controllerInstance, Responseable $responseInstance) {
                $this->partialStub('Please implement this method.');
        }
-}
 
-// [EOF]
-?>
+}
index 57ca8fa3d83c850212118eb3dc867e11d2488f38..37c11b95790cd2f324b42fc35e5a6152ecf67c1d 100644 (file)
@@ -3,6 +3,7 @@
 namespace Org\Shipsimu\Hub\Crawler;
 
 // Import application-specific stuff
+use Org\Shipsimu\Hub\Crawler\Factory\State\CrawlerStateFactory;
 use Org\Shipsimu\Hub\Generic\BaseHubSystem;
 
 // Import framework stuff
index a783a12b17a897a3614050d6dd546fdeeedf441c..de8c4845bd925866f841852817dd10de5578c690 100644 (file)
@@ -95,7 +95,5 @@ class NodeConsoleCrawler extends BaseNodeCrawler implements Crawler, Registerabl
        public function addExtraFilters (Controller $controllerInstance, Responseable $responseInstance) {
                $this->partialStub('Please implement this method.');
        }
-}
 
-// [EOF]
-?>
+}
index 9940759552a488f7f65b2d53f37b4eb724a10130..6f751fa92c6082451a70487ae99005c3e791b539 100644 (file)
@@ -46,7 +46,7 @@ class CommunicatorFactory extends ObjectFactory {
         *
         * @param       $configEntry                    A configuration entry naming the real class' name
         * @parasm      $communicatorType               Type of the communicator, can currently be 'node'
-        * @return      $communicatorInstance   A communicator instance
+        * @return      $communicatorInstance   An instance of a Communicator class
         */
        public static final function createCommunicatorInstance ($configEntry, $communicatorType) {
                // If there is no communicator?
index 6a6eff4625bf4a06be009e4dc6398d8554d0d522..cb9687cf50a9f65483f4b0756893a53d93f0ce1b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 // Own namespace
-namespace Org\Shipsimu\Hub\Source\Unit;
+namespace Org\Shipsimu\Hub\Crawler\Source\Unit;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
index 270ac7e343ce7adeb5c67d18d9a261131e4d0e65..77fe09951bcd9f9888c28d507722af8533503553 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 // Own namespace
-namespace Org\Shipsimu\Hub\Source\Url;
+namespace Org\Shipsimu\Hub\Crawler\Source\Url;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
index 01a5fbb060515220a3f9df8a585c93d1fc126666..c64299fe7ae3aec75a45fb3423045739990d4183 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Factory\State\Communicator;
 
+// Import application-specific stuff
+use Org\ShipSimu\Hub\Communicator\Communicator;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 
@@ -43,8 +46,8 @@ class CommunicatorStateFactory extends ObjectFactory {
         * given communicator instance.
         *
         * @param       $stateName                              Name of the state
-        * @param       $communicatorInstance   A Communicator class instance
-        * @return      $stateInstance                  A Stateable class instance
+        * @param       $communicatorInstance   An instance of a Communicator class
+        * @return      $stateInstance                  An instance of a Stateable class
         */
        public static final function createCommunicatorStateInstanceByName ($stateName, Communicator $communicatorInstance) {
                // Then construct the class' configuraton entry
index 1d5e52a5e4ef82902a41ea52813cf84b1c224276..f05631534f56d998802faec5c95095003b4b5cd0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 // Own namespace
-namespace Org\Shipsimu\Hub\Factory\State\Crawler;
+namespace Org\Shipsimu\Hub\Crawler\Factory\State;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
index 80668f155237223a2baf158f915bfb959859f9f1..4ee24df93f3b2504ce9f4aa198e89d94cfe4a3ed 100644 (file)
@@ -69,7 +69,7 @@ class CrawlerTaskHandlerInitializerFilter extends BaseCrawlerFilter implements F
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get crawler instance
-               //$crawlerInstance = Registry::getRegistry()->getInstance('crawler');
+               $crawlerInstance = Registry::getRegistry()->getInstance('crawler');
 
                // Get a new task handler instance
                $handlerInstance = ObjectFactory::createObjectByConfiguredName('task_handler_class');
@@ -120,7 +120,7 @@ class CrawlerTaskHandlerInitializerFilter extends BaseCrawlerFilter implements F
                // 10) URL sources
                foreach (explode(':', $this->getConfigInstance()->getConfigEntry('crawler_url_stacks')) as $stack) {
                        // Init task instance
-                       $taskInstance = ObjectFactory::createObjectByConfiguredName('crawler_url_source_' . $stack . '_task_class');
+                       $taskInstance = ObjectFactory::createObjectByConfiguredName('crawler_url_source_' . $stack . '_task_class', array($crawlerInstance));
 
                        // And register it
                        $handlerInstance->registerTask('crawler_url_source_' . $stack, $taskInstance);
index 95de43636179de50670af8b4486354211a19fa40..b940f6ed42ea778b22a17bc509f3f351f90646b3 100644 (file)
@@ -6,7 +6,7 @@ namespace Org\Shipsimu\Hub\Scanner;
 use Org\Shipsimu\Hub\Generic\BaseHubSystem;
 
 /**
- * A general Scanner class
+ * A general scanner class
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
index 60ceaf4dde5d7aafc5bfd9377d0ff638aabcc793..0a09b066e5fadaf285e088bf198074580503f1bb 100644 (file)
@@ -2,6 +2,10 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Crawler\Scanner\UploadedList;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Scanner\BaseScanner;
+use Org\Shipsimu\Hub\Scanner\Scanner;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 
index 17a0d75a2b01f4a422e7286f3cbda692da379fb0..1d4957829055d535e3cde6810085a64a516a4ecd 100644 (file)
@@ -1,12 +1,12 @@
 <?php
 // Own namespace
-namespace Org\Shipsimu\Hub\Source;
+namespace Org\Shipsimu\Hub\Crawler\Source;
 
 // Import application-specific stuff
 use Org\Shipsimu\Hub\Generic\BaseHubSystem;
 
 /**
- * A general Source class
+ * A general source class
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
index a246a5c4effba1a36549a1841346d77222b333eb..26ae79894240934fc251ea0e79835d280fdf901a 100644 (file)
@@ -1,4 +1,13 @@
 <?php
+// Own namespace
+namespace Org\Shipsimu\Hub\Crawler\Source\Url;
+
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Crawler\Source\BaseSource;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Factory\Stack\FileStackFactory;
+
 /**
  * A general URL source class
  *
index 610d7778d51d2cbaef33f73a28b675bb1d605b75..059964e56ae8f4aa4ea8bfe645f97c518e75f98e 100644 (file)
@@ -1,6 +1,9 @@
 <?php
 // Own namespace
-namespace Org\Shipsimu\Hub\Source\Unit;
+namespace Org\Shipsimu\Hub\Crawler\Source\Unit;
+
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Crawler\Source\BaseSource;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
@@ -42,7 +45,7 @@ class TestUnitSource extends BaseSource implements UnitSource, Registerable {
        /**
         * Creates an instance of this class
         *
-        * @return      $sourceInstance         An instance of a Source class
+        * @return      $sourceInstance         An instance of a UnitSource class
         */
        public final static function createTestUnitSource () {
                // Get new instance
index f96ebbc8f123463457dcc68366a424ca0f91df3e..7bea489d920144bf0cb58ee6d5088df004742b04 100644 (file)
@@ -2,6 +2,10 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Crawler\Source\FoundRss;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Crawler\Source\Url\BaseUrlSource;
+use Org\Shipsimu\Hub\Crawler\Source\Url\UrlSource;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 
@@ -41,7 +45,7 @@ class CrawlerFoundRssUrlSource extends BaseUrlSource implements UrlSource, Regis
        /**
         * Creates an instance of this class
         *
-        * @return      $sourceInstance         An instance of a Source class
+        * @return      $sourceInstance         An instance of an UrlSource class
         */
        public final static function createCrawlerFoundRssUrlSource () {
                // Get new instance
@@ -63,7 +67,5 @@ class CrawlerFoundRssUrlSource extends BaseUrlSource implements UrlSource, Regis
        public function fillUrlStack () {
                $this->partialStub('Please implement this method.');
        }
-}
 
-// [EOF]
-?>
+}
index c17a152f3c94afed73c96c2075e537bce5bb638c..32c0de07ea9607236384e7996b7258786c3c4431 100644 (file)
@@ -2,6 +2,10 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Crawler\Source\LocalStart;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Crawler\Source\Url\BaseUrlSource;
+use Org\Shipsimu\Hub\Crawler\Source\Url\UrlSource;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 
@@ -41,7 +45,7 @@ class CrawlerLocalStartUrlSource extends BaseUrlSource implements UrlSource, Reg
        /**
         * Creates an instance of this class
         *
-        * @return      $sourceInstance         An instance of a Source class
+        * @return      $sourceInstance         An instance of an UrlSource class
         */
        public final static function createCrawlerLocalStartUrlSource () {
                // Get new instance
@@ -63,7 +67,5 @@ class CrawlerLocalStartUrlSource extends BaseUrlSource implements UrlSource, Reg
        public function fillUrlStack () {
                $this->partialStub('Please implement this method.');
        }
-}
 
-// [EOF]
-?>
+}
index 5185577243d4c36813678691a74e2bfd8becf2a7..5ea203620d916dfe8b02e9f7840ebebc27eec6f3 100644 (file)
@@ -2,6 +2,10 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Crawler\Source\RssStart;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Crawler\Source\Url\BaseUrlSource;
+use Org\Shipsimu\Hub\Crawler\Source\Url\UrlSource;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 
@@ -41,7 +45,7 @@ class CrawlerRssStartUrlSource extends BaseUrlSource implements UrlSource, Regis
        /**
         * Creates an instance of this class
         *
-        * @return      $sourceInstance         An instance of a Source class
+        * @return      $sourceInstance         An instance of an UrlSource class
         */
        public final static function createCrawlerRssStartUrlSource () {
                // Get new instance
@@ -63,7 +67,5 @@ class CrawlerRssStartUrlSource extends BaseUrlSource implements UrlSource, Regis
        public function fillUrlStack () {
                $this->partialStub('Please implement this method.');
        }
-}
 
-// [EOF]
-?>
+}
index daa2bb8a82f6f54af7bf2c0906baec6b467f58fe..214cd22095e4308f67b84b261c20db5ac39c474f 100644 (file)
@@ -2,6 +2,10 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Crawler\Source\Url\UploadList;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Crawler\Source\Url\BaseUrlSource;
+use Org\Shipsimu\Hub\Crawler\Source\Url\UrlSource;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
@@ -144,7 +148,7 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R
        /**
         * Creates an instance of this class
         *
-        * @return      $sourceInstance         An instance of a Source class
+        * @return      $sourceInstance         An instance of an UrlSource class
         */
        public final static function createCrawlerUploadedListUrlSource () {
                // Get new instance
index f24b9562e7980916a9f20bc51df49408a68120a7..64f15cc66e4ba3859c96bc9a4d4150fe223f3b0e 100644 (file)
@@ -2,6 +2,11 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\State\Communicator;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Communicator\BaseCommunicator;
+use Org\ShipSimu\Hub\Communicator\Communicator;
+use Org\Shipsimu\Hub\Communicator\State\BaseCommunicatorState;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\State\Stateable;
 
@@ -57,7 +62,5 @@ class CommunicatorActiveState extends BaseCommunicatorState implements Stateable
                // Return the prepared instance
                return $stateInstance;
        }
-}
 
-// [EOF]
-?>
+}
index a717f1e04bcbbc4bbd913961d8d83df5b2f8f98c..3e0140865979f41df787af3112e3db9e579c44d9 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Communicator\State;
 
+// Import application-specific stuff
+use Org\ShipSimu\Hub\Communicator\Communicator;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\State\BaseState;
 
@@ -28,6 +31,11 @@ use Org\Mxchange\CoreFramework\State\BaseState;
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 abstract class BaseCommunicatorState extends BaseState {
+       /**
+        * An instance of a communicator
+        */
+       private $communicatorInstance = NULL;
+
        /**
         * Protected constructor
         *
@@ -54,4 +62,23 @@ abstract class BaseCommunicatorState extends BaseState {
                } // END - if
        }
 
+       /**
+        * Getter for communicator instance
+        *
+        * @return      $communicatorInstance   An instance of a Communicator class
+        */
+       public final function getCommunicatorInstance () {
+               return $this->communicatorInstance;
+       }
+
+       /**
+        * Setter for communicator instance
+        *
+        * @param       $communicatorInstance   An instance of a Communicator class
+        * @return      void
+        */
+       protected final function setCommunicatorInstance (Communicator $communicatorInstance) {
+               $this->communicatorInstance = $communicatorInstance;
+       }
+
 }
index e192260c45437a86eff9671e6c5c7853961bc301..d30c0c86a29ee061c97d10c84db08d3fce491f8d 100644 (file)
@@ -2,6 +2,11 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\State\Communicator;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Communicator\BaseCommunicator;
+use Org\ShipSimu\Hub\Communicator\Communicator;
+use Org\Shipsimu\Hub\Communicator\State\BaseCommunicatorState;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Executor\Executor;
 use Org\Mxchange\CoreFramework\State\Stateable;
@@ -68,4 +73,5 @@ class CommunicatorInitState extends BaseCommunicatorState implements Stateable {
         */
        public function executeState (Executor $executorInstance) {
        }
+
 }
index 18f56ac474f1987c774660eca1c02cb02af1e8f0..1c67f046342d4ac607fbef730a25565c24400273 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\State\Crawler;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Crawler\State\BaseCrawlerState;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Executor\Executor;
 use Org\Mxchange\CoreFramework\State\Stateable;
index 0c6d1f9acb254ec13cb4c746b071aef1120d29dc..5e2ef07cafa47fdd2b010438ade7aa3b6f86bdbb 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\State\Crawler;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Crawler\State\BaseCrawlerState;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Executor\Executor;
 use Org\Mxchange\CoreFramework\State\Stateable;
index da4840c0141c5de3b7a941d8eadbe6dd14457ff9..07661498b5500b2abf7793c6471223f2c2bd979f 100644 (file)
@@ -2,6 +2,10 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\State\Crawler;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Crawler\State\BaseCrawlerState;
+use Org\Shipsimu\Hub\Crawler\Factory\State\CrawlerStateFactory;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Executor\Executor;
 use Org\Mxchange\CoreFramework\State\Stateable;
@@ -79,4 +83,5 @@ class CrawlerInitState extends BaseCrawlerState implements Stateable {
                // Change state to 'booting'
                CrawlerStateFactory::createCrawlerStateInstanceByName('booting');
        }
+
 }
index a340757baba4b53399fdd6a387875b3b92e4ef35..a92d4c9556acb723f12eb694aeb51086bb483929 100644 (file)
@@ -1,9 +1,10 @@
 <?php
 // Own namespace
-namespace Org\Shipsimu\Hub\Task\Source\Url;
+namespace Org\Shipsimu\Hub\Crawler\Task\Source\Url;
 
 // Import application-specific stuff
-use Org\Shipsimu\Hub\Source\Url\UrlSourceObjectFactory;
+use Org\Shipsimu\Hub\Crawler\Crawler;
+use Org\Shipsimu\Hub\Crawler\Source\Url\UrlSourceObjectFactory;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
@@ -31,6 +32,11 @@ use Org\Mxchange\CoreFramework\Task\BaseTask;
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 abstract class BaseUrlSourceTask extends BaseTask {
+       /**
+        * An instance of a Crawler class
+        */
+       private $crawlerInstance = NULL;
+
        /**
         * Protected constructor
         *
@@ -52,7 +58,26 @@ abstract class BaseUrlSourceTask extends BaseTask {
                $sourceInstance = UrlSourceObjectFactory::createUrlSourceInstance($this);
 
                // And set it here
-               $this->setUrlSourceInstance($sourceInstance);
+               $this->getCrawlerInstance()->setUrlSourceInstance($sourceInstance);
+       }
+
+       /**
+        * Setter for a Crawler instance
+        *
+        * @param       $crawlerInstance                An instance of a Crawler class
+        * @return      void
+        */
+       protected final function setCrawlerInstance (Crawler $crawlerInstance) {
+               $this->crawlerInstance = $crawlerInstance;
+       }
+
+       /**
+        * Getter for a Crawler instance
+        *
+        * @return      $crawlerInstance                An instance of a Crawler class
+        */
+       protected final function getCrawlerInstance () {
+               return $this->crawlerInstance;
        }
 
 }
index d7296a41e74f0c462cac2b17b735f46b0dc8826d..c9466c45e04a785b2e251ba9d1279eba8ebc56a4 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Crawler\Task\Communicator\Node;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Factory\Communicator\CommunicatorFactory;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Registry\Registry;
 use Org\Mxchange\CoreFramework\Task\BaseTask;
index 8dfb590b32d94abc5a6be39e60c0fa47d6830ac3..5ce32065e21f409db92c5d1e200f6456bc997445 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 // Own namespace
-namespace Org\Shipsimu\Hub\Crawler\Ping;
+namespace Org\Shipsimu\Hub\Crawler\Task\Ping;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
index b4a6f0a0f49686a0d11f447d2aff18c3ce8c9b89..f0c61174aaf7f6a297754b7a9a62e7538a78e5ba 100644 (file)
@@ -2,6 +2,10 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Crawler\Task\Source\FoundRss;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Crawler\Crawler;
+use Org\Shipsimu\Hub\Crawler\Task\Source\Url\BaseUrlSourceTask;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\Taskable;
 use Org\Mxchange\CoreFramework\Visitor\Visitable;
@@ -43,12 +47,16 @@ class CrawlerUrlSourceFoundRssTask extends BaseUrlSourceTask implements Taskable
        /**
         * Creates an instance of this class
         *
+        * @param       $crawlerInstance        An instance of a Crawler class
         * @return      $taskInstance   An instance of a Visitable class
         */
-       public final static function createCrawlerUrlSourceFoundRssTask () {
+       public final static function createCrawlerUrlSourceFoundRssTask (Crawler $crawlerInstance) {
                // Get new instance
                $taskInstance = new CrawlerUrlSourceFoundRssTask();
 
+               // Set crawler instance here
+               $taskInstance->setCrawlerInstance($crawlerInstance);
+
                // Return the prepared instance
                return $taskInstance;
        }
@@ -72,7 +80,7 @@ class CrawlerUrlSourceFoundRssTask extends BaseUrlSourceTask implements Taskable
         */
        public function executeTask () {
                // Get source instance
-               $sourceInstance = $this->getUrlSourceInstance();
+               $sourceInstance = $this->getCrawlerInstance()->getUrlSourceInstance();
 
                // Is it not set?
                if (is_null($sourceInstance)) {
@@ -80,7 +88,7 @@ class CrawlerUrlSourceFoundRssTask extends BaseUrlSourceTask implements Taskable
                        $this->initUrlSourceTask();
 
                        // And re-get it
-                       $sourceInstance = $this->getUrlSourceInstance();
+                       $sourceInstance = $this->getCrawlerInstance()->getUrlSourceInstance();
                } // END - if
 
                // Get the URL source instance and fill the stack with crawl entries
index a71e3bc9c82a79bc3bf5576a454d2baa3e8c939e..7eabde2df3ceb82081e3ea87d7cfa5f76490bb73 100644 (file)
@@ -2,6 +2,10 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Crawler\Task\Source\LocalStart;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Crawler\Crawler;
+use Org\Shipsimu\Hub\Crawler\Task\Source\Url\BaseUrlSourceTask;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\Taskable;
 use Org\Mxchange\CoreFramework\Visitor\Visitable;
@@ -43,12 +47,16 @@ class CrawlerUrlSourceLocalStartTask extends BaseUrlSourceTask implements Taskab
        /**
         * Creates an instance of this class
         *
+        * @param       $crawlerInstance        An instance of a Crawler class
         * @return      $taskInstance   An instance of a Visitable class
         */
-       public final static function createCrawlerUrlSourceLocalStartTask () {
+       public final static function createCrawlerUrlSourceLocalStartTask (Crawler $crawlerInstance) {
                // Get new instance
                $taskInstance = new CrawlerUrlSourceLocalStartTask();
 
+               // Set crawler instance here
+               $taskInstance->setCrawlerInstance($crawlerInstance);
+
                // Return the prepared instance
                return $taskInstance;
        }
@@ -72,7 +80,7 @@ class CrawlerUrlSourceLocalStartTask extends BaseUrlSourceTask implements Taskab
         */
        public function executeTask () {
                // Get source instance
-               $sourceInstance = $this->getUrlSourceInstance();
+               $sourceInstance = $this->getCrawlerInstance()->getUrlSourceInstance();
 
                // Is it not set?
                if (is_null($sourceInstance)) {
@@ -80,7 +88,7 @@ class CrawlerUrlSourceLocalStartTask extends BaseUrlSourceTask implements Taskab
                        $this->initUrlSourceTask();
 
                        // And re-get it
-                       $sourceInstance = $this->getUrlSourceInstance();
+                       $sourceInstance = $this->getCrawlerInstance()->getUrlSourceInstance();
                } // END - if
 
                // Get the URL source instance and fill the stack with crawl entries
index d8d274a094b3e73b176a56ec0da034f31a34bcf7..0f07ba11fddbe171926a515ce3f322d9157804bf 100644 (file)
@@ -2,6 +2,10 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Crawler\Task\Source\RssStart;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Crawler\Crawler;
+use Org\Shipsimu\Hub\Crawler\Task\Source\Url\BaseUrlSourceTask;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\Taskable;
 use Org\Mxchange\CoreFramework\Visitor\Visitable;
@@ -43,12 +47,16 @@ class CrawlerUrlSourceRssStartTask extends BaseUrlSourceTask implements Taskable
        /**
         * Creates an instance of this class
         *
+        * @param       $crawlerInstance        An instance of a Crawler class
         * @return      $taskInstance   An instance of a Visitable class
         */
-       public final static function createCrawlerUrlSourceRssStartTask () {
+       public final static function createCrawlerUrlSourceRssStartTask (Crawler $crawlerInstance) {
                // Get new instance
                $taskInstance = new CrawlerUrlSourceRssStartTask();
 
+               // Set crawler instance here
+               $taskInstance->setCrawlerInstance($crawlerInstance);
+
                // Return the prepared instance
                return $taskInstance;
        }
@@ -72,7 +80,7 @@ class CrawlerUrlSourceRssStartTask extends BaseUrlSourceTask implements Taskable
         */
        public function executeTask () {
                // Get source instance
-               $sourceInstance = $this->getUrlSourceInstance();
+               $sourceInstance = $this->getCrawlerInstance()->getUrlSourceInstance();
 
                // Is it not set?
                if (is_null($sourceInstance)) {
@@ -80,7 +88,7 @@ class CrawlerUrlSourceRssStartTask extends BaseUrlSourceTask implements Taskable
                        $this->initUrlSourceTask();
 
                        // And re-get it
-                       $sourceInstance = $this->getUrlSourceInstance();
+                       $sourceInstance = $this->getCrawlerInstance()->getUrlSourceInstance();
                } // END - if
 
                // Get the URL source instance and fill the stack with crawl entries
index cf73c3f7b6ceacc54061bf30f40c863dbb16ddf1..15a6960c4945392e9bd8e19689c54f37a93945b4 100644 (file)
@@ -2,6 +2,10 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Crawler\Task\Source\UploadedList;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Crawler\Crawler;
+use Org\Shipsimu\Hub\Crawler\Task\Source\Url\BaseUrlSourceTask;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\Taskable;
 use Org\Mxchange\CoreFramework\Visitor\Visitable;
@@ -43,12 +47,16 @@ class CrawlerUrlSourceUploadedListTask extends BaseUrlSourceTask implements Task
        /**
         * Creates an instance of this class
         *
+        * @param       $crawlerInstance        An instance of a Crawler class
         * @return      $taskInstance   An instance of a Visitable class
         */
-       public final static function createCrawlerUrlSourceUploadedListTask () {
+       public final static function createCrawlerUrlSourceUploadedListTask (Crawler $crawlerInstance) {
                // Get new instance
                $taskInstance = new CrawlerUrlSourceUploadedListTask();
 
+               // Set cralwer instance here
+               $taskInstance->setCrawlerInstance($crawlerInstance);
+
                // Return the prepared instance
                return $taskInstance;
        }
@@ -72,7 +80,7 @@ class CrawlerUrlSourceUploadedListTask extends BaseUrlSourceTask implements Task
         */
        public function executeTask () {
                // Get source instance
-               $sourceInstance = $this->getUrlSourceInstance();
+               $sourceInstance = $this->getCrawlerInstance()->getUrlSourceInstance();
 
                // Is it not set?
                if (is_null($sourceInstance)) {
@@ -80,7 +88,7 @@ class CrawlerUrlSourceUploadedListTask extends BaseUrlSourceTask implements Task
                        $this->initUrlSourceTask();
 
                        // And re-get it
-                       $sourceInstance = $this->getUrlSourceInstance();
+                       $sourceInstance = $this->getCrawlerInstance()->getUrlSourceInstance();
                } // END - if
 
                // Get the URL source instance and fill the stack with crawl entries
index 9e8a115900a8dc148ec0c01da3fcbc27701031a3..737a051a18bd70f4293946af4d94a126db3558cb 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Miner\Task\Communicator\Node;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Factory\Communicator\CommunicatorFactory;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
 use Org\Mxchange\CoreFramework\Task\Taskable;
index bd33cc0dd4cb4e221a23c6cb13a22d42ae24d013..0509ddfff7fda490cb57128526241e0ddadf693c 100644 (file)
@@ -1317,16 +1317,16 @@ $cfg->setConfigEntry('crawler_url_stacks', 'local_start:uploaded_list:rss_start:
 $cfg->setConfigEntry('crawler_node_communicator_task_class', 'Org\Shipsimu\Hub\Crawler\Task\Communicator\Node\CrawlerNodeCommunicatorTask');
 
 // CFG: CRAWLER-URL-LOCAL-START-STACK-CLASS
-$cfg->setConfigEntry('crawler_url_local_start_stack_class', 'Org\Mxchange\CoreFramework\Stack\Filesystem\FiFoFileStack');
+$cfg->setConfigEntry('crawler_url_local_start_stack_class', 'Org\Mxchange\CoreFramework\Stacker\Filesystem\FiFoFileStack');
 
 // CFG: CRAWLER-URL-UPLOADED-LIST-STACK-CLASS
-$cfg->setConfigEntry('crawler_url_uploaded_list_stack_class', 'Org\Mxchange\CoreFramework\Stack\Filesystem\FiFoFileStack');
+$cfg->setConfigEntry('crawler_url_uploaded_list_stack_class', 'Org\Mxchange\CoreFramework\Stacker\Filesystem\FiFoFileStack');
 
 // CFG: CRAWLER-URL-RSS-START-STACK-CLASS
-$cfg->setConfigEntry('crawler_url_rss_start_stack_class', 'Org\Mxchange\CoreFramework\Stack\Filesystem\FiFoFileStack');
+$cfg->setConfigEntry('crawler_url_rss_start_stack_class', 'Org\Mxchange\CoreFramework\Stacker\Filesystem\FiFoFileStack');
 
 // CFG: CRAWLER-URL-FOUND-RSS-STACK-CLASS
-$cfg->setConfigEntry('crawler_url_found_rss_stack_class', 'Org\Mxchange\CoreFramework\Stack\Filesystem\FiFoFileStack');
+$cfg->setConfigEntry('crawler_url_found_rss_stack_class', 'Org\Mxchange\CoreFramework\Stacker\Filesystem\FiFoFileStack');
 
 // CFG: CRAWLER-URL-LOCAL-START-FILE-STACK-INDEX-CLASS
 $cfg->setConfigEntry('crawler_url_local_start_file_stack_index_class', 'Org\Mxchange\CoreFramework\Index\Stack\FileStackIndex');
@@ -1443,7 +1443,7 @@ $cfg->setConfigEntry('task_crawler_snippet_extractor_interval_delay', 250);
 $cfg->setConfigEntry('task_crawler_snippet_extractor_max_runs', 0);
 
 // CFG: CRAWLER-PING-TASK-CLASS
-$cfg->setConfigEntry('crawler_ping_task_class', 'CrawlerPingTask');
+$cfg->setConfigEntry('crawler_ping_task_class', 'Org\Shipsimu\Hub\Crawler\Task\Ping\CrawlerPingTask');
 
 // CFG: TASK-CRAWLER-PING-STARTUP-DELAY
 $cfg->setConfigEntry('task_crawler_ping_startup_delay', 1500);
index 7c7673ced134992858667cd058e990a2af1cf272..65183e719a04922f2b880e52dc4214949a1bc297 100644 (file)
@@ -34,7 +34,5 @@ interface Scanner extends HubInterface {
         * @return      void
         */
        function execute ();
-}
 
-// [EOF]
-?>
+}
index be647ffb9513e53ca7a13ebc29bb46b9afe81273..d0b15f676cfd4e47fa39859ac4e6dff5e665b92c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 // Own namespace
-namespace Org\Shipsimu\Hub\Source;
+namespace Org\Shipsimu\Hub\Crawler\Source;
 
 // Import application-specific stuff
 use Org\Shipsimu\Hub\Generic\HubInterface;
@@ -29,6 +29,3 @@ use Org\Shipsimu\Hub\Generic\HubInterface;
  */
 interface Source extends HubInterface {
 }
-
-// [EOF]
-?>
index 70ce96beb88ecf8375fad7ee1112fe1e5422a19c..08099d07d516dd7fc1ad138dc109c5733fe5aeed 100644 (file)
@@ -1,4 +1,10 @@
 <?php
+// Own namespace
+namespace Org\Shipsimu\Hub\Crawler\Source\Unit;
+
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Crawler\Source\Source;
+
 /**
  * An interface for unit sources
  *
@@ -28,7 +34,5 @@ interface UnitSource extends Source {
         * @return      $message        A message from our source
         */
        function generateMessageFromSource ();
-}
 
-// [EOF]
-?>
+}
index 8f30d0a5f3e55e1e6b6946b1123614653bf52745..db1ca56f893372bffdc863c986903f7a49e5e95b 100644 (file)
@@ -1,4 +1,10 @@
 <?php
+// Own namespace
+namespace Org\Shipsimu\Hub\Crawler\Source\Url;
+
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Crawler\Source\Source;
+
 /**
  * An interface for URL sources
  *
@@ -35,7 +41,5 @@ interface UrlSource extends Source {
         * @return      $isEmpty        Whether the stack 'urls' is empty.
         */
        function isUrlStackEmpty ();
-}
 
-// [EOF]
-?>
+}
diff --git a/core b/core
index ee94e79ac63d2c612ca96ba1928f9400026ce4c0..bb121094b0c87c1ed028dfb5f86565b782742e6d 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit ee94e79ac63d2c612ca96ba1928f9400026ce4c0
+Subproject commit bb121094b0c87c1ed028dfb5f86565b782742e6d