// Import hub-specific sutff
use Hub\Discovery\Recipient\BaseRecipientDiscovery;
use Hub\Discovery\Recipient\Node\DiscoverableNodeRecipient;
+use Hub\Factory\Handler\Protocol\ProtocolHandlerFactory;
use Hub\Network\Package\NetworkPackage;
use Hub\Node\Data\InvalidSessionIdException;
use Hub\Tools\HubTools;
// Import hub-specific stuff
use Hub\Container\Socket\StorableSocket;
use Hub\Discovery\Recipient\BaseRecipientDiscovery;
+use Hub\Discovery\Protocol\ProtocolDiscovery;
+use Hub\Discovery\Socket\DiscoverableSocket;
use Hub\Factory\Node\NodeObjectFactory;
use Hub\Factory\Socket\SocketFactory;
use Hub\Generic\BaseHubSystem;
namespace Hub\Factory\Handler\Protocol;
// Import application-specific stuff
+use Hub\Discovery\Protocol\ProtocolDiscovery;
use Hub\Helper\HubHelper;
// Import framework stuff
// Please don't call this method
throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
}
-}
-// [EOF]
-?>
+}
namespace Hub\Handler\Protocol\;
// Import appplication-specific stuff
+use Hub\Handler\Protocol\BaseProtocolHandler;
use Hub\Handler\Protocol\HandleableProtocol;
// Import framework stuff
* 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 BaseProtocolHandler extends BaseHandler implements HandleableProtocol {
+abstract class BaseProtocolHandler extends BaseHandler implements HandleableProtocol {
/**
* Whole UNL instance
*/
private $universalNodeLocatorInstance = NULL;
+ /**
+ * Name of used protocol
+ */
+ private $protocolName = 'invalid';
+
/**
* Protected constructor
*
return $this->universalNodeLocatorData[$element];
}
+ /**
+ * Getter for protocol name
+ *
+ * @return $protocolName Name of used protocol
+ */
+ public final function getProtocolName () {
+ return $this->protocolName;
+ }
+
+ /**
+ * Setter for protocol name
+ *
+ * @param $protocolName Name of used protocol
+ * @return void
+ */
+ protected final function setProtocolName ($protocolName) {
+ $this->protocolName = $protocolName;
+ }
+
/**
* Getter for UNL instance
*
namespace Hub\Handler\Protocol\Network\IpV4;
// Import application-specific stuff
+use Hub\Handler\Protocol\BaseProtocolHandler;
use Hub\Locator\Node\LocateableNode;
use Hub\Network\Package\NetworkPackage;
* 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 BaseIpV4ProtocolHandler extends BaseProtocolHandler {
+abstract class BaseIpV4ProtocolHandler extends BaseProtocolHandler {
/**
* Port number
*/
<?php
// Own namespace
-namespace Hub\Handler\Protocol\Tcp;
+namespace Hub\Handler\Protocol\Network\IpV4\Tcp;
// Import application-specific stuff
+use Hub\Handler\Protocol\Network\IpV4\BaseIpV4ProtocolHandler;
use Hub\Handler\Protocol\HandleableProtocol;
// Import framework stuff
// Return the prepared instance
return $handlerInstance;
}
-}
-// [EOF]
-?>
+}
// Import application-specific stuff
use Hub\Container\Socket\StorableSocket;
+use Hub\Factory\Handler\Protocol\ProtocolHandlerFactory;
use Hub\Factory\Socket\SocketFactory;
use Hub\Helper\Connection\ConnectionHelper;
use Hub\Locator\Node\LocateableNode;
use Hub\Helper\Node\BaseNodeHelper;
use Hub\Helper\Node\NodeHelper;
use Hub\Network\Package\NetworkPackage;
+use Hub\Node\Helper\HelpableNode;
// Import framework stuff
use CoreFramework\Factory\Template\XmlTemplateEngineFactory;
// Import application-specific stuff
use Hub\Factory\Network\NetworkPackageFactory;
use Hub\Helper\Node\NodeHelper;
+use Hub\Node\Helper\HelpableNode;
// Import framework stuff
use CoreFramework\Factory\Template\XmlTemplateEngineFactory;
// Import application-specific stuff
use Hub\Factory\Network\NetworkPackageFactory;
use Hub\Helper\Node\NodeHelper;
+use Hub\Node\Helper\HelpableNode;
use Hub\Template\Engine\Xml\Dht\Bootstrap\XmlDhtBootstrapTemplateEngine;
// Import framework stuff
// Import application-specific stuff
use Hub\Factory\Network\NetworkPackageFactory;
use Hub\Helper\Node\NodeHelper;
+use Hub\Node\Helper\HelpableNode;
// Import framework stuff
use CoreFramework\Factory\Template\XmlTemplateEngineFactory;
use Hub\Helper\Node\BaseNodeHelper;
use Hub\Helper\Node\NodeHelper;
use Hub\Network\Package\NetworkPackage;
+use Hub\Node\Helper\HelpableNode;
/**
* A ??? hub helper class
use Hub\Helper\Node\BaseNodeHelper;
use Hub\Helper\Node\NodeHelper;
use Hub\Network\Package\NetworkPackage;
+use Hub\Node\Helper\HelpableNode;
use Hub\Tag\Tagable;
// Import framework stuff
use Hub\Helper\Node\BaseNodeHelper;
use Hub\Helper\Node\NodeHelper;
use Hub\Network\Package\NetworkPackage;
+use Hub\Node\Helper\HelpableNode;
// Import framework stuff
use CoreFramework\Factory\Template\XmlTemplateEngineFactory;
use Hub\Factory\Assembler\Package\PackageAssemblerFactory;
use Hub\Factory\Dht\DhtObjectFactory;
use Hub\Factory\Discovery\Package\PackageDiscoveryFactory;
+use Hub\Factory\Discovery\Socket\SocketDiscoveryFactory;
use Hub\Factory\Information\Connection\ConnectionInfoFactory;
use Hub\Factory\Node\NodeObjectFactory;
use Hub\Generic\BaseHubSystem;
// Import application-specific stuff
use Hub\Container\Socket\StorableSocket;
use Hub\Connection\InvalidConnectionTypeException;
+use Hub\Factory\Handler\Protocol\ProtocolHandlerFactory;
use Hub\Listener\Listenable;
use Hub\Locator\Node\LocateableNode;
use Hub\Network\Package\NetworkPackage;
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class BaseTag extends BaseHubSystem implements Registerable {
- /**
- * Constants for tags
- */
- const TAG_SELF_CONNECT = 'self_connect';
- const TAG_CLAIM_MINING_REWARD = 'claim_reward';
-
/**
* An array with all tags
*/
namespace Hub\Tag\Package;
// Import application-specific stuff
+use Hub\Factory\Handler\Protocol\ProtocolHandlerFactory;
use Hub\Factory\Registry\Object\ObjectTypeRegistryFactory;
use Hub\Listener\Listenable;
use Hub\Network\Package\NetworkPackage;
// Pop the last entry
$this->getStackInstance()->popNamed('node_self_connect');
}
-}
-// [EOF]
-?>
+}
$cfg->setConfigEntry('node_request_node_list_answer_template_type', 'xml/answer/requests');
// CFG: NODE-SELF-CONNECT-TEMPLATE-CLASS
-$cfg->setConfigEntry('node_self_connect_template_class', 'XmlSelfConnectTemplateEngine');
+$cfg->setConfigEntry('node_self_connect_template_class', 'Hub\Template\Engine\Xml\SelfConnect\XmlSelfConnectTemplateEngine');
// CFG: NODE-SELF-CONNECT-TEMPLATE-TYPE
$cfg->setConfigEntry('node_self_connect_template_type', 'xml/self_connect');
$cfg->setConfigEntry('package_recipient_discovery_class', 'Hub\Discovery\Network\Recipient\PackageRecipientDiscovery');
// CFG: SOCKET-DISCOVERY-CLASS
-$cfg->setConfigEntry('socket_discovery_class', 'PackageSocketDiscovery');
+$cfg->setConfigEntry('socket_discovery_class', 'Hub\Network\Discovery\Socket\PackageSocketDiscovery');
// CFG: DHT-RECIPIENT-DISCOVERY-CLASS
$cfg->setConfigEntry('dht_recipient_discovery_class', 'Hub\Discovery\Recipient\Dht\DhtRecipientDiscovery');
$cfg->setConfigEntry('unl_discovery_class', 'Hub\Discovery\Locator\UniversalNodeLocatorDiscovery');
// CFG: TCP-PROTOCOL-HANDLER-CLASS
-$cfg->setConfigEntry('tcp_protocol_handler_class', 'TcpProtocolHandler');
+$cfg->setConfigEntry('tcp_protocol_handler_class', 'Hub\Handler\Protocol\Network\IpV4\Tcp\TcpProtocolHandler');
// CFG: UNIVERSAL-NODE-LOCATOR-CLASS
$cfg->setConfigEntry('universal_node_locator_class', 'Hub\Locator\Node\UniversalNodeLocator');
<?php
// Own namespace
-namespace Hub\Helper\Node;
+namespace Hub\Node\Helper;
// Import application-specific stuff
use Hub\Helper\HubHelper;
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
interface Tagable extends HubInterface {
+ // Constants for tags
+ const TAG_SELF_CONNECT = 'self_connect';
+ const TAG_CLAIM_MINING_REWARD = 'claim_reward';
+
/**
* Chooses the right protocol from given package data
*