]> git.mxchange.org Git - hub.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Mon, 22 May 2017 20:47:55 +0000 (22:47 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 21 Aug 2020 16:50:08 +0000 (18:50 +0200)
- imported PackageDiscoveryFactory, BaseRecipientDiscovery, DiscoverableRecipient
- imported DiscoverableNodeRecipient, RecipientListFactory, (Base)Recipient
- imported ObjectFactory (opps?)
- imported InvalidSessionIdException (also where it is being caught!)
- imported FrameworkException
- imported BaseIterator
- recipients and not receipt! ;-)
- also they are network-relevant and not generic
- added namespaces to configuration entries

Signed-off-by: Roland Häder <roland@mxchange.org>
27 files changed:
application/hub/classes/decoder/package/class_PackageDecoder.php
application/hub/classes/discovery/recipient/class_
application/hub/classes/discovery/recipient/class_BaseRecipientDiscovery.php
application/hub/classes/discovery/recipient/dht/class_DhtRecipientDiscovery.php
application/hub/classes/discovery/recipient/package/class_PackageRecipientDiscovery.php
application/hub/classes/discovery/recipient/socket/class_PackageSocketDiscovery.php
application/hub/classes/iterator/pool/tasks/class_TaskPoolIterator.php
application/hub/classes/package/class_NetworkPackage.php
application/hub/classes/pools/listener/class_DefaultListenerPool.php
application/hub/classes/recipient/class_
application/hub/classes/recipient/class_BaseRecipient.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/tools/class_HubTools.php
application/hub/config.php
application/hub/exceptions/factory/class_FactoryRequiredParameterException.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/resolver/class_NoValidHostnameException.php
application/hub/exceptions/tasks/class_InvalidTaskException.php
application/hub/interfaces/discovery/recipient/dht/class_DiscoverableDhtRecipient.php
application/hub/interfaces/discovery/recipient/node/class_DiscoverableNodeRecipient.php
application/hub/interfaces/discovery/recipient/socket/class_DiscoverableSocket.php
application/hub/interfaces/recipient/class_Recipient.php

index a5b689e66b68d26e8b85631bfcd71e1c6b495e41..5cce8c2a89111b36a096a8c2864a25055e242166 100644 (file)
@@ -5,6 +5,7 @@ namespace Hub\Network\Decoder\Package;
 // Import application-specific stuff
 use Hub\Decoder\BaseDecoder;
 use Hub\Decoder\Decodeable;
+use Hub\Factory\Discovery\Package\PackageDiscoveryFactory;
 use Hub\Factory\Network\NetworkPackageFactory;
 use Hub\Handler\Network\RawData\Chunks\ChunkHandler;
 use Hub\Handler\Network\RawData\Chunks\HandleableChunks;
index 6a792f53fea6bd70acf6dbb4285e5144cca81ad9..c4d93590053a072ecbcba329d768056e75b64aad 100644 (file)
@@ -1,4 +1,10 @@
 <?php
+// Own namespace
+namespace Hub\Discovery\Recipient\;
+
+// Import framework-specific stuff
+use Hub\Discovery\Recipient\BaseRecipientDiscovery;
+
 /**
  * A !!! recipient discovery class
  *
@@ -44,7 +50,5 @@ class !!!RecipientDiscovery extends BaseRecipientDiscovery implements Discoverab
                // Return the prepared instance
                return $discoveryInstance;
        }
-}
 
-// [EOF]
-?>
+}
index cc9ff9c0c6579828819adabc9f7a38ad4b65866c..462ffc902cc4a5089aee9bd9c82733aa500032bb 100644 (file)
@@ -4,6 +4,8 @@ namespace Hub\Discovery\Recipient;
 
 // Import framework-specific stuff
 use Hub\Discovery\Node\BaseNodeDiscovery;
+use Hub\Discovery\Recipient\DiscoverableRecipient;
+use Hub\Factory\Lists\Recipient\RecipientListFactory;
 
 /**
  * A PackageRecipient discovery class
index ac3d5f7b89c006dc9d1ec37fd72279efad677bc8..ac24c3830190dd113479e684de224f06aa876188 100644 (file)
@@ -1,8 +1,9 @@
 <?php
 // Own namespace
-namespace Hub\Discovery\Dht\Recipient;
+namespace Hub\Discovery\Recipient\Dht;
 
 // Import application-specific stuff
+use Hub\Discovery\Recipient\BaseRecipientDiscovery;
 use Hub\Factory\Dht\DhtObjectFactory;
 
 // Import framework stuff
index 54b1983e63448615798d77017fd4d1fb5ed1e515..918a1e4f05ae94504ea70cd070c77d1fdd0f3f5b 100644 (file)
@@ -3,10 +3,15 @@
 namespace Hub\Discovery\Network\Recipient;
 
 // Import hub-specific sutff
+use Hub\Discovery\Recipient\BaseRecipientDiscovery;
+use Hub\Discovery\Recipient\Node\DiscoverableNodeRecipient;
 use Hub\Network\Package\NetworkPackage;
+use Hub\Node\Data\InvalidSessionIdException;
 use Hub\Tools\HubTools;
 
 // Import framework stuff
+use CoreFramework\Factory\ObjectFactory;
+use CoreFramework\Generic\FrameworkException;
 use CoreFramework\Registry\Registerable;
 
 /**
@@ -73,7 +78,7 @@ class PackageRecipientDiscovery extends BaseRecipientDiscovery implements Discov
 
                        // Try to solve it
                        $recipientInstance->resolveRecipient($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT], $this->getListInstance(), $packageData);
-               } catch (FrameworkException $e) {
+               } catch (InvalidSessionIdException $e) {
                        // Didn't work, so try the non-generic, depending recipient field itself (this may fail)
                        try {
                                // Try to find the right class
index 371a3862a1c734ed440d730c130ea7121897eab6..177c8d82141214a755d4097d326f56835fe3330a 100644 (file)
@@ -4,6 +4,7 @@ namespace Hub\Network\Discovery\Socket;
 
 // Import hub-specific stuff
 use Hub\Container\Socket\StorableSocket;
+use Hub\Discovery\Recipient\BaseRecipientDiscovery;
 use Hub\Factory\Node\NodeObjectFactory;
 use Hub\Factory\Socket\SocketFactory;
 use Hub\Generic\BaseHubSystem;
index 5084d71dbbaa926e8d1c2796503c509c0cc28d4a..fbcdc84f93f8258593a1ca9160813b14dc3201aa 100644 (file)
@@ -3,6 +3,7 @@
 namespace Hub\Iterator\Pool\Task;
 
 // Import framework stuff
+use CoreFramework\Iterator\BaseIterator;
 use CoreFramework\Lists\Listable;
 use CoreFramework\Registry\Registerable;
 
index 83820a27910287a972cd089881061d0e07c9f6f2..8c33927cb37faa7b40ef873bdaddc4d1d114cd04 100644 (file)
@@ -7,6 +7,7 @@ use Hub\Container\Socket\StorableSocket;
 use Hub\Database\Frontend\Node\Dht\NodeDistributedHashTableDatabaseWrapper;
 use Hub\Factory\Assembler\Package\PackageAssemblerFactory;
 use Hub\Factory\Dht\DhtObjectFactory;
+use Hub\Factory\Discovery\Package\PackageDiscoveryFactory;
 use Hub\Factory\Information\Connection\ConnectionInfoFactory;
 use Hub\Factory\Node\NodeObjectFactory;
 use Hub\Generic\BaseHubSystem;
index a44658925c31c1093edd2bab56214c74bd8c1cb7..268acd06f9a3df5c6e6f5224202c7260936e55a1 100644 (file)
@@ -9,7 +9,6 @@ use Hub\Pool\BasePool;
 use Hub\Pool\Listener\PoolableListener;
 
 // Import framework stuff
-use CoreFramework\Factory\ObjectFactory;
 
 /**
  * A default listener pool
index 605e663dc50b438a88b8ca74ac0c4cce09f0cddc..82893fec5cd37065dd568a4381cb0ee4069da4d5 100644 (file)
@@ -1,6 +1,9 @@
 <?php
 // Own namespace
-namespace Hub\Recipient\;
+namespace Hub\Network\Recipient\;
+
+// Import application-specific stuff
+use Hub\Network\Recipient\BaseRecipient;
 
 // Import framework stuff
 use CoreFramework\Lists\Listable;
@@ -67,7 +70,5 @@ class ???Recipient extends BaseRecipient implements Recipient {
                assert($recipient == '|||');
                $this->partialStub('Please implement this method. recipient=' . $recipient);
        }
-}
 
-// [EOF]
-?>
+}
index e0d9f87e801527a027b84da583ffd67d654b4f38..5340d0e6a0b01b10d8e072b4336335d3ecade6df 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 // Own namespace
-namespace Hub\Receipt;
+namespace Hub\Network\Recipient;
 
 // Import hub-specific stuff
 use Hub\Generic\BaseHubSystem;
@@ -38,7 +38,5 @@ class BaseRecipient extends BaseHubSystem {
                // Call parent constructor
                parent::__construct($className);
        }
-}
 
-// [EOF]
-?>
+}
index 2e3e2a78dd6a100962ee1c12644da11044e5cba9..8d7742ee1bcb6894b537575c8dec44772628edf5 100644 (file)
@@ -1,10 +1,12 @@
 <?php
 // Own namespace
-namespace Hub\Recipient\Dht;
+namespace Hub\Network\Recipient\Dht;
 
 // Import application-specific stuff
 use Hub\Database\Frontend\Node\Dht\NodeDistributedHashTableDatabaseWrapper;
 use Hub\Network\Package\NetworkPackage;
+use Hub\Network\Recipient\BaseRecipient;
+use Hub\Network\Recipient\Recipient;
 
 // Import framework stuff
 use CoreFramework\Factory\ObjectFactory;
index 69c53ed4dcb586b5a12bb08343f4e63a5935164e..97155687fde69ea1e3400e40bd341dba81d200f3 100644 (file)
@@ -4,6 +4,8 @@ namespace Hub\Network\Recipient\Direct;
 
 // Import hub-specific sutff
 use Hub\Network\Package\NetworkPackage;
+use Hub\Network\Recipient\BaseRecipient;
+use Hub\Network\Recipient\Recipient;
 use Hub\Tools\HubTools;
 
 // Import framework stuff
index 5202ff1c1554e2c7a0a28885c3a1bd993a74ed2d..25e2406196a754a85b7662906d1f7a9a362a0e04 100644 (file)
@@ -1,9 +1,11 @@
 <?php
 // Own namespace
-namespace Hub\Network\Recipient\Self;
+namespace Hub\Network\Recipient\Loopback;
 
 // Import hub-specific sutff
 use Hub\Network\Package\NetworkPackage;
+use Hub\Network\Recipient\BaseRecipient;
+use Hub\Network\Recipient\Recipient;
 use Hub\Tools\HubTools;
 
 // Import framework stuff
index 77b717c2cccb9e0e488acda135fcd79552d76166..3cdc3f4460e900ed045ef0bb1a91db7d1a90e2e6 100644 (file)
@@ -1,10 +1,12 @@
 <?php
 // Own namespace
-namespace Hub\Network\Receipt\Upper;
+namespace Hub\Network\Recipient\Upper;
 
 // Import hub-specific stuff
 use Hub\Generic\BaseHubSystem;
 use Hub\Network\Package\NetworkPackage;
+use Hub\Network\Recipient\BaseRecipient;
+use Hub\Network\Recipient\Recipient;
 
 // Import framework stuff
 use CoreFramework\Lists\Listable;
index bbac6089573f30cd32c0d3d95c53f2fa893b1f5a..011ee327188db9e5523dd5c97ecb9f34b3bbd1da 100644 (file)
@@ -8,6 +8,7 @@ use Hub\Factory\Dht\DhtObjectFactory;
 use Hub\Factory\Node\NodeObjectFactory;
 use Hub\Generic\BaseHubSystem;
 use Hub\Locator\Node\LocateableNode;
+use Hub\Node\Data\InvalidSessionIdException;
 
 // Import framework stuff
 use CoreFramework\Configuration\FrameworkConfiguration;
index 60a10358894e9f186e66fd6e4f18f5f6afa68066..466580767190df8ff2a88686a19d1f799b4b04b2 100644 (file)
@@ -685,7 +685,7 @@ $cfg->setConfigEntry('task_dht_publication_interval_delay', 5000);
 $cfg->setConfigEntry('task_dht_publication_max_runs', 0);
 
 // CFG: TASK-POOL-ITERATOR-CLASS
-$cfg->setConfigEntry('task_pool_iterator_class', 'TaskPoolIterator');
+$cfg->setConfigEntry('task_pool_iterator_class', 'Hub\Iterator\Pool\Task\TaskPoolIterator');
 
 // CFG: MONITOR-POOL-ITERATOR-CLASS
 $cfg->setConfigEntry('monitor_pool_iterator_class', 'Hub\Iterator\Pool\Monitor\MonitorPoolIterator');
@@ -718,13 +718,13 @@ $cfg->setConfigEntry('socket_container_class', 'Hub\Container\Socket\SocketConta
 $cfg->setConfigEntry('ipc_socket_file_name', 'php_hub_ipc_socket');
 
 // CFG: PACKAGE-RECIPIENT-DISCOVERY-CLASS
-$cfg->setConfigEntry('package_recipient_discovery_class', 'PackageRecipientDiscovery');
+$cfg->setConfigEntry('package_recipient_discovery_class', 'Hub\Discovery\Network\Recipient\PackageRecipientDiscovery');
 
 // CFG: SOCKET-DISCOVERY-CLASS
 $cfg->setConfigEntry('socket_discovery_class', 'PackageSocketDiscovery');
 
 // CFG: DHT-RECIPIENT-DISCOVERY-CLASS
-$cfg->setConfigEntry('dht_recipient_discovery_class', 'DhtRecipientDiscovery');
+$cfg->setConfigEntry('dht_recipient_discovery_class', 'Hub\Discovery\Recipient\Dht\DhtRecipientDiscovery');
 
 // CFG: UNL-DISCOVERY-CLASS
 $cfg->setConfigEntry('unl_discovery_class', 'Hub\Discovery\Locator\UniversalNodeLocatorDiscovery');
@@ -736,7 +736,7 @@ $cfg->setConfigEntry('tcp_protocol_handler_class', 'TcpProtocolHandler');
 $cfg->setConfigEntry('universal_node_locator_class', 'Hub\Locator\Node\UniversalNodeLocator');
 
 // CFG: RECIPIENT-LIST-CLASS
-$cfg->setConfigEntry('recipient_list_class', 'RecipientList');
+$cfg->setConfigEntry('recipient_list_class', 'Hub\Lists\Recipient\RecipientList');
 
 // CFG: PACKAGE-TAGS-CLASS
 $cfg->setConfigEntry('package_tags_class', 'Hub\Tag\Package\PackageTags');
@@ -923,16 +923,16 @@ $cfg->setConfigEntry('request_node_list_answer_status_okay_handler_class', 'Requ
 ///////////////////////////////////////////////////////////////////////////////
 
 // CFG: DIRECT-RECIPIENT-CLASS
-$cfg->setConfigEntry('direct_recipient_class', 'DirectRecipient');
+$cfg->setConfigEntry('direct_recipient_class', 'Hub\Network\Recipient\Direct\DirectRecipient');
 
 // CFG: DHT-RECIPIENT-CLASS
-$cfg->setConfigEntry('dht_recipient_class', 'DhtRecipient');
+$cfg->setConfigEntry('dht_recipient_class', 'Hub\Network\Recipient\Dht\DhtRecipient');
 
 // CFG: SELF-RECIPIENT-CLASS
-$cfg->setConfigEntry('self_recipient_class', 'SelfRecipient');
+$cfg->setConfigEntry('self_recipient_class', 'Hub\Network\Recipient\Loopback\SelfRecipient');
 
 // CFG: UPPER-RECIPIENT-CLASS
-$cfg->setConfigEntry('upper_recipient_class', 'UpperRecipient');
+$cfg->setConfigEntry('upper_recipient_class', 'Hub\Network\Recipient\Upper\UpperRecipient');
 
 ///////////////////////////////////////////////////////////////////////////////
 //                         Miner configuration
index 7f0c63481f81ae9bd6a8340a988c41c7022213e9..4a119796e4fb8b4573c5f44c139f6d2827564591 100644 (file)
@@ -4,6 +4,7 @@ namespace Hub\Factory\Parameter;
 
 // Import framework stuff
 use CoreFramework\Factory\ObjectFactory;
+use CoreFramework\Generic\FrameworkException;
 
 /**
  * This exception is thrown if not all required parameter are given.
@@ -13,6 +14,7 @@ use CoreFramework\Factory\ObjectFactory;
  * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
+ * @todo               this is generic
  *
  * 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
index baa53ff3471a068f09a8a43dece9f4d21b2569f2..6f965ac794a20cfb407d0ef0c0dcc8fb7e04e1f5 100644 (file)
@@ -7,6 +7,7 @@
  * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
+ * @todo               this is generic
  *
  * 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
index c8bddc4044f268d941fb5908d9a79543676d5a06..f5b16ffc762f5b487e48b47b3d4fa25975feea90 100644 (file)
@@ -7,6 +7,7 @@
  * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
+ * @todo               this is generic
  *
  * 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
index 10ba8e10273e85476509ea887bd6174e7e1d48c9..7fe024b57d8e3429833010226d632bf754ae24f2 100644 (file)
@@ -7,6 +7,7 @@
  * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
+ * @todo               this is generic
  *
  * 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
index 24a5ea7d8759a451ea40f5cf3ae2e76e1f7f0da3..485b25c724c183136915181ab460e21ad18223c8 100644 (file)
@@ -7,6 +7,7 @@
  * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
+ * @todo               this is generic
  *
  * 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
index f2b57e650515d8511e2cca4cfebba81908e8f8b3..998fddf001d08b5132a651673a1849cd51bfdeb3 100644 (file)
@@ -1,4 +1,10 @@
 <?php
+// Own namespace
+namespace CoreFramework\Task;
+
+// Import framework stuff
+use CoreFramework\Generic\FrameworkException;
+
 /**
  * This exception is thrown when a task is invalid
  *
@@ -7,6 +13,7 @@
  * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
+ * @todo               this is generic
  *
  * 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
index fa42a27e07d20c4ede04d92ffa9c9e4b20c4b68e..e98d846a6db2aadc8f9a2206397380ba3995182f 100644 (file)
@@ -1,4 +1,10 @@
 <?php
+// Own namespace
+namespace Hub\Discovery\Recipient\Dht;
+
+// Import application-specific stuff
+use Hub\Discovery\Recipient\DiscoverableRecipient;
+
 /**
  * An interface for DHT recipient discovery
  *
@@ -29,7 +35,5 @@ interface DiscoverableDhtRecipient extends DiscoverableRecipient {
         * @return      $recipients             An indexed array with DHT recipients
         */
        function resolveRecipientsByPackageData (array $packageData);
-}
 
-// [EOF]
-?>
+}
index 6633089c8bf8663b93c8b237d3ecf65fd97de4e2..f3f800909b167a5e923d1a5618cc286be1d6fe51 100644 (file)
@@ -1,4 +1,10 @@
 <?php
+// Own namespace
+namespace Hub\Discovery\Recipient\Node;
+
+// Import application-specific stuff
+use Hub\Discovery\Recipient\DiscoverableRecipient;
+
 /**
  * An interface for node recipient discovery
  *
@@ -37,7 +43,5 @@ interface DiscoverableNodeRecipient extends DiscoverableRecipient {
         * @return      void
         */
        function discoverRawRecipients (array $decodedData);
-}
 
-// [EOF]
-?>
+}
index 95dd2de72e83b0291534e268547f5a952f4e1616..fda8684b8bc5bd9129a3486bbb690b13074ede93 100644 (file)
@@ -3,6 +3,7 @@
 namespace Hub\Discovery\Socket;
 
 // Import application-specific stuff
+use Hub\Discovery\Recipient\DiscoverableRecipient;
 use Hub\Handler\Protocol\HandleableProtocol;
 
 /**
index 9c36529fb51f4f22f60913265d77dfc6bc062129..1e170d22b3299cdab1fe13b2e9cc5f332c298b0a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 // Own namespace
-namespace Hub\Recipient;
+namespace Hub\Network\Recipient;
 
 // Import application-specific stuff
 use Hub\Generic\HubInterface;