- 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>
// 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;
<?php
+// Own namespace
+namespace Hub\Discovery\Recipient\;
+
+// Import framework-specific stuff
+use Hub\Discovery\Recipient\BaseRecipientDiscovery;
+
/**
* A !!! recipient discovery class
*
// Return the prepared instance
return $discoveryInstance;
}
-}
-// [EOF]
-?>
+}
// Import framework-specific stuff
use Hub\Discovery\Node\BaseNodeDiscovery;
+use Hub\Discovery\Recipient\DiscoverableRecipient;
+use Hub\Factory\Lists\Recipient\RecipientListFactory;
/**
* A PackageRecipient discovery class
<?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
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;
/**
// 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
// 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;
namespace Hub\Iterator\Pool\Task;
// Import framework stuff
+use CoreFramework\Iterator\BaseIterator;
use CoreFramework\Lists\Listable;
use CoreFramework\Registry\Registerable;
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;
use Hub\Pool\Listener\PoolableListener;
// Import framework stuff
-use CoreFramework\Factory\ObjectFactory;
/**
* A default listener pool
<?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;
assert($recipient == '|||');
$this->partialStub('Please implement this method. recipient=' . $recipient);
}
-}
-// [EOF]
-?>
+}
<?php
// Own namespace
-namespace Hub\Receipt;
+namespace Hub\Network\Recipient;
// Import hub-specific stuff
use Hub\Generic\BaseHubSystem;
// Call parent constructor
parent::__construct($className);
}
-}
-// [EOF]
-?>
+}
<?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;
// 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
<?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
<?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;
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;
$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');
$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');
$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');
///////////////////////////////////////////////////////////////////////////////
// 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
// Import framework stuff
use CoreFramework\Factory\ObjectFactory;
+use CoreFramework\Generic\FrameworkException;
/**
* This exception is thrown if not all required parameter are given.
* @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
* @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
* @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
* @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
* @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
<?php
+// Own namespace
+namespace CoreFramework\Task;
+
+// Import framework stuff
+use CoreFramework\Generic\FrameworkException;
+
/**
* This exception is thrown when a task is invalid
*
* @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
<?php
+// Own namespace
+namespace Hub\Discovery\Recipient\Dht;
+
+// Import application-specific stuff
+use Hub\Discovery\Recipient\DiscoverableRecipient;
+
/**
* An interface for DHT recipient discovery
*
* @return $recipients An indexed array with DHT recipients
*/
function resolveRecipientsByPackageData (array $packageData);
-}
-// [EOF]
-?>
+}
<?php
+// Own namespace
+namespace Hub\Discovery\Recipient\Node;
+
+// Import application-specific stuff
+use Hub\Discovery\Recipient\DiscoverableRecipient;
+
/**
* An interface for node recipient discovery
*
* @return void
*/
function discoverRawRecipients (array $decodedData);
-}
-// [EOF]
-?>
+}
namespace Hub\Discovery\Socket;
// Import application-specific stuff
+use Hub\Discovery\Recipient\DiscoverableRecipient;
use Hub\Handler\Protocol\HandleableProtocol;
/**
<?php
// Own namespace
-namespace Hub\Recipient;
+namespace Hub\Network\Recipient;
// Import application-specific stuff
use Hub\Generic\HubInterface;