]> git.mxchange.org Git - hub.git/commitdiff
Continued with rewrites:
authorRoland Häder <roland@mxchange.org>
Fri, 19 May 2017 22:24:38 +0000 (00:24 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 21 Aug 2020 16:50:03 +0000 (18:50 +0200)
- introduced HubInterface which holds all public methods from BaseHubSystem
- added HttpClient stuff (unfinished) from core project as this is no longer
  generic
- other stuff

Signed-off-by: Roland Häder <roland@mxchange.org>
40 files changed:
application/hub/classes/class_BaseHubSystem.php
application/hub/classes/client/.htaccess [new file with mode: 0644]
application/hub/classes/client/http/.htaccess [new file with mode: 0644]
application/hub/classes/client/http/class_HttpClient.p [new file with mode: 0644]
application/hub/classes/client/http/class_HttpClient.ph [new file with mode: 0644]
application/hub/classes/client/http/class_HttpClient.php [new file with mode: 0644]
application/hub/classes/factories/client/.htaccess [new file with mode: 0644]
application/hub/classes/factories/client/class_ClientFactory.php [new file with mode: 0644]
application/hub/classes/listener/class_BaseListener.php
application/hub/classes/listener/tcp/class_TcpListener.php
application/hub/classes/listener/udp/class_UdpListener.php
application/hub/interfaces/apt-proxy/class_AptProxy.php
application/hub/interfaces/blocks/class_Minable.php
application/hub/interfaces/chat/class_Chatter.php
application/hub/interfaces/class_HubInterface.php [new file with mode: 0644]
application/hub/interfaces/consumer/class_Consumer.php
application/hub/interfaces/container/socket/class_StorableSocket.php
application/hub/interfaces/crawler/class_Crawler.php
application/hub/interfaces/cruncher/class_CruncherHelper.php
application/hub/interfaces/decoder/class_Decodeable.php
application/hub/interfaces/distributable/class_Distributable.php
application/hub/interfaces/executor/class_Executor.php
application/hub/interfaces/locator/class_LocateableNode.php
application/hub/interfaces/lookup/class_Lookupable.php
application/hub/interfaces/miner/class_MinerHelper.php
application/hub/interfaces/package/assembler/class_Assembler.php
application/hub/interfaces/package/class_Deliverable.php
application/hub/interfaces/package/class_Receivable.php
application/hub/interfaces/package/fragmenter/class_Fragmentable.php
application/hub/interfaces/pool/class_Poolable.php
application/hub/interfaces/pool/peer/class_PoolablePeer.php
application/hub/interfaces/producer/class_Producer.php
application/hub/interfaces/recipient/class_Recipient.php
application/hub/interfaces/resolver/class_ProtocolResolver.php
application/hub/interfaces/scanner/class_Scanner.php
application/hub/interfaces/shareable/info/class_ShareableInfo.php
application/hub/interfaces/socket/class_SocketTag.php
application/hub/interfaces/source/class_Source.php
application/hub/interfaces/tags/class_Tagable.php
application/hub/interfaces/work_units/class_UnitHelper.php

index ed5b205170aa350e8334fba9a71d82b099470ddb..1165131762a7c9b51afc8fe7510b56d661fe3129 100644 (file)
@@ -41,7 +41,7 @@ use \BadMethodCallException;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class BaseHubSystem extends BaseFrameworkSystem {
+class BaseHubSystem extends BaseFrameworkSystem implements HubInterface {
        // Exception codes
        const EXCEPTION_CHUNK_ALREADY_ASSEMBLED       = 0x900;
        const EXCEPTION_ANNOUNCEMENT_NOT_ACCEPTED     = 0x901;
@@ -144,7 +144,7 @@ class BaseHubSystem extends BaseFrameworkSystem {
         * @throws      BadMethodCallException  If socket_last_error() gives zero back
         * @todo        Move all this socket-related stuff into own class, most of it resides in BaseListener
         */
-       protected final function handleSocketError ($method, $line, StorableSocket $socketInstance, array $socketData) {
+       public final function handleSocketError ($method, $line, StorableSocket $socketInstance, array $socketData) {
                // Trace message
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HUB-SYSTEM: CALLED!');
 
diff --git a/application/hub/classes/client/.htaccess b/application/hub/classes/client/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/classes/client/http/.htaccess b/application/hub/classes/client/http/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/classes/client/http/class_HttpClient.p b/application/hub/classes/client/http/class_HttpClient.p
new file mode 100644 (file)
index 0000000..98e50d0
--- /dev/null
@@ -0,0 +1,23 @@
+
+               // First get a socket
+               // @TODO Add some DNS caching here
+
+               // Open connection
+               if ($helperInstance->isProxyUsed() === true) {
+                       // Resolve hostname into IP address
+                       $ip = ConsoleTools::resolveIpAddress($helperInstance->getConfigInstance()->getConfigEntry('proxy_host'));
+
+                       // @TODO Handle $ip = false
+
+                       // Connect to host through proxy connection
+                       $socketResource = fsockopen($ip, $helperInstance->getConfigInstance()->getConfigEntry('proxy_port'), $errorNo, $errorStr, 30);
+               } else {
+                       // Connect to host directly
+                       $socketResource = fsockopen('188.138.90.169', 80, $errorNo, $errorStr, 30);
+               }
+
+               // Check if there was an error else
+               if ($errorNo > 0) {
+                       // Then throw again
+                       throw new InvalidSocketException(array($helperInstance, $socketResource, $errorNo, $errorStr), BaseListener::EXCEPTION_INVALID_SOCKET);
+               } // END - if
diff --git a/application/hub/classes/client/http/class_HttpClient.ph b/application/hub/classes/client/http/class_HttpClient.ph
new file mode 100644 (file)
index 0000000..4999070
--- /dev/null
@@ -0,0 +1,98 @@
+
+       /**
+        * Determines own remote IP address (e.g. can be used to probe if we are
+        * reachable from outside by determining external address and then connect to it.
+        * This is accomblished by connecting to the IP of www.shipsimu.org which
+        * should default to 188.138.90.169 and requesting /ip.php which does only
+        * return the content of $_SERVER['REMOTE_ADDR']. Of course, this method
+        * requires a working Internet connection.
+        *
+        * This method is taken from a user comment on php.net and heavily rewritten.
+        * Compare to following link:
+        * http://de.php.net/manual/en/function.socket-create.php#49368
+        *
+        * @return      $externalAddress        The determined external address address
+        * @todo        Make IP, host name, port and script name configurable
+        */
+       public static function determineExternalAddress () {
+               // Get helper instance
+               $helperInstance = new ConsoleTools();
+
+               // First get a socket
+               // @TODO Add some DNS caching here
+
+               // Open connection
+               if ($helperInstance->isProxyUsed() === true) {
+                       // Resolve hostname into IP address
+                       $ip = ConsoleTools::resolveIpAddress($helperInstance->getConfigInstance()->getConfigEntry('proxy_host'));
+
+                       // @TODO Handle $ip = false
+
+                       // Connect to host through proxy connection
+                       $socketResource = fsockopen($ip, $helperInstance->getConfigInstance()->getConfigEntry('proxy_port'), $errorNo, $errorStr, 30);
+               } else {
+                       // Connect to host directly
+                       $socketResource = fsockopen('188.138.90.169', 80, $errorNo, $errorStr, 30);
+               }
+
+               // Check if there was an error else
+               if ($errorNo > 0) {
+                       // Then throw again
+                       throw new InvalidSocketException(array($helperInstance, $socketResource, $errorNo, $errorStr), BaseListener::EXCEPTION_INVALID_SOCKET);
+               } // END - if
+
+               // Prepare the GET request
+               $request  = 'GET ' . ($helperInstance->isProxyUsed() === true ? 'http://shipsimu.org' : '') . '/ip.php HTTP/1.0' . self::HTTP_EOL;
+               $request .= 'Host: shipsimu.org' . self::HTTP_EOL;
+               $request .= 'User-Agent: ' . $this->getUserAgent() . self::HTTP_EOL;
+               $request .= 'Connection: close' . self::HTTP_EOL;
+
+               // Do we use proxy?
+               if ($helperInstance->isProxyUsed() === true) {
+                       // CONNECT method?
+                       if ($helperInstance->getConfigInstance()->getConfigEntry('proxy_connect_method') == 'Y') {
+                               // Setup proxy tunnel
+                               $response = $helperInstance->setupProxyTunnel('shipsimu.org', 80, $socketResource);
+
+                               // If the response is invalid, abort
+                               if ((count($response) == 3) && (empty($response[0])) && (empty($response[1])) && (empty($response[2]))) {
+                                       // Invalid response!
+                                       $helperInstance->debugBackTrace('Proxy tunnel not working: response=' . print_r($response, true));
+                               } // END - if
+                       } else {
+                               // Add header for proxy
+                               $request .= 'Proxy-Connection: Keep-Alive' . self::HTTP_EOL;
+                       }
+               } // END - if
+
+               // Add last HTTP_EOL
+               $request .= self::HTTP_EOL;
+
+               // Send it to the socket
+               fwrite($socketResource, $request);
+
+               // Init IP (this will always be the last line)
+               $externalAddress = 'invalid';
+
+               // And read the reply
+               while (!feof($socketResource)) {
+                       // Get line
+                       $externalAddress = trim(fgets($socketResource, 128));
+
+                       // Detect HTTP response
+                       if ((substr($externalAddress, 0, 7) == 'HTTP/1.') && (substr($externalAddress, -6, 6) != '200 OK')) {
+                               // Stop processing
+                               break;
+                       } // END - if
+               } // END - while
+
+               // Close socket
+               fclose($socketResource);
+
+
+               // Debug message
+               /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONSOLE-TOOLS: Resolved external address: ' . $externalAddress);
+
+               // Return determined external address
+               return $externalAddress;
+       }
diff --git a/application/hub/classes/client/http/class_HttpClient.php b/application/hub/classes/client/http/class_HttpClient.php
new file mode 100644 (file)
index 0000000..efad8cb
--- /dev/null
@@ -0,0 +1,161 @@
+<?php
+// Own namespace
+namespace CoreFramework\Client\Http;
+
+/**
+ * A HTTP client class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class HttpClient extends BaseClient implements Client {
+       // Constants
+       const HTTP_EOL = "\r\n";
+       const HTTP_USER_AGENT = 'HttpClient-Core/1.0';
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Set default user agent string (to allow other classes to override this)
+               $this->setUserAgent(self::HTTP_USER_AGENT);
+
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this Client class and prepares it for usage
+        *
+        * @return      $clientInstance         An instance of a Client class
+        */
+       public final static function createHttpClient () {
+               // Get a new instance
+               $clientInstance = new HttpClient();
+
+               // Return the prepared instance
+               return $clientInstance;
+       }
+
+       /**
+        * Checks wether proxy configuration is used
+        *
+        * @return      $isUsed         Wether proxy is used
+        */
+       protected function isProxyUsed () {
+               // Do we have cache?
+               if (!isset($GLOBALS[__METHOD__])) {
+                       // Determine it
+                       $GLOBALS[__METHOD__] = (($this->getConfigInstance()->getConfigEntry('proxy_host') != '') && ($this->getConfigInstance()->getConfigEntry('proxy_port') > 0));
+               } // END - if
+
+               // Return cache
+               return $GLOBALS[__METHOD__];
+       }
+
+       /**
+        * Sets up a proxy tunnel for given hostname and through resource
+        *
+        * @param       $host           Host to connect to
+        * @param       $port           Port number to connect to
+        * @return      $response       Response array
+        */
+       protected function setupProxyTunnel ($host, $port) {
+               // Initialize array
+               $response = array('', '', '');
+
+               // Do the connect
+               $respArray = $this->doConnectRequest($host, $port);
+
+               // Analyze first header line
+               if (((strtolower($respArray[0]) !== 'http/1.0') && (strtolower($respArray[0]) !== 'http/1.1')) || ($respArray[1] != '200')) {
+                       // Response code is not 200
+                       return $response;
+               } // END - if
+
+               // All fine!
+               return $respArray;
+       }
+
+       /**
+        * Sends a raw HTTP request out to given IP/host and port number
+        *
+        * @param       $method                 Request method (GET, POST, HEAD, CONNECT, ...)
+        * @param       $host                   Host to connect to
+        * @param       $port                   Port number to connect to
+        * @return      $responseArray  Array with raw response
+        */
+       private function sendRawHttpRequest ($method, $host, $port, array $header = array()) {
+               // Minimum raw HTTP/1.1 request
+               $rawRequest  = $method . ' ' . $host . ':' . $port . ' HTTP/1.1' . self::HTTP_EOL;
+               $rawRequest .= 'Host: ' . $host . ':' . $port . self::HTTP_EOL;
+
+               // Use login data to proxy? (username at least)
+               if ($this->getConfigInstance()->getConfigEntry('proxy_username') != '') {
+                       // Add it as well
+                       $encodedAuth = base64_encode($this->getConfigInstance()->getConfigEntry('proxy_username') . ':' . $this->getConfigInstance()->getConfigEntry('proxy_password'));
+                       $rawRequest .= 'Proxy-Authorization: Basic ' . $encodedAuth . self::HTTP_EOL;
+               } // END - if
+
+               // Add last new-line
+               $rawRequest .= self::HTTP_EOL;
+               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HTTP-CLIENT: rawRequest=' . $rawRequest);
+
+               // Write request
+               fwrite($this->getSocketResource(), $rawRequest);
+
+               // Got response?
+               if (feof($this->getSocketResource())) {
+                       // No response received
+                       return $response;
+               } // END - if
+
+               // Read the first line
+               $resp = trim(fgets($this->getSocketResource(), 10240));
+
+               // "Explode" the string to an array
+               $responseArray = explode(' ', $resp);
+
+               // And return it
+               return $responseArray;
+       }
+
+       /**
+        * A HTTP/1.1 CONNECT request
+        *
+        * @param       $host   Host to connect to
+        * @param       $port   Port number to connect to
+        * @return      $responseArray  An array with the read response
+        */
+       public function doConnectRequest ($host, $port) {
+               // Prepare extra header(s)
+               $headers = array(
+                       'Proxy-Connection' => 'Keep-Alive'
+               );
+
+               // Prepare raw request
+               $responseArray = $this->sendRawHttpRequest('CONNECT', $host, $port, $headers);
+
+               // Return response array
+               return $responseArray;
+       }
+
+}
diff --git a/application/hub/classes/factories/client/.htaccess b/application/hub/classes/factories/client/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/classes/factories/client/class_ClientFactory.php b/application/hub/classes/factories/client/class_ClientFactory.php
new file mode 100644 (file)
index 0000000..b40974d
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+// Own namespace
+namespace Hub\Factory\Client;
+
+// Import application-specific stuff
+use Hub\Container\Socket\StorableSocket;
+
+// Import framework stuff
+use CoreFramework\Factory\ObjectFactory;
+use CoreFramework\Registry\Registry;
+
+/**
+ * An object factory for clients
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ClientFactory extends ObjectFactory {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates a client object for given protocol. This method uses the
+        * registry pattern to cache those instances.
+        *
+        * @param       $protocolInstance       An instance of a HandleableProtocol class to create a client object for (e.g. 'http' for a HTTP/1.1 client)
+        * @param       $socketInstance         An instance of a StorableSocket class (or NULL)
+        * @return      $clientInstance         An instance of the requested client
+        */
+       public static final function createClientByProtocolInstance (HandleableProtocol $protocolInstance, StorableSocket $socketInstance = NULL) {
+               // Default is NULL (to initialize variable)
+               $clientInstance = NULL;
+
+               // Generate registry key
+               $registryKey = strtolower($protocolInstance->getProtocolName()) . '_client';
+
+               // Is the key already in registry?
+               if (Registry::getRegistry()->instanceExists($registryKey)) {
+                       // Then use that instance
+                       $clientInstance = Registry::getRegistry()->getInstance($registryKey);
+
+                       // Is socket instance given?
+                       if ($socketInstance instanceof StorableSocket) {
+                               // Set socket instance
+                               $clientInstance->setSocketInstance($socketInstance);
+                       } // END - if
+               } else {
+                       // Generate object instance
+                       $clientInstance = self::createObjectByConfiguredName($registryKey, array($socketInstance));
+
+                       // Set it in registry for later re-use
+                       Registry::getRegistry()->addInstance($registryKey, $clientInstance);
+               }
+
+               // Return the prepared instance
+               return $clientInstance;
+       }
+
+}
index 8a03b784c40b84ed979bdc7c2fb81a23f1c780e7..89db507eddb843d9f7170164407496834e17cb6b 100644 (file)
@@ -5,6 +5,7 @@ namespace Hub\Listener;
 // Import application-specific stuff
 use Hub\Container\Socket\StorableSocket;
 use Hub\Factory\Information\Connection\ConnectionInfoFactory;
+use Hub\Generic\BaseHubSystem;
 use Hub\Handler\RawData\BaseRawDataHandler;
 use Hub\Helper\Connection\BaseConnectionHelper;
 use Hub\Network\Package\NetworkPackage;
@@ -14,7 +15,6 @@ use Hub\Pool\Peer\PoolablePeer;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Factory\Registry\Socket\SocketRegistryFactory;
 use CoreFramework\Generic\UnsupportedOperationException;
-use CoreFramework\Object\BaseFrameworkSystem;
 use CoreFramework\Visitor\Visitable;
 use CoreFramework\Visitor\Visitor;
 
@@ -40,7 +40,7 @@ use CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class BaseListener extends BaseFrameworkSystem implements Visitable {
+class BaseListener extends BaseHubSystem implements Visitable {
        // Exception code constants
        const EXCEPTION_SOCKET_ALREADY_REGISTERED        = 0xa01;
        const EXCEPTION_SOCKET_CREATION_FAILED           = 0xa02;
@@ -198,7 +198,7 @@ class BaseListener extends BaseFrameworkSystem implements Visitable {
         * @throws      InvalidServerSocketException            If the given resource is no server socket
         * @throws      SocketAlreadyRegisteredException        If the given resource is already registered
         */
-       protected function registerServerSocketResource (StorableSocket $socketInstance) {
+       protected function registerServerSocketInstance (StorableSocket $socketInstance) {
                // First check if it is valid
                if (!$socketInstance->isServerSocketResource()) {
                        // No server socket
index 3fdf23f8255968dc4eb7e5d1f460807cac170d51..1a387388c18a3f9e43e21460d83b31f842d2014b 100644 (file)
@@ -174,7 +174,7 @@ class TcpListener extends BaseListener implements Listenable {
                } // END - if
 
                // Set the main socket
-               $this->registerServerSocketResource($mainSocket);
+               $this->registerServerSocketInstance($mainSocket);
 
                // Initialize the peer pool instance
                $poolInstance = ObjectFactory::createObjectByConfiguredName('node_pool_class', array($this));
index ff4e14a5d7e51cd3f45f8c5ad970a6ea975a6f02..c06401292d7863e4923e0606c1111e834b5ed5e0 100644 (file)
@@ -84,19 +84,6 @@ class UdpListener extends BaseListener implements Listenable {
                if (!socket_bind($mainSocket, $this->getListenAddress(), $this->getListenPort())) {
                        // Handle the socket error with a faked recipientData array
                        $this->handleSocketError(__METHOD__, __LINE__, $mainSocket, array('0.0.0.0', '0'));
-                       /*
-                       // Get socket error code for verification
-                       $socketError = socket_last_error($mainSocket);
-
-                       // Get error message
-                       $errorMessage = socket_strerror($socketError);
-
-                       // Shutdown this socket
-                       $this->shutdownSocket($mainSocket);
-
-                       // And throw again
-                       throw new InvalidSocketException(array($this, $mainSocket, $socketError, $errorMessage), SocketHandler::EXCEPTION_INVALID_SOCKET);
-                       */
                } // END - if
 
                // Now, we want non-blocking mode
@@ -104,19 +91,6 @@ class UdpListener extends BaseListener implements Listenable {
                if (!socket_set_nonblock($mainSocket)) {
                        // Handle the socket error with a faked recipientData array
                        $this->handleSocketError(__METHOD__, __LINE__, $mainSocket, array('0.0.0.0', '0'));
-                       /*
-                       // Get socket error code for verification
-                       $socketError = socket_last_error($socket);
-
-                       // Get error message
-                       $errorMessage = socket_strerror($socketError);
-
-                       // Shutdown this socket
-                       $this->shutdownSocket($mainSocket);
-
-                       // And throw again
-                       throw new InvalidSocketException(array($this, $mainSocket, $socketError, $errorMessage), SocketHandler::EXCEPTION_INVALID_SOCKET);
-                       */
                } // END - if
 
                // Set the option to reuse the port
@@ -124,23 +98,10 @@ class UdpListener extends BaseListener implements Listenable {
                if (!socket_set_option($mainSocket, SOL_SOCKET, SO_REUSEADDR, 1)) {
                        // Handle the socket error with a faked recipientData array
                        $this->handleSocketError(__METHOD__, __LINE__, $mainSocket, array('0.0.0.0', '0'));
-                       /*
-                       // Get socket error code for verification
-                       $socketError = socket_last_error($mainSocket);
-
-                       // Get error message
-                       $errorMessage = socket_strerror($socketError);
-
-                       // Shutdown this socket
-                       $this->shutdownSocket($mainSocket);
-
-                       // And throw again
-                       throw new InvalidSocketException(array($this, $mainSocket, $socketError, $errorMessage), SocketHandler::EXCEPTION_INVALID_SOCKET);
-                       */
                } // END - if
 
                // Remember the socket in our class
-               $this->registerServerSocketResource($mainSocket);
+               $this->registerServerSocketInstance($mainSocket);
 
                // Initialize the network package handler
                $handlerInstance = ObjectFactory::createObjectByConfiguredName('udp_raw_data_handler_class');
index 5f6dfbf50eadcbefc16d597c97c64977151d4cb4..d76f416e2a7bc5150590fe50cf8f6aad001aebe2 100644 (file)
@@ -2,9 +2,11 @@
 // Own namespace
 namespace Hub\AptProxy;
 
+// Import application-specific stuff
+use Hub\Generic\HubInterface;
+
 // Import framework stuff
 use CoreFramework\Controller\Controller;
-use CoreFramework\Generic\FrameworkInterface;
 use CoreFramework\Response\Responseable;
 
 /**
@@ -30,7 +32,7 @@ use CoreFramework\Response\Responseable;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface AptProxy extends FrameworkInterface {
+interface AptProxy extends HubInterface {
        /**
         * Method to "bootstrap" the apt-proxy. This step does also apply provided
         * command-line arguments stored in the request instance. You should now
index 06dd8b0d4875fe142788ac5c7942f17005e1b81e..9906d31b7669e36f4f7f3a6e1ad99064cc9331fb 100644 (file)
@@ -2,8 +2,8 @@
 // Own namespace
 namespace Hub\Miner;
 
-// Import framework stuff
-use CoreFramework\Generic\FrameworkInterface;
+// Import application-specific stuff
+use Hub\Generic\HubInterface;
 
 /**
  * An interface for minable (blocks)
@@ -28,7 +28,7 @@ use CoreFramework\Generic\FrameworkInterface;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface Minable extends FrameworkInterface {
+interface Minable extends HubInterface {
 }
 
 // [EOF]
index 78a7522ef5b7908eb2bfc5216970a1a15e836993..1dcdfdbf24c3448dac869df5d6388e143685f39a 100644 (file)
@@ -2,9 +2,11 @@
 // Own namespace
 namespace Hub\Chatter;
 
+// Import application-specific stuff
+use Hub\Generic\HubInterface;
+
 // Import framework stuff
 use CoreFramework\Controller\Controller;
-use CoreFramework\Generic\FrameworkInterface;
 use CoreFramework\Response\Responseable;
 
 /**
@@ -30,7 +32,7 @@ use CoreFramework\Response\Responseable;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface Chatter extends FrameworkInterface {
+interface Chatter extends HubInterface {
        /**
         * Method to "bootstrap" the chatter. This step does also apply provided
         * command-line arguments stored in the request instance. You should now
diff --git a/application/hub/interfaces/class_HubInterface.php b/application/hub/interfaces/class_HubInterface.php
new file mode 100644 (file)
index 0000000..34efdca
--- /dev/null
@@ -0,0 +1,103 @@
+<?php
+// Own namespace
+namespace Hub\Generic;
+
+// Import application-specific stuff
+use Hub\Container\Socket\StorableSocket;
+
+// Inport frameworks stuff
+use CoreFramework\Generic\FrameworkInterface;
+
+/**
+ * This is the top-level interface for all hub-based interfaces.
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ * @todo               Find a better name for this interface
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface HubInterface extends FrameworkInterface {
+
+       /**
+        * Checks whether start/end marker are set
+        *
+        * @param       $data   Data to be checked
+        * @return      $isset  Whether start/end marker are set
+        */
+       function ifStartEndMarkersSet ($data);
+
+       /**
+        * Handles socket error for given socket resource and peer data. This method
+        * validates socket resource stored in given container if it is a valid
+        * resource (see is_resource()) but assumes valid data in array
+        * $recipientData, except that count($recipientData) is always 2.
+        *
+        * @param       $method                         Value of __METHOD__ from calling method
+        * @param       $line                           Value of __LINE__ from calling method
+        * @param       $socketInstance         An instance of a StoreableSocket class
+        * @param       $socketData                     A valid socket data array (0 = IP/file name, 1 = port)
+        * @return      void
+        * @throws      InvalidSocketException  If the stored socket resource is no socket resource
+        * @throws      BadMethodCallException  If socket_last_error() gives zero back
+        * @todo        Move all this socket-related stuff into own class, most of it resides in BaseListener
+        */
+       function handleSocketError ($method, $line, StorableSocket $socketInstance, array $socketData);
+
+       /**
+        * Getter for listener pool instance
+        *
+        * @return      $listenerPoolInstance   Our current listener pool instance
+        */
+       function getListenerPoolInstance ();
+
+       /**
+        * Getter for info instance
+        *
+        * @return      $infoInstance   An instance of a ShareableInfo class
+        */
+       function getInfoInstance ();
+
+       /**
+        * Getter for node id
+        *
+        * @return      $nodeId         Current node id
+        */
+       function getNodeId ();
+
+       /**
+        * Getter for private key
+        *
+        * @return      $privateKey             Current private key
+        */
+       function getPrivateKey ();
+
+       /**
+        * Getter for private key hash
+        *
+        * @return      $privateKeyHash         Current private key hash
+        */
+       function getPrivateKeyHash ();
+
+       /**
+        * Getter for session id
+        *
+        * @return      $sessionId      Current session id
+        */
+       function getSessionId ();
+
+}
index 9ebf585b399d54ceaada971548200790495d47d7..0e62003ca80876ac55afb999601728d33631da14 100644 (file)
@@ -2,8 +2,8 @@
 // Own namespace
 namespace Hub\Consumer;
 
-// Import framework stuff
-use CoreFramework\Generic\FrameworkInterface;
+// Import application-specific stuff
+use Hub\Generic\HubInterface;
 
 /**
  * An interface for the producer/consumer implementation
@@ -27,7 +27,7 @@ use CoreFramework\Generic\FrameworkInterface;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface Consumer extends FrameworkInterface {
+interface Consumer extends HubInterface {
 }
 
 // [EOF]
index 6fe91550460f19f1521bca170c281e4cd1fade47..81c21725f911492e5b266a2cba879d75cc016af8 100644 (file)
@@ -2,8 +2,8 @@
 // Own namespace
 namespace Hub\Container\Socket;
 
-// Import framework stuff
-use CoreFramework\Generic\FrameworkInterface;
+// Import application-specific stuff
+use Hub\Generic\HubInterface;
 
 /**
  * An interface for socket containers
@@ -27,7 +27,7 @@ use CoreFramework\Generic\FrameworkInterface;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface StorableSocket extends FrameworkInterface {
+interface StorableSocket extends HubInterface {
 
        /**
         * Checks whether the given Universal Node Locator matches with the one from package data
index d87d18409a19cba23e86ca9f04ed527078a73bf7..605083731c82625af49671c2f142cda0e12382eb 100644 (file)
@@ -2,9 +2,11 @@
 // Own namespace
 namespace Hub\Crawler;
 
+// Import application-specific stuff
+use Hub\Generic\HubInterface;
+
 // Import framework stuff
 use CoreFramework\Controller\Controller;
-use CoreFramework\Generic\FrameworkInterface;
 use CoreFramework\Response\Responseable;
 use CoreFramework\State\Stateable;
 
@@ -31,7 +33,7 @@ use CoreFramework\State\Stateable;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface Crawler extends FrameworkInterface {
+interface Crawler extends HubInterface {
        /**
         * Method to "bootstrap" the crawler. This step does also apply provided
         * command-line arguments stored in the request instance. You should now
index ddb3f293eb7936782eb5fbe3e24defbe089836f2..5c64b9e43d3599e2acc10e3b3aefa72b57f201a0 100644 (file)
@@ -2,9 +2,11 @@
 // Own namespace
 namespace Hub\Helper\Cruncher;
 
+// Import application-specific stuff
+use Hub\Generic\HubInterface;
+
 // Import framework stuff
 use CoreFramework\Controller\Controller;
-use CoreFramework\Generic\FrameworkInterface;
 use CoreFramework\Response\Responseable;
 
 /**
@@ -30,7 +32,7 @@ use CoreFramework\Response\Responseable;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface CruncherHelper extends FrameworkInterface {
+interface CruncherHelper extends HubInterface {
        /**
         * Method to "bootstrap" the cruncher. This step does also apply provided
         * command-line arguments stored in the request instance. You should now
index 185564a347acc16c7ae30c45cfb76ea3739a49a8..00ce39c2fa2360e54f02e5073f6712a9271c80cc 100644 (file)
@@ -2,8 +2,8 @@
 // Own namespace
 namespace Hub\Decoder;
 
-// Import framework stuff
-use CoreFramework\Generic\FrameworkInterface;
+// Import application-specific stuff
+use Hub\Generic\HubInterface;
 
 /**
  * An interface for decoders
@@ -27,7 +27,7 @@ use CoreFramework\Generic\FrameworkInterface;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface Decodeable extends FrameworkInterface {
+interface Decodeable extends HubInterface {
        /**
         * Checks whether the assoziated stacker for raw package data has some entries left
         *
index 814a1ebd55465990b709babdec6891bba74b7a59..0890a07012381b09c4e317798771dec4b636bf7b 100644 (file)
@@ -2,8 +2,8 @@
 // Own namespace
 namespace Hub\Dht;
 
-// Import framework stuff
-use CoreFramework\Generic\FrameworkInterface;
+// Import application-specific stuff
+use Hub\Generic\HubInterface;
 
 /**
  * An interface for DHTs
@@ -27,7 +27,7 @@ use CoreFramework\Generic\FrameworkInterface;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface Distributable extends FrameworkInterface {
+interface Distributable extends HubInterface {
        /**
         * Initializes the distributable hash table (DHT)
         *
index 4ec3c6ad2ba3a7e71d6f71fb3f338d5dfd363e67..e2f20de43ccc99486fac673d07ab79b09f53890e 100644 (file)
@@ -2,8 +2,10 @@
 // Own namespace
 namespace Hub\Executor;
 
+// Import application-specific stuff
+use Hub\Generic\HubInterface;
+
 // Import framework stuff
-use CoreFramework\Generic\FrameworkInterface;
 use CoreFramework\State\Stateable;
 
 /**
@@ -28,7 +30,7 @@ use CoreFramework\State\Stateable;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface Executor extends FrameworkInterface {
+interface Executor extends HubInterface {
        /**
         * Initializes the executor, whatever it does.
         *
index 3927e57f8f9e75c371a047f312785e31f9e1e8ec..dd45658d8f1575420993d3caebf6c8d4dfda8ac7 100644 (file)
@@ -2,8 +2,8 @@
 // Own namespace
 namespace Hub\Locator\Node;
 
-// Import framework stuff
-use CoreFramework\Generic\FrameworkInterface;
+// Import application-specific stuff
+use Hub\Generic\HubInterface;
 
 /**
  * An interface for node locators (UNL mostly)
@@ -27,7 +27,7 @@ use CoreFramework\Generic\FrameworkInterface;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface LocateableNode extends FrameworkInterface {
+interface LocateableNode extends HubInterface {
 }
 
 // [EOF]
index 3c534f3338a15a5db6403156bc60ea8b1def0190..6dd42925c592523f7ff78cf36e778f6a62eee98e 100644 (file)
@@ -2,8 +2,8 @@
 // Own namespace
 namespace Hub\LookupTable;
 
-// Import framework stuff
-use CoreFramework\Generic\FrameworkInterface;
+// Import application-specific stuff
+use Hub\Generic\HubInterface;
 
 /**
  * An interface for lookup tables
@@ -27,7 +27,7 @@ use CoreFramework\Generic\FrameworkInterface;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface Lookupable extends FrameworkInterface {
+interface Lookupable extends HubInterface {
 }
 
 // [EOF]
index 83d6372a7a562b1dc6d2204ed059f4b7d8ffbfe4..22f6c742d5726de13f88b2a8be0eb5a732831700 100644 (file)
@@ -2,9 +2,11 @@
 // Own namespace
 namespace Hub\Helper\Miner;
 
+// Import application-specific stuff
+use Hub\Generic\HubInterface;
+
 // Import framework stuff
 use CoreFramework\Controller\Controller;
-use CoreFramework\Generic\FrameworkInterface;
 use CoreFramework\Response\Responseable;
 
 /**
@@ -30,7 +32,7 @@ use CoreFramework\Response\Responseable;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface MinerHelper extends FrameworkInterface {
+interface MinerHelper extends HubInterface {
        /**
         * Method to "bootstrap" the miner. This step does also apply provided
         * command-line arguments stored in the request instance. You should now
index 3bb0220ee5fb77472fa4fc2ee608f9cb05c61bc5..5e03b451ce015fd32ca29beb1ddcfd70df4159b2 100644 (file)
@@ -2,8 +2,8 @@
 // Own namespace
 namespace Hub\Assembler;
 
-// Import framework stuff
-use CoreFramework\Generic\FrameworkInterface;
+// Import application-specific stuff
+use Hub\Generic\HubInterface;
 
 /**
  * An interface for a package assembler
@@ -27,7 +27,7 @@ use CoreFramework\Generic\FrameworkInterface;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface Assembler extends FrameworkInterface {
+interface Assembler extends HubInterface {
        /**
         * Chunks the content from $packageContent and feeds it into another queue
         * for verification and possible re-requesting.
index e60d9ac24f74333219a1cb296365a88de0558ac7..a5b9e08bd8573c699ff58b96bdb39f40c4c41831 100644 (file)
@@ -3,11 +3,9 @@
 namespace Hub\Network\Deliver;
 
 // Import application-specific stuff
+use Hub\Generic\HubInterface;
 use Hub\Helper\HubHelper;
 
-// Import framework stuff
-use CoreFramework\Generic\FrameworkInterface;
-
 /**
  * An interface for package delivery boys... ;-)
  *
@@ -30,7 +28,7 @@ use CoreFramework\Generic\FrameworkInterface;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface Deliverable extends FrameworkInterface {
+interface Deliverable extends HubInterface {
        /**
         * "Enqueues" raw content into this delivery class by reading the raw content
         * from given helper's template instance and pushing it on the 'undeclared'
index c36e9eb46717cb1ef9337db0f5ec88eb9a671df8..9e58cac9a14267c41bd194f99de5fb37a239458b 100644 (file)
@@ -5,8 +5,8 @@ namespace Hub\Network\Receive;
 // Import application-specific stuff
 use Hub\Network\Networkable;
 
-// Import framework stuff
-use CoreFramework\Generic\FrameworkInterface;
+// Import application-specific stuff
+use Hub\Generic\HubInterface;
 
 /**
  * An interface for package receivers
@@ -30,7 +30,7 @@ use CoreFramework\Generic\FrameworkInterface;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface Receivable extends FrameworkInterface {
+interface Receivable extends HubInterface {
        /**
         * Checks whether new raw data from the socket has arrived
         *
index d948096a381b71ec477555dbb070aa26faa363a0..3812bc092cf018c2414ee26546f2502d335785d9 100644 (file)
@@ -5,8 +5,8 @@ namespace Hub\Fragmenter;
 // Import application-specific stuff
 use Hub\Helper\Connection\ConnectionHelper;
 
-// Import framework stuff
-use CoreFramework\Generic\FrameworkInterface;
+// Import application-specific stuff
+use Hub\Generic\HubInterface;
 
 /**
  * An interface for a package fragmenter
@@ -30,7 +30,7 @@ use CoreFramework\Generic\FrameworkInterface;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface Fragmentable extends FrameworkInterface {
+interface Fragmentable extends HubInterface {
        /**
         * This method does "implode" the given package data array into one long
         * string, splits it into small chunks, adds a serial number and checksum
index af0242eaa49baca2bdfdb65237a62bd0f35db145..d48f7cd26f24210c2a864d14b48bfa89e55b8c71 100644 (file)
@@ -2,8 +2,8 @@
 // Own namespace
 namespace Hub\Pool;
 
-// Import framework stuff
-use CoreFramework\Generic\FrameworkInterface;
+// Import application-specific stuff
+use Hub\Generic\HubInterface;
 
 /**
  * A Poolable interface
@@ -27,7 +27,7 @@ use CoreFramework\Generic\FrameworkInterface;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface Poolable extends FrameworkInterface {
+interface Poolable extends HubInterface {
 
        /**
         * Pre-shuts down the pool
index 737df9fbb5fc7cdc4078adb96093e481262a1b94..6414010a4106ccd5d52f50021587fab2d09815fb 100644 (file)
@@ -3,6 +3,7 @@
 namespace Hub\Pool\Peer;
 
 // Import application-specific stuff
+use Hub\Container\Socket\StorableSocket;
 use Hub\Pool\Poolable;
 use Hub\Tag\Socket\SocketTag;
 
@@ -32,13 +33,13 @@ interface PoolablePeer extends Poolable, SocketTag {
        /**
         * Adds a socket resource to the peer pool
         *
-        * @param       $socketResource         A valid (must be!) socket resource
+        * @param       $socketInstance         An instance of a StorableSocket class
         * @param       $connectionType         Type of connection, can only be 'incoming', 'outgoing' or 'server'
         * @return      void
         * @throws      InvalidSocketException  If the given resource is invalid or errorous
         * @throws      InvalidConnectionTypeException  If the provided connection type is not valid
         */
-       function addPeer ($socketResource, $connectionType);
+       function addPeer (StorableSocket $socketInstance, $connectionType);
 
        /**
         * Getter for array of all socket resource arrays
index 9679965207920f2446424d971c998cddf2977181..31fff2c21999b01c40bb4257329250a30dd3363c 100644 (file)
@@ -2,8 +2,8 @@
 // Own namespace
 namespace Hub\Producer;
 
-// Import framework stuff
-use CoreFramework\Generic\FrameworkInterface;
+// Import application-specific stuff
+use Hub\Generic\HubInterface;
 
 /**
  * An interface for the producer/consumer implementation
@@ -27,7 +27,7 @@ use CoreFramework\Generic\FrameworkInterface;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface Producer extends FrameworkInterface {
+interface Producer extends HubInterface {
 }
 
 // [EOF]
index c653b3dde620369940bf4800d74cc2380a1bd564..9c36529fb51f4f22f60913265d77dfc6bc062129 100644 (file)
@@ -2,8 +2,10 @@
 // Own namespace
 namespace Hub\Recipient;
 
+// Import application-specific stuff
+use Hub\Generic\HubInterface;
+
 // Import framework stuff
-use CoreFramework\Generic\FrameworkInterface;
 use CoreFramework\Lists\Listable;
 
 /**
@@ -28,7 +30,7 @@ use CoreFramework\Lists\Listable;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface Recipient extends FrameworkInterface {
+interface Recipient extends HubInterface {
        /**
         * Tries to resolve given recipient into session ids or Universal Node Locator
         * depending on implementation (hint: Template Method Pattern)
index cef69e8cc63ce4a28ae796020733e55f0d5ec88b..624362f75d1a3cfec17fd282aa61c52c3ed638fe 100644 (file)
@@ -3,10 +3,9 @@
 namespace Hub\Resolver\Protocol;
 
 // Import application-specific stuff
+use Hub\Generic\HubInterface;
 use Hub\Helper\Node\NodeHelper;
 
-// Import framework stuff
-use CoreFramework\Generic\FrameworkInterface;
 
 /**
  * An interface for ProtocolResolvers
@@ -30,7 +29,7 @@ use CoreFramework\Generic\FrameworkInterface;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface ProtocolResolver extends FrameworkInterface {
+interface ProtocolResolver extends HubInterface {
        /**
         * Returns an instance of a LocateableNode class for a given NodeHelper
         * instance or null if it was not found.
index 9db3270e988cb43d07d5c569f42a6af5f424336f..e9b28acb97cc28e0886f0ad92b30da562f428bdc 100644 (file)
@@ -2,8 +2,8 @@
 // Own namespace
 namespace Hub\Scanner;
 
-// Import framework stuff
-use CoreFramework\Generic\FrameworkInterface;
+// Import application-specific stuff
+use Hub\Generic\HubInterface;
 
 /**
  * An interface for scanners
@@ -27,7 +27,7 @@ use CoreFramework\Generic\FrameworkInterface;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface Scanner extends FrameworkInterface {
+interface Scanner extends HubInterface {
        /**
         * Runs the scanner (please no loops here)
         *
index 203bbda036a13ea8843652cb2b160d2b810e0fd5..7b1a0f51c5d062c1c7e20ae1794a1e960a840d8a 100644 (file)
@@ -5,8 +5,10 @@ namespace Hub\Information;
 // Import application-specific stuff
 use Hub\Helper\Connection\ConnectionHelper;
 
+// Import application-specific stuff
+use Hub\Generic\HubInterface;
+
 // Import framework stuff
-use CoreFramework\Generic\FrameworkInterface;
 use CoreFramework\Listener\Listenable;
 
 /**
@@ -31,7 +33,7 @@ use CoreFramework\Listener\Listenable;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface ShareableInfo extends FrameworkInterface {
+interface ShareableInfo extends HubInterface {
        /**
         * Fills the information class with data from a Listenable instance
         *
index bc37e328079e5355133eaf44970c5bf734c2b77f..ce3ab3064e44c2d8d9be0e983de7242ad529fc9b 100644 (file)
@@ -2,8 +2,8 @@
 // Own namespace
 namespace Hub\Tag\Socket;
 
-// Import framework stuff
-use CoreFramework\Generic\FrameworkInterface;
+// Import application-specific stuff
+use Hub\Generic\HubInterface;
 
 /**
  * An interface/tag for socket classes
@@ -27,7 +27,7 @@ use CoreFramework\Generic\FrameworkInterface;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface SocketTag extends FrameworkInterface {
+interface SocketTag extends HubInterface {
        /**
         * "Getter" for a valid socket resource from given packae data.
         *
index efc8ff9e3d308caeffa0b6b93f696f02dd400d3a..27d13ca4f74412336d424c131eb38bc0abeaf4fd 100644 (file)
@@ -2,8 +2,8 @@
 // Own namespace
 namespace Hub\Source;
 
-// Import framework stuff
-use CoreFramework\Generic\FrameworkInterface;
+// Import application-specific stuff
+use Hub\Generic\HubInterface;
 
 /**
  * An interface for sources
@@ -27,7 +27,7 @@ use CoreFramework\Generic\FrameworkInterface;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface Source extends FrameworkInterface {
+interface Source extends HubInterface {
 }
 
 // [EOF]
index cac89f9a4c508df19de376c4061a28afa137ab51..5ece046b6826fc92666522e4e8384e0aa5609525 100644 (file)
@@ -2,8 +2,10 @@
 // Own namespace
 namespace Hub\Tag;
 
+// Import application-specific stuff
+use Hub\Generic\HubInterface;
+
 // Import framework stuff
-use CoreFramework\Generic\FrameworkInterface;
 use CoreFramework\Listener\Listenable;
 
 /**
@@ -28,7 +30,7 @@ use CoreFramework\Listener\Listenable;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface Tagable extends FrameworkInterface {
+interface Tagable extends HubInterface {
        /**
         * Chooses the right protocol from given package data
         *
index 0d6bd854ae25d7d6db4cf9d0b7d8dd323a504837..ec56b31953ae4ba9ebf3be987a971585e08e26bb 100644 (file)
@@ -2,8 +2,8 @@
 // Own namespace
 namespace Hub\Helper\Unit;
 
-// Import framework stuff
-use CoreFramework\Generic\FrameworkInterface;
+// Import application-specific stuff
+use Hub\Generic\HubInterface;
 
 /**
  * An interface for work/test/foo unit helper
@@ -27,7 +27,7 @@ use CoreFramework\Generic\FrameworkInterface;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface UnitHelper extends FrameworkInterface {
+interface UnitHelper extends HubInterface {
        /**
         * Generates a work/test/foo unit instance
         *