]> git.mxchange.org Git - hub.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Mon, 22 May 2017 16:32:00 +0000 (18:32 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 21 Aug 2020 16:50:07 +0000 (18:50 +0200)
- imported FrameworkException
- imported InvalidConnectionTypeException
- need to call StorableSocket's method
- raw-data is always network-related

Signed-off-by: Roland Häder <roland@mxchange.org>
46 files changed:
application/hub/classes/class_BaseHubSystem.php
application/hub/classes/container/socket/class_SocketContainer.php
application/hub/classes/discovery/recipient/package/class_PackageRecipientDiscovery.php
application/hub/classes/handler/message-types/class_BaseMessageHandler.php
application/hub/classes/handler/network/socket/class_SocketRawDataHandler.php
application/hub/classes/handler/network/tcp/class_TcpRawDataHandler.php
application/hub/classes/handler/network/udp/class_UdpRawDataHandler.php
application/hub/classes/handler/raw_data/network/class_
application/hub/classes/handler/raw_data/network/class_BaseRawDataHandler.php
application/hub/classes/package/assembler/class_PackageAssembler.php
application/hub/classes/package/class_NetworkPackage.php
application/hub/classes/pools/peer/class_DefaultPeerPool.php
application/hub/classes/recipient/dht/class_DhtRecipient.php
application/hub/classes/recipient/direct/class_DirectRecipient.php
application/hub/classes/recipient/self/class_SelfRecipient.php
application/hub/classes/recipient/upper/class_UpperRecipient.php
application/hub/classes/streams/raw_data/output/class_RawDataOutputStream.php
application/hub/exceptions/announcement/class_AnnouncementNotAcceptedException.php
application/hub/exceptions/announcement/class_NoAnnouncementAttemptedException.php
application/hub/exceptions/connection/class_InvalidConnectionTypeException.php
application/hub/exceptions/dht/class_DhtBootstrapNotAcceptedException.php
application/hub/exceptions/dht/class_NoDhtBootstrapAttemptedException.php
application/hub/exceptions/factory/class_FactoryRequiredParameterException.php
application/hub/exceptions/ids/class_InvalidSessionIdException.php
application/hub/exceptions/lists/class_InvalidListHashException.php
application/hub/exceptions/lists/class_ListGroupAlreadyAddedException.php
application/hub/exceptions/lists/class_NoListGroupException.php
application/hub/exceptions/node/class_NodeAlreadyAnnouncedException.php
application/hub/exceptions/node/class_NodeSessionIdVerficationException.php
application/hub/exceptions/package/class_FinalChunkVerificationException.php
application/hub/exceptions/package/class_InvalidDataChecksumException.php
application/hub/exceptions/package/class_InvalidPrivateKeyHashException.php
application/hub/exceptions/package/class_UnexpectedPackageStatusException.php
application/hub/exceptions/package/class_UnsupportedPackageCodeHandlerException.php
application/hub/exceptions/peer/class_PeerAlreadyRegisteredException.php
application/hub/exceptions/requests/class_NoRequestNodeListAttemptedException.php
application/hub/exceptions/requests/class_RequestNotAcceptedException.php
application/hub/exceptions/resolver/class_NoValidHostnameException.php
application/hub/exceptions/stream/class_MultipleMessageSentException.php
application/hub/exceptions/tags/class_InvalidTagException.php
application/hub/exceptions/tasks/class_InvalidTaskException.php
application/hub/exceptions/unl/class_InvalidUnlException.php
application/hub/exceptions/wrapper/class_NodeAlreadyRegisteredException.php
application/hub/exceptions/wrapper/class_NodeDataMissingException.php
application/hub/interfaces/container/socket/class_StorableSocket.php
application/hub/interfaces/handler/chunks/class_HandleableChunks.php

index f4faee74d04dd811cf81f3e9d25955eee02950ad..338059c1418244b9cdc0402022ed0de5a25006a9 100644 (file)
@@ -4,7 +4,7 @@ namespace Hub\Generic;
 
 // Import application-specific stuff
 use Hub\Handler\Protocol\HandleableProtocol;
-use Hub\Handler\RawData\BaseRawDataHandler;
+use Hub\Handler\Network\RawData\BaseRawDataHandler;
 use Hub\Information\ShareableInfo;
 use Hub\Listener\BaseListener;
 use Hub\Listener\Listenable;
index a146286cbbd793658da7fb942abdf8d932986e80..04c7b89e266160c3ab9d54aec3dd03dc58eeddab 100644 (file)
@@ -3,7 +3,7 @@
 namespace Hub\Container\Socket;
 
 // Import application-specific stuff
-use Hub\Handler\RawData\BaseRawDataHandler;
+use Hub\Handler\Network\RawData\BaseRawDataHandler;
 use Hub\Helper\Connection\BaseConnectionHelper;
 use Hub\Information\ShareableInfo;
 use Hub\Listener\BaseListener;
@@ -849,7 +849,7 @@ class SocketContainer extends BaseContainer implements StorableSocket, Visitable
         * @param       $connectionType         Type of connection, can be 'incoming', 'outgoing' or 'server'
         * @return      $isValid                        Whether the provided connection type is valid
         */
-       private function isValidConnectionType ($connectionType) {
+       public function isValidConnectionType ($connectionType) {
                // Is it valid?
                $isValid = in_array($connectionType, $this->connectionTypes, TRUE);
 
index d6e4983986806e73b1d1a851f6c6e32c5e325bb1..54b1983e63448615798d77017fd4d1fb5ed1e515 100644 (file)
@@ -125,7 +125,5 @@ class PackageRecipientDiscovery extends BaseRecipientDiscovery implements Discov
                        // @TODO Unfinished: $this->getListInstance()->addEntry('unl', $decodedData[NetworkPackage::PACKAGE_DATA_RECIPIENT]);
                }
        }
-}
 
-// [EOF]
-?>
+}
index 1dc6648932f8798751d62516ab40dedba5fe1141..e502920a49ac81aaf581c1b2c4bf3156cb47c71c 100644 (file)
@@ -6,6 +6,9 @@ namespace Hub\Handler\Message;
 use Hub\Generic\BaseHubSystem;
 use Hub\Network\Receive\Receivable;
 
+// Import framework stuff
+use CoreFramework\Generic\FrameworkException;
+
 /**
  * A general message handler, this class must be abstract to make the template
  * method pattern working.
@@ -93,7 +96,5 @@ abstract class BaseMessageHandler extends BaseDataHandler {
                 */
                $packageInstance->feedHashToMiner($messageData);
        }
-}
 
-// [EOF]
-?>
+}
index f60eba73e3c9835dd8528ddf5bc36280398c2917..e02f2f10f6606340d12412b568c581ecc9908854 100644 (file)
@@ -3,7 +3,7 @@
 namespace Hub\Handler\Network\Socket\RawData;
 
 // Import application-specific stuff
-use Hub\Handler\RawData\BaseRawDataHandler;
+use Hub\Handler\Network\RawData\BaseRawDataHandler;
 use Hub\Network\Networkable;
 
 /**
index ee1f41f526d61301e9b5f04fb72240cbd718610d..3832dc37b72fdddaca99f2093728dcf378b38fec 100644 (file)
@@ -3,7 +3,7 @@
 namespace Hub\Handler\Network\RawData\Tcp;
 
 // Import application-specific stuff
-use Hub\Handler\RawData\BaseRawDataHandler;
+use Hub\Handler\Network\RawData\BaseRawDataHandler;
 use Hub\Network\Networkable;
 use Hub\Pool\Poolable;
 
index 2c3e0a911274ed195c13be9117bb6cef2688ba04..f1aaa667fb108b7c6abb6a27c55ea8211137790c 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 // Own namespace
-namespace Hub\Handler\RawData\Udp;
+namespace Hub\Handler\Network\RawData\Udp;
 
 // Import application-specific stuff
-use Hub\Handler\RawData\BaseRawDataHandler;
+use Hub\Handler\Network\RawData\BaseRawDataHandler;
 use Hub\Network\Networkable;
 use Hub\Pool\Poolable;
 
index ef0cc605b32920a6be2446f0e7774ce949501089..0b5036feb452d14c2990da7e77172969b28a6613 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 // Own namespace
-namespace Hub\Handler\RawData;
+namespace Hub\Handler\Network\RawData;
 
 // Import application-specific stuff
-use Hub\Handler\RawData\BaseRawDataHandler;
+use Hub\Handler\Network\RawData\BaseRawDataHandler;
 use Hub\Network\Networkable;
 
 /**
index 3374872e2162c973b7c195f5deaf6385760fefbc..2034014473252eec40e21811787bd6288c860750 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 // Own namespace
-namespace Hub\Handler\RawData;
+namespace Hub\Handler\Network\RawData;
 
 // Import application-specific stuff
 use Hub\Container\Socket\StorableSocket;
index 3ba2381945fc6503ae01c8952175a5343fdf7ae3..9c677aee4a038c90c3df1677df9402d4b8277ae2 100644 (file)
@@ -5,7 +5,7 @@ namespace Hub\Network\Package\Assembler;
 // Import hub-specific stuff
 use Hub\Container\Socket\StorableSocket;
 use Hub\Generic\BaseHubSystem;
-use Hub\Handler\RawData\BaseRawDataHandler;
+use Hub\Handler\Network\RawData\BaseRawDataHandler;
 use Hub\Network\Package\NetworkPackage;
 use Hub\Network\Receive\Receivable;
 
index 693c94c43b57b59de291868cc3ba7ca95088d6af..c8f7861ba1620e2a238ce08394e7df54ec53570c 100644 (file)
@@ -9,7 +9,7 @@ use Hub\Factory\Dht\DhtObjectFactory;
 use Hub\Factory\Information\Connection\ConnectionInfoFactory;
 use Hub\Factory\Node\NodeObjectFactory;
 use Hub\Generic\BaseHubSystem;
-use Hub\Handler\RawData\BaseRawDataHandler;
+use Hub\Handler\Network\RawData\BaseRawDataHandler;
 use Hub\Helper\Connection\ConnectionHelper;
 use Hub\Helper\HubHelper;
 use Hub\Information\ShareableInfo;
index 42f681b72ade4a14551f73fbb48de90e404bd94c..61c3309f1a2551e92a4c6ceca7eb58170d79b00f 100644 (file)
@@ -4,6 +4,7 @@ namespace Hub\Pool\Peer;
 
 // Import application-specific stuff
 use Hub\Container\Socket\StorableSocket;
+use Hub\Connection\InvalidConnectionTypeException;
 use Hub\Listener\Listenable;
 use Hub\Locator\Node\LocateableNode;
 use Hub\Network\Package\NetworkPackage;
@@ -107,7 +108,7 @@ class DefaultPeerPool extends BasePool implements PoolablePeer {
                $this->validateSocket($socketInstance);
 
                // Is the connection type valid?
-               if (!$this->isValidConnectionType($connectionType)) {
+               if (!$socketInstance->isValidConnectionType($connectionType)) {
                        // Is not a valid connection type!
                        throw new InvalidConnectionTypeException(array($this, $connectionType), self::EXCEPTION_INVALID_CONNECTION_TYPE);
                } // END - if
@@ -181,15 +182,9 @@ class DefaultPeerPool extends BasePool implements PoolablePeer {
         *
         * @param       $connectionType         Type of connection, can only be 'incoming', 'outgoing' or 'server'
         * @return      $sockets                        An array with sockets of given type
-        * @throws      InvalidConnectionTypeException  If the provided connection type is not valid
+        * @throws      InvalidConnectionTypeException  If the found connection type is not valid
         */
        public function getSocketsByConnectionType ($connectionType) {
-               // Is the connection type valid?
-               if (!$this->isValidConnectionType($connectionType)) {
-                       // Is not a valid connection type!
-                       throw new InvalidConnectionTypeException(array($this, $connectionType), self::EXCEPTION_INVALID_CONNECTION_TYPE);
-               } // END - if
-
                // Get the array list
                $socketArrays = $this->getArrayFromList('pool');
 
@@ -200,6 +195,12 @@ class DefaultPeerPool extends BasePool implements PoolablePeer {
                foreach ($socketArrays as $socketArray) {
                        // Does it match?
                        if ($socketArray[Poolable::SOCKET_ARRAY_CONN_TYPE] === $connectionType) {
+                               // Is the connection type valid?
+                               if (!$socketArray[Poolable::SOCKET_ARRAY_INSTANCE]->isValidConnectionType($connectionType)) {
+                                       // Is not a valid connection type!
+                                       throw new InvalidConnectionTypeException(array($this, $connectionType), self::EXCEPTION_INVALID_CONNECTION_TYPE);
+                               } // END - if
+
                                // Add the socket
                                array_push($sockets, $socketArray[Poolable::SOCKET_ARRAY_INSTANCE]);
                        } // END - if
index f6c527143aa6f3651a29818f681cba446ee3d8fd..2d4511fedb9b26ffbec7e0159fa3794042f92c46 100644 (file)
@@ -98,7 +98,5 @@ class DhtRecipient extends BaseRecipient implements Recipient {
                // Debug message
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-RECIPIENT: recipient=' . $recipient . ' - EXIT!');
        }
-}
 
-// [EOF]
-?>
+}
index 18b48dc1b5939697f9c3b54dfbc92d2324e11df1..69c53ed4dcb586b5a12bb08343f4e63a5935164e 100644 (file)
@@ -84,7 +84,5 @@ class DirectRecipient extends BaseRecipient implements Recipient {
                        $listInstance->addEntry('unl', $unlData);
                } // END - foreach
        }
-}
 
-// [EOF]
-?>
+}
index e942b4dd10fae9c0724098e4ece7f35f864e522f..5202ff1c1554e2c7a0a28885c3a1bd993a74ed2d 100644 (file)
@@ -80,7 +80,5 @@ class SelfRecipient extends BaseRecipient implements Recipient {
                        $listInstance->addEntry('unl', $unl);
                } // END - if
        }
-}
 
-// [EOF]
-?>
+}
index 0047f370439ee8384d8051ea0150c1ce7ce8a70d..77b717c2cccb9e0e488acda135fcd79552d76166 100644 (file)
@@ -88,7 +88,5 @@ class UpperRecipient extends BaseRecipient implements Recipient {
                        $listInstance->addEntry('unl', $unlData);
                } // END - foreach
        }
-}
 
-// [EOF]
-?>
+}
index 19e67abe170d272275f0e69e8a051dde9de9a778..c7ff58ebbb22a4ec0331ac1af2f33f9d9a5cdb5d 100644 (file)
@@ -3,7 +3,7 @@
 namespace Hub\Stream\Output\RawData;
 
 // Import application-specific stuff
-use Hub\Handler\RawData\BaseRawDataHandler;
+use Hub\Handler\Network\RawData\BaseRawDataHandler;
 
 /**
  * A RawDataOutputStream class
index 5d212353eca8e1df85bec8ba80b66af6d50f7b44..c510f7321ad349ad5bd3c5b7c2f333901051f23f 100644 (file)
@@ -1,4 +1,10 @@
 <?php
+// Own namespace
+namespace Hub\Node\Announcement;
+
+// Import framework stuff
+use CoreFramework\Generic\FrameworkException;
+
 /**
  * This exception is thrown when an announcement from other nodes was received
  * but this node doesn't accept announcements.
index 5a3e6c1af4800c49fb18c79705a737f364dfca69..721d9e9b203b89de5a9e8196ddf1ed09c603ad9f 100644 (file)
@@ -1,4 +1,10 @@
 <?php
+// Own namespace
+namespace Hub\Node\Announcement;
+
+// Import framework stuff
+use CoreFramework\Generic\FrameworkException;
+
 /**
  * This exception is thrown when an announcement from other nodes was received
  * but this node doesn't accept announcements.
index e27705d99a99fffc9ec88c1423fe413a0fa5f78d..a40854056813f4750d5c690a82510acb2a369c48 100644 (file)
@@ -1,4 +1,10 @@
 <?php
+// Own namespace
+namespace Hub\Connection;
+
+// Import framework stuff
+use CoreFramework\Generic\FrameworkException;
+
 /**
  * This exception is thrown when an invalid connection type is being detected
  *
index 7f44a8fb9db4a6e8bf452d66ffdc0ef58c3a2641..5e2e6dd2c9bfce4c1ca5966f7c0f7894a13d9622 100644 (file)
@@ -1,10 +1,13 @@
 <?php
 // Own namespace
-namespace Hub\Node\Bootstrap;
+namespace Hub\Dht\Bootstrap;
 
 // Import application-specific stuff
 use Hub\Factory\Node\NodeObjectFactory;
 
+// Import framework stuff
+use CoreFramework\Generic\FrameworkException;
+
 /**
  * This exception is thrown when a DHT bootstrap request from other nodes was
  * received but this node doesn't accept such requests.
index a52852f8c03ccdc8518fb8b072121042fadcc72e..f977c1c2333b414dad85de98dae730a56ee5b42b 100644 (file)
@@ -1,4 +1,10 @@
 <?php
+// Own namespace
+namespace Hub\Dht;
+
+// Import framework stuff
+use CoreFramework\Generic\FrameworkException;
+
 /**
  * This exception is thrown when an DHT bootstrap answer comes but this node
  * didn't send out such request.
index b5bb886926b83b97517c294e339fe55f76ccc51d..7f0c63481f81ae9bd6a8340a988c41c7022213e9 100644 (file)
@@ -45,7 +45,5 @@ class FactoryRequiredParameterException extends FrameworkException {
                // Call parent exception constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index af68f6bd4b4d91e1a668e4c401514722384542f5..d77a2f2df53232a98fc33d98abc3d5c7c0ca60d7 100644 (file)
@@ -1,4 +1,10 @@
 <?php
+// Own namespace
+namespace Hub\Node\Data;
+
+// Import framework stuff
+use CoreFramework\Generic\FrameworkException;
+
 /**
  * This exception is thrown when a hash is invalid
  *
@@ -38,7 +44,5 @@ class InvalidSessionIdException extends FrameworkException {
                // Call parent exception constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index c3247cb3d154e034254dae9b034b591baba16fb3..baa53ff3471a068f09a8a43dece9f4d21b2569f2 100644 (file)
@@ -41,7 +41,5 @@ class InvalidListHashException extends FrameworkException {
                // Call parent exception constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index 62a61f73680a30938680f36630798d606b03c6dc..c8bddc4044f268d941fb5908d9a79543676d5a06 100644 (file)
@@ -40,7 +40,5 @@ class ListGroupAlreadyAddedException extends FrameworkException {
                // Call parent exception constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index c18eb72cf4a2cf4d43a6b648904339f41701e9d8..10ba8e10273e85476509ea887bd6174e7e1d48c9 100644 (file)
@@ -40,7 +40,5 @@ class NoListGroupException extends FrameworkException {
                // Call parent exception constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index e65b5c9cab40c229a1e836965f8a00c544d8e51f..7812bfd8d0d57657a1ff881ff6e93ecea38b6842 100644 (file)
@@ -1,4 +1,10 @@
 <?php
+// Own namespace
+namespace Hub\Node\Announcement;
+
+// Import framework stuff
+use CoreFramework\Generic\FrameworkException;
+
 /**
  * This exception is thrown when *this* (local) node has already been announced.
  *
index 67861f789b082404db4f3c84cee2da6d8a6cf449..1243c54aaf3f0d79bc5655a0cbddf81d58e7c3e7 100644 (file)
@@ -1,4 +1,10 @@
 <?php
+// Own namespace
+namespace Hub\Node\Verification;
+
+// Import framework stuff
+use CoreFramework\Generic\FrameworkException;
+
 /**
  * This exception is thrown when a provided session id in a message cannot be
  * verified. This can be the case when e.g. it doesn't match any records or the
index e01bf850fc521c2f0d6443bd77454825b85e4ef9..4392798aca5c18821016ee454c569fcf9fd95217 100644 (file)
@@ -1,4 +1,10 @@
 <?php
+// Own namespace
+namespace Hub\Node\Network\Chunk;
+
+// Import framework stuff
+use CoreFramework\Generic\FrameworkException;
+
 /**
  * This exception is thrown when the final (last) chunks does not contain the
  * "End-Of-Package-Identifier".
@@ -44,7 +50,5 @@ class FinalChunkVerificationException extends FrameworkException {
                // Call parent exception constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index b0b691b63dde0f779777197f54a591d95a76122c..4eab57e8fa2df76b8d89e71032696d337dd577ff 100644 (file)
@@ -5,6 +5,9 @@ namespace Hub\RawData;
 // Import application-specific stuff
 use Hub\Network\Package\NetworkPackage;
 
+// Import framework stuff
+use CoreFramework\Generic\FrameworkException;
+
 /**
  * This exception is thrown when the checksum (sometimes called "hash") of the
  * package data (aka "message" emcoded with BASE64) is not valid.
@@ -48,7 +51,5 @@ class InvalidDataChecksumException extends FrameworkException {
                // Call parent exception constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index 5a51d828b2566276ab4b272d1675d7aafefcfa5d..6a3abca8ad2ec2bcee62d10367f0f283da275f03 100644 (file)
@@ -1,4 +1,10 @@
 <?php
+// Own namespace
+namespace Hub\Node\Generic;
+
+// Import framework stuff
+use CoreFramework\Generic\FrameworkException;
+
 /**
  * This exception is thrown when a private key's hash is invalid (e.g. empty).
  *
@@ -41,7 +47,5 @@ class InvalidPrivateKeyHashException extends FrameworkException {
                // Call parent exception constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index d63d92e8f69372c8a641b59a3234077b4ab8dca9..f5f7eeba6c347dac3c03bb0e6016e358abb1809b 100644 (file)
@@ -5,6 +5,9 @@ namespace Hub\Status\Package;
 // Import application-specific stuff
 use Hub\Network\Package\NetworkPackage;
 
+// Import framework stuff
+use CoreFramework\Generic\FrameworkException;
+
 /**
  * This exception is thrown when an unexpected package status was detected.
  *
@@ -50,7 +53,5 @@ class UnexpectedPackageStatusException extends FrameworkException {
                // Call parent exception constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index 03008573edbc15b8b15c78ffdb428d3e3ac387b7..93ce11b9bace4a82bc39ee13c391666040cface0 100644 (file)
@@ -3,7 +3,10 @@
 namespace Hub\Handler\Network\PackageCode;
 
 // Import application-specific stuff
-use Hub\Handler\RawData\BaseRawDataHandler;
+use Hub\Handler\Network\RawData\BaseRawDataHandler;
+
+// Import framework stuff
+use CoreFramework\Generic\FrameworkException;
 
 /**
  * This exception is thrown when an unexpected package status was detected.
@@ -47,7 +50,5 @@ class UnsupportedPackageCodeHandlerException extends FrameworkException {
                // Call parent exception constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index 61c5c62e0996113f1469f12ec97e8b93dbb2e9d4..47ce2e0ced1593e5a64fdfc61a774e128add1f14 100644 (file)
@@ -5,6 +5,9 @@ namespace Hub\Peer;
 // Import application-specific stuff
 use Hub\Network\Package\NetworkPackage;
 
+// Import framework stuff
+use CoreFramework\Generic\FrameworkException;
+
 /**
  * This exception is thrown when a peer is already registered
  *
index 197a507da2d750d8a597022b3035159291594d62..13723c56d04911acafad463974ce2e493b4d423f 100644 (file)
@@ -1,4 +1,10 @@
 <?php
+// Own namespace
+namespace Hub\Node\Messaging;
+
+// Import framework stuff
+use CoreFramework\Generic\FrameworkException;
+
 /**
  * This exception is thrown when 
  *
index 24ca1d75d3aaafc9a2f09921a9f4b8cb262abb5f..f1d1626afb074433f2b3758af83ebf2b40068379 100644 (file)
@@ -1,4 +1,10 @@
 <?php
+// Own namespace
+namespace Hub\Node\Messaging;
+
+// Import framework stuff
+use CoreFramework\Generic\FrameworkException;
+
 /**
  * This exception is thrown when an incoming request (e.g. node-list has been
  * requested) is not accepted by this node. This may happen when such
@@ -43,7 +49,5 @@ class RequestNotAcceptedException extends FrameworkException {
                // Call parent exception constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index c4252e5f030349e3877589376fb9b46db4ed1323..24a5ea7d8759a451ea40f5cf3ae2e76e1f7f0da3 100644 (file)
@@ -39,7 +39,5 @@ class NoValidHostnameException extends FrameworkException {
                // Call parent exception constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index c42b4c3243c2972070c8cb1d58eeea9d6a86eca8..f6ff77d76f0b6caf6e440b2fb4aa7fa78ec9a490 100644 (file)
@@ -1,4 +1,10 @@
 <?php
+// Own namespace
+namespace Hub\Network\Message;
+
+// Import framework stuff
+use CoreFramework\Generic\FrameworkException;
+
 /**
  * This exception is thrown when multiple messages are found in in-buffer.
  *
@@ -39,7 +45,5 @@ class MultipleMessageSentException extends FrameworkException {
                // Call parent exception constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index 719972a0e72e9582841166e5a23026572ac3e348..24077c6501ced7820c28a3c7a59d44120a4d58c7 100644 (file)
@@ -1,4 +1,10 @@
 <?php
+// Own namespace
+namespace Hub\Node\Tagging;
+
+// Import framework stuff
+use CoreFramework\Generic\FrameworkException;
+
 /**
  * This exception is thrown when a tag is invalid
  *
@@ -40,7 +46,5 @@ class InvalidTagException extends FrameworkException {
                // Call parent exception constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index d43d69d65e49a1ce37ee4b665db0352614daee7a..f2b57e650515d8511e2cca4cfebba81908e8f8b3 100644 (file)
@@ -39,7 +39,5 @@ class InvalidTaskException extends FrameworkException {
                // Call parent exception constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index fa43107c90f8a9e475fad25b22a6fcdac007739a..5187bf5c52fc3c6a534d887142a478a067d62741 100644 (file)
@@ -5,6 +5,9 @@ namespace Hub\Unl;
 // Import application-specific stuff
 use Hub\Network\Package\NetworkPackage;
 
+// Import framework stuff
+use CoreFramework\Generic\FrameworkException;
+
 /**
  * This exception is thrown when a protocol handler cannot validate given package data's recipient (UNL).
  *
@@ -47,7 +50,5 @@ class InvalidUnlException extends FrameworkException {
                // Call parent exception constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index d86dac21e7cc832af6e42d28deca8626292e3f25..6d7baf54b37fcd7e4c459ec4b4e38be78082ccdd 100644 (file)
@@ -1,4 +1,10 @@
 <?php
+// Own namespace
+namespace Hub\Node\Registering;
+
+// Import framework stuff
+use CoreFramework\Generic\FrameworkException;
+
 /**
  * This exception is thrown when a node is already registered and registerNode() has been called again
  *
index cc9166871806940fce7fab0799b7ef861034f915..4e6b8041e087db06673fd1467fc86182296e2b12 100644 (file)
@@ -1,4 +1,10 @@
 <?php
+// Own namespace
+namespace Hub\Node\Data;
+
+// Import framework stuff
+use CoreFramework\Generic\FrameworkException;
+
 /**
  * This exception is thrown when a node is not yet registered and updateNode() has been called
  *
index 815acb5d9eb86e6d366b3b978307c47544b6c371..09687e8f20997d26f4c7f619fb7f8465c2addbce 100644 (file)
@@ -201,4 +201,12 @@ interface StorableSocket extends FrameworkInterface {
         */
        function doShutdown ();
 
+       /**
+        * Checks whether the given connection type is valid
+        *
+        * @param       $connectionType         Type of connection, can be 'incoming', 'outgoing' or 'server'
+        * @return      $isValid                        Whether the provided connection type is valid
+        */
+       function isValidConnectionType ($connectionType);
+
 }
index 18f256d6c5cd656bae02d09c4b3e8d37dcbd0cf6..1d0a90a09475881353808c14be2d3ecad44ae12a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 // Own namespace
-namespace Hub\Handler\RawData\Chunks;
+namespace Hub\Handler\Network\RawData\Chunks;
 
 // Import framework stuff
 use CoreFramework\Handler\Handleable;