From 3690f8bbc396a8deedcf3f9b832e126ed786e3a2 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Sun, 7 Dec 2014 19:23:04 +0100 Subject: [PATCH] Continued a little: - Added resolveUniversalResourceLocatorFromNodeHelper() to interface - BaseProtocolResolver now expandes BaseHubSystem to have some setters back. - Improved comments here and there Signed-off-by: Roland Haeder --- .../hub/interfaces/resolver/class_ProtocolResolver.php | 8 ++++++++ application/hub/main/class_BaseHubSystem.php | 4 ++-- .../main/resolver/protocol/class_BaseProtocolResolver.php | 2 +- .../resolver/protocol/tcp/class_TcpProtocolResolver.php | 4 ++-- .../source/urls/class_CrawlerUploadedListUrlSource.php | 7 +++++-- data/url_lists/demo.lst | 1 - 6 files changed, 18 insertions(+), 8 deletions(-) delete mode 100644 data/url_lists/demo.lst diff --git a/application/hub/interfaces/resolver/class_ProtocolResolver.php b/application/hub/interfaces/resolver/class_ProtocolResolver.php index 21dbecac9..84bc584c9 100644 --- a/application/hub/interfaces/resolver/class_ProtocolResolver.php +++ b/application/hub/interfaces/resolver/class_ProtocolResolver.php @@ -22,6 +22,14 @@ OS. */ interface ProtocolResolver extends FrameworkInterface { + /** + * Returns an command instance for a given NodeHelper instance or null if it + * was not found. + * + * @param $nodeInstance An instance of a NodeHelper class + * @return $unlInstance An instance of a LocateableNode class + */ + function resolveUniversalResourceLocatorFromNodeHelper (NodeHelper $nodeInstance); } // [EOF] diff --git a/application/hub/main/class_BaseHubSystem.php b/application/hub/main/class_BaseHubSystem.php index f41ac725c..58c9dc3ee 100644 --- a/application/hub/main/class_BaseHubSystem.php +++ b/application/hub/main/class_BaseHubSystem.php @@ -437,7 +437,7 @@ class BaseHubSystem extends BaseFrameworkSystem { /** * Setter for session id * - * @param $sessionId The new session id + * @param $sessionId The new session id * @return void */ protected final function setSessionId ($sessionId) { @@ -447,7 +447,7 @@ class BaseHubSystem extends BaseFrameworkSystem { /** * Getter for session id * - * @return $sessionId Current session id + * @return $sessionId Current session id */ public final function getSessionId () { return $this->getConfigInstance()->getConfigEntry('session_id'); diff --git a/application/hub/main/resolver/protocol/class_BaseProtocolResolver.php b/application/hub/main/resolver/protocol/class_BaseProtocolResolver.php index 1a8e82524..7db28005c 100644 --- a/application/hub/main/resolver/protocol/class_BaseProtocolResolver.php +++ b/application/hub/main/resolver/protocol/class_BaseProtocolResolver.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class BaseProtocolResolver extends BaseResolver { +class BaseProtocolResolver extends BaseHubSystem { /** * Protected constructor * diff --git a/application/hub/main/resolver/protocol/tcp/class_TcpProtocolResolver.php b/application/hub/main/resolver/protocol/tcp/class_TcpProtocolResolver.php index bc23f32a1..41a1f6d20 100644 --- a/application/hub/main/resolver/protocol/tcp/class_TcpProtocolResolver.php +++ b/application/hub/main/resolver/protocol/tcp/class_TcpProtocolResolver.php @@ -49,8 +49,8 @@ class TcpProtocolResolver extends BaseProtocolResolver implements ProtocolResolv } /** - * Returns an command instance for a given request class or null if - * it was not found + * Returns an command instance for a given NodeHelper instance or null if it + * was not found. * * @param $nodeInstance An instance of a NodeHelper class * @return $unlInstance An instance of a LocateableNode class diff --git a/application/hub/main/source/urls/class_CrawlerUploadedListUrlSource.php b/application/hub/main/source/urls/class_CrawlerUploadedListUrlSource.php index 41fe3d7d7..928a9e284 100644 --- a/application/hub/main/source/urls/class_CrawlerUploadedListUrlSource.php +++ b/application/hub/main/source/urls/class_CrawlerUploadedListUrlSource.php @@ -59,9 +59,12 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R public function processStack () { // Does the stack have some entries left? if (!$this->isUrlStackEmpty()) { - // Nothing to handle here + /* + * Handle next entry. This method will be called very often, so need + * to process more than one entry at a time. + */ $this->processNextEntry(); - } elseif ($this-> + } // @TODO elseif ($this-> $this->partialStub('Please implement this method.'); } diff --git a/data/url_lists/demo.lst b/data/url_lists/demo.lst deleted file mode 100644 index 84b5b400b..000000000 --- a/data/url_lists/demo.lst +++ /dev/null @@ -1 +0,0 @@ -http://mxchange.org -- 2.39.5