// Own namespace
namespace Hub\Command;
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
// Import framework stuff
use CoreFramework\Command\BaseCommand;
use CoreFramework\Command\Commandable;
use Hub\Generic\BaseHubSystem;
// Import framework stuff
+use CoreFramework\Factory\ObjectFactory;
use CoreFramework\Object\BaseFrameworkSystem;
/**
<?php
+// Own namespace
+namespace Hub\Database\Frontend\Node\Dht;
+
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
/**
* A database wrapper for distributed hash tables
*
// Import hub-specific stuff
use Hub\Generic\BaseHubSystem;
+// Import framework stuff
+use CoreFramework\Factory\ObjectFactory;
+
/**
* A general DHT class
*
<?php
+// Own namespace
+namespace Hub\Discovery\Dht\Recipient;
+
+// Import application-specific stuff
+use Hub\Factory\Dht\DhtObjectFactory;
+
/**
* A DhtRecipient discovery class
*
namespace Hub\Network\Discovery\Socket;
// Import hub-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
use Hub\Generic\BaseHubSystem;
/**
<?php
+// Own namespace
+namespace Hub\Factory\;
+
+// Import framework stuff
+use CoreFramework\Factory\ObjectFactory;
+
/**
* A factory class for !!!
*
<?php
+// Own namespace
+namespace Hub\Factory\Dht;
+
+// Import framework stuff
+use CoreFramework\Factory\ObjectFactory;
+
/**
* A factory class for DHT objects
*
<?php
+// Own namespace
+namespace Hub\Factory\State\Node;
+
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
/**
* A factory class for node states
*
// Own namespace
namespace Hub\Filter\Activation\Node\;
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
// Import framework stuff
use CoreFramework\Request\Requestable;
use CoreFramework\Response\Responseable;
// Own namespace
namespace Hub\Filter\Bootstrap\Node\;
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
// Import framework stuff
use CoreFramework\Request\Requestable;
use CoreFramework\Response\Responseable;
// Own namespace
namespace Hub\Filter\Bootstrap\Node\Extra;
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
// Import framework stuff
use CoreFramework\Request\Requestable;
use CoreFramework\Response\Responseable;
// Own namespace
namespace Hub\Filter\Bootstrap\Node\NodeId;
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
// Import framework stuff
use CoreFramework\Request\Requestable;
use CoreFramework\Response\Responseable;
// Own namespace
namespace Hub\Filter\Bootstrap\Node\PrivateKey;
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
// Import framework stuff
use CoreFramework\Request\Requestable;
use CoreFramework\Response\Responseable;
// Own namespace
namespace Hub\Filter\Bootstrap\Node;
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
// Import framework stuff
use CoreFramework\Request\Requestable;
use CoreFramework\Response\Responseable;
// Own namespace
namespace Hub\Filter\Bootstrap\Node\Pool;
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
// Import framework stuff
use CoreFramework\Request\Requestable;
use CoreFramework\Response\Responseable;
// Own namespace
namespace Hub\Filter\;
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
// Import framework stuff
use CoreFramework\Request\Requestable;
use CoreFramework\Response\Responseable;
// Own namespace
namespace Hub\Node\Filter\Initialization;
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
// Import framework stuff
use CoreFramework\Request\Requestable;
use CoreFramework\Response\Responseable;
// Own namespace
namespace Hub\Node\Filter\WelcomeTeaser;
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
// Import framework stuff
use CoreFramework\Request\Requestable;
use CoreFramework\Response\Responseable;
// Own namespace
namespace Hub\Filter\Shutdown\Node\;
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
// Import framework stuff
use CoreFramework\Request\Requestable;
use CoreFramework\Response\Responseable;
// Own namespace
namespace Hub\Filter\Shutdown\Node\NodeList;
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
// Import framework stuff
use CoreFramework\Request\Requestable;
use CoreFramework\Response\Responseable;
// Own namespace
namespace Hub\Filter\Shutdown\Node;
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
// Import framework stuff
use CoreFramework\Request\Requestable;
use CoreFramework\Response\Responseable;
// Own namespace
namespace Hub\Filter\Initializer\Node\Handler\Task;
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
// Import framework stuff
use CoreFramework\Request\Requestable;
use CoreFramework\Response\Responseable;
+++ /dev/null
-<?php
-/**
- * A AnnouncementAnswerOkay handler
- *
- * @author Roland Haeder <webmaster@shipsimu.org>
- * @version 0.0.0
- * @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
- *
- * 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 AnnouncementAnswerOkayHandler extends BaseAnserStatusHandler implements HandleableAnswerStatus, Registerable {
- /**
- * Protected constructor
- *
- * @return void
- */
- protected function __construct () {
- // Call parent constructor
- parent::__construct(__CLASS__);
-
- // Init array
- $this->searchData = array(
- XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID,
- XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_ADDRESS,
- );
-
- // Set handler name
- $this->setHandlerName('announcement_answer_okay');
- }
-
- /**
- * Creates an instance of this class
- *
- * @return $handlerInstance An instance of a HandleableMessage class
- */
- public final static function createAnnouncementAnswerOkayHandler () {
- // Get new instance
- $handlerInstance = new AnnouncementAnswerOkayHandler();
-
- // Return the prepared instance
- return $handlerInstance;
- }
-
- /**
- * Handles given message data array
- *
- * @param $messageData An array of message data
- * @param $packageInstance An instance of a Receivable class
- * @return void
- * @todo Do some more here: Handle karma, et cetera?
- */
- public function handleAnswerMessageData (array $messageData, Receivable $packageInstance) {
- /*
- * Query DHT and force update (which will throw an exception if the
- * node is not found).
- */
- $this->getDhtInstance()->registerNodeByMessageData($messageData, $this, TRUE);
-
- // Get handler instance
- $handlerInstance = Registry::getRegistry()->getInstance('task_handler');
-
- // Generate DHT bootstrap task
- $taskInstance = ObjectFactory::createObjectByConfiguredName('node_dht_late_bootstrap_task_class');
-
- // Register it as well
- $handlerInstance->registerTask('dht_late_bootstrap', $taskInstance);
-
- // Get the node instance
- $nodeInstance = NodeObjectFactory::createNodeInstance();
-
- // Change state
- $nodeInstance->getStateInstance()->nodeAnnouncementSuccessful();
-
- // Prepare next message
- $this->prepareNextMessage($messageData, $packageInstance);
- }
-
- /**
- * Initializes configuration data from given message data array
- *
- * The following array is being handled over:
- *
- * my-external-address => 1.2.3.4
- * my-internal-address => 5.6.7.8
- * my-status => reachable
- * my-node-id => aaabbbcccdddeeefff123456789
- * my-session-id => aaabbbcccdddeeefff123456789
- * my-tcp-port => 9060
- * my-udp-port => 9060
- * answer-status => OKAY
- * message_type => announcement_answer
- *
- * @param $messageData An array with all message data
- * @return void
- */
- protected function initMessageConfigurationData (array $messageData) {
- // Get node instance
- $nodeInstance = NodeObjectFactory::createNodeInstance();
-
- // Get an array of all accepted object types
- $objectList = $nodeInstance->getListFromAcceptedObjectTypes();
-
- // Add missing (temporary) configuration 'accepted_object_types'
- $this->getConfigInstance()->setConfigEntry(NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_ACCEPTED_OBJECTS, implode(BaseHubNode::OBJECT_LIST_SEPARATOR, $objectList));
- }
-
- /**
- * Removes configuration data with given message data array from global
- * configuration. For content of $messageData see method comment above.
- *
- * @param $messageData An array with all message data
- * @return void
- */
- protected function removeMessageConfigurationData (array $messageData) {
- // Remove temporay configuration
- $this->getConfigInstance()->unsetConfigEntry(NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_ACCEPTED_OBJECTS);
- }
-}
-
-// [EOF]
-?>
--- /dev/null
+<?php
+// Own namespace
+namespace Hub\Handler\Node\Announcement\Answer;
+
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
+/**
+ * A AnnouncementAnswerOkay handler
+ *
+ * @author Roland Haeder <webmaster@shipsimu.org>
+ * @version 0.0.0
+ * @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
+ *
+ * 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 NodeAnnouncementAnswerOkayHandler extends BaseAnserStatusHandler implements HandleableAnswerStatus, Registerable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Init array
+ $this->searchData = array(
+ XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID,
+ XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_ADDRESS,
+ );
+
+ // Set handler name
+ $this->setHandlerName('announcement_answer_okay');
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @return $handlerInstance An instance of a HandleableMessage class
+ */
+ public final static function createNodeAnnouncementAnswerOkayHandler () {
+ // Get new instance
+ $handlerInstance = new NodeAnnouncementAnswerOkayHandler();
+
+ // Return the prepared instance
+ return $handlerInstance;
+ }
+
+ /**
+ * Handles given message data array
+ *
+ * @param $messageData An array of message data
+ * @param $packageInstance An instance of a Receivable class
+ * @return void
+ * @todo Do some more here: Handle karma, et cetera?
+ */
+ public function handleAnswerMessageData (array $messageData, Receivable $packageInstance) {
+ /*
+ * Query DHT and force update (which will throw an exception if the
+ * node is not found).
+ */
+ $this->getDhtInstance()->registerNodeByMessageData($messageData, $this, TRUE);
+
+ // Get handler instance
+ $handlerInstance = Registry::getRegistry()->getInstance('task_handler');
+
+ // Generate DHT bootstrap task
+ $taskInstance = ObjectFactory::createObjectByConfiguredName('node_dht_late_bootstrap_task_class');
+
+ // Register it as well
+ $handlerInstance->registerTask('dht_late_bootstrap', $taskInstance);
+
+ // Get the node instance
+ $nodeInstance = NodeObjectFactory::createNodeInstance();
+
+ // Change state
+ $nodeInstance->getStateInstance()->nodeAnnouncementSuccessful();
+
+ // Prepare next message
+ $this->prepareNextMessage($messageData, $packageInstance);
+ }
+
+ /**
+ * Initializes configuration data from given message data array
+ *
+ * The following array is being handled over:
+ *
+ * my-external-address => 1.2.3.4
+ * my-internal-address => 5.6.7.8
+ * my-status => reachable
+ * my-node-id => aaabbbcccdddeeefff123456789
+ * my-session-id => aaabbbcccdddeeefff123456789
+ * my-tcp-port => 9060
+ * my-udp-port => 9060
+ * answer-status => OKAY
+ * message_type => announcement_answer
+ *
+ * @param $messageData An array with all message data
+ * @return void
+ */
+ protected function initMessageConfigurationData (array $messageData) {
+ // Get node instance
+ $nodeInstance = NodeObjectFactory::createNodeInstance();
+
+ // Get an array of all accepted object types
+ $objectList = $nodeInstance->getListFromAcceptedObjectTypes();
+
+ // Add missing (temporary) configuration 'accepted_object_types'
+ $this->getConfigInstance()->setConfigEntry(NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_ACCEPTED_OBJECTS, implode(BaseHubNode::OBJECT_LIST_SEPARATOR, $objectList));
+ }
+
+ /**
+ * Removes configuration data with given message data array from global
+ * configuration. For content of $messageData see method comment above.
+ *
+ * @param $messageData An array with all message data
+ * @return void
+ */
+ protected function removeMessageConfigurationData (array $messageData) {
+ // Remove temporay configuration
+ $this->getConfigInstance()->unsetConfigEntry(NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_ACCEPTED_OBJECTS);
+ }
+}
+
+// [EOF]
+?>
// Own namespace
namespace Hub\Handler\Node\Message\Announcement;
-// Import hub-specific stuff
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
use Hub\Generic\BaseHubSystem;
/**
<?php
+// Own namespace
+namespace Hub\Handler\Node\Answer\Announcement;
+
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
/**
* A NodeMessageAnnouncementAnswer handler
*
<?php
+// Own namespace
+namespace Hub\Handler\Answer\Node\DhtBootstrap;
+
+// Import application-specific stuff
+use Hub\Factory\Dht\DhtObjectFactory;
+
/**
* A NodeMessageDhtBootstrapAnswer handler
*
<?php
+// Own namespace
+namespace Hub\Handler\Node\Answer\Request\NodeList;
+
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
/**
* A NodeMessageRequestNodeListAnswer handler
*
<?php
+// Own namespace
+namespace Hub\Handler\Node\Answer\Dht\Bootstrap;
+
+// Import application-specific stuff
+use Hub\Factory\Dht\DhtObjectFactory;
+use Hub\Factory\Node\NodeObjectFactory;
+
/**
* A NodeMessageDhtBootstrap handler
*
<?php
+// Own namespace
+namespace Hub\Handler\Node\Message\Request\NodeList;
+
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
/**
* A NodeMessageRequestNodeList handler
*
<?php
+// Own namespace
+namespace Hub\Handler\Node\Message\SelfConnect;
+
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
/**
* A NodeMessageSelfConnect handler
*
use Hub\Generic\BaseHubSystem;
// Import framework stuff
+use CoreFramework\Factory\ObjectFactory;
use CoreFramework\Object\BaseFrameworkSystem;
/**
use Hub\Tools\HubTools;
// Import framework stuff
+use CoreFramework\Factory\ObjectFactory;
use CoreFramework\Object\BaseFrameworkSystem;
use CoreFramework\Request\Requestable;
use CoreFramework\Response\Responseable;
// Own namespace
namespace Hub\Network\Package;
-// Import hub-specific stuff
+// Import application-specific stuff
+use Hub\Factory\Dht\DhtObjectFactory;
+use Hub\Factory\Node\NodeObjectFactory;
use Hub\Generic\BaseHubSystem;
use Hub\Tools\HubTools;
+// Import framework stuff
+use CoreFramework\Factory\ObjectFactory;
+
/**
* A NetworkPackage class. This class implements Deliverable and Receivable
* because all network packages should be deliverable to other nodes and
// Import hub-specific stuff
use Hub\Generic\BaseHubSystem;
+// Import framework stuff
+use CoreFramework\Factory\ObjectFactory;
+
/**
* A general pool class
*
namespace Hub\Producer;
// Import framework stuff
+use CoreFramework\Factory\ObjectFactory;
use CoreFramework\Object\BaseFrameworkSystem;
/**
<?php
+// Own namespace
+namespace Hub\State\Dht\Booting;
+
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
/**
* A Booting dht state class
*
<?php
+// Own namespace
+namespace Hub\State\Node\Active;
+
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
/**
* An active node state class
*
<?php
+// Own namespace
+namespace Hub\Task\Node\Announcement;
+
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
/**
* A Announcement node-task
*
<?php
+// Own namespace
+namespace Hub\Task\Node\Dht\Bootstrap;
+
+// Import application-specific stuff
+use Hub\Factory\Dht\DhtObjectFactory;
+
/**
* A DhtBootstrap node-task
*
<?php
+// Own namespace
+namespace Hub\Task\Node\Dht\Initialization;
+
+// Import application-specific stuff
+use Hub\Factory\Dht\DhtObjectFactory;
+
/**
* A DhtInitialization node-task
*
<?php
+// Own namespace
+namespace Hub\Task\Node\Dht\Bootstrap\Late;
+
+// Import application-specific stuff
+use Hub\Factory\Dht\DhtObjectFactory;
+
/**
* A DhtBootstrap node-task
*
<?php
+// Own namespace
+namespace Hub\Task\Node\Dht\Check\Publication;
+
+// Import application-specific stuff
+use Hub\Factory\Dht\DhtObjectFactory;
+
/**
* A DhtPublicationCheck node-task
*
<?php
+// Own namespace
+namespace Hub\Task\Node\Dht\Publication;
+
+// Import application-specific stuff
+use Hub\Factory\Dht\DhtObjectFactory;
+
/**
* A DhtPublication node-task
*
<?php
+// Own namespace
+namespace Hub\Task\Node\Dht\Query;
+
+// Import application-specific stuff
+use Hub\Factory\Dht\DhtObjectFactory;
+
/**
* A DhtQuery node-task
*
<?php
+// Own namespace
+namespace Hub\Task\Node\Listener\Socket;
+
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
/**
* A HubSocketListener task
*
<?php
+// Own namespace
+namespace Hub\Task\Node\SelfConnect;
+
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
/**
* A SelfConnect node-task
*
<?php
+// Own namespace
+namespace Hub\TemplateEngine\Xml;
+
+// Import framework stuff
+use CoreFramework\Factory\ObjectFactory;
+
/**
* A generic XML template engine class
*
// Own namespace
namespace Hub\Tools;
-// Import hub-specific stuff
+// Import application-specific stuff
+use Hub\Factory\Dht\DhtObjectFactory;
+use Hub\Factory\Node\NodeObjectFactory;
use Hub\Generic\BaseHubSystem;
// Import framework stuff
use CoreFramework\Configuration\FrameworkConfiguration;
+use CoreFramework\Factory\ObjectFactory;
/**
* This class contains static helper functions for our hub
///////////////////////////////////////////////////////////////////////////////
// CFG: ANNOUNCEMENT-ANSWER-STATUS-OKAY-HANDLER-CLASS
-$cfg->setConfigEntry('announcement_answer_status_okay_handler_class', 'AnnouncementAnswerOkayHandler');
+$cfg->setConfigEntry('announcement_answer_status_okay_handler_class', 'Hub\Handler\Node\Announcement\Answer\NodeAnnouncementAnswerOkayHandler');
// CFG: REQUEST-NODE-LIST-ANSWER-STATUS-OKAY-HANDLER-CLASS
$cfg->setConfigEntry('request_node_list_answer_status_okay_handler_class', 'RequestNodeListAnswerOkayHandler');
<?php
+// Own namespace
+namespace Hub\Node\Bootstrap;
+
+// Import application-specific stuff
+use Hub\Factory\Node\NodeObjectFactory;
+
/**
* This exception is thrown when a DHT bootstrap request from other nodes was
* received but this node doesn't accept such requests.
<?php
+// Own namespace
+namespace Hub\Factory\Parameter;
+
+// Import framework stuff
+use CoreFramework\Factory\ObjectFactory;
+
/**
* This exception is thrown if not all required parameter are given.
*