]> git.mxchange.org Git - hub.git/commitdiff
Merge branch 'master' into refacuring/protocol_handler
authorRoland Haeder <roland@mxchange.org>
Sun, 11 Jan 2015 20:55:35 +0000 (21:55 +0100)
committerRoland Haeder <roland@mxchange.org>
Sun, 11 Jan 2015 20:55:44 +0000 (21:55 +0100)
Now with latest "core".

Signed-off-by: Roland Haeder <roland@mxchange.org>
Conflicts:
application/hub/main/source/urls/class_CrawlerUploadedListUrlSource.php
core

427 files changed:
application/hub/class_ApplicationHelper.php
application/hub/config-local.php-dist
application/hub/config.php
application/hub/data.php
application/hub/debug.php
application/hub/exceptions.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_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/state/class_InvalidStateException.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/wrapper/class_NodeAlreadyRegisteredException.php
application/hub/exceptions/wrapper/class_NodeDataMissingException.php
application/hub/init.php
application/hub/interfaces/apt-proxy/class_AptProxy.php
application/hub/interfaces/consumer/class_Consumer.php
application/hub/interfaces/decoder/class_Decodeable.php
application/hub/interfaces/discovery/class_Discoverable [new file with mode: 0644]
application/hub/interfaces/discovery/class_Discoverable.php
application/hub/interfaces/discovery/dht/.htaccess [deleted file]
application/hub/interfaces/discovery/dht/class_DiscoverableDhtRecipient.php [deleted file]
application/hub/interfaces/discovery/node/.htaccess [deleted file]
application/hub/interfaces/discovery/node/class_DiscoverableNodeRecipient.php [deleted file]
application/hub/interfaces/discovery/protocol/.htaccess [new file with mode: 0644]
application/hub/interfaces/discovery/protocol/class_DiscoverableProtocol.php [new file with mode: 0644]
application/hub/interfaces/discovery/recipient/.htaccess [new file with mode: 0644]
application/hub/interfaces/discovery/recipient/class_DiscoverableRecipient.php [new file with mode: 0644]
application/hub/interfaces/discovery/recipient/dht/.htaccess [new file with mode: 0644]
application/hub/interfaces/discovery/recipient/dht/class_DiscoverableDhtRecipient.php [new file with mode: 0644]
application/hub/interfaces/discovery/recipient/node/.htaccess [new file with mode: 0644]
application/hub/interfaces/discovery/recipient/node/class_DiscoverableNodeRecipient.php [new file with mode: 0644]
application/hub/interfaces/discovery/recipient/socket/.htaccess [new file with mode: 0644]
application/hub/interfaces/discovery/recipient/socket/class_DiscoverableSocket.php [new file with mode: 0644]
application/hub/interfaces/discovery/socket/.htaccess [deleted file]
application/hub/interfaces/discovery/socket/class_DiscoverableSocket.php [deleted file]
application/hub/interfaces/discovery/unl/.htaccess [new file with mode: 0644]
application/hub/interfaces/discovery/unl/class_DiscoverableUniversalNodeLocator.php [new file with mode: 0644]
application/hub/interfaces/distributable/class_Distributable.php
application/hub/interfaces/distributable/node/class_DistributableNode.php
application/hub/interfaces/executor/class_Executor.php
application/hub/interfaces/filter/class_FilterablePackage.php
application/hub/interfaces/handler/answer-status/class_HandleableAnswerStatus.php
application/hub/interfaces/handler/chunks/class_HandleableChunks.php
application/hub/interfaces/handler/class_Handleable.php [deleted file]
application/hub/interfaces/handler/message-types/class_HandleableMessage.php
application/hub/interfaces/handler/network/class_Networkable.php
application/hub/interfaces/handler/task/class_HandleableTask.php
application/hub/interfaces/helper/connections/class_ConnectionHelper.php
application/hub/interfaces/helper/dht/class_HelpableDht.php
application/hub/interfaces/helper/hub/class_HubHelper.php [new file with mode: 0644]
application/hub/interfaces/helper/messages/class_MessageHelper.php
application/hub/interfaces/helper/node/class_HelpableNode.php
application/hub/interfaces/helper/nodes/class_NodeHelper.php
application/hub/interfaces/listener/class_Listenable.php
application/hub/interfaces/lists/class_Listable.php
application/hub/interfaces/locator/.htaccess [new file with mode: 0644]
application/hub/interfaces/locator/class_LocateableNode.php [new file with mode: 0644]
application/hub/interfaces/lookup/class_Lookupable.php
application/hub/interfaces/lookup/node_states/class_LookupableNodeState.php
application/hub/interfaces/lookup/peer_states/class_LookupablePeerState.php
application/hub/interfaces/package/assembler/class_Assembler.php
application/hub/interfaces/package/class_Deliverable.php
application/hub/interfaces/package/class_Receivable.php
application/hub/interfaces/package/fragmenter/class_Fragmentable.php
application/hub/interfaces/pool/class_Poolable.php
application/hub/interfaces/pool/listener/class_PoolableListener.php
application/hub/interfaces/pool/peer/class_PoolablePeer.php
application/hub/interfaces/producer/block/class_BlockProducer.php
application/hub/interfaces/producer/class_
application/hub/interfaces/producer/class_Producer.php
application/hub/interfaces/producer/keys/class_KeyProducer.php
application/hub/interfaces/producer/work_units/class_UnitProducer.php
application/hub/interfaces/protocol/class_ProtocolHandler.php [deleted file]
application/hub/interfaces/recipient/class_Recipient.php
application/hub/interfaces/resolver/.htaccess [new file with mode: 0644]
application/hub/interfaces/resolver/class_ProtocolResolver.php [new file with mode: 0644]
application/hub/interfaces/scanner/class_Scanner.php
application/hub/interfaces/socket/class_SocketTag.php
application/hub/interfaces/source/class_Source.php
application/hub/interfaces/source/units/class_UnitSource.php
application/hub/interfaces/source/urls/class_UrlSource.php
application/hub/interfaces/states/class_
application/hub/interfaces/states/class_Stateable.php
application/hub/interfaces/states/client/class_ClientStateable.php
application/hub/interfaces/states/hub/class_HubStateable.php
application/hub/interfaces/states/peer/class_PeerStateable.php
application/hub/interfaces/tags/class_Tagable.php
application/hub/interfaces/tasks/class_Taskable.php
application/hub/interfaces/visitor/class_Visitable.php
application/hub/interfaces/visitor/class_Visitor.php
application/hub/interfaces/visitor/decorator/class_DecoratorVisitor.php
application/hub/interfaces/visitor/listener/class_ListenerVisitor.php
application/hub/interfaces/visitor/pool/class_PoolVisitor.php
application/hub/interfaces/visitor/pool/listener/class_ListenerPoolVisitor.php
application/hub/interfaces/visitor/tasks/class_TaskVisitor.php
application/hub/interfaces/work_units/class_UnitHelper.php
application/hub/interfaces/wrapper/class_NodeDhtWrapper.php
application/hub/interfaces/wrapper/class_NodeInformationWrapper.php
application/hub/interfaces/wrapper/class_UnitDatabaseWrapper.php
application/hub/loader.php
application/hub/main/blocks/class_
application/hub/main/blocks/class_BaseBlock.php
application/hub/main/blocks/miner/class_HashBlock.php
application/hub/main/chains/class_PackageFilterChain.php
application/hub/main/class_
application/hub/main/class_Base
application/hub/main/class_BaseHubSystem.php
application/hub/main/commands/console/class_HubConsoleMainCommand.php
application/hub/main/compressor/decorator/class_NetworkPackageCompressorDecorator.php
application/hub/main/controller/console/class_HubConsoleDefaultNewsController.php
application/hub/main/decoder/class_
application/hub/main/decoder/class_BaseDecoder.php
application/hub/main/decoder/package/class_PackageDecoder.php
application/hub/main/decorators/class_BaseDecorator.php
application/hub/main/dht/class_
application/hub/main/dht/class_BaseDht.php
application/hub/main/dht/node/class_NodeDhtFacade.php
application/hub/main/discovery/class_ [new file with mode: 0644]
application/hub/main/discovery/class_BaseNodeDiscovery.php
application/hub/main/discovery/dht/.htaccess [deleted file]
application/hub/main/discovery/dht/class_DhtRecipientDiscovery.php [deleted file]
application/hub/main/discovery/node/.htaccess [new file with mode: 0644]
application/hub/main/discovery/node/class_UniversalNodeLocatorDiscovery.php [new file with mode: 0644]
application/hub/main/discovery/package/.htaccess [deleted file]
application/hub/main/discovery/package/class_PackageRecipientDiscovery.php [deleted file]
application/hub/main/discovery/protocol/.htaccess [new file with mode: 0644]
application/hub/main/discovery/protocol/class_ProtocolDiscovery.php [new file with mode: 0644]
application/hub/main/discovery/recipient/.htaccess [new file with mode: 0644]
application/hub/main/discovery/recipient/class_ [new file with mode: 0644]
application/hub/main/discovery/recipient/class_BaseRecipientDiscovery.php [new file with mode: 0644]
application/hub/main/discovery/recipient/dht/.htaccess [new file with mode: 0644]
application/hub/main/discovery/recipient/dht/class_DhtRecipientDiscovery.php [new file with mode: 0644]
application/hub/main/discovery/recipient/package/.htaccess [new file with mode: 0644]
application/hub/main/discovery/recipient/package/class_PackageRecipientDiscovery.php [new file with mode: 0644]
application/hub/main/discovery/recipient/socket/.htaccess [new file with mode: 0644]
application/hub/main/discovery/recipient/socket/class_PackageSocketDiscovery.php [new file with mode: 0644]
application/hub/main/discovery/socket/.htaccess [deleted file]
application/hub/main/discovery/socket/class_PackageSocketDiscovery.php [deleted file]
application/hub/main/factories/chain/class_PackageFilterChainFactory.php
application/hub/main/factories/chunks/class_ChunkHandlerFactory.php
application/hub/main/factories/class_
application/hub/main/factories/dht/class_DhtObjectFactory.php
application/hub/main/factories/discovery/class_PackageDiscoveryFactory.php
application/hub/main/factories/discovery/class_SocketDiscoveryFactory.php
application/hub/main/factories/handler/class_MessageTypeHandlerFactory.php
application/hub/main/factories/handler/class_ProtocolHandlerFactory.php
application/hub/main/factories/lists/class_RecipientListFactory.php
application/hub/main/factories/node/class_NodeObjectFactory.php
application/hub/main/factories/package/assembler/class_PackageAssemblerFactory.php
application/hub/main/factories/package/class_NetworkPackageFactory.php
application/hub/main/factories/package/fragmenter/class_FragmenterFactory.php
application/hub/main/factories/producer/class_ProducerFactory.php
application/hub/main/factories/registry/class_ObjectTypeRegistryFactory.php
application/hub/main/factories/resolver/.htaccess [new file with mode: 0644]
application/hub/main/factories/resolver/class_ProtocolResolverFactory.php [new file with mode: 0644]
application/hub/main/factories/scanner/class_ScannerObjectFactory.php
application/hub/main/factories/socket/class_SocketFactory.php
application/hub/main/factories/source/units/class_UnitSourceFactory.php
application/hub/main/factories/source/url/class_UrlSourceObjectFactory.php
application/hub/main/factories/states/dht/class_DhtStateFactory.php
application/hub/main/factories/states/node/class_NodeStateFactory.php
application/hub/main/factories/states/peer/class_PeerStateFactory.php
application/hub/main/factories/tags/class_PackageTagsFactory.php
application/hub/main/filter/activation/node/class_NodeActivation
application/hub/main/filter/activation/node/class_NodeActivationAnnouncementFilter.php
application/hub/main/filter/bootstrap/node/class_NodeBootstrapExtraBootstrappingFilter.php
application/hub/main/filter/class_
application/hub/main/filter/class_BaseHubFilter.php
application/hub/main/filter/class_BaseNodeFilter.php
application/hub/main/filter/node/class_Node
application/hub/main/filter/node/class_NodeInitializationFilter.php
application/hub/main/filter/node/class_NodePhpRequirementsFilter.php
application/hub/main/filter/node/class_NodeWelcomeTeaserFilter.php
application/hub/main/filter/shutdown/node/class_NodeShutdown
application/hub/main/filter/shutdown/node/class_NodeShutdownFlushNodeListFilter.php
application/hub/main/filter/shutdown/node/class_NodeShutdownNodeFilter.php
application/hub/main/filter/shutdown/node/class_NodeShutdownTaskHandlerFilter.php
application/hub/main/filter/tags/answer/class_PackageAnnouncementAnswerTagFilter.php
application/hub/main/filter/tags/answer/class_PackageDhtBootstrapAnswerTagFilter.php
application/hub/main/filter/tags/answer/class_PackageRequestNodeListAnswerTagFilter.php
application/hub/main/filter/tags/class_PackageAnnouncementTagFilter.php
application/hub/main/filter/tags/class_PackageDhtBootstrapTagFilter.php
application/hub/main/filter/tags/class_PackageRequestNodeListTagFilter.php
application/hub/main/filter/tags/class_PackageSelfConnectTagFilter.php
application/hub/main/filter/task/node/class_NodeTaskHandlerInitializerFilter.php
application/hub/main/handler/answer-status/announcement/class_AnnouncementAnswerOkayHandler.php
application/hub/main/handler/answer-status/class_
application/hub/main/handler/answer-status/class_BaseAnserStatusHandler.php
application/hub/main/handler/answer-status/requests/class_RequestNodeListAnswerOkayHandler.php
application/hub/main/handler/chunks/class_ChunkHandler.php
application/hub/main/handler/class_BaseDataHandler.php
application/hub/main/handler/class_BaseHandler.php
application/hub/main/handler/message-types/announcement/class_NodeMessageAnnouncementHandler.php
application/hub/main/handler/message-types/answer/class_NodeMessageAnnouncementAnswerHandler.php
application/hub/main/handler/message-types/answer/class_NodeMessageDhtBootstrapAnswerHandler.php
application/hub/main/handler/message-types/answer/class_NodeMessageRequestNodeListAnswerHandler.php
application/hub/main/handler/message-types/class_
application/hub/main/handler/message-types/class_BaseMessageHandler.php
application/hub/main/handler/message-types/dht/class_NodeMessageDhtBootstrapHandler.php
application/hub/main/handler/message-types/requests/class_NodeMessageRequestNodeListHandler.php
application/hub/main/handler/message-types/self-connect/class_NodeMessageSelfConnectHandler.php
application/hub/main/handler/network/class_BaseRawDataHandler.php
application/hub/main/handler/network/tcp/class_
application/hub/main/handler/network/tcp/class_TcpRawDataHandler.php
application/hub/main/handler/network/udp/class_UdpRawDataHandler.php
application/hub/main/handler/protocol/.htaccess [new file with mode: 0644]
application/hub/main/handler/protocol/class_ [new file with mode: 0644]
application/hub/main/handler/protocol/class_BaseProtocolHandler.php [new file with mode: 0644]
application/hub/main/handler/protocol/tcp/.htaccess [new file with mode: 0644]
application/hub/main/handler/protocol/tcp/class_TcpProtocolHandler.php [new file with mode: 0644]
application/hub/main/handler/tasks/class_TaskHandler.php
application/hub/main/helper/class_
application/hub/main/helper/class_BaseHubSystemHelper.php
application/hub/main/helper/connection/class_
application/hub/main/helper/connection/class_BaseConnectionHelper.php
application/hub/main/helper/connection/tcp/class_TcpConnectionHelper.php
application/hub/main/helper/connection/udp/class_UdpConnectionHelper.php
application/hub/main/helper/dht/class_DhtBootstrapHelper.php
application/hub/main/helper/dht/class_DhtPublishEntryHelper.php
application/hub/main/helper/messages/class_
application/hub/main/helper/messages/class_BaseMessageHelper.php
application/hub/main/helper/messages/crypto/class_CryptoRandomUnitMessageHelper.php
application/hub/main/helper/node/announcement/class_NodeAnnouncementHelper.php
application/hub/main/helper/node/answer/announcement/class_NodeAnnouncementMessageAnswerHelper.php
application/hub/main/helper/node/answer/class_BaseHubAnswerHelper.php
application/hub/main/helper/node/answer/dht/class_NodeDhtBootstrapMessageAnswerHelper.php
application/hub/main/helper/node/answer/requests/class_NodeRequestNodeListMessageAnswerHelper.php
application/hub/main/helper/node/class_
application/hub/main/helper/node/class_BaseNodeHelper.php
application/hub/main/helper/node/connection/class_NodeSelfConnectHelper.php
application/hub/main/helper/node/requests/class_NodeRequestNodeListHelper.php
application/hub/main/helper/work_units/class_BaseWorkUnitHelper.php
application/hub/main/iterator/hub/class_HubPingIterator.php
application/hub/main/iterator/network/class_NetworkListenIterator.php
application/hub/main/iterator/pool/class_DefaultIterator.php
application/hub/main/iterator/pool/handler/class_Handler
application/hub/main/iterator/pool/handler/class_HandlerPoolIterator.php
application/hub/main/iterator/pool/monitor/class_MonitorPoolIterator.php
application/hub/main/iterator/pool/shutdown/class_Shutdown
application/hub/main/iterator/pool/shutdown/class_ShutdownPoolIterator.php
application/hub/main/iterator/pool/tasks/class_TaskPoolIterator.php
application/hub/main/iterator/producer/keys/class_TestUnitKeyProducerIterator.php
application/hub/main/listener/class_
application/hub/main/listener/class_BaseListener.php
application/hub/main/listener/class_BaseListenerDecorator.php
application/hub/main/listener/tcp/class_
application/hub/main/listener/tcp/class_TcpListener.php
application/hub/main/listener/tcp/decorators/class_ClientTcpListenerDecorator.php
application/hub/main/listener/tcp/decorators/class_HubTcpListenerDecorator.php
application/hub/main/listener/udp/class_
application/hub/main/listener/udp/class_UdpListener.php
application/hub/main/listener/udp/decorators/class_ClientUdpListenerDecorator.php
application/hub/main/listener/udp/decorators/class_HubUdpListenerDecorator.php
application/hub/main/lists/class_
application/hub/main/lists/class_BaseList.php
application/hub/main/lists/groups/class_ListGroupList.php
application/hub/main/lists/hub/class_HubList.php
application/hub/main/lists/pool/class_PoolEntriesList.php
application/hub/main/lists/recipient/class_RecipientList.php
application/hub/main/lists/tasks/class_TaskList.php
application/hub/main/nodes/boot/class_HubBootNode.php
application/hub/main/nodes/class_
application/hub/main/nodes/class_BaseHubNode.php
application/hub/main/nodes/list/class_HubListNode.php
application/hub/main/nodes/master/class_HubMasterNode.php
application/hub/main/nodes/regular/class_HubRegularNode.php
application/hub/main/package/assembler/class_PackageAssembler.php
application/hub/main/package/class_NetworkPackage.php
application/hub/main/package/fragmenter/class_PackageFragmenter.php
application/hub/main/pools/class_
application/hub/main/pools/class_BasePool.php
application/hub/main/pools/listener/class_DefaultListenerPool.php
application/hub/main/pools/peer/class_DefaultPeerPool.php
application/hub/main/producer/class_
application/hub/main/producer/class_BaseProducer.php
application/hub/main/producer/cruncher/class_BaseKeyProducer.php
application/hub/main/producer/cruncher/class_BaseUnitProducer.php
application/hub/main/producer/cruncher/keys/class_CruncherKeyProducer.php
application/hub/main/recipient/class_
application/hub/main/recipient/class_BaseRecipient.php
application/hub/main/recipient/dht/class_DhtRecipient.php
application/hub/main/recipient/direct/class_DirectRecipient.php
application/hub/main/recipient/self/class_SelfRecipient.php
application/hub/main/recipient/upper/class_UpperRecipient.php
application/hub/main/registry/connection/class_ConnectionRegistry.php
application/hub/main/registry/objects/class_ObjectTypeRegistry.php
application/hub/main/registry/socket/class_SocketRegistry.php
application/hub/main/resolver/command/console/class_HubConsoleCommandResolver.php
application/hub/main/resolver/controller/console/class_HubConsoleControllerResolver.php
application/hub/main/resolver/controller/http/class_HubHttpControllerResolver.php
application/hub/main/resolver/protocol/.htaccess [new file with mode: 0644]
application/hub/main/resolver/protocol/class_ [new file with mode: 0644]
application/hub/main/resolver/protocol/class_BaseProtocolResolver.php [new file with mode: 0644]
application/hub/main/resolver/protocol/tcp/.htaccess [new file with mode: 0644]
application/hub/main/resolver/protocol/tcp/class_TcpProtocolResolver.php [new file with mode: 0644]
application/hub/main/resolver/state/class_BaseStateResolver.php
application/hub/main/resolver/state/peer/class_PeerStateResolver.php
application/hub/main/scanner/class_
application/hub/main/scanner/class_BaseScanner.php
application/hub/main/source/class_
application/hub/main/source/class_BaseSource.php
application/hub/main/source/class_BaseUrlSource.php
application/hub/main/source/units/class_TestUnitSource.php
application/hub/main/source/urls/class_CrawlerUploadedListUrlSource.php
application/hub/main/states/class_
application/hub/main/states/class_BaseState.php
application/hub/main/states/communicator/active/class_CommunicatorActiveState.php
application/hub/main/states/communicator/init/class_CommunicatorInitState.php
application/hub/main/states/crawler/active/class_CrawlerActiveState.php
application/hub/main/states/crawler/booting/class_CrawlerBootingState.php
application/hub/main/states/crawler/init/class_CrawlerInitState.php
application/hub/main/states/dht/active/class_DhtActiveState.php
application/hub/main/states/dht/booting/class_DhtBootingState.php
application/hub/main/states/dht/class_
application/hub/main/states/dht/class_BaseDhtState.php
application/hub/main/states/dht/init/class_DhtInitState.php
application/hub/main/states/dht/virgin/class_DhtVirginState.php
application/hub/main/states/node/active/class_NodeActiveState.php
application/hub/main/states/node/announced/class_NodeAnnouncementCompletedState.php
application/hub/main/states/node/announced/class_NodeAnnouncingState.php
application/hub/main/states/node/class_
application/hub/main/states/node/class_BaseNodeState.php
application/hub/main/states/node/init/class_NodeInitState.php
application/hub/main/states/node/seniors/class_NodeReachableState.php
application/hub/main/states/node/virgin/class_NodeVirginState.php
application/hub/main/states/peer/class_
application/hub/main/states/peer/class_BasePeerState.php
application/hub/main/states/peer/connected/class_ConnectedPeerState.php
application/hub/main/states/peer/errors/class_ConnectionRefusedPeerState.php
application/hub/main/states/peer/errors/class_ConnectionTimedOutPeerState.php
application/hub/main/states/peer/errors/class_NoRouteToHostPeerState.php
application/hub/main/states/peer/errors/class_OperationAlreadyProgressPeerState.php
application/hub/main/states/peer/errors/class_ProblemPeerState.php
application/hub/main/states/peer/errors/class_TransportEndpointGonePeerState.php
application/hub/main/states/peer/init/class_InitPeerState.php
application/hub/main/statistics/connection/class_ConnectionStatisticsHelper.php
application/hub/main/tags/class_
application/hub/main/tags/class_BaseTags.php
application/hub/main/tags/package/class_PackageTags.php
application/hub/main/tasks/chat/class_
application/hub/main/tasks/class_
application/hub/main/tasks/class_BaseTask.php
application/hub/main/tasks/idle/class_IdleLoopTask.php
application/hub/main/tasks/network/class_NetworkPackageReaderTask.php
application/hub/main/tasks/network/class_NetworkPackageWriterTask.php
application/hub/main/tasks/node/announcement/class_NodeAnnouncementTask.php
application/hub/main/tasks/node/chunks/class_NodeChunkAssemblerTask.php
application/hub/main/tasks/node/class_Node
application/hub/main/tasks/node/decoder/class_NodePackageDecoderTask.php
application/hub/main/tasks/node/dht/class_NodeDhtBootstrapTask.php
application/hub/main/tasks/node/dht/class_NodeDhtInitializationTask.php
application/hub/main/tasks/node/dht/class_NodeDhtLateBootstrapTask.php
application/hub/main/tasks/node/dht/class_NodeDhtPublicationCheckTask.php
application/hub/main/tasks/node/dht/class_NodeDhtPublicationTask.php
application/hub/main/tasks/node/dht/class_NodeDhtQueryTask.php
application/hub/main/tasks/node/listener/class_NodeSocketListenerTask.php
application/hub/main/tasks/node/ping/class_NodePingTask.php
application/hub/main/tasks/node/self_connect/class_NodeSelfConnectTask.php
application/hub/main/tasks/node/tags/class_NodePackageTagsInitTask.php
application/hub/main/tasks/node/update/class_NodeUpdateCheckTask.php
application/hub/main/template/announcement/class_XmlAnnouncementTemplateEngine.php
application/hub/main/template/answer/announcement/class_XmlAnnouncementAnswerTemplateEngine.php
application/hub/main/template/answer/class_
application/hub/main/template/answer/class_BaseXmlAnswerTemplateEngine.php
application/hub/main/template/answer/dht/class_XmlDhtBootstrapAnswerTemplateEngine.php
application/hub/main/template/answer/requests/class_XmlRequestNodeListAnswerTemplateEngine.php
application/hub/main/template/class_
application/hub/main/template/class_BaseXmlTemplateEngine.php
application/hub/main/template/connect/class_XmlSelfConnectTemplateEngine.php
application/hub/main/template/dht/class_XmlDhtBootstrapTemplateEngine.php
application/hub/main/template/entries/class_XmlRequestNodeListEntryTemplateEngine.php
application/hub/main/template/objects/class_XmlObjectRegistryTemplateEngine.php
application/hub/main/template/publish/class_XmlDhtPublishEntryTemplateEngine.php
application/hub/main/template/requests/class_XmlRequestNodeListTemplateEngine.php
application/hub/main/tools/class_HubTools.php
application/hub/main/unl/.htaccess [new file with mode: 0644]
application/hub/main/unl/class_UniversalNodeLocator.php [new file with mode: 0644]
application/hub/main/visitor/class_
application/hub/main/visitor/class_BaseVisitor.php
application/hub/main/visitor/pool/class_
application/hub/main/visitor/pool/handler/class_Handler
application/hub/main/visitor/pool/monitor/class_RawDataPoolMonitorVisitor.php
application/hub/main/visitor/pool/shutdown/class_Shutdown
application/hub/main/visitor/pool/shutdown/class_ShutdownListenerPoolVisitor.php
application/hub/main/visitor/socket/class_HalfShutdownSocketVisitor.php
application/hub/main/visitor/socket/class_ShutdownSocketVisitor.php
application/hub/main/visitor/tasks/class_ActiveTaskVisitor.php
application/hub/main/visitor/tasks/class_ShutdownTaskVisitor.php
application/hub/main/wrapper/node/class_NodeDistributedHashTableDatabaseWrapper.php
application/hub/main/wrapper/node/class_NodeInformationDatabaseWrapper.php
application/hub/main/wrapper/states/class_PeerStateLookupDatabaseWrapper.php
application/hub/starter.php
application/hub/templates/xml/.xml
application/hub/templates/xml/announcement/announcement.xml
application/hub/templates/xml/answer/announcement/announcement_answer.xml
application/hub/templates/xml/answer/dht_bootstrap/dht_bootstrap_answer.xml
application/hub/templates/xml/answer/requests/request_node_list_answer.xml
application/hub/templates/xml/cruncher/producer/test_unit.xml
application/hub/templates/xml/cruncher/producer/work_unit.xml
application/hub/templates/xml/dht_bootstrap/dht_bootstrap.xml
application/hub/templates/xml/dht_publish/publish.xml
application/hub/templates/xml/node/node_status.xml
application/hub/templates/xml/object_registry/object_registry.xml
application/hub/templates/xml/requests/request_node_list.xml
application/hub/templates/xml/self_connect/self_connect.xml
core
find-bad-php.sh [new file with mode: 0755]
index.php

index 6ee84878739f623d34ebb7257180454db085086b..a99055086c52c919fecc524c995b678581798f4a 100644 (file)
@@ -22,7 +22,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0
- * @copyright  Copyright (c) 2007 - 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007 - 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  *
  * This program is free software: you can redistribute it and/or modify
@@ -152,10 +152,10 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
                // Set this application in registry
                Registry::getRegistry()->addInstance('app', $this);
 
-               // Is no external IP set?
-               if ($this->getConfigInstance()->getConfigEntry('external_ip') == '') {
-                       // Determine external IP
-                       $this->getConfigInstance()->setConfigEntry('external_ip', ConsoleTools::determineExternalIp());
+               // Is no external address set?
+               if ($this->getConfigInstance()->getConfigEntry('external_address') == '') {
+                       // Determine external address
+                       $this->getConfigInstance()->setConfigEntry('external_address', HubTools::determineOwnExternalAddress());
                } // END - if
 
                // Default response is console
index bf693f8e54ea6a14f073736bf564a5df8f12e7ad..5f4bff07a02abfb3f468e9bfd00d7b03e472ebed 100644 (file)
@@ -9,14 +9,14 @@
  * objects which would be rejected by the global network) please change
  * hub_bootstrap_nodes (semicolon-seperated list) to your bootstrapper.
  *
- * You can set external_ip to a hostname, e.g. me.homelinux.org, which will be
+ * You can set external_address to a hostname, e.g. me.homelinux.org, which will be
  * included in the announcement. This is very useful for consumer DSL
  * connections because they might be disconnected every 24 hours and rotate the
  * IP number.
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0
- * @copyright  Copyright (c) 2007 - 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007 - 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  *
  * This program is free software: you can redistribute it and/or modify
@@ -45,14 +45,14 @@ $cfg->setConfigEntry('node_listen_port', 9060);
 // CFG: NODE-DEFAULT-MODE (can be 'regular', 'list', 'master' or 'boot', default is 'regular')
 $cfg->setConfigEntry('node_default_mode', 'regular');
 
-// CFG: EXTERNAL-IP
-// Use this if auto-detection fails: $cfg->setConfigEntry('external_ip', '');
+// CFG: EXTERNAL-ADDRESS
+// Use this if auto-detection fails: $cfg->setConfigEntry('external_address', '');
 
-// CFG: ALLOW-PUBLISH-INTERNAL-IP
-// Use this in intranet-only environment: $cfg->setConfigEntry('allow_publish_internal_ip', 'Y');
+// CFG: ALLOW-PUBLISH-INTERNAL-ADDRESS
+// Use this in intranet-only environment: $cfg->setConfigEntry('allow_publish_internal_address', 'Y');
 
 // CFG: HUB-BOOTSTRAP-NODES
-$cfg->setConfigEntry('hub_bootstrap_nodes', '188.138.90.169:9060');
+$cfg->setConfigEntry('hub_bootstrap_nodes', 'tcp://188.138.90.169:9060');
 
 // [EOF]
 ?>
index 33069d54f026ad4de21587a26a55474c806ba3d0..855dbfd3d791414b88c0ea8ab0bd3504d03728ce 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0
- * @copyright  Copyright (c) 2007 - 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007 - 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  *
  * This program is free software: you can redistribute it and/or modify
@@ -729,6 +729,18 @@ $cfg->setConfigEntry('socket_discovery_class', 'PackageSocketDiscovery');
 // CFG: DHT-RECIPIENT-DISCOVERY-CLASS
 $cfg->setConfigEntry('dht_recipient_discovery_class', 'DhtRecipientDiscovery');
 
+// CFG: UNL-DISCOVERY-CLASS
+$cfg->setConfigEntry('unl_discovery_class', 'UniversalNodeLocatorDiscovery');
+
+// CFG: PROTOCOL-DISCOVERY-CLASS
+$cfg->setConfigEntry('protocol_discovery_class', 'ProtocolDiscovery');
+
+// CFG: TCP-PROTOCOL-HANDLER-CLASS
+$cfg->setConfigEntry('tcp_protocol_handler_class', 'TcpProtocolHandler');
+
+// CFG: UNIVERSAL-NODE-LOCATOR-CLASS
+$cfg->setConfigEntry('universal_node_locator_class', 'UniversalNodeLocator');
+
 // CFG: RECIPIENT-LIST-CLASS
 $cfg->setConfigEntry('recipient_list_class', 'RecipientList');
 
@@ -741,6 +753,12 @@ $cfg->setConfigEntry('tcp_connection_helper_class', 'TcpConnectionHelper');
 // CFG: UDP-CONNECTION-HELPER-CLASS
 $cfg->setConfigEntry('udp_connection_helper_class', 'UdpConnectionHelper');
 
+// CFG: HUB-COMMUNICATION-PROTOCOL-TYPE
+$cfg->setConfigEntry('hub_communication_protocol_type', 'tcp');
+
+// CFG: TCP-PROTOCOL-RESOLVER-CLASS
+$cfg->setConfigEntry('tcp_protocol_resolver_class', 'TcpProtocolResolver');
+
 // CFG: TCP-BUFFER-LENGTH
 $cfg->setConfigEntry('tcp_buffer_length', 1024);
 
@@ -775,14 +793,14 @@ $cfg->setConfigEntry('private_key', '');
 // CFG: PRIVATE-KEY-HASH
 $cfg->setConfigEntry('private_key_hash', '');
 
-// CFG: INTERNAL-IP
-$cfg->setConfigEntry('internal_ip', ConsoleTools::acquireSelfIPAddress());
+// CFG: EXTERNAL-ADDRESS
+$cfg->setConfigEntry('external_address', '');
 
-// CFG: EXTERNAL-IP
-$cfg->setConfigEntry('external_ip', '');
+// CFG: INTERNAL-ADDRESS
+$cfg->setConfigEntry('internal_address', '');
 
-// CFG: ALLOW-PUBLISH-INTERNAL-IP
-$cfg->setConfigEntry('allow_publish_internal_ip', 'N');
+// CFG: ALLOW-PUBLISH-INTERNAL-ADDRESS
+$cfg->setConfigEntry('allow_publish_internal_address', 'N');
 
 // CFG: NODE-STATUS
 $cfg->setConfigEntry('node_status', 'invalid');
@@ -1460,8 +1478,8 @@ $cfg->setConfigEntry('task_crawler_uploaded_list_scanner_interval_delay', 1000);
 // CFG: TASK-CRAWLER-URL-SOURCE-FOUND-RSS-MAX-RUNS
 $cfg->setConfigEntry('task_crawler_uploaded_list_scanner_max_runs', 0);
 
-// CFG: CSV-FILE-PATH
-$cfg->setConfigEntry('csv_file_path', 'data/url_lists');
+// CFG: CRAWLER-CSV-FILE-PATH
+$cfg->setConfigEntry('crawler_csv_file_path', 'data/url_lists');
 
 ///////////////////////////////////////////////////////////////////////////////
 //                            HTTP Configuration
index a2870c05c04f8d332721c409f2d85ed8222882b8..054c9374115ada9679cd8700aa0873df527aaa51 100644 (file)
@@ -7,7 +7,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 5fe2cdc4e9a232b0211829c508c9f5ebcb4f1997..ee6d5b66d56eb168ed566ec0b41d29e4a6243c33 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0
- * @copyright  Copyright (c) 2007 - 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007 - 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  *
  * This program is free software: you can redistribute it and/or modify
index a7c409ae1805ab82a18d5fc06dc0e6d3a423b36c..18642da28013a7d9a5c250f2cddef5be0296477b 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0
- * @copyright  Copyright (c) 2007 - 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007 - 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  *
  * This program is free software: you can redistribute it and/or modify
index ff059215476d94cd4924344810a5a8849a52dde9..3004802cd2eb399dc1ca3a29c37f5066de4ed35e 100644 (file)
@@ -5,7 +5,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -32,14 +32,13 @@ class AnnouncementNotAcceptedException extends FrameworkException {
         */
        public function __construct (array $messageArray, $code) {
                // Construct the message
-               $message = sprintf('[%s:%d] This node (%s) is not accepting announcements, but got one from session-id=%s,ip=%s/%s,listen port=%s,status=%s,mode=%s',
+               $message = sprintf('[%s:%d] This node (%s) is not accepting announcements, but got one from session-id=%s,unl=%s/%s,status=%s,mode=%s',
                        $messageArray[0]->__toString(),
                        $this->getLine(),
                        $messageArray[1]->__toString(),
                        $messageArray[2][XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID],
-                       $messageArray[2][XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_IP],
-                       $messageArray[2][XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_IP],
-                       $messageArray[2][XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_LISTEN_PORT],
+                       $messageArray[2][XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_ADDRESS],
+                       $messageArray[2][XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_ADDRESS],
                        $messageArray[2][XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_NODE_STATUS],
                        $messageArray[2][XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_NODE_MODE]
                );
index ba21567d9f010d31c59f7755d70516b76dc5ca4e..a9531006048e2a9ab350b86e15416b74e1ffb503 100644 (file)
@@ -5,7 +5,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -32,14 +32,13 @@ class NoAnnouncementAttemptedException extends FrameworkException {
         */
        public function __construct (array $messageArray, $code) {
                // Construct the message
-               $message = sprintf('[%s:%d] This node (%s) has not attempted to announce itself, but got an answer from session-id=%s,ip=%s/%s,listen port=%s,status=%s.',
+               $message = sprintf('[%s:%d] This node (%s) has not attempted to announce itself, but got an answer from session-id=%s,unl=%s/%s,status=%s.',
                        $messageArray[0]->__toString(),
                        $this->getLine(),
                        $messageArray[1]->__toString(),
                        $messageArray[2][XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID],
-                       $messageArray[2][XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_IP],
-                       $messageArray[2][XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_IP],
-                       $messageArray[2][XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_LISTEN_PORT],
+                       $messageArray[2][XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_ADDRESS],
+                       $messageArray[2][XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_ADDRESS],
                        $messageArray[2][XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_NODE_STATUS]
                );
 
index 74ffabb24c7ac98deea227e12d5e65f32695e70e..33edad1f380dbc7e1c1d5178b625b3293c89c4d1 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 66a905e97b1039656ec0fcdc0e67c44d6b375cfb..e2637e3aebb34823759a582106e66a56ef640f4a 100644 (file)
@@ -5,7 +5,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -32,14 +32,13 @@ class DhtBootstrapNotAcceptedException extends FrameworkException {
         */
        public function __construct (array $messageArray, $code) {
                // Construct the message
-               $message = sprintf('[%s:%d] This node (%s) is not accepting DHT bootstrap requests, but got one from session-id=%s,ip=%s/%s,listen port=%s,status=%s,mode=%s',
+               $message = sprintf('[%s:%d] This node (%s) is not accepting DHT bootstrap requests, but got one from session-id=%s,unl=%s/%s,status=%s,mode=%s',
                        $messageArray[0]->__toString(),
                        $this->getLine(),
                        $messageArray[0]->getNodeInstance()->__toString(),
                        $messageArray[1][XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_SESSION_ID],
-                       $messageArray[1][XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_EXTERNAL_IP],
-                       $messageArray[1][XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_INTERNAL_IP],
-                       $messageArray[1][XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_LISTEN_PORT],
+                       $messageArray[1][XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_EXTERNAL_ADDRESS],
+                       $messageArray[1][XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_INTERNAL_ADDRESS],
                        $messageArray[1][XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_NODE_STATUS],
                        $messageArray[1][XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_NODE_MODE]
                );
index 3d73caf9160f9ede120e065799f15a883cecbd31..68c03c13823d7b64a5d5de05cf92eb15d1068148 100644 (file)
@@ -5,7 +5,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 6f0cdc6946cff152a064fe537b9209447678d0df..3d91bd7f45248e25285c91995844e95ad18f4838 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index dbf11328bfa9a25e2d3b8652c250409a8c406d64..535a0e3b5e8e67d741f839862debce28ab7994ac 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 8f3fe264fb7fb6351b4d4630d0f4d5813551f615..7f290ae009d562cdc7b9d1fd41d0eb0e08d7c58e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 3ef764fda3368a558c84ccfe6227a73f614cb93d..551c0e04e7a37f50ca16d765b17dc3d109360409 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index a96831c54a7f1cd4a707b8f49665b41c824fbcd5..d6898a2f56c15200e3654b84556c31e12a90ce4d 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 4f89d51700307970a8a61654717e06451a4edc68..169ed9feb33ac2a2f2c51271ec7fe98e6ad92fcc 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 33d33b8815bcce6183558001b785e1ba8bca0701..1acf2b29edc44ac853665153695f57984e6df620 100644 (file)
@@ -2,11 +2,11 @@
 /**
  * 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
- * IP/port combination doesn't match to it.
+ * address doesn't match to it.
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -33,13 +33,12 @@ class NodeSessionIdVerficationException extends FrameworkException {
         */
        public function __construct (array $messageArray, $code) {
                // Construct the message
-               $message = sprintf('[%s:%d] Session id %s cannot be verfied. ip=%s/%s,listen port=%s,status=%s.',
+               $message = sprintf('[%s:%d] Session id %s cannot be verfied. unl=%s/%s,status=%s.',
                        $messageArray[0]->__toString(),
                        $this->getLine(),
                        $messageArray[1][XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID],
-                       $messageArray[1][XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_IP],
-                       $messageArray[1][XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_IP],
-                       $messageArray[1][XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_LISTEN_PORT],
+                       $messageArray[1][XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_ADDRESS],
+                       $messageArray[1][XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_ADDRESS],
                        $messageArray[1][XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_NODE_STATUS]
                );
 
index 1ec55d640e5b5469f679fc0af15b06e8a8696fe0..d8ba0021516af4a385d1d284030b316b0b86ff21 100644 (file)
@@ -5,7 +5,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index da2bc467c2e477d7ddf7fd0f5ae9602302db47b1..e2e50c74ce9537dd776a9a04abf1f6ea062fb913 100644 (file)
@@ -5,7 +5,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index d72bec643d8887246a8285417334547e7a5410f6..7b2d89c759ff99dec44fd9a3f473585a3eb4190b 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 1fdef6b5d53b9a52d86f0b1d1fc2fea4d943319a..0c4a04a9c08d225bedb2e4604cd12d31ba01e662 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 864292993934f05d179dc054b0577ab5c3cc0d5e..c211d002875cd51db64b43c7c8717193fe33603b 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 0eb7e2c202ba311fe93636486a27e728ccaa5d59..ed58f0d2921e849e734e247147ebb84cb0e1eeea 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 0706d6f0b9d84fb3fcc5c75de8a7981e15b44e3f..042e4048bb40e3eb08830ce144b3d0e6a093ff96 100644 (file)
@@ -6,7 +6,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index d369e6312001ad1cb6b5eb2d8dfaf8057de88d70..02e7546223c34021195ab92b69a2989dc520ae1b 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 1ad035033e96b940f035ce20c50f2e4a21cfbd69..4daf9ae14b62456898a678342f29575378d64e8c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index bebe02b07393de78ea557ae27347164f85a4c509..ce41f4bfb7b7fea2cf6f49e5f012e5b9f0d9aa7c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 8683bfc0edf69fe237513412feef7cc65fa9ccfe..062c37d2c9c7727c9009903816227be123d0c0c7 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 94a3bfb20e6299bce3d4df37649d967f70f9dd71..998d1ab25565c7514f5628238c04c110c55a82ee 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index c06f05f5154da4c076b41de95fa88e08af873fa5..318782cb70daa6d68b18a6dbe56ceca01bd1f99a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -31,12 +31,11 @@ class NodeAlreadyRegisteredException extends FrameworkException {
         */
        public function __construct (array $messageArray, $code) {
                // Construct the message
-               $message = sprintf('[%s:%d] Node already registered: session-id=%s, external-ip=%s, listen-port=%s',
+               $message = sprintf('[%s:%d] Node already registered: session-id=%s, external-address=%s',
                        $messageArray[0]->__toString(),
                        $this->getLine(),
                        $msssageArray[1][NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_SESSION_ID],
-                       $msssageArray[1][NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_EXTERNAL_IP],
-                       $msssageArray[1][NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_LISTEN_PORT],
+                       $msssageArray[1][NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_EXTERNAL_ADDRESS]
                );
 
                // Call parent exception constructor
index e679caae4b56e96315c9693b4d344d386abb3dbe..c2de8a4be7876b5605a6bde70881b1bcffb91d98 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -31,12 +31,11 @@ class NodeDataMissingException extends FrameworkException {
         */
        public function __construct (array $messageArray, $code) {
                // Construct the message
-               $message = sprintf('[%s:%d] Node not registered/missing: session-id=%s, external-ip=%s, listen-port=%s',
+               $message = sprintf('[%s:%d] Node not registered/missing: session-id=%s, external-address=%s',
                        $messageArray[0]->__toString(),
                        $this->getLine(),
                        $msssageArray[1][NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_SESSION_ID],
-                       $msssageArray[1][NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_EXTERNAL_IP],
-                       $msssageArray[1][NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_LISTEN_PORT],
+                       $msssageArray[1][NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_EXTERNAL_ADDRESS]
                );
 
                // Call parent exception constructor
index d5920d42ab95ed2fe7b91eac213eb85ab978d7ef..42cf824036aea8ee55f8bed7e1ee14cba14640e1 100644 (file)
@@ -7,7 +7,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0
- * @copyright  Copyright (c) 2007 - 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007 - 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  *
  * This program is free software: you can redistribute it and/or modify
@@ -34,8 +34,8 @@ require($cfg->getConfigEntry('base_path') . 'inc/output.php');
 // the inc/database.php script
 require($cfg->getConfigEntry('base_path') . 'inc/database.php');
 
-// Get's our IP address
-ConsoleTools::acquireSelfIPAddress();
+// Get own internal address
+HubTools::determineOwnInternalAddress();
 
 // [EOF]
 ?>
index 3440d33aed6ea8ab16c37b93ea4887d4f9fcc09a..2e31e8273098510feea2a010695a9f3c924e1928 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               We need to find a better name for this interface
index 4d4c285e33bf9d663ce0b53b181757ae0700f58d..1199bd2fa41c822eb7cab6784c009619d369f8ab 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 9eec33074a8f490e874c5fa4e7414bdfa40b7dbf..bf9c84142d19855dbfbad9f972ba100616a1a911 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
diff --git a/application/hub/interfaces/discovery/class_Discoverable b/application/hub/interfaces/discovery/class_Discoverable
new file mode 100644 (file)
index 0000000..8c49835
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * An interface for !!! discovery
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core 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/>.
+ */
+interface Discoverable!!! extends Discoverable {
+}
+
+// [EOF]
+?>
index b10b10dc2cc7c00106317dd47e619a5d49ca7479..8bb0dc9f0b0528b34ef40840acc81ce8941a9218 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 interface Discoverable extends FrameworkInterface {
-       /**
-        * "Getter" for recipient iterator
-        *
-        * @return      $iteratorInstance       An instance of a Iterateable object
-        */
-       function getIterator ();
-
-       /**
-        * Clears all recipients for e.g. another package to deliver
-        *
-        * @return      void
-        */
-       function clearRecipients ();
-
-       /**
-        * Checks whether the recipient list is empty
-        *
-        * @return      $isEmpty        Whether the recipient list is empty
-        */
-       function isRecipientListEmpty ();
 }
 
 // [EOF]
diff --git a/application/hub/interfaces/discovery/dht/.htaccess b/application/hub/interfaces/discovery/dht/.htaccess
deleted file mode 100644 (file)
index 3a42882..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Deny from all
diff --git a/application/hub/interfaces/discovery/dht/class_DiscoverableDhtRecipient.php b/application/hub/interfaces/discovery/dht/class_DiscoverableDhtRecipient.php
deleted file mode 100644 (file)
index d015336..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-/**
- * An interface for socket discovery
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core 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/>.
- */
-interface DiscoverableDhtRecipient extends Discoverable {
-       /**
-        * Resolves one or more recipients for a DHT transfer by given package data.
-        *
-        * @param       $packageData    Valid package data array
-        * @return      $recipients             An indexed array with DHT recipients
-        */
-       function resolveRecipientsByPackageData (array $packageData);
-}
-
-// [EOF]
-?>
diff --git a/application/hub/interfaces/discovery/node/.htaccess b/application/hub/interfaces/discovery/node/.htaccess
deleted file mode 100644 (file)
index 3a42882..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Deny from all
diff --git a/application/hub/interfaces/discovery/node/class_DiscoverableNodeRecipient.php b/application/hub/interfaces/discovery/node/class_DiscoverableNodeRecipient.php
deleted file mode 100644 (file)
index 2b1b7b4..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php
-/**
- * An interface for recipient discovery
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core 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/>.
- */
-interface DiscoverableNodeRecipient extends Discoverable, IteratorAggregate {
-       /**
-        * Tries to discover all recipients for given package data
-        *
-        * @param       $packageData    Raw package data array
-        * @return      void
-        */
-       function discoverRecipients (array $packageData);
-
-       /**
-        * Tries to discover all recipients by given decoded package data.
-        *
-        * @param       $decodedData    Raw raw package data array
-        * @return      void
-        */
-       function discoverRawRecipients (array $decodedData);
-
-       /**
-        * "Getter" for recipient iterator
-        *
-        * @return      $iteratorInstance       An instance of a Iterateable object
-        */
-       function getIterator ();
-
-       /**
-        * Clears all recipients for e.g. another package to deliver
-        *
-        * @return      void
-        */
-       function clearRecipients ();
-}
-
-// [EOF]
-?>
diff --git a/application/hub/interfaces/discovery/protocol/.htaccess b/application/hub/interfaces/discovery/protocol/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/interfaces/discovery/protocol/class_DiscoverableProtocol.php b/application/hub/interfaces/discovery/protocol/class_DiscoverableProtocol.php
new file mode 100644 (file)
index 0000000..97c894f
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+/**
+ * An interface for protocol discovery
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core 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/>.
+ */
+interface DiscoverableProtocol extends Discoverable {
+       /**
+        * "Discovers" the protocol type from given raw package data. This is done
+        * by looking at the 'recipient' field and extract the first part from it.
+        *
+        * @param       $packageData    Raw package data
+        * @return      $protocolType   Type of protocol, e.g. 'tcp' for TCP/IPv4 connections
+        */
+       function discoverProtocolByPackageData (array $packageData);
+}
+
+// [EOF]
+?>
diff --git a/application/hub/interfaces/discovery/recipient/.htaccess b/application/hub/interfaces/discovery/recipient/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/interfaces/discovery/recipient/class_DiscoverableRecipient.php b/application/hub/interfaces/discovery/recipient/class_DiscoverableRecipient.php
new file mode 100644 (file)
index 0000000..28f7db1
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+/**
+ * An interface for recipient discovery
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core 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/>.
+ */
+interface DiscoverableRecipient extends Discoverable {
+       /**
+        * "Getter" for recipient iterator
+        *
+        * @return      $iteratorInstance       An instance of a Iterateable object
+        */
+       function getIterator ();
+
+       /**
+        * Clears all recipients for e.g. another package to deliver
+        *
+        * @return      void
+        */
+       function clearRecipients ();
+
+       /**
+        * Checks whether the recipient list is empty
+        *
+        * @return      $isEmpty        Whether the recipient list is empty
+        */
+       function isRecipientListEmpty ();
+}
+
+// [EOF]
+?>
diff --git a/application/hub/interfaces/discovery/recipient/dht/.htaccess b/application/hub/interfaces/discovery/recipient/dht/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/interfaces/discovery/recipient/dht/class_DiscoverableDhtRecipient.php b/application/hub/interfaces/discovery/recipient/dht/class_DiscoverableDhtRecipient.php
new file mode 100644 (file)
index 0000000..79e721c
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+/**
+ * An interface for DHT recipient discovery
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core 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/>.
+ */
+interface DiscoverableDhtRecipient extends DiscoverableRecipient {
+       /**
+        * Resolves one or more recipients for a DHT transfer by given package data.
+        *
+        * @param       $packageData    Valid package data array
+        * @return      $recipients             An indexed array with DHT recipients
+        */
+       function resolveRecipientsByPackageData (array $packageData);
+}
+
+// [EOF]
+?>
diff --git a/application/hub/interfaces/discovery/recipient/node/.htaccess b/application/hub/interfaces/discovery/recipient/node/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/interfaces/discovery/recipient/node/class_DiscoverableNodeRecipient.php b/application/hub/interfaces/discovery/recipient/node/class_DiscoverableNodeRecipient.php
new file mode 100644 (file)
index 0000000..a36d119
--- /dev/null
@@ -0,0 +1,43 @@
+<?php
+/**
+ * An interface for node recipient discovery
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core 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/>.
+ */
+interface DiscoverableNodeRecipient extends DiscoverableRecipient {
+       /**
+        * Tries to discover all recipients for given package data
+        *
+        * @param       $packageData    Raw package data array
+        * @return      void
+        */
+       function discoverRecipients (array $packageData);
+
+       /**
+        * Tries to discover all recipients by given decoded package data.
+        *
+        * @param       $decodedData    Raw raw package data array
+        * @return      void
+        */
+       function discoverRawRecipients (array $decodedData);
+}
+
+// [EOF]
+?>
diff --git a/application/hub/interfaces/discovery/recipient/socket/.htaccess b/application/hub/interfaces/discovery/recipient/socket/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/interfaces/discovery/recipient/socket/class_DiscoverableSocket.php b/application/hub/interfaces/discovery/recipient/socket/class_DiscoverableSocket.php
new file mode 100644 (file)
index 0000000..a943526
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+/**
+ * An interface for socket discovery
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core 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/>.
+ */
+interface DiscoverableSocket extends DiscoverableRecipient {
+       /**
+        * Tries to discover the right socket for given package data and returns a
+        * matching socket resource.
+        *
+        * @param       $packageData            Raw package data array
+        * @param       $connectionType         Type of connection, can be 'incoming' or 'outgoing', *NEVER* 'server'!
+        * @return      $socketResource         A valid socket resource
+        * @throws      NoListGroupException    If the procol group is not found in peer list
+        * @throws      NullPointerException    If listenerInstance is NULL
+        */
+       function discoverSocket (array $packageData, $connectionType);
+}
+
+// [EOF]
+?>
diff --git a/application/hub/interfaces/discovery/socket/.htaccess b/application/hub/interfaces/discovery/socket/.htaccess
deleted file mode 100644 (file)
index 3a42882..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Deny from all
diff --git a/application/hub/interfaces/discovery/socket/class_DiscoverableSocket.php b/application/hub/interfaces/discovery/socket/class_DiscoverableSocket.php
deleted file mode 100644 (file)
index 332bf1e..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-/**
- * An interface for socket discovery
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core 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/>.
- */
-interface DiscoverableSocket extends Discoverable {
-       /**
-        * Tries to discover the right socket for given package data and returns a
-        * matching socket resource.
-        *
-        * @param       $packageData            Raw package data array
-        * @param       $connectionType         Type of connection, can be 'incoming' or 'outgoing', *NEVER* 'server'!
-        * @return      $socketResource         A valid socket resource
-        * @throws      NoListGroupException    If the procol group is not found in peer list
-        * @throws      NullPointerException    If listenerInstance is NULL
-        */
-       function discoverSocket (array $packageData, $connectionType);
-}
-
-// [EOF]
-?>
diff --git a/application/hub/interfaces/discovery/unl/.htaccess b/application/hub/interfaces/discovery/unl/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/interfaces/discovery/unl/class_DiscoverableUniversalNodeLocator.php b/application/hub/interfaces/discovery/unl/class_DiscoverableUniversalNodeLocator.php
new file mode 100644 (file)
index 0000000..769389f
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+/**
+ * An interface for UNL discovery
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core 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/>.
+ */
+interface DiscoverableUniversalNodeLocator extends Discoverable {
+       /**
+        * "Discovers" an instance of a LocateableNode class for given NodeHelper class
+        *
+        * @param       $nodeInstance   An instance of a NodeHelper class
+        * @return      $unlInstance    An instance of a LocateableNode class
+        */
+       function discoverUniversalNodeLocatorByNode (NodeHelper $nodeInstance);
+
+       /**
+        * "Discovers" the full universal node locator for given configuration entry
+        * which should represent the address part of the UNL. In case of an IP
+        * address, this *must not* include the port number as this is being found
+        * out for you.
+        *
+        * Valid values for $configKey: internal,external
+        *
+        * @param       $configKey      Key for address to get (valid: internal,external)
+        * @return      $unl            Universal node locator
+        */
+       function discoverUniversalNodeLocatorByConfiguredAddress ($configKey);
+}
+
+// [EOF]
+?>
index 4ed84d86a1636e519f32503f88cd70cf7c98f170..a58ec5436cb8a7d1bb8000cc06a570519f175791 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index c44bc463ca5780f4d4ba8b0ea09f784cc363fae0..9461918a5741bb361a620f0c88c617f476e6a662 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -35,28 +35,28 @@ interface DistributableNode extends Distributable {
         * following data must always be present:
         *
         * - session-id  (for finding the node's record together with below data)
-        * - external-ip (hostname or IP number)
+        * - external-address (hostname or IP number)
         * - listen-port (TCP/UDP listen port for inbound connections)
         *
         * @param       $messageData            An array with all minimum message data
-        * @param       $handlerInstance        An instance of a Handleable class
+        * @param       $handlerInstance        An instance of a HandleableDataSet class
         * @param       $forceUpdate            Optionally force update, don't register (default: register if not found)
         * @return      void
         */
-       function registerNodeByMessageData (array $messageData, Handleable $handlerInstance, $forceUpdate = FALSE);
+       function registerNodeByMessageData (array $messageData, HandleableDataSet $handlerInstance, $forceUpdate = FALSE);
 
        /**
         * Queries the local DHT data(base) for a node list with all supported
         * object types except the node by given session id.
         *
         * @param       $messageData            An array with message data from a node_list request
-        * @param       $handlerInstance        An instance of a Handleable class
+        * @param       $handlerInstance        An instance of a HandleableDataSet class
         * @param       $excludeKey                     Array key which should be excluded
         * @param       $andKey                         Array of $separator-separated list of elements which all must match
         * @param       $separator                      Sepator char (1st parameter for explode() call)
         * @return      $nodeList                       An array with all found nodes
         */
-       function queryLocalNodeListExceptByMessageData (array $messageData, Handleable $handlerInstance, $excludeKey, $andKey, $separator);
+       function queryLocalNodeListExceptByMessageData (array $messageData, HandleableDataSet $handlerInstance, $excludeKey, $andKey, $separator);
 
        /**
         * Inserts given node list array (from earlier database result produced by
index d85585cd571db5940167a726fe56bf53e366a70b..11ee81b7d0f15719837fe772ab76b9fd7c5c875a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index c046d3276ebefa491ba8f55c7dc0702ca6be75cb..4a700c0cd3273c6ceaafafbfe91920184bf912bc 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 86dbb9eaff72ce91a0a56fdf277c9758b6bc7845..bdbf13bac05f71dc09616cc704af18268e7f8106 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface HandleableAnswerStatus extends Handleable {
+interface HandleableAnswerStatus extends HandleableDataSet {
        /**
         * Handles given message data array
         *
index 173e70666f66890083639cf2e03b87892cb9b9c5..76d7b56b2c16e26c1ea9c5b485a99b0a9bb330e1 100644 (file)
@@ -1,10 +1,10 @@
 <?php
 /**
- * Handleable chunks interface
+ * An interface for chunk handlers
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
diff --git a/application/hub/interfaces/handler/class_Handleable.php b/application/hub/interfaces/handler/class_Handleable.php
deleted file mode 100644 (file)
index 66c0c29..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-/**
- * A Handleable interface
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 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/>.
- */
-interface Handleable extends FrameworkInterface {
-       /**
-        * Adds all required elements from given array into data set instance
-        *
-        * @param       $dataSetInstance        An instance of a StoreableCriteria class
-        * @param       $messageData            An array with all message data
-        * @return      void
-        */
-       function addArrayToDataSet (StoreableCriteria $dataSetInstance, array $messageData);
-}
-
-// [EOF]
-?>
index ea4246c822139dff0b3df961d1c0b9ddce5a1111..8bf0ab5a9f588193df586e7ec338c3f4c22326cf 100644 (file)
@@ -1,10 +1,10 @@
 <?php
 /**
- * Handleable chunks interface
+ * An interface for message handlers
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface HandleableMessage extends Handleable {
+interface HandleableMessage extends HandleableDataSet {
        /**
         * Handles data array of the message
         *
index f250481ed19ee6e6889b508ab07351f7dd0759f2..242491123b7f9530a0028bf1f14ea953ba7a5bdf 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface Networkable extends Handleable {
+interface Networkable extends HandleableDataSet {
        /**
         * Processes raw data from given resource. This is mostly useful for TCP
         * package handling and is implemented in the TcpListener class
index 2020c566f84a6dd39e1e5e2ef4078f85ff276781..905fd664e8079e9370e082cbc8b72d6c2ba81733 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface HandleableTask extends Handleable {
+interface HandleableTask extends HandleableDataSet {
        /**
         * Searches a task by given instance
         *
index f6530d87b5c096ebfed0c8263e786edd5b11dd6f..6bf7b5cd341b777339116626ae8e1cc10446a574 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               Please find another name for this interface
@@ -22,7 +22,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface ConnectionHelper extends Helper {
+interface ConnectionHelper extends HubHelper {
        /**
         * Sends raw package data to the recipient
         *
@@ -42,18 +42,11 @@ interface ConnectionHelper extends Helper {
        function doShutdown ();
 
        /**
-        * Getter for port number to satify ProtocolHandler
+        * Getter for port number to satify HandleableProtocol
         *
         * @return      $port   The port number
         */
-       function getPort ();
-
-       /**
-        * Getter for protocol
-        *
-        * @return      $protocol       Used protocol
-        */
-       function getProtocol ();
+       function getConnectionPort ();
 
        /**
         * Getter for IP address
index c0864204a7e2273e533dfafd2af543fd8d5c8c2f..a7aafa2b1b562f5d2c2a51e9c7c0571c410d01f6 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface HelpableDht extends Helper {
+interface HelpableDht extends HubHelper {
        /**
         * Loads the descriptor XML file
         *
diff --git a/application/hub/interfaces/helper/hub/class_HubHelper.php b/application/hub/interfaces/helper/hub/class_HubHelper.php
new file mode 100644 (file)
index 0000000..853eb02
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+/**
+ * An general interface for hub helper classes
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 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/>.
+ */
+interface HubHelper extends Helper {
+       /**
+        * Tries to determine the used protocol for this package (this helper is helping to send out)
+        *
+        * @return      $protocolType   Type of protocol to use, usually TCP
+        */
+       function determineProtocolType ();
+}
+
+// [EOF]
+?>
index 72570eb4993a69f3258f309287618933e4d362ed..3385cfe32927140b0d2c677e04e51f68e8cee313 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               Please find another name for this interface
index 177610f20216a83837f240434f318d2e53f2b368..fc783208bdc0da9f6a6c88c5b59bb15e83802668 100644 (file)
@@ -1,10 +1,10 @@
 <?php
 /**
- * An interface for hub helper classes
+ * An interface for node helper classes
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface HelpableNode extends Helper {
+interface HelpableNode extends HubHelper {
        /**
         * Loads the descriptor XML file
         *
index 325c8e12d9250efaa0c6d227de427d0cef1093ba..31354fa47a9a99c42e62878e9737425ae0198630 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               We need to find a better name for this interface
@@ -109,18 +109,18 @@ interface NodeHelper extends Helper, AddableCriteria {
        function doSelfConnection (Taskable $taskInstance);
 
        /**
-        * "Getter for address:port combination
+        * Determines an instance of a LocateableNode class
         *
-        * @return      $addressPort    A address:port combination for this node
+        * @return      $unlInstance    An instance of a LocateableNode class for this node
         */
-       function getAddressPort ();
+       function determineUniversalNodeLocator ();
 
        /**
-        * "Getter for address:port array
+        * "Getter for an array of an instance of a LocateableNode class
         *
-        * @return      $addressPortArray       An array address:port combination for this node
+        * @return      $unlData        An array of an instance of a LocateableNode class
         */
-       function getAddressPortArray ();
+       function getUniversalNodeLocatorArray ();
 
        /**
         * Updates/refreshes node data (e.g. state).
index c8070e383092e0775debe7b718baa696c68ec494..ec878cc538ffe69823c904c3b88d092d5e6e49df 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface Listenable extends ProtocolHandler {
+interface Listenable extends FrameworkInterface {
        /**
         * Initializes the listener by setting up the required socket server
         *
@@ -52,6 +52,27 @@ interface Listenable extends ProtocolHandler {
         * @return      void
         */
        function monitorIncomingRawData (Receivable $receiverInstance);
+
+       /**
+        * Getter for listen address
+        *
+        * @return      $listenAddress  The address this listener should listen on
+        */
+       function getListenAddress ();
+
+       /**
+        * Getter for listen port
+        *
+        * @return      $listenPort             The port this listener should listen on
+        */
+       function getListenPort ();
+
+       /**
+        * Getter for peer pool instance
+        *
+        * @return      $poolInstance   The peer pool instance we shall set
+        */
+       function getPoolInstance ();
 }
 
 // [EOF]
index 584925243cdb5ce4d0c4c9ea6a222d78e1d55aef..b648e03dc86787afbce5da59a9698bd8ad9b4c9c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
diff --git a/application/hub/interfaces/locator/.htaccess b/application/hub/interfaces/locator/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/interfaces/locator/class_LocateableNode.php b/application/hub/interfaces/locator/class_LocateableNode.php
new file mode 100644 (file)
index 0000000..8be0226
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * An interface for node locators (UNL mostly)
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 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/>.
+ */
+interface LocateableNode extends FrameworkInterface {
+}
+
+// [EOF]
+?>
index b46725f16c3d5547ada8aaa8fa3c770a9dfb94f0..9fd3f12efb225c37c588e564f636f9c99d76af33 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 35a1a27e178623852ae6cda325a6e0892c4391c2..e1b92c164807fcdb1fed7023e3399f662369bc93 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index e76ceb459a96b3bd2a4d6d0f822da765930bfb5c..95b3b1fdc0f3d680dd3ca570c8a4712878775eed 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index b87a91992cdb68536d79b565149f719e217eb5c8..08ce5c356588a43320787f8e1952fe599e6d665c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 292209360af3c0346d37422f77dae5632f713f89..7f6b56c2ccef60dd2488e52316143557801390c1 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -27,11 +27,10 @@ interface Deliverable extends FrameworkInterface {
         * from given helper's template instance and pushing it on the 'undeclared'
         * stack.
         *
-        * @param       $helperInstance         An instance of a Helper class
-        * @param       $protocol                       Name of used protocol (TCP/UDP)
+        * @param       $helperInstance         An instance of a HubHelper class
         * @return      void
         */
-       function enqueueRawDataFromTemplate (Helper $helperInstance, $protocol);
+       function enqueueRawDataFromTemplate (HubHelper $helperInstance);
 
        /**
         * Checks whether a package has been enqueued for delivery.
index 55e081b5fcd459d9bad8a231932040967345c5cd..aaef2c387a96411199a1bdf3292be62a5afcca63 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 51d962fa52b547eac49ff371131477f71ceb33bf..d7e6d61f3b2a375afcaad3fa9891333e550be295 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index a1e51816c67e0cf1274d1bd37bd94b1327a181f7..8776131ed5fe191c83a0043f754cff55d3b1a254 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 57cc054471d9b2726a517010b5d71c37ac6fa40b..c09d17ce5b8c522e4850298ed2f41c30f68b7be3 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 79e8a08c41eb82efc8d139a8657e9423bafb90af..badd521df3e3410b3d6fed08738f36b7b7c68641 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 2c61358d104b14e02d94e738b8a13f09fbc6fbce..7ca78f23e3131b561ae3b42af680b534b7ce63ad 100644 (file)
@@ -5,7 +5,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 611fdcc1b9a8d080e5ff4d18bbe971a1596cf971..fe7bda7bcdf9d8a42ccaf504ab165cd168f5004e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 39efebb4f39575fb64e6c2268f043d56d8d79381..9562dcf21de37948e4234959344be9e60b7baa5b 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 70b89f6d30ed9568e8c1eb139b43725a5a8b846e..dc1f1d67fd458a0856a06c57cce6d1274b157be8 100644 (file)
@@ -5,7 +5,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 126aaaf350179457ba66fde5b4ca4c5f275d0fd5..4df02b5bfd3e2a949f09165f73f4cd9b253faba0 100644 (file)
@@ -5,7 +5,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
diff --git a/application/hub/interfaces/protocol/class_ProtocolHandler.php b/application/hub/interfaces/protocol/class_ProtocolHandler.php
deleted file mode 100644 (file)
index d8e8188..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-/**
- * An interface for protocol handlers
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 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/>.
- */
-interface ProtocolHandler extends FrameworkInterface {
-       /**
-        * Getter for port number to satify ProtocolHandler
-        *
-        * @return      $port   The port number
-        */
-       function getPort ();
-
-       /**
-        * Getter for protocol
-        *
-        * @return      $protocol       Used protocol
-        */
-       function getProtocol ();
-}
-
-// [EOF]
-?>
index 2a6c03196c1bec468d913e83c2bbd7c68ef97602..eab4a6a69a97bfbb3c7fa3df266c499276984028 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -23,7 +23,7 @@
  */
 interface Recipient extends FrameworkInterface {
        /**
-        * Tries to resolve given recipient into session ids or ip:port combination
+        * Tries to resolve given recipient into session ids or Universal Node Locator
         * depending on implementation (hint: Template Method Pattern)
         *
         * @param       $recipient              Recipient to resolve (e.g. could be a virtual recipient or direct session id)
diff --git a/application/hub/interfaces/resolver/.htaccess b/application/hub/interfaces/resolver/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/interfaces/resolver/class_ProtocolResolver.php b/application/hub/interfaces/resolver/class_ProtocolResolver.php
new file mode 100644 (file)
index 0000000..d33a492
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/**
+ * An interface for ProtocolResolvers
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 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/>.
+ */
+interface ProtocolResolver extends FrameworkInterface {
+       /**
+        * Returns an instance of a LocateableNode class for a given NodeHelper
+        * instance or null if it was not found.
+        *
+        * @param       $nodeInstance   An instance of a NodeHelper class
+        * @return      $unlInstance    An instance of a LocateableNode class
+        */
+       function resolveUniversalNodeLocatorFromNodeHelper (NodeHelper $nodeInstance);
+
+       /**
+        * Returns the UNL as string from given configuration key.
+        *
+        * @param       $configKey      Configuration key for UNL address (valid: internal,external)
+        * @return      $unl            Universal node locator
+        */
+       function resolveUniversalNodeLocatorFromConfigKey ($configKey);
+}
+
+// [EOF]
+?>
index 7d697a0690dba5220918dc526dc8d7e92eb55874..a96833fc2fbae3ad7db342246a01d79863427d05 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 9db1ca9b44bb600693e4a33af846ded047af48b1..1f40a0ea1384b3a73e6e7d63dc5e075407a08b68 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index d66de7af609b455c5bdebbcd3086a757e710c60a..7292653507524fefb7273940a83218ad00183034 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 2c25a214b197d3353edd56d35d0c800bfcd47d84..fe03c22f1a18157f49aa108c8796cd2a29c039c8 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 19bba42a4fb617381ad734456f2c730d8989da79..e95634b5c318788067200b97ffc0d1c2709ed84a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 2a323f6ea03e4a7c7637f9553c9b4188a627b9c2..aa79e77ae6b2b1711ca78f1db17fc07345e09d0d 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index f8fb9bd7cdd19365d77c0e35596140713aaab664..2093a30cfb30a1d06f606713ad71b8c58ed70329 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index b1dafe9b7cc96ec220973429825adee7963f53ba..c1be593938f084ecc42eb31235b6e10b1e9519a4 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 5e11f72e8c319275c319ba2f6808b5081423ab86..ce3488e797becaad04741af282da2dd0b1e6e92c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 7133b442e38a6191f39d9a094f905bddcf5494cd..0a3f2332caca9944c3a852e7b43211f194cd0fa6 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 98000f5c7944fbf7fc3acbc04834a6ef509fd267..2c6b55754d8b3b1311b5bd52e3378f88874e16e9 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -26,7 +26,7 @@ interface Tagable extends FrameworkInterface {
         * Chooses the right protocol from given package data
         *
         * @param       $packageData    Raw package data
-        * @return      $protocolName   Name of the choosen procotol
+        * @return      $protocolInstance       An instance of a HandleableProtocol class
         */
        function chooseProtocolFromPackageData (array $packageData);
 
index 257d2c53bc14ee3d1b39b9bab047dc26353f1981..1d9e978d1217320ddb1fd4396f83365cd5843ab1 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 6124fbaaf39a643602861e80ab3bd3de70c5b67a..fac2743a762890c9add701f3978901433ea372a1 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 96ba0dd55645a93261bac6c7fbe2b7d9866a4fbf..d61cdaeccbd817f8d4e4c91202b9fbf05fe20e88 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index fffcdab6e3ea175b40df769470b9815bcdd4164a..7f02641b4ce0e132606445ab71eacb9f94b71ac9 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 37f8ec73d8a7e5be382da60e2374e9711ce52903..972b2cd7f501e7b7d897bc5237a4b070ddb1c4e6 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 3f4b4a1128adac42cc4523760da18320ece1f5b3..92f08be51640723897dedcada627c4f9640a56c3 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 392b05e3cefde7e7753636a422be8cda19e3ae64..f2efac2330ca76bd065e85ece1dfd6b9c06aa88e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index bfc92144ca010182bfc730f593a2d669beeb635f..e2149181edbccd10847d5f11a36423828bdeca61 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 200aa5b8bb6d71ebaed560068f9b75a10c1d60b6..6d6cc4c1cba87b8e379bb57b5094bed7d62a0c3d 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 9b8ba7a8d2fef423cb81ae6a8a2bad1556eb6e57..d2b21e337f91135b6062ba82e5fee6b2c2584a75 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -38,7 +38,7 @@ interface NodeDhtWrapper extends DatabaseWrapper {
 
        /**
         * Checks whether the local (*this*) node is registered in the DHT by
-        * checking if the external ip/port is found.
+        * checking if the external address is found.
         *
         * @return      $isRegistered   Whether *this* node is registered in the DHT
         */
@@ -71,20 +71,20 @@ interface NodeDhtWrapper extends DatabaseWrapper {
         * Registeres a node by given message data.
         *
         * @param       $messageData            An array of all message data
-        * @param       $handlerInstance        An instance of a Handleable class
+        * @param       $handlerInstance        An instance of a HandleableDataSet class
         * @return      void
         */
-       function registerNodeByMessageData (array $messageData, Handleable $handlerInstance);
+       function registerNodeByMessageData (array $messageData, HandleableDataSet $handlerInstance);
 
        /**
         * Updates an existing entry in node list
         *
         * @param       $messageData            An array of all message data
-        * @param       $handlerInstance        An instance of a Handleable class
+        * @param       $handlerInstance        An instance of a HandleableDataSet class
         * @param       $searchInstance         An instance of LocalSearchCriteria class
         * @return      void
         */
-       function updateNodeByMessageData (array $messageData, Handleable $handlerInstance, LocalSearchCriteria $searchInstance);
+       function updateNodeByMessageData (array $messageData, HandleableDataSet $handlerInstance, LocalSearchCriteria $searchInstance);
 
        /**
         * Determines whether the given node data is already inserted in the DHT
index 6763cad698c82c51d1fbe61cb169354fb4c86fc5..a33011c4c8ba1006cfce1d5e416e6a22eb88fe02 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 2e65190498c6ac89910278c17c0692b90a9104fa..29206eaf352291e0845bd57c36c3ec985434ba58 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 0bfd5ec63478d2c42b12306bf3c2505692f71eed..81bdc7ad728147c4954e8c8fa004f3be3fcc89e3 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0
- * @copyright  Copyright (c) 2007 - 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007 - 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  *
  * This program is free software: you can redistribute it and/or modify
index f575db81699c7983ce2d2f373528214562aeb7f4..f46f29370ef68a612afdd5be753200524f9e4452 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 9c9b78c8828dd08553c5a3b01a0b148ab7ae9a31..27032e71e0d4044d6a8df8d97aa4fa845db4bcb1 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 53e61a3846a9204f3149305757717a8fbf895451..9dcf4dc40a88a385ee56ea722b651554c61448e7 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 22bb43224f3cfbdc973fd5076f3a80d701c2d0a7..71bae7680e53302c979c6e3df942e94b6cedd3d9 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index c665c8e3bb0a605ac8beadb849ca1c1dc02fc8f9..86865221a13e746b7742f6a036edbeec9000c43f 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 2df8404ecb16fd3bf8cd09a242caa3f8569d2ad8..534d10dd85b6cd802ae2712e695fe34ef9fdd5fd 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index ad83f7de251cfed72af6a9b0b9c7315a655c4111..d6399194594514328ea6aa2332296f3dc8b96c34 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -68,11 +68,6 @@ class BaseHubSystem extends BaseFrameworkSystem {
         */
        private $minerInstance = NULL;
 
-       /**
-        * Listener instance
-        */
-       private $listenerInstance = NULL;
-
        /**
         * A network package handler instance
         */
@@ -108,6 +103,11 @@ class BaseHubSystem extends BaseFrameworkSystem {
         */
        private $assemblerInstance = NULL;
 
+       /**
+        * Name of used protocol
+        */
+       private $protocolName = 'invalid';
+
        /**
         * Protected constructor
         *
@@ -214,25 +214,6 @@ class BaseHubSystem extends BaseFrameworkSystem {
                $this->minerInstance = $minerInstance;
        }
 
-       /**
-        * Setter for listener instance
-        *
-        * @param       $listenerInstance       A Listenable instance
-        * @return      void
-        */
-       protected final function setListenerInstance (Listenable $listenerInstance) {
-               $this->listenerInstance = $listenerInstance;
-       }
-
-       /**
-        * Getter for listener instance
-        *
-        * @return      $listenerInstance       A Listenable instance
-        */
-       protected final function getListenerInstance () {
-               return $this->listenerInstance;
-       }
-
        /**
         * Setter for network package handler instance
         *
@@ -432,7 +413,7 @@ class BaseHubSystem extends BaseFrameworkSystem {
        /**
         * Setter for session id
         *
-        * @param       $sessionId              The new session id
+        * @param       $sessionId      The new session id
         * @return      void
         */
        protected final function setSessionId ($sessionId) {
@@ -442,12 +423,31 @@ class BaseHubSystem extends BaseFrameworkSystem {
        /**
         * Getter for session id
         *
-        * @return      $sessionId              Current session id
+        * @return      $sessionId      Current session id
         */
        public final function getSessionId () {
                return $this->getConfigInstance()->getConfigEntry('session_id');
        }
 
+       /**
+        * 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;
+       }
+
        /**
         * Constructs a callable method name from given socket error code. If the
         * method is not found, a generic one is used.
index fc8cfa24391a73153fed1d9c4214618372307feb..9a9223d5ddf46ac6a912db2a7ab91baf9775cc38 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index a3afdf6d525fa275a02a45819831955702b010e8..c1c326906c027b656945acfcc018be69ac07f0cc 100644 (file)
@@ -5,7 +5,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 660c0bd676e20c9b7b2feb7d5704708bd98f72bc..a0c09cb464b8614fe0fab1447bb6f1974b2f752f 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 37dc83686a2b08f088b86f2575e2264922deef9c..b12739479d9cd23559055c1c29a4c6b8a0e0ce9e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 7ea767176be950899f206c5814c711c95c4a9529..b0ca7a6d3ae268bfbea67a45e0568fa8db2b8019 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index ce9a11a13bc3659eeeaf31f7e40594be9df5a41a..bdeed7552781f31d678801aca91557c9f1452c9e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index f81af11b591f44d45496937d53d7577156d9e84d..69efc67dbf07f98b4d90108a7b9663ae31e2d6f1 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 5342bec91f6535e007b5bc71aaf4a8d49aef1704..c09b01be7941a305d4889c85fc27fb74098f341b 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 490875a36e995e5cb29f031c343ab2a8f00f32c5..d2deb72fc620d4b13e4644a13a5a6cc01367fde2 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 2a3cc48265b3efaf2bf2dea3e13ff47d54587923..bccf4116e3087d4b8ef3eca9df6c78b574221a39 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -158,23 +158,23 @@ class NodeDhtFacade extends BaseDht implements DistributableNode, Registerable {
         * following data must always be present:
         *
         * - session-id  (for finding the node's record together with below data)
-        * - external-ip (hostname or IP number)
+        * - external-address (hostname or IP number)
         * - listen-port (TCP/UDP listen port for inbound connections)
         *
         * @param       $messageArray           An array with all minimum message data
-        * @param       $handlerInstance        An instance of a Handleable class
+        * @param       $handlerInstance        An instance of a HandleableDataSet class
         * @param       $forceUpdate            Optionally force update, don't register (default: register if not found)
         * @return      void
         * @throws      NodeSessionIdVerficationException       If the node was not found and update is forced
         */
-       public function registerNodeByMessageData (array $messageData, Handleable $handlerInstance, $forceUpdate = FALSE) {
+       public function registerNodeByMessageData (array $messageData, HandleableDataSet $handlerInstance, $forceUpdate = FALSE) {
                // Get a search criteria class
                $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
 
                // Debug message
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-FACADE[' . __METHOD__ . ':' . __LINE__ . ']: state=' . $this->getPrintableState() . ',messageData=' . print_r($messageData, TRUE) . ',handlerInstance=' . $handlerInstance->__toString() . ',forceUpdate=' . intval($forceUpdate) . ',count(getSearchData())=' . count($handlerInstance->getSearchData()));
 
-               // Search for the node's session id and external IP/hostname + TCP/UDP listen port
+               // Search for the node's session id and external address/hostname + TCP/UDP listen port
                foreach ($handlerInstance->getSearchData() as $key) {
                        // Debug message
                        //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-FACADE[' . __METHOD__ . ':' . __LINE__ . ']: state=' . $this->getPrintableState() . ',key=' . $key);
@@ -208,8 +208,7 @@ class NodeDhtFacade extends BaseDht implements DistributableNode, Registerable {
                } else {
                        /*
                         * Do not register non-existent nodes here. This is maybe fatal,
-                        * caused by "stolen" session id and/or not matching IP
-                        * number/port combination.
+                        * caused by "stolen" session id and/or not matching address.
                         */
                        throw new NodeSessionIdVerficationException(array($this, $messageData), BaseHubSystem::EXCEPTION_NODE_SESSION_ID_NOT_VERIFYING);
                }
@@ -223,13 +222,13 @@ class NodeDhtFacade extends BaseDht implements DistributableNode, Registerable {
         * object types except the node by given session id.
         *
         * @param       $messageData            An array with message data from a node_list request
-        * @param       $handlerInstance        An instance of a Handleable class
+        * @param       $handlerInstance        An instance of a HandleableDataSet class
         * @param       $excludeKey                     Array key which should be excluded
         * @param       $andKey                         Array of $separator-separated list of elements which all must match
         * @param       $separator                      Sepator char (1st parameter for explode() call)
         * @return      $nodeList                       An array with all found nodes
         */
-       public function queryLocalNodeListExceptByMessageData (array $messageData, Handleable $handlerInstance, $excludeKey, $andKey, $separator) {
+       public function queryLocalNodeListExceptByMessageData (array $messageData, HandleableDataSet $handlerInstance, $excludeKey, $andKey, $separator) {
                // Make sure both keys are there
                assert((isset($messageData[$excludeKey])) && (isset($messageData[$andKey])));
 
diff --git a/application/hub/main/discovery/class_ b/application/hub/main/discovery/class_
new file mode 100644 (file)
index 0000000..95ee1f0
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * A !!! discovery class
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core 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 !!!Discovery extends BaseNodeDiscovery implements Discoverable,,,, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Create an instance of this class
+        *
+        * @return      $discoveryInstance      An instance of this discovery class
+        */
+       public static final function create!!!Discovery () {
+               // Get an instance of this class
+               $discoveryInstance = new !!!Discovery();
+
+               // Return the prepared instance
+               return $discoveryInstance;
+       }
+}
+
+// [EOF]
+?>
index a608b7b07b16bbd6b84e0634e7b1a5fc46bbde26..9a8db0a27f39f2b9c7405d86d315d3789d7adabc 100644 (file)
@@ -1,10 +1,10 @@
 <?php
 /**
- * A PackageRecipient discovery class
+ * A general node discovery class
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -31,73 +31,6 @@ class BaseNodeDiscovery extends BaseDiscovery implements Discoverable {
        protected function __construct ($className) {
                // Call parent constructor
                parent::__construct($className);
-
-               /*
-                * Get recipients list instance and set it here for all discovery
-                * implementations.
-                */
-               $listInstance = RecipientListFactory::createRecipientListInstance();
-               $this->setListInstance($listInstance);
-       }
-
-       /**
-        * Determines the protoctol name
-        *
-        * @param       $packageData    Valid package data
-        * @return      $protocolName   Name of used protocol (TCP/UDP/etc.)
-        */
-       protected function determineProtocolByPackageData (array $packageData) {
-               // First we need a tags instance
-               $tagsInstance = PackageTagsFactory::createPackageTagsInstance();
-
-               /*
-                * We need to decide here which socket (TCP or UDP) should be used for
-                * the actual data transmission. In this process we will find out if
-                * the recipient of this package has already a known (registered) socket
-                * and if so we can re-use it. If there is no socket registered, we try
-                * to make a new connection (TCP or UDP) to the given IP:port.
-                */
-               $protocolName = $tagsInstance->chooseProtocolFromPackageData($packageData);
-
-               // Return it
-               return $protocolName;
-       }
-
-       /**
-        * "Getter" for recipient iterator
-        *
-        * @return$iteratorInstance An instance of a Iterateable object
-        */
-       public final function getIterator () {
-               // Get iterator from it
-               $iteratorInstance = $this->getListInstance()->getIterator();
-
-               // Return it
-               return $iteratorInstance;
-       }
-
-       /**
-        * Clears all recipients for e.g. another package to deliver. This method
-        * simply clears the inner list instance.
-        *
-        * @return      void
-        */
-       public final function clearRecipients () {
-               // Clear the list
-               $this->getListInstance()->clearList();
-       }
-
-       /**
-        * Checks whether the recipient list is empty
-        *
-        * @return      $isEmpty        Whether the recipient list is empty
-        */
-       public final function isRecipientListEmpty () {
-               // Check it ...
-               $isEmpty = ($this->getListInstance()->count() == 0);
-
-               // Return it
-               return $isEmpty;
        }
 }
 
diff --git a/application/hub/main/discovery/dht/.htaccess b/application/hub/main/discovery/dht/.htaccess
deleted file mode 100644 (file)
index 3a42882..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Deny from all
diff --git a/application/hub/main/discovery/dht/class_DhtRecipientDiscovery.php b/application/hub/main/discovery/dht/class_DhtRecipientDiscovery.php
deleted file mode 100644 (file)
index 35809b6..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-<?php
-/**
- * A DhtRecipient discovery class
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core 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 DhtRecipientDiscovery extends BaseNodeDiscovery implements DiscoverableDhtRecipient, Registerable {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       protected function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-       }
-
-       /**
-        * Create an instance of this class
-        *
-        * @return      $discoveryInstance      An instance of this discovery class
-        */
-       public static final function createDhtRecipientDiscovery () {
-               // Get an instance of this class
-               $discoveryInstance = new DhtRecipientDiscovery();
-
-               // Get a DHT instance
-               $dhtInstance = DhtObjectFactory::createDhtInstance('node');
-
-               // Set it here
-               $discoveryInstance->setDhtInstance($dhtInstance);
-
-               // Return the prepared instance
-               return $discoveryInstance;
-       }
-
-       /**
-        * Resolves one or more recipients for a DHT transfer by given package data.
-        *
-        * @param       $packageData    Valid package data array
-        * @return      $recipients             An indexed array with DHT recipients
-        */
-       public function resolveRecipientsByPackageData (array $packageData) {
-               // Use facade to get recipients back
-               $recipients = $this->getDhtInstance()->findRecipientsByPackageData($packageData);
-
-               // Return it
-               return $recipients;
-       }
-}
-
-// [EOF]
-?>
diff --git a/application/hub/main/discovery/node/.htaccess b/application/hub/main/discovery/node/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/discovery/node/class_UniversalNodeLocatorDiscovery.php b/application/hub/main/discovery/node/class_UniversalNodeLocatorDiscovery.php
new file mode 100644 (file)
index 0000000..551e4a1
--- /dev/null
@@ -0,0 +1,105 @@
+<?php
+/**
+ * A UniversalNodeLocator discovery class
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core 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 UniversalNodeLocatorDiscovery extends BaseNodeDiscovery implements DiscoverableUniversalNodeLocator, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Create an instance of this class
+        *
+        * @return      $discoveryInstance      An instance of this discovery class
+        */
+       public static final function createUniversalNodeLocatorDiscovery () {
+               // Get an instance of this class
+               $discoveryInstance = new UniversalNodeLocatorDiscovery();
+
+               // Return the prepared instance
+               return $discoveryInstance;
+       }
+
+       /**
+        * "Discovers" an instance of a LocateableNode class for given NodeHelper class
+        *
+        * @param       $nodeInstance   An instance of a NodeHelper class
+        * @return      $unlInstance    An instance of a LocateableNode class
+        */
+       public function discoverUniversalNodeLocatorByNode (NodeHelper $nodeInstance) {
+               /*
+                * First get an instance from the configured hub communication protocol
+                * type (which is mostly TCP, so you get a TcpProtocolResolver here).
+                */
+               $resolverInstance = ProtocolResolverFactory::createResolverFromConfiguredProtocol();
+
+               // Then resolve the node instance into an UNL instance
+               $unlInstance = $resolverInstance->resolveUniversalNodeLocatorFromNodeHelper($nodeInstance);
+
+               // ... and return it
+               return $unlInstance;
+       }
+
+       /**
+        * "Discovers" the full universal node locator for given configuration entry
+        * which should represent the address part of the UNL. In case of an IP
+        * address, this *must not* include the port number as this is being found
+        * out for you.
+        *
+        * Valid values for $configKey: internal,external
+        *
+        * @param       $configKey      Key for address to get (valid: internal,external)
+        * @return      $unl            Universal node locator
+        */
+       public function discoverUniversalNodeLocatorByConfiguredAddress ($configKey) {
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('UNL-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']:configKey=' . $configKey . ' - CALLED!');
+
+               // Is there cache?
+               if (!isset($GLOBALS[__METHOD__][$configKey])) {
+                       // Validate config key
+                       assert(($configKey == 'internal') || ($configKey == 'external'));
+
+                       /*
+                        * First get an instance from the configured hub communication protocol
+                        * type (which is mostly TCP, so you get a TcpProtocolResolver here).
+                        */
+                       $resolverInstance = ProtocolResolverFactory::createResolverFromConfiguredProtocol();
+
+                       // Get back the full UNL
+                       $GLOBALS[__METHOD__][$configKey] = $resolverInstance->resolveUniversalNodeLocatorFromConfigKey($configKey);
+               } // END - if
+
+               // Return cached value
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('UNL-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']:configKey=' . $configKey . ',unl=' . $GLOBALS[__METHOD__][$configKey] . ' - EXIT!');
+               return $GLOBALS[__METHOD__][$configKey];
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/discovery/package/.htaccess b/application/hub/main/discovery/package/.htaccess
deleted file mode 100644 (file)
index 3a42882..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Deny from all
diff --git a/application/hub/main/discovery/package/class_PackageRecipientDiscovery.php b/application/hub/main/discovery/package/class_PackageRecipientDiscovery.php
deleted file mode 100644 (file)
index 724ff60..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-<?php
-/**
- * A PackageRecipient discovery class
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core 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 PackageRecipientDiscovery extends BaseNodeDiscovery implements DiscoverableNodeRecipient, Registerable {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       protected function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-       }
-
-       /**
-        * Create an instance of this class
-        *
-        * @return      $discoveryInstance      An instance of this discovery class
-        */
-       public static final function createPackageRecipientDiscovery () {
-               // Get an instance of this class
-               $discoveryInstance = new PackageRecipientDiscovery();
-
-               // Return the prepared instance
-               return $discoveryInstance;
-       }
-
-       /**
-        * Tries to discover all recipients for given package data
-        *
-        * @param       $packageData    Raw package data array
-        * @return      void
-        */
-       public function discoverRecipients (array $packageData) {
-               // This must be available
-               //* DEBUG: */ print $this->__toString() . ': packageData=' . print_r($packageData, TRUE);
-               assert(isset($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT]));
-
-               // First try out the direct recipient (session id)
-               try {
-                       // Get instance (should not break)
-                       $recipientInstance = ObjectFactory::createObjectByConfiguredName('direct_recipient_class');
-
-                       // Try to solve it
-                       $recipientInstance->resolveRecipient($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT], $this->getListInstance(), $packageData);
-               } catch (FrameworkException $e) {
-                       // Didn't work, so try the non-generic, depending recipient field itself (this may fail)
-                       try {
-                               // Try to find the right class
-                               $recipientInstance = ObjectFactory::createObjectByConfiguredName(strtolower($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT]) . '_recipient_class');
-
-                               // And try to solve again
-                               $recipientInstance->resolveRecipient($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT], $this->getListInstance(), $packageData);
-                       } catch (FrameworkException $e) {
-                               // Could not find class, what ever failed
-                               $this->debugInstance($e->getMessage());
-                       }
-               }
-       }
-
-       /**
-        * Tries to discover all recipients by given decoded package data.
-        *
-        * @param       $decodedData    Raw raw package data array
-        * @return      void
-        * @todo        Add some validation of recipient field, e.g. ip:port is found
-        * @todo        The if() does only check for TCP, not UDP, e.g. try to get a $handlerInstance here
-        */
-       public function discoverRawRecipients (array $decodedData) {
-               // This must be available
-               assert(isset($decodedData[NetworkPackage::PACKAGE_DATA_RECIPIENT]));
-
-               // First clear all recipients
-               $this->clearRecipients();
-
-               // Explode 'recipient', first element is the IP/hostname
-               $recipient = explode(':', $decodedData[NetworkPackage::PACKAGE_DATA_RECIPIENT]);
-
-               // Is the 'recipient' field same as this peer's IP?
-               if ((($recipient[0] == HubTools::determineOwnExternalIp()) && ($recipient[1] == $this->getConfigInstance()->getConfigEntry('node_listen_port'))) || ($recipient[0] == $this->getConfigInstance()->getServerAddress())) {
-                       /*
-                        * Is same as own external IP + TCP/UDP listen port or internal IP, don't do anything here so other
-                        * classes found an empty recipient list for internal (own) handling
-                        * of the original content.
-                        */
-
-                       // Debug output (may flood)
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Recipient ' . $recipient[0] . ' matches own ip (' .  HubTools::determineOwnExternalIp() . ' or ' . $this->getConfigInstance()->getServerAddress() . ')');
-               } else {
-                       // Debug output (may flood)
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Recipient ' . $recipient[0] . ' is different than own external ip (' .  HubTools::determineOwnExternalIp() . ') nor internal ip (' . $this->getConfigInstance()->getServerAddress() . '), need to forward (not yet implemented)!');
-
-                       // This package is to be delivered to someone else, so add it
-                       $this->getListInstance()->addEntry('ip_port', $decodedData[NetworkPackage::PACKAGE_DATA_RECIPIENT]);
-               }
-       }
-}
-
-// [EOF]
-?>
diff --git a/application/hub/main/discovery/protocol/.htaccess b/application/hub/main/discovery/protocol/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/discovery/protocol/class_ProtocolDiscovery.php b/application/hub/main/discovery/protocol/class_ProtocolDiscovery.php
new file mode 100644 (file)
index 0000000..e95a891
--- /dev/null
@@ -0,0 +1,77 @@
+<?php
+/**
+ * A Protocol discovery class
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core 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 ProtocolDiscovery extends BaseNodeDiscovery implements DiscoverableProtocol, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Create an instance of this class
+        *
+        * @return      $discoveryInstance      An instance of this discovery class
+        */
+       public static final function createProtocolDiscovery () {
+               // Get an instance of this class
+               $discoveryInstance = new ProtocolDiscovery();
+
+               // Return the prepared instance
+               return $discoveryInstance;
+       }
+
+       /**
+        * "Discovers" the protocol type from given raw package data. This is done
+        * by looking at the 'recipient' field and extract the first part from it.
+        *
+        * @param       $packageData    Raw package data
+        * @return      $protocolType   Type of protocol, e.g. 'tcp' for TCP/IPv4 connections
+        */
+       public function discoverProtocolByPackageData (array $packageData) {
+               //* DEBUG: */ die(__METHOD__ . ':packageData=' . print_r($packageData, TRUE));
+
+               /*
+                * "Explode" the 'recipient' array element into a new one, giving at
+                * least two entries: protocol://address
+                */
+               $recipient = explode(':', $packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT]);
+
+               // At least 2 entries must be found
+               assert(count($recipient) >= 2);
+
+               // Now get the first part (protocol type) and make all lower-case
+               $protocolType = strtolower($recipient[0]);
+
+               // Return it
+               // @TODO Add some validation here???
+               return $protocolType;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/discovery/recipient/.htaccess b/application/hub/main/discovery/recipient/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/discovery/recipient/class_ b/application/hub/main/discovery/recipient/class_
new file mode 100644 (file)
index 0000000..bd90342
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * A !!! recipient discovery class
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core 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 !!!RecipientDiscovery extends BaseRecipientDiscovery implements Discoverable,,,Recipient, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Create an instance of this class
+        *
+        * @return      $discoveryInstance      An instance of this discovery class
+        */
+       public static final function create!!!Discovery () {
+               // Get an instance of this class
+               $discoveryInstance = new !!!Discovery();
+
+               // Return the prepared instance
+               return $discoveryInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/discovery/recipient/class_BaseRecipientDiscovery.php b/application/hub/main/discovery/recipient/class_BaseRecipientDiscovery.php
new file mode 100644 (file)
index 0000000..56d3db4
--- /dev/null
@@ -0,0 +1,105 @@
+<?php
+/**
+ * A PackageRecipient discovery class
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core 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 BaseRecipientDiscovery extends BaseNodeDiscovery implements DiscoverableRecipient {
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Real class name
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+
+               /*
+                * Get recipients list instance and set it here for all discovery
+                * implementations.
+                */
+               $listInstance = RecipientListFactory::createRecipientListInstance();
+               $this->setListInstance($listInstance);
+       }
+
+       /**
+        * Determines the protoctol name
+        *
+        * @param       $packageData            Valid package data
+        * @return      $protocolInstance       An instance of a HandleableProtocol class
+        */
+       protected function determineProtocolByPackageData (array $packageData) {
+               // First we need a tags instance
+               $tagsInstance = PackageTagsFactory::createPackageTagsInstance();
+
+               /*
+                * We need to decide here which socket (TCP or UDP) should be used for
+                * the actual data transmission. In this process we will find out if
+                * the recipient of this package has already a known (registered) socket
+                * and if so we can re-use it. If there is no socket registered, we try
+                * to make a new connection to the given Universal Node Locator.
+                */
+               $protocolInstance = $tagsInstance->chooseProtocolFromPackageData($packageData);
+
+               // Return it
+               return $protocolInstance;
+       }
+
+       /**
+        * "Getter" for recipient iterator
+        *
+        * @return$iteratorInstance An instance of a Iterateable object
+        */
+       public final function getIterator () {
+               // Get iterator from it
+               $iteratorInstance = $this->getListInstance()->getIterator();
+
+               // Return it
+               return $iteratorInstance;
+       }
+
+       /**
+        * Clears all recipients for e.g. another package to deliver. This method
+        * simply clears the inner list instance.
+        *
+        * @return      void
+        */
+       public final function clearRecipients () {
+               // Clear the list
+               $this->getListInstance()->clearList();
+       }
+
+       /**
+        * Checks whether the recipient list is empty
+        *
+        * @return      $isEmpty        Whether the recipient list is empty
+        */
+       public final function isRecipientListEmpty () {
+               // Check it ...
+               $isEmpty = ($this->getListInstance()->count() == 0);
+
+               // Return it
+               return $isEmpty;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/discovery/recipient/dht/.htaccess b/application/hub/main/discovery/recipient/dht/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/discovery/recipient/dht/class_DhtRecipientDiscovery.php b/application/hub/main/discovery/recipient/dht/class_DhtRecipientDiscovery.php
new file mode 100644 (file)
index 0000000..5fe1bee
--- /dev/null
@@ -0,0 +1,70 @@
+<?php
+/**
+ * A DhtRecipient discovery class
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core 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 DhtRecipientDiscovery extends BaseRecipientDiscovery implements DiscoverableDhtRecipient, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Create an instance of this class
+        *
+        * @return      $discoveryInstance      An instance of this discovery class
+        */
+       public static final function createDhtRecipientDiscovery () {
+               // Get an instance of this class
+               $discoveryInstance = new DhtRecipientDiscovery();
+
+               // Get a DHT instance
+               $dhtInstance = DhtObjectFactory::createDhtInstance('node');
+
+               // Set it here
+               $discoveryInstance->setDhtInstance($dhtInstance);
+
+               // Return the prepared instance
+               return $discoveryInstance;
+       }
+
+       /**
+        * Resolves one or more recipients for a DHT transfer by given package data.
+        *
+        * @param       $packageData    Valid package data array
+        * @return      $recipients             An indexed array with DHT recipients
+        */
+       public function resolveRecipientsByPackageData (array $packageData) {
+               // Use facade to get recipients back
+               $recipients = $this->getDhtInstance()->findRecipientsByPackageData($packageData);
+
+               // Return it
+               return $recipients;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/discovery/recipient/package/.htaccess b/application/hub/main/discovery/recipient/package/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/discovery/recipient/package/class_PackageRecipientDiscovery.php b/application/hub/main/discovery/recipient/package/class_PackageRecipientDiscovery.php
new file mode 100644 (file)
index 0000000..dbde150
--- /dev/null
@@ -0,0 +1,122 @@
+<?php
+/**
+ * A PackageRecipient discovery class
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core 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 PackageRecipientDiscovery extends BaseRecipientDiscovery implements DiscoverableNodeRecipient, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Create an instance of this class
+        *
+        * @return      $discoveryInstance      An instance of this discovery class
+        */
+       public static final function createPackageRecipientDiscovery () {
+               // Get an instance of this class
+               $discoveryInstance = new PackageRecipientDiscovery();
+
+               // Return the prepared instance
+               return $discoveryInstance;
+       }
+
+       /**
+        * Tries to discover all recipients for given package data
+        *
+        * @param       $packageData    Raw package data array
+        * @return      void
+        */
+       public function discoverRecipients (array $packageData) {
+               // This must be available
+               //* DEBUG: */ print $this->__toString() . ': packageData=' . print_r($packageData, TRUE);
+               assert(isset($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT]));
+
+               // First try out the direct recipient (session id)
+               try {
+                       // Get instance (should not break)
+                       $recipientInstance = ObjectFactory::createObjectByConfiguredName('direct_recipient_class');
+
+                       // Try to solve it
+                       $recipientInstance->resolveRecipient($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT], $this->getListInstance(), $packageData);
+               } catch (FrameworkException $e) {
+                       // Didn't work, so try the non-generic, depending recipient field itself (this may fail)
+                       try {
+                               // Try to find the right class
+                               $recipientInstance = ObjectFactory::createObjectByConfiguredName(strtolower($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT]) . '_recipient_class');
+
+                               // And try to solve again
+                               $recipientInstance->resolveRecipient($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT], $this->getListInstance(), $packageData);
+                       } catch (FrameworkException $e) {
+                               // Could not find class, what ever failed
+                               $this->debugInstance($e->getMessage());
+                       }
+               }
+       }
+
+       /**
+        * Tries to discover all recipients by given decoded package data.
+        *
+        * @param       $decodedData    Raw raw package data array
+        * @return      void
+        * @todo        Add some validation of recipient field, e.g. an Universal Node Locator is found
+        * @todo        The if() does only check for TCP, not UDP, e.g. try to get a $handlerInstance here
+        */
+       public function discoverRawRecipients (array $decodedData) {
+               // This must be available
+               die(__METHOD__ . ': Unfinished' . PHP_EOL);
+               assert(isset($decodedData[NetworkPackage::PACKAGE_DATA_RECIPIENT]));
+
+               // First clear all recipients
+               $this->clearRecipients();
+
+               // Explode 'recipient', first element is the IP/hostname
+               $recipient = explode(':', $decodedData[NetworkPackage::PACKAGE_DATA_RECIPIENT]);
+
+               // Is the 'recipient' field same as this peer's IP?
+               if ((($recipient[0] == HubTools::determineOwnExternalAddress()) && ($recipient[1] == $this->getConfigInstance()->getConfigEntry('node_listen_port'))) || ($recipient[0] == $this->getConfigInstance()->getServerAddress())) {
+                       /*
+                        * Is same as own external address + TCP/UDP listen port or
+                        * internal address, don't do anything here so other classes found
+                        * an empty recipient list for internal (own) handling of the
+                        * original content.
+                        */
+
+                       // Debug output (may flood)
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Recipient ' . $recipient[0] . ' matches own ip (' .  HubTools::determineOwnExternalAddress() . ' or ' . $this->getConfigInstance()->getServerAddress() . ')');
+               } else {
+                       // Debug output (may flood)
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Recipient ' . $recipient[0] . ' is different than own external address (' .  HubTools::determineOwnExternalAddress() . ') nor internal address (' . $this->getConfigInstance()->getServerAddress() . '), need to forward (not yet implemented)!');
+
+                       // This package is to be delivered to someone else, so add it
+                       $this->getListInstance()->addEntry('unl', $decodedData[NetworkPackage::PACKAGE_DATA_RECIPIENT]);
+               }
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/discovery/recipient/socket/.htaccess b/application/hub/main/discovery/recipient/socket/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/discovery/recipient/socket/class_PackageSocketDiscovery.php b/application/hub/main/discovery/recipient/socket/class_PackageSocketDiscovery.php
new file mode 100644 (file)
index 0000000..b36aee5
--- /dev/null
@@ -0,0 +1,184 @@
+<?php
+/**
+ * A socket discovery class
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core 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 PackageSocketDiscovery extends BaseRecipientDiscovery implements DiscoverableSocket, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Create an instance of this class
+        *
+        * @return      $discoveryInstance      An instance of this discovery class
+        */
+       public static final function createPackageSocketDiscovery () {
+               // Get an instance of this class
+               $discoveryInstance = new PackageSocketDiscovery();
+
+               // Output debug message
+               self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Initialized.');
+
+               // Return the prepared instance
+               return $discoveryInstance;
+       }
+
+       /**
+        * Tries to dicover the right listener instance
+        *
+        * @param       $protocolName           Protocol name
+        * @param       $packageData            Raw package data
+        * @return      $listenerInstance       An instance of a Listenable instance or null
+        */
+       public function discoverListenerInstance ($protocolName, array $packageData) {
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: protocolName=' . $protocolName . ' - ENTERED!');
+
+               /*
+                * Get the listener pool instance, we need to lookup the matching
+                * listener->poolInstance chain there.
+                */
+               $poolInstance = NodeObjectFactory::createNodeInstance()->getListenerPoolInstance();
+
+               // Init listener instance
+               $listenerInstance = NULL;
+
+               /*
+                * Now we need to choose again. It is whether we are speaking with a hub
+                * or with a client. So just handle it over to all listeners in this
+                * pool.
+                */
+               foreach ($poolInstance->getPoolEntriesInstance()->getArrayFromGroup($protocolName) as $listenerInstance) {
+                       // Debug output
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: protocolName=' . $protocolName . ',listenerInstance=' . $listenerInstance->__toString());
+
+                       // Does the listener want that package?
+                       if ($listenerInstance->ifListenerAcceptsPackageData($packageData)) {
+                               // This listener likes our package data, so abort here
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Listener is accepting package data.');
+                               break;
+                       } // END - if
+
+                       // Debug output
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Listener is NOT accepting package data.');
+               } // END - foreach
+
+               // Return it
+               return $listenerInstance;
+       }
+
+       /**
+        * Tries to discover the right socket for given package data and returns a
+        * matching socket resource for that protocol.
+        *
+        * @param       $packageData            Raw package data array
+        * @param       $connectionType         Type of connection, can be 'incoming' or 'outgoing', *NEVER* 'server'!
+        * @return      $socketResource         A valid socket resource or FALSE if an error occured
+        * @throws      NoListGroupException    If the procol group is not found in peer list
+        * @throws      NullPointerException    If listenerInstance is NULL
+        */
+       public function discoverSocket (array $packageData, $connectionType) {
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: connectionType=' . $connectionType . ' - CALLED!');
+
+               // Assert on type
+               assert($connectionType != BaseConnectionHelper::CONNECTION_TYPE_SERVER);
+
+               // Determine protocol name
+               $protocolName = $this->determineProtocolByPackageData($packageData);
+
+               // Is it the same?
+               assert(strtoupper($protocolName) == $packageData[NetworkPackage::PACKAGE_DATA_PROTOCOL]);
+
+               // Get the listener instance
+               $listenerInstance = $this->discoverListenerInstance($protocolName, $packageData);
+
+               // If there is no listener who wants to have that package, we simply drop it here
+               if (is_null($listenerInstance)) {
+                       // Abort with no resource
+                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+               } // END - if
+
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('protocolName=' . $protocolName . ',packageData=' . print_r($packageData, TRUE));
+
+               /*
+                * Now we have the listener instance, we can determine the right
+                * resource to continue. The first step is to get the attached pool
+                * instance and pass over the whole package data to get the right
+                * socket.
+                */
+               $socketResource = $listenerInstance->getPoolInstance()->getSocketFromPackageData($packageData, $connectionType);
+
+               // Debug message
+               if (is_resource($socketResource)) {
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',error=' . socket_strerror(socket_last_error($socketResource)) . ',packageData=' . print_r($packageData, TRUE));
+               } else {
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',packageData=' . print_r($packageData, TRUE));
+               }
+
+               // Is it FALSE, the recipient isn't known to us and we have no connection to it
+               if (($socketResource === FALSE) || (!is_resource($socketResource)) || (socket_last_error($socketResource) > 0)) {
+                       // Try to create a new socket resource
+                       try {
+                               // Possibly noisy debug message
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Trying to establish a ' . strtoupper($protocolName) . ' connection to ' . $packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] . ' ...');
+
+                               // Get a socket resource from our factory (if succeeded)
+                               $socketResource = SocketFactory::createSocketFromPackageData($packageData, $protocolName);
+                       } catch (SocketConnectionException $e) {
+                               // The connection fails of being established, so log it away
+                               self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Caught ' . $e->__toString() . ',message=' . $e->getMessage());
+                       }
+               } // END - if
+
+               // Try to resolve the socket resource
+               try {
+                       // Get the helper instance from registry
+                       $helperInstance = Registry::getRegistry()->getInstance('connection');
+
+                       // Possibly noisy debug message
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Going to resolve socket from peer state and given package data ...');
+
+                       // Resolve the peer's state (but ignore return value)
+                       PeerStateResolver::resolveStateByPackage($helperInstance, $packageData, $socketResource);
+               } catch (InvalidSocketException $e) {
+                       // This cannot be fixed, so log it away
+                       self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Cannot discover socket resource for recipient ' . $packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] . ': ' . $e->getMessage());
+
+                       // Make any failed attempts to 'FALSE'
+                       $socketResource = FALSE;
+               }
+
+               // And return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: socketResource=' . $socketResource . ',packageData=' . print_r($packageData, TRUE));
+               return $socketResource;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/discovery/socket/.htaccess b/application/hub/main/discovery/socket/.htaccess
deleted file mode 100644 (file)
index 3a42882..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Deny from all
diff --git a/application/hub/main/discovery/socket/class_PackageSocketDiscovery.php b/application/hub/main/discovery/socket/class_PackageSocketDiscovery.php
deleted file mode 100644 (file)
index 125b68f..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-<?php
-/**
- * A socket discovery class
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core 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 PackageSocketDiscovery extends BaseNodeDiscovery implements DiscoverableSocket, Registerable {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       protected function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-       }
-
-       /**
-        * Create an instance of this class
-        *
-        * @return      $discoveryInstance      An instance of this discovery class
-        */
-       public static final function createPackageSocketDiscovery () {
-               // Get an instance of this class
-               $discoveryInstance = new PackageSocketDiscovery();
-
-               // Output debug message
-               self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Initialized.');
-
-               // Return the prepared instance
-               return $discoveryInstance;
-       }
-
-       /**
-        * Tries to dicover the right listener instance
-        *
-        * @param       $protocolName           Protocol name
-        * @param       $packageData            Raw package data
-        * @return      $listenerInstance       An instance of a Listenable instance or null
-        */
-       public function discoverListenerInstance ($protocolName, array $packageData) {
-               // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: protocolName=' . $protocolName . ' - ENTERED!');
-
-               /*
-                * Get the listener pool instance, we need to lookup the matching
-                * listener->poolInstance chain there.
-                */
-               $poolInstance = NodeObjectFactory::createNodeInstance()->getListenerPoolInstance();
-
-               // Init listener instance
-               $listenerInstance = NULL;
-
-               /*
-                * Now we need to choose again. It is whether we are speaking with a hub
-                * or with a client. So just handle it over to all listeners in this
-                * pool.
-                */
-               foreach ($poolInstance->getPoolEntriesInstance()->getArrayFromGroup($protocolName) as $listenerInstance) {
-                       // Debug output
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: protocolName=' . $protocolName . ',listenerInstance=' . $listenerInstance->__toString());
-
-                       // Does the listener want that package?
-                       if ($listenerInstance->ifListenerAcceptsPackageData($packageData)) {
-                               // This listener likes our package data, so abort here
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Listener is accepting package data.');
-                               break;
-                       } // END - if
-
-                       // Debug output
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Listener is NOT accepting package data.');
-               } // END - foreach
-
-               // Return it
-               return $listenerInstance;
-       }
-
-       /**
-        * Tries to discover the right socket for given package data and returns a
-        * matching socket resource for that protocol.
-        *
-        * @param       $packageData            Raw package data array
-        * @param       $connectionType         Type of connection, can be 'incoming' or 'outgoing', *NEVER* 'server'!
-        * @return      $socketResource         A valid socket resource or FALSE if an error occured
-        * @throws      NoListGroupException    If the procol group is not found in peer list
-        * @throws      NullPointerException    If listenerInstance is NULL
-        */
-       public function discoverSocket (array $packageData, $connectionType) {
-               // Assert on type
-               assert($connectionType != BaseConnectionHelper::CONNECTION_TYPE_SERVER);
-
-               // Determine protocol name
-               $protocolName = $this->determineProtocolByPackageData($packageData);
-
-               // Is it the same?
-               assert(strtoupper($protocolName) == $packageData[NetworkPackage::PACKAGE_DATA_PROTOCOL]);
-
-               // Get the listener instance
-               $listenerInstance = $this->discoverListenerInstance($protocolName, $packageData);
-
-               // If there is no listener who wants to have that package, we simply drop it here
-               if (is_null($listenerInstance)) {
-                       // Abort with no resource
-                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
-               } // END - if
-
-               // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('protocolName=' . $protocolName . ',packageData=' . print_r($packageData, TRUE));
-
-               /*
-                * Now we have the listener instance, we can determine the right
-                * resource to continue. The first step is to get the attached pool
-                * instance and pass over the whole package data to get the right
-                * socket.
-                */
-               $socketResource = $listenerInstance->getPoolInstance()->getSocketFromPackageData($packageData, $connectionType);
-
-               // Debug message
-               if (is_resource($socketResource)) {
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',error=' . socket_strerror(socket_last_error($socketResource)) . ',packageData=' . print_r($packageData, TRUE));
-               } else {
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',packageData=' . print_r($packageData, TRUE));
-               }
-
-               // Is it FALSE, the recipient isn't known to us and we have no connection to it
-               if (($socketResource === FALSE) || (!is_resource($socketResource)) || (socket_last_error($socketResource) > 0)) {
-                       // Try to create a new socket resource
-                       try {
-                               // Possibly noisy debug message
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Trying to establish a ' . strtoupper($protocolName) . ' connection to ' . $packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] . ' ...');
-
-                               // Get a socket resource from our factory (if succeeded)
-                               $socketResource = SocketFactory::createSocketFromPackageData($packageData, $protocolName);
-                       } catch (SocketConnectionException $e) {
-                               // The connection fails of being established, so log it away
-                               self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Caught ' . $e->__toString() . ',message=' . $e->getMessage());
-                       }
-               } // END - if
-
-               // Try to resolve the socket resource
-               try {
-                       // Get the helper instance from registry
-                       $helperInstance = Registry::getRegistry()->getInstance('connection');
-
-                       // Possibly noisy debug message
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Going to resolve socket from peer state and given package data ...');
-
-                       // Resolve the peer's state (but ignore return value)
-                       PeerStateResolver::resolveStateByPackage($helperInstance, $packageData, $socketResource);
-               } catch (InvalidSocketException $e) {
-                       // This cannot be fixed, so log it away
-                       self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Cannot discover socket resource for recipient ' . $packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] . ': ' . $e->getMessage());
-
-                       // Make any failed attempts to 'FALSE'
-                       $socketResource = FALSE;
-               }
-
-               // And return it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: socketResource=' . $socketResource . ',packageData=' . print_r($packageData, TRUE));
-               return $socketResource;
-       }
-}
-
-// [EOF]
-?>
index 2a33c07ed24026c56f3ca3b1e4f5856a40a1886e..579c7293e4883f68f85ee289bbb9cb5626c1e3a4 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 868a1cf6daa341440b5c42c2ddc7ad24ae77f2d9..b3f756aab7b052fe6187c09e0b92ec2a59cd2c92 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 71a957b15d43ed698a6bbe36cb05448afe1cc450..ee3559981d693cb3708cc446ff01a093bf121f05 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 11f35a8bbf6428534c1113237713397aed2690db..2439257480cad660ee0e3f5f41805ce70cfd606d 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index b6ff858bb5965208097ff66715333360b3b29be2..1ceec26cba5808e9b0659f3f00cff3e675ff6da8 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 03401299a04d22fab4b842244f6d862331efaa41..79ad5e07da53aa16e2b89bd03ec7b17a3adfd7ed 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 4feb19d1543256ebe8dfd3dd95f479f988bbaa2e..2deec66b2256d98708ad064f7c6723a7df7453cb 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index f7e5832df862f3ba6c2c9fef13eaed034af3094a..12ada2e94afa906ef96fa7759ae95ad5d525d6ee 100644 (file)
@@ -34,29 +34,60 @@ class ProtocolHandlerFactory extends ObjectFactory {
        }
 
        /**
-        * Returns a singleton protocol handler instance. If an instance is
-        * found in registry, it will be returned, else a new instance is created
-        * and stored in the same registry entry.
+        * Returns a protocol handler based on given protocol type. This is mostly 'tcp'.
         *
-        * @param       $messageType            Protocol to create an object from
+        * @param       $protocolType           Protocol type to create/return a protocol handler instance for
         * @return      $handlerInstance        A protocol handler instance
         */
-       public static final function createProtocolHandlerInstance ($messageType) {
+       private static function createProtocolHandlerByType ($protocolType) {
                // Do we have an instance in the registry?
-               if (Registry::getRegistry()->instanceExists($messageType . '_protocol_handler')) {
+               if (Registry::getRegistry()->instanceExists($protocolType . '_protocol_handler')) {
                        // Then use this instance
-                       $handlerInstance = Registry::getRegistry()->getInstance($messageType . '_protocol_handler');
+                       $handlerInstance = Registry::getRegistry()->getInstance($protocolType . '_protocol_handler');
                } else {
                        // Now prepare the tags instance
-                       $handlerInstance = self::createObjectByConfiguredName($messageType . '_protocol_handler_class');
+                       $handlerInstance = self::createObjectByConfiguredName($protocolType . '_protocol_handler_class');
 
                        // Set the instance in registry for further use
-                       Registry::getRegistry()->addInstance($messageType . '_protocol_handler', $handlerInstance);
+                       Registry::getRegistry()->addInstance($protocolType . '_protocol_handler', $handlerInstance);
                }
 
                // Return the instance
                return $handlerInstance;
        }
+
+       /**
+        * Returns a singleton protocol handler instance from given HubHelper
+        * instance. If an instance is found in registry, it will be returned, else
+        * a new instance is created and stored in the same registry entry.
+        *
+        * @param       $helperInstance         An instance of a HubHelper class
+        * @return      $handlerInstance        A protocol handler instance
+        */
+       public static final function createProtocolHandlerFromRecipientHelper (HubHelper $helperInstance) {
+               // Get the protocol type from given helper instance
+               $protocolType = $helperInstance->determineProtocolType();
+
+               // Call super factory method
+               return self::createProtocolHandlerByType($protocolType);
+       }
+
+       /**
+        * Creates an instance of a protocol handler from given (raw) package data
+        *
+        * @param       $packageData            An array with raw package data
+        * @return      $handlerInstance        A protocol handler instance
+        */
+       public static final function createProtocolHandlerFromPackageData (array $packageData) {
+               // Now that there is no direct node instance available, a protocol discovery class is required
+               $discoveryInstance = ObjectFactory::createObjectByConfiguredName('protocol_discovery_class');
+
+               // "Discover" the protocol type
+               $protocolType = $discoveryInstance->discoverProtocolByPackageData($packageData);
+
+               // Call super factory method
+               return self::createProtocolHandlerByType($protocolType);
+       }
 }
 
 // [EOF]
index ea2bd7631854b5907ca6e7411240fab3b309b410..02d95a6757c3a94e0cffaf2ff4f94c63441543f9 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 966822bc2ef3c72d5e1c5dd2b20ec95182a1d09a..64386e741cd982602323dcd74b0cf143e877ae94 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index a588924971cf45a1f482ed844297cc8e0c940dce..c1d9b73ebf7d33f51f9332af8efe5b8d07bf2449 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 8fbaa246bcb50c7862e252c0228e4b3575e6c3a2..6c4817f6b31272eceec756d3baade22d23437c95 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 71811d6733faa5d94947cdd96f4a74499bb47b1e..e89b30341c02fcea481e6f84ba3256a849a611d5 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index d936f9e56b5fc6eec2ce577bb18dc6b8a0c1ae6a..ea82b64beec43c206432881c2b149aea2d86679e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index b6c01765609ccdc6e0231b15793c549622183101..ac28c5052ba5dcd094d313e100b33dbd09df988e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
diff --git a/application/hub/main/factories/resolver/.htaccess b/application/hub/main/factories/resolver/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/factories/resolver/class_ProtocolResolverFactory.php b/application/hub/main/factories/resolver/class_ProtocolResolverFactory.php
new file mode 100644 (file)
index 0000000..92d9ea1
--- /dev/null
@@ -0,0 +1,62 @@
+<?php
+/**
+ * A factory class for ProtocolResolver
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.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 ProtocolResolverFactory extends ObjectFactory {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Returns a singleton (registry-based) ProtocolResolver instance
+        *
+        * @return      $resolverInstance       An instance of a ProtocolResolver class
+        */
+       public static final function createResolverFromConfiguredProtocol () {
+               // Get the configured protocol
+               $protocolName = FrameworkConfiguration::getSelfInstance()->getConfigEntry('hub_communication_protocol_type');
+
+               // If there is no handler?
+               if (Registry::getRegistry()->instanceExists($protocolName . '_protocol_resolver')) {
+                       // Get handler from registry
+                       $resolverInstance = Registry::getRegistry()->getInstance($protocolName . '_protocol_resolver');
+               } else {
+                       // Get the handler instance
+                       $resolverInstance = self::createObjectByConfiguredName($protocolName . '_protocol_resolver_class');
+
+                       // Add it to the registry
+                       Registry::getRegistry()->addInstance($protocolName . '_protocol_resolver', $resolverInstance);
+               }
+
+               // Return the instance
+               return $resolverInstance;
+       }
+}
+
+// [EOF]
+?>
index c92d3bc32bd834805621b8620af356fc96c73c95..839de1a69303be6edfa69952124eb6a880b0551f 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index c319eefeab703ecfc536af537d0ffa6b091c836f..b642e824600d31c9ba9bf77f586819bac1b1067d 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               Find an interface for hub helper
@@ -37,15 +37,15 @@ class SocketFactory extends ObjectFactory {
         * Creates a valid socket resource from given packae data and protocol
         *
         * @param       $packageData            Raw package data
-        * @param       $protocolName           Protocol name (TCP/UDP)
+        * @param       $protocolInstance       An instance of a HandleableProtocol class
         * @return      $socketResource         Socket resource
         */
-       public static function createSocketFromPackageData (array $packageData, $protocolName) {
+       public static function createSocketFromPackageData (array $packageData, HandleableProtocol $protocolInstance) {
                // Get an instance
                $factoryInstance = new SocketFactory();
 
                // Construct registry key
-               $registryKey = 'socket_' . $protocolName . '_' . $packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT];
+               $registryKey = 'socket_' . $protocolInstance->getProtocolName() . '_' . $packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT];
 
                // Debug message
                //*NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Trying to find a socket with registryKey=' . $registryKey);
@@ -62,7 +62,7 @@ class SocketFactory extends ObjectFactory {
                        //*NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Using socket ' . $socketResource . '(' . gettype($socketResource) . ') from registry.');
                } else {
                        // Construct configuration entry for object factory and get it
-                       $className = FrameworkConfiguration::getSelfInstance()->getConfigEntry($protocolName . '_connection_helper_class');
+                       $className = FrameworkConfiguration::getSelfInstance()->getConfigEntry($protocolInstance->getProtocolName() . '_connection_helper_class');
 
                        // Debug message
                        //*NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Going to use class ' . $className . ' for creating a socket resource ...');
index 06ae52ce39eff3aef4699aa991d64c93b258f3a3..a89d9cae8cc2e32ed697481e16b27c5dc48b49ad 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 42b6056296989cbe82a11452b8c2f09dca52189d..7e947c00fd8ee28693905486e8fce3625ce94ed0 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 4685dc84f052728345609db51e5ebea9e565d37e..ed9e027e9cd89463015022bf5a924d8f443d7ae1 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index deeadfb7d48a345bfdab0ed635aa6c752a5f214f..7ce80192547ad3e93f9708bdcfaf445f35bdf2c8 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index af03fa071187d7ae6d509d087d43ff39c1cfa634..82ab0a466bee373e9b96330f1f4a86d7af62ba8d 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 3db2305655e7ddb0f75a11954acd0cf44f927ef8..6393a395671170104def5f2708292a87d761a69b 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 3cf893fd64ec9c9288f23840b6c3a39041f6c41d..003a921eb738bae508e053db9c3bfcddff69832c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index b98cc31d873ccd8e68accf714a92ef3e453d8d48..d41e1fe20d7887107aaa6a5206f62b6e3ca12236 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index cee02f27eff37df56086f6db052349f41edcaf8d..96ee9c9538d632d54e12ef3cf4ffdbf6f16e859e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 9b9c40be5a60f41e2a39c0a0a8ffecb530a74889..9fde3e7106a2790079f92d646d60e92c9d159daf 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index ea3bd006353170b5001fd907a91310355d630ccd..353ee6867b447a23d2536c07fe06981b2cda90ae 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 7541fae1f7e679992ccb67df5187c31d5987164c..341d40472e564952bfd716cf56084f982330ab78 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index eca905df1165d1f15b99135ffee2063106a3f1d3..c1db6fadab82e3d1231d5a7fad89b160fd552233 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 4064df324b6eabeaa1f851b8402cce5fa038125d..bf2e596eba0108f7c45bdffcafaa552824be0b49 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index ed012e232e93dc33b349760643e956d5fb6591d5..619d09d9e300a18c30a81131d44abc3baad8174a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 26c55436e580098aa5782dfbeefb1f203d67b281..c2f05b3530097f5108a27c3f3a0cad1a83fbb5ab 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index f5b0d318315d43eaee82dd142c66d7c99d630af9..ea26e97e7623e690c36d59382ae27d7beadfe58f 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 61067437cb19419652a3e47f22bef329cf6bdaee..dacd419e6a33c4d11f0aeef9887d4d80a8ec2dc5 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index d7e7de8dcaaa3b4b86c9b4aac54cc944fb26167a..9d8eb00ed6ca3d82633021cdd976992de5bcd12d 100644 (file)
@@ -6,7 +6,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 851a42e1055d333c0f13a0a6ae7e43824d587364..8f2ac6b4f31bcfe09d61b216b30425189effe652 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index f5a31459cb4b11f6e475f26a6b25cd7ba7b566c5..b355d51f00067bdc8b4782d8d9ec304a888bf9b2 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -33,12 +33,11 @@ class PackageAnnouncementAnswerTagFilter extends BaseNodeFilter implements Filte
 
                // Init array
                $this->dataXmlNodes = array(
-                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_IP   => '',
-                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_IP   => '',
-                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_NODE_STATUS   => '',
-                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID    => '',
-                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_LISTEN_PORT   => 9060,
-                       BaseXmlAnswerTemplateEngine::ANSWER_STATUS                           => '',
+                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_ADDRESS => '',
+                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_ADDRESS => '',
+                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_NODE_STATUS      => '',
+                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID       => '',
+                       BaseXmlAnswerTemplateEngine::ANSWER_STATUS                              => '',
                );
        }
 
index a1041d9f47907f0bd5803d6180bf888dc74c13cf..4e7cb5ed1fb57c0f6aafe629bc005600d53f2aeb 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 4141c85ffebb8ceed327b7ad009b8790434cf9d0..0c35c72a6b335389be272728052678d6cf2114d5 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 5a0cba4c24567eb4b1f82274aab628e6a482e1bf..e075372e49e01d292e11127d06420ebd3202938b 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -33,12 +33,11 @@ class PackageAnnouncementTagFilter extends BaseNodeFilter implements FilterableP
 
                // Init array
                $this->dataXmlNodes = array(
-                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_IP => '',
-                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_IP => '',
-                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_NODE_STATUS => '',
-                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_NODE_MODE   => '',
-                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID  => '',
-                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_LISTEN_PORT => 9060,
+                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_ADDRESS => '',
+                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_ADDRESS => '',
+                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_NODE_STATUS      => '',
+                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_NODE_MODE        => '',
+                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID       => ''
                );
        }
 
index ec130aeba650b1dab5977d795813895b73db3111..0a878f73071f85ffcdd9ccca6310c4ed71db60e0 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -33,12 +33,11 @@ class PackageDhtBootstrapTagFilter extends BaseNodeFilter implements FilterableP
 
                // Init array
                $this->dataXmlNodes = array(
-                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_EXTERNAL_IP => '',
-                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_INTERNAL_IP => '',
-                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_NODE_STATUS => '',
-                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_NODE_MODE   => '',
-                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_SESSION_ID  => '',
-                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_LISTEN_PORT => 9060,
+                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_EXTERNAL_ADDRESS => '',
+                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_INTERNAL_ADDRESS => '',
+                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_NODE_STATUS      => '',
+                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_NODE_MODE        => '',
+                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_SESSION_ID       => '',
                );
        }
 
index 40e56c801bf21368fc16a7d7329074f3481b17ea..4e049196ccf2dc1a5327a8e12ca1d66d9193f895 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 3f08a7b6d73dab8305b39b1913c0a1df27967e4c..7e7ac2340d472dc2c9efa7a2e60d0e33f9565d3c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index a6728b69397e563df90312878998a974c52bc4ae..631ba93848770ef279ad026c584d9ec2d4f4a601 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 84d8b6a79c47a36661a25e94e44ed6876b131efc..e3e06646fe0638e5313586a1dfa2d35873f3b591 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -34,8 +34,7 @@ class AnnouncementAnswerOkayHandler extends BaseAnserStatusHandler implements Ha
                // Init array
                $this->searchData = array(
                        XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID,
-                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_IP,
-                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_LISTEN_PORT
+                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_ADDRESS,
                );
 
                // Set handler name
@@ -94,14 +93,14 @@ class AnnouncementAnswerOkayHandler extends BaseAnserStatusHandler implements Ha
         *
         * The following array is being handled over:
         *
-        *   my-external-ip => 1.2.3.4
-        *   my-internal-ip => 5.6.7.8
-        *   my-status      => reachable
-        *   my-session-id  => aaabbbcccdddeeefff123456789
-        *   my-tcp-port    => 9060
-        *   my-udp-port    => 9060
-        *   answer-status  => OKAY
-        *   message_type   => announcement_answer
+        *   my-external-address => 1.2.3.4
+        *   my-internal-address => 5.6.7.8
+        *   my-status           => reachable
+        *   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
index af4f1d8839b7543fca522f4aebbf42253c88ae0c..0191c392b8636b18b40d14dc9ff5b57aa46e5a9e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index fc25defa710c6999f1971cc2853868358c249b7f..28e8fca3f4addd25ce6ae31b21a89c616a22460a 100644 (file)
@@ -15,7 +15,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index b0e254270fc21b0773b573c0ff4e2c05de871153..bddc7d4bdef999a66c71c5fb7a8ffd8c3f38b6f5 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 0821f01386b88d8c69d62745d70e9898169ed76a..91fa097bbf811724f7697a211686fe4d2e53a36b 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 4c7717cd3826575533f89a7254b21a1c38d5bdf2..a8245372702ef546ed4186bc9703253687653a3a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index c12a3bf7cd9fd866c1693316de6e4615e7ba0f3f..9f7e288b691a338528f7c74f34abc842b68970c0 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -21,7 +21,7 @@
  * 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 BaseHandler extends BaseHubSystem implements Handleable {
+class BaseHandler extends BaseHubSystem implements HandleableDataSet {
        /**
         * Handler name
         */
index 684dc08011e9236cb37cb918245b8c602b79ab13..3c20cb41fc10278003872c5c5f9facdc3133e40a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -36,34 +36,31 @@ class NodeMessageAnnouncementHandler extends BaseMessageHandler implements Handl
 
                // Init message data array
                $this->messageDataElements = array(
-                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_IP,
-                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_IP,
+                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_ADDRESS,
+                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_ADDRESS,
                        XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_NODE_STATUS,
                        XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_NODE_MODE,
                        XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID,
-                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_LISTEN_PORT,
                );
 
                // Init message-data->configuration translation array
                $this->messageToConfig = array(
-                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_IP => 'your_external_ip',
-                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_IP => 'your_internal_ip',
-                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID  => 'your_session_id'
+                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_ADDRESS => 'your_external_address',
+                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_ADDRESS => 'your_internal_address',
+                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID       => 'your_session_id'
                );
 
                // Init config-copy array
                $this->configCopy = array(
-                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_IP => 'external_ip',
-                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_IP => 'internal_ip',
-                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_NODE_STATUS => 'node_status',
-                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID  => 'session_id',
-                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_LISTEN_PORT => 'node_listen_port',
+                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_ADDRESS => 'external_address',
+                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_ADDRESS => 'internal_address',
+                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_NODE_STATUS      => 'node_status',
+                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID       => 'session_id',
                );
 
                // Init array
                $this->searchData = array(
-                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_IP,
-                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_LISTEN_PORT
+                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_ADDRESS
                );
        }
 
index 59bc4de0b61f1aa1ca091bae9c3bd6cb76ddd889..3e97cfb93b3194b9006c36ec86fa70375ce0d715 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -36,37 +36,34 @@ class NodeMessageAnnouncementAnswerHandler extends BaseMessageHandler implements
 
                // Init message data array
                $this->messageDataElements = array(
-                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_IP,
-                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_IP,
+                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_ADDRESS,
+                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_ADDRESS,
                        XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_NODE_STATUS,
                        XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID,
-                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_LISTEN_PORT,
                        BaseXmlAnswerTemplateEngine::ANSWER_STATUS,
                );
 
                // Init message-data->configuration translation array
                $this->messageToConfig = array(
                /*
-                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_IP => 'your_external_ip',
-                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_IP => 'your_internal_ip',
-                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID  => 'your_session_id'
+                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_ADDRESS => 'your_external_address',
+                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_ADDRESS => 'your_internal_address',
+                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID       => 'your_session_id'
                */
                );
 
                // Init config-copy array
                $this->configCopy = array(
-                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_IP => 'external_ip',
-                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_IP => 'internal_ip',
-                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_NODE_STATUS => 'node_status',
-                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID  => 'session_id',
-                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_LISTEN_PORT => 'node_listen_port',
+                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_ADDRESS => 'external_address',
+                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_ADDRESS => 'internal_address',
+                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_NODE_STATUS      => 'node_status',
+                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID       => 'session_id',
                );
 
                // Init array
                $this->searchData = array(
                        XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID,
-                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_IP,
-                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_LISTEN_PORT
+                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_ADDRESS,
                );
        }
 
index cf4fa42c9f6c86844dafa2c2b1d5a945d3b8ee20..4de6abb5941a0fa9d87818e9f968ad62ae10115a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -36,37 +36,34 @@ class NodeMessageDhtBootstrapAnswerHandler extends BaseMessageHandler implements
 
                // Init message data array
                $this->messageDataElements = array(
-                       XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_EXTERNAL_IP,
-                       XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_INTERNAL_IP,
+                       XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_EXTERNAL_ADDRESS,
+                       XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_INTERNAL_ADDRESS,
                        XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_NODE_STATUS,
                        XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_SESSION_ID,
-                       XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_LISTEN_PORT,
                        BaseXmlAnswerTemplateEngine::ANSWER_STATUS,
                );
 
                // Init message-data->configuration translation array
                $this->messageToConfig = array(
                /*
-                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_EXTERNAL_IP => 'your_external_ip',
-                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_INTERNAL_IP => 'your_internal_ip',
-                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_SESSION_ID  => 'your_session_id'
+                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_EXTERNAL_ADDRESS => 'your_external_address',
+                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_INTERNAL_ADDRESS => 'your_internal_address',
+                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_SESSION_ID       => 'your_session_id'
                */
                );
 
                // Init config-copy array
                $this->configCopy = array(
-                       XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_EXTERNAL_IP => 'external_ip',
-                       XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_INTERNAL_IP => 'internal_ip',
-                       XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_NODE_STATUS => 'node_status',
-                       XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_SESSION_ID  => 'session_id',
-                       XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_LISTEN_PORT => 'node_listen_port',
+                       XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_EXTERNAL_ADDRESS => 'external_address',
+                       XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_INTERNAL_ADDRESS => 'internal_address',
+                       XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_NODE_STATUS      => 'node_status',
+                       XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_SESSION_ID       => 'session_id',
                );
 
                // Init array
                $this->searchData = array(
                        XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_SESSION_ID,
-                       XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_EXTERNAL_IP,
-                       XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_LISTEN_PORT
+                       XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_EXTERNAL_ADDRESS,
                );
        }
 
index bcd471d6d8135ce7a945b870140bb208a6c7d7e0..641c7ee303c023eaf6510f5c9081e5f65b9c8c6e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index d36ac50cc8aa0b64fef47dea74b30db9de55a5eb..131e3c1c89cba2c2e10525220fc135196d8c2630 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -36,7 +36,7 @@ class NodeMessage???Handler extends BaseMessageHandler implements HandleableMess
 
                // Init message data array
                $this->messageDataElements = array(
-                       Xml???TemplateEngine::!!!_DATA_EXTERNAL_IP,
+                       Xml???TemplateEngine::!!!_DATA_EXTERNAL_ADDRESS,
                        Xml???TemplateEngine::!!!_DATA_NODE_STATUS,
                        Xml???TemplateEngine::!!!_DATA_SESSION_ID,
                        Xml???TemplateEngine::!!!_DATA_LISTEN_PORT,
index fad63f03ee6780e233fc84c4a5a75d7aff559622..78902af7194494461aceafaa71856ab5ba18e676 100644 (file)
@@ -5,7 +5,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -58,7 +58,7 @@ abstract class BaseMessageHandler extends BaseDataHandler {
         * following data must always be present:
         *
         * - session-id  (for finding the node's record together with below data)
-        * - external-ip (hostname or IP number)
+        * - external-address (hostname or IP number)
         * - listen-port (TCP/UDP listen port for inbound connections)
         *
         * @param       $messageArray   An array with all minimum message data
index e6344ca18c42ee015bf0154c8d905f4f9c8a9b85..c793a6fb0377b0a12561d43c04885822495c783b 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -36,34 +36,31 @@ class NodeMessageDhtBootstrapHandler extends BaseMessageHandler implements Handl
 
                // Init message data array
                $this->messageDataElements = array(
-                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_EXTERNAL_IP,
-                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_INTERNAL_IP,
+                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_EXTERNAL_ADDRESS,
+                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_INTERNAL_ADDRESS,
                        XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_NODE_STATUS,
                        XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_NODE_MODE,
                        XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_SESSION_ID,
-                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_LISTEN_PORT,
                );
 
                // Init message-data->configuration translation array
                $this->messageToConfig = array(
-                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_EXTERNAL_IP => 'your_external_ip',
-                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_INTERNAL_IP => 'your_internal_ip',
-                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_SESSION_ID  => 'your_session_id'
+                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_EXTERNAL_ADDRESS => 'your_external_address',
+                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_INTERNAL_ADDRESS => 'your_internal_address',
+                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_SESSION_ID       => 'your_session_id'
                );
 
                // Init config-copy array
                $this->configCopy = array(
-                       XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_EXTERNAL_IP => 'external_ip',
-                       XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_INTERNAL_IP => 'internal_ip',
-                       XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_NODE_STATUS => 'node_status',
-                       XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_SESSION_ID  => 'session_id',
-                       XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_LISTEN_PORT => 'node_listen_port',
+                       XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_EXTERNAL_ADDRESS => 'external_address',
+                       XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_INTERNAL_ADDRESS => 'internal_address',
+                       XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_NODE_STATUS      => 'node_status',
+                       XmlDhtBootstrapAnswerTemplateEngine::DHT_BOOTSTRAP_DATA_SESSION_ID       => 'session_id',
                );
 
                // Init array
                $this->searchData = array(
-                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_EXTERNAL_IP,
-                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_LISTEN_PORT
+                       XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_EXTERNAL_ADDRESS,
                );
        }
 
index 81d6aad3e0964256cab92f861357d69d2e374228..8c7d5841eeaa52566f9a84850f3fe1d2a15531c1 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 76e3f902aef3133bddb0799a1c4ec1c5bdaad766..efd0f64b41e362ae25b78b4618d9a49083d46fc4 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 6bb894438ef3e625f4906ffeb7b9c06e4978fd1d..1098d473b78782212fc57310da0227219019ad81 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -140,16 +140,16 @@ class BaseRawDataHandler extends BaseHandler {
        }
 
        /**
-        * Checks whether the 'recipient' field matches our own address:port
-        * combination.
+        * Checks whether the 'recipient' field matches our own an universal node
+        * locator.
         *
         * @param       $packageData    Raw package data
         * @return      $matches                Whether it matches
         * @todo        This method will be moved to a better place
         */
-       protected function ifRecipientMatchesOwnAddress (array $packageData) {
+       protected function ifRecipientMatchesOwnUniversalNodeLocator (array $packageData) {
                // Construct own address first
-               $ownAddress = NodeObjectFactory::createNodeInstance()->getAddressPort();
+               $ownAddress = NodeObjectFactory::createNodeInstance()->determineUniversalNodeLocator();
 
                // Does it match?
                $matches = ($ownAddress === $packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT]);
index 9324cf1fcdbf5688b9ea1c9208718368b3ed5d18..d954717600dc1623abe9a3d252bcab115c01cbda 100644 (file)
@@ -138,7 +138,7 @@ socket_close($mainSocket);
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index ea089fdf35f33ad2fdd9f6b21161aafe9b471700..bb6fe494d0e7b498aa153d4d50eb977cf5449e9a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index ad9a5cda57e267b2c1fa9ea153496e96ac2d97ee..9bb47a18287745252b65755e6d14f82b14def96e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -49,8 +49,8 @@ class UdpRawDataHandler extends BaseRawDataHandler implements Networkable {
        }
 
        /**
-        * Processes raw data from given resource. This is mostly useful for TCP
-        * package handling and is implemented in the TcpListener class
+        * Processes raw data from given resource. This is mostly useful for UDP
+        * package handling and is implemented in the UdpListener class
         *
         * @param       $socketArray    A valid socket resource array
         * @return      void
diff --git a/application/hub/main/handler/protocol/.htaccess b/application/hub/main/handler/protocol/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/handler/protocol/class_ b/application/hub/main/handler/protocol/class_
new file mode 100644 (file)
index 0000000..770d443
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/**
+ * A ??? protocol handler
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.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 ???ProtocolHandler extends BaseProtocolHandler implements HandleableProtocol, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set handler name
+               $this->setHandlerName('|||_protocol');
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @return      $handlerInstance        An instance of a HandleableMessage class
+        */
+       public final static function create???ProtocolHandler () {
+               // Get new instance
+               $handlerInstance = new ???ProtocolHandler();
+
+               // Return the prepared instance
+               return $handlerInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/handler/protocol/class_BaseProtocolHandler.php b/application/hub/main/handler/protocol/class_BaseProtocolHandler.php
new file mode 100644 (file)
index 0000000..c2421c1
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+/**
+ * A general handler for protocols such as TCP, UDP and others.
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 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 BaseProtocolHandler extends BaseHandler {
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/handler/protocol/tcp/.htaccess b/application/hub/main/handler/protocol/tcp/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/handler/protocol/tcp/class_TcpProtocolHandler.php b/application/hub/main/handler/protocol/tcp/class_TcpProtocolHandler.php
new file mode 100644 (file)
index 0000000..bdbdd3e
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/**
+ * A Tcp protocol handler (IPv4)
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.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 TcpProtocolHandler extends BaseProtocolHandler implements HandleableProtocol, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set handler name
+               $this->setHandlerName('tcp_protocol');
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @return      $handlerInstance        An instance of a HandleableMessage class
+        */
+       public final static function createTcpProtocolHandler () {
+               // Get new instance
+               $handlerInstance = new TcpProtocolHandler();
+
+               // Return the prepared instance
+               return $handlerInstance;
+       }
+}
+
+// [EOF]
+?>
index f849e4d86e794dbaf2b80409b6ef83866d50eab8..c8a87bc0b6466763c2831b7ca2c6ce15fde60e16 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index d3888ea4559f45494dc3bd58875b1691fcd86a2f..f2df8d58c3f532d3acb4cbf2a5e9d7bbfccd673c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  * @todo               Find an interface for hub helper
@@ -33,7 +33,7 @@ class !!!???Helper extends BaseHubSystemHelper implements Helpable!!! {
                parent::__construct(__CLASS__);
 
                // Set recipient type
-               $this->setRecipientType(NetworkPackage::NETWORK_TARGET_!!!);
+               $this->setRecipientType(NetworkPackage::NETWORK_TARGET_```);
 
                // Set package tags
                $this->setPackageTags(array('???'));
@@ -78,7 +78,7 @@ class !!!???Helper extends BaseHubSystemHelper implements Helpable!!! {
                $packageInstance = NetworkPackageFactory::createNetworkPackageInstance();
 
                // Next, feed the content in. The network package class is a pipe-through class.
-               $packageInstance->enqueueRawDataFromTemplate($this, NetworkPackage::PROTOCOL_TCP);
+               $packageInstance->enqueueRawDataFromTemplate($this);
        }
 }
 
index de901600c4dc647406de6a4566078c574785f83c..b4f365a816ceddddd0581b745606920a39dcbbf6 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -21,7 +21,7 @@
  * 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 BaseHubSystemHelper extends BaseHubSystem implements Helper {
+class BaseHubSystemHelper extends BaseHubSystem implements HubHelper {
        /**
         * Recipient type
         */
@@ -79,6 +79,17 @@ class BaseHubSystemHelper extends BaseHubSystem implements Helper {
        public final function setPackageTags (array $packageTags) {
                $this->packageTags = $packageTags;
        }
+
+       /**
+        * Tries to determine the used protocol for this package (this helper is helping to send out)
+        *
+        * @return      $protocolType   Type of protocol to use, usually TCP
+        * @todo        0% done
+        */
+       public function determineProtocolType () {
+               die(__METHOD__ . ':' . print_r($this, TRUE));
+               // Return it
+       }
 }
 
 // [EOF]
index 10696dc8cfd5cc05ebec8b5fff1fe3597042eca5..7dcb01a5f4ca4033937bfa95b2f46f7c933412c0 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  * @todo               Find an interface for hub helper
@@ -33,7 +33,7 @@ class ???ConnectionHelper extends BaseConnectionHelper implements ConnectionHelp
                parent::__construct(__CLASS__);
 
                // Set protocol
-               $this->setProtocol('!!!');
+               $this->setProtocolName('!!!');
        }
 
        /**
index eede0f8f3a9800eb0104794bd47849be2254d15c..706a3796d635566042ee5ed7dbf216e4e83e21f6 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -21,7 +21,7 @@
  * 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 BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, ProtocolHandler {
+class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable {
        // Exception codes
        const EXCEPTION_UNSUPPORTED_ERROR_HANDLER = 0x9100;
 
@@ -41,14 +41,14 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable,
        const CONNECTION_TYPE_SERVER   = 'server';
 
        /**
-        * Protocol used
+        * Name of used protocol for this connection
         */
-       private $protocol = 'invalid';
+       private $connectionType = 'invalid';
 
        /**
         * Port number used
         */
-       private $port = 0;
+       private $connectionPort = 0;
 
        /**
         * (IP) Adress used
@@ -122,48 +122,48 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable,
         */
        public final function __toString () {
                // Class name representation
-               $class = self::getConnectionClassName($this->getAddress(), $this->getPort(), parent::__toString());
+               $class = self::getConnectionClassName($this->getAddress(), $this->getConnectionPort(), parent::__toString());
 
                // Return it
                return $class;
        }
 
        /**
-        * Getter for port number to satify ProtocolHandler
+        * Getter for connection type
         *
-        * @return      $port   The port number
+        * @return      $connectionType         Name of used protocol in this connection
         */
-       public final function getPort () {
-               return $this->port;
+       public final function getConnectionType () {
+               return $this->connectionType;
        }
 
        /**
-        * Setter for port number to satify ProtocolHandler
+        * Setter for connection type
         *
-        * @param       $port   The port number
+        * @param       $connectionType         Name of used protocol in this connection
         * @return      void
         */
-       protected final function setPort ($port) {
-               $this->port = $port;
+       protected final function setConnectionType ($connectionType) {
+               $this->connectionType = $connectionType;
        }
 
        /**
-        * Getter for protocol
+        * Getter for port number to satify HandleableProtocol
         *
-        * @return      $protocol       Used protocol
+        * @return      $connectionPort The port number
         */
-       public final function getProtocol () {
-               return $this->protocol;
+       public final function getConnectionPort () {
+               return $this->connectionPort;
        }
 
        /**
-        * Setter for protocol
+        * Setter for port number to satify HandleableProtocol
         *
-        * @param       $protocol       Used protocol
+        * @param       $connectionPort The port number
         * @return      void
         */
-       protected final function setProtocol ($protocol) {
-               $this->protocol = $protocol;
+       protected final function setConenctionPort ($connectionPort) {
+               $this->connectionPort = $connectionPort;
        }
 
        /**
@@ -413,7 +413,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable,
                assert(strlen($rawData) > 0);
 
                // Calculate buffer size
-               $bufferSize = $this->getConfigInstance()->getConfigEntry($this->getProtocol() . '_buffer_length');
+               $bufferSize = $this->getConfigInstance()->getConfigEntry($this->getProtocolName() . '_buffer_length');
 
                // Encode the raw data with our output-stream
                $encodedData = $this->getOutputStreamInstance()->streamData($rawData);
index 4c7a6ab4ee3e6e6c69f4314038d1434f8515a19b..de83320a9afeac61135b184b3ce36162dc8e6c87 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               Find an interface for hub helper
@@ -33,7 +33,7 @@ class TcpConnectionHelper extends BaseConnectionHelper implements ConnectionHelp
                parent::__construct(__CLASS__);
 
                // Set protocol
-               $this->setProtocol('tcp');
+               $this->setProtocolName('tcp');
        }
 
        /**
@@ -93,36 +93,41 @@ class TcpConnectionHelper extends BaseConnectionHelper implements ConnectionHelp
                // Try to solve the recipient
                try {
                        // Resolve any session ids; 0 = IP, 1 = Port
-                       $recipientData = explode(':', HubTools::resolveSessionId($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT]));
+                       $resolved = HubTools::resolveSessionId($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT]);
+                       die(__METHOD__ . 'resolved=' . print_r($resolved, TRUE));
+
+                       $recipientData = explode(':', $resolved);
                } catch (NoValidHostnameException $e) {
                        // Debug message
                        self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Failed to resolve ' . $packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] . ':' . $e->getMessage());
 
                        // Is the recipient equal as configured IP
-                       if (substr($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT], 0, strlen($helperInstance->getConfigInstance()->getConfigEntry('external_ip'))) == $helperInstance->getConfigInstance()->getConfigEntry('external_ip')) {
-                               // This connects to shipsimu.org and requests /ip.php which will return our external IP number
-                               $recipientData[0] = ConsoleTools::determineExternalIp();
+                       if (substr($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT], 0, strlen($helperInstance->getConfigInstance()->getConfigEntry('external_address'))) == $helperInstance->getConfigInstance()->getConfigEntry('external_address')) {
+                               // This may connect to shipsimu.org and requests 'ip.php' which will return our external IP address
+                               $recipientData[0] = HubTools::determineExternalAddress();
 
-                               // Do we have hostname:ip match?
+                               // Do we have ip:port match?
+                               // @TODO Rewrite this test for UNLs
                                if (strpos($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT], ':') === FALSE) {
-                                       // No hostname:ip!
+                                       // No ip:port!
                                        $helperInstance->debugInstance($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] . ' does not contain ":". Please fix this.');
                                } // END - if
 
-                               // "explode" the hostname:ip, so index 1 will be the port number
+                               // "explode" the ip:port, so index 1 will be the port number
+                               // @TODO Rewrite this test for UNLs
                                $recipientArray = explode(':', $packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT]);
 
                                // Add the port
                                $recipientData[1] = $recipientArray[1];
                        } else {
                                // It doesn't match, we need to take care of this later
-                               $helperInstance->debugInstance($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] . '!=' . $helperInstance->getConfigInstance()->getConfigEntry('external_ip'));
+                               $helperInstance->debugInstance($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] . '!=' . $helperInstance->getConfigInstance()->getConfigEntry('external_address'));
                        }
                }
 
-               // Set ip/port
+               // Set address and maybe port
                $helperInstance->setAddress($recipientData[0]);
-               $helperInstance->setPort($recipientData[1]);
+               $helperInstance->setConnectionPort($recipientData[1]);
 
                // Now connect to it
                if (!$helperInstance->connectToPeerByRecipientData($recipientData)) {
index 9b238379318d3047546ad60e4c257383be5779a0..d863f6a6cf18509b43eaa16c44abada1fc8f691e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               Find an interface for hub helper
@@ -33,7 +33,7 @@ class UdpConnectionHelper extends BaseConnectionHelper implements ConnectionHelp
                parent::__construct(__CLASS__);
 
                // Set protocol
-               $this->setProtocol('udp');
+               $this->setProtocolName('udp');
        }
 
        /**
index bc5fcafccdd0fe1c4dedbac5f9009f6f689fcf06..436cfd16d5f9073fa1c673387a3229f4a5d4cc13 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               Find an interface for hub helper
@@ -83,7 +83,7 @@ class DhtBootstrapHelper extends BaseHubSystemHelper implements HelpableDht {
         */
        public function sendPackage (Distributable $dhtInstance) {
                // Debug message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!');
 
                /*
                 * Sanity check: Is the DHT in the approx. state? 'init' for bootstrap
@@ -98,10 +98,11 @@ class DhtBootstrapHelper extends BaseHubSystemHelper implements HelpableDht {
                $packageInstance = NetworkPackageFactory::createNetworkPackageInstance();
 
                // Next, feed the content in. The network package class is a pipe-through class.
-               $packageInstance->enqueueRawDataFromTemplate($this, NetworkPackage::PROTOCOL_TCP);
+               //* DEBUG: */ die(__METHOD__ . ':dhtInstance=' . print_r($dhtInstance, TRUE));
+               $packageInstance->enqueueRawDataFromTemplate($this);
 
                // Debug message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!');
        }
 }
 
index 0e00a83f43faf9d59a1f9bf2cd1324db82e93ccd..b0351f60a97bce91df3d7282fc4ac4688e26c037 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               Find an interface for hub helper
@@ -91,7 +91,7 @@ class DhtPublishEntryHelper extends BaseHubSystemHelper implements HelpableDht {
                $packageInstance = NetworkPackageFactory::createNetworkPackageInstance();
 
                // Next, feed the content in. The network package class is a pipe-through class.
-               $packageInstance->enqueueRawDataFromTemplate($this, NetworkPackage::PROTOCOL_TCP);
+               $packageInstance->enqueueRawDataFromTemplate($this);
        }
 }
 
index d5e2002d948229f5b1ad66da22a6685181e937d4..10e5d099eb7b2a5d5812b58e9fc8c475a15279c4 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index d3a98a9a01eaa72e827d6a09591d2c82333388f4..73080ac9dbc8bc9cb38edeb8e019cd39afdfc660 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index c9af05f3a5cd550d6e0fc1d74991415c41d255f7..15b66a4a9e0310e5628a49bbb20a95b143b147de 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index d76523988269a1d40388c3c15a798631df731397..0edef644e879387078a006b1ff97e976ddce13ff 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               Find an interface for hub helper
@@ -96,7 +96,7 @@ class NodeAnnouncementHelper extends BaseNodeHelper implements HelpableNode {
                $packageInstance = NetworkPackageFactory::createNetworkPackageInstance();
 
                // Next, feed the content in. The network package class is a pipe-through class.
-               $packageInstance->enqueueRawDataFromTemplate($this, NetworkPackage::PROTOCOL_TCP);
+               $packageInstance->enqueueRawDataFromTemplate($this);
        }
 }
 
index 7c15681b5f15b7a4f8430c90d2893820c919be58..c1b65451a1d8fffd68f787110d08e5d7cc2d4695 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               Find an interface for hub helper
@@ -96,7 +96,7 @@ class NodeAnnouncementMessageAnswerHelper extends BaseHubAnswerHelper implements
                $packageInstance = NetworkPackageFactory::createNetworkPackageInstance();
 
                // Next, feed the content in. The network package class is a pipe-through class.
-               $packageInstance->enqueueRawDataFromTemplate($this, NetworkPackage::PROTOCOL_TCP);
+               $packageInstance->enqueueRawDataFromTemplate($this);
        }
 }
 
index b07c80fbdd3184436c804e0cfc2473d03c031fed..4c9e7762c036c4524f24cf514d17ff70f645cc27 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index eebebd4ca9def4560bff5857f7f65c1ff9f4cef5..7b6966f04d6891da4271e31520200814f942e9e0 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               Find an interface for hub helper
@@ -96,7 +96,7 @@ class NodeDhtBootstrapMessageAnswerHelper extends BaseHubAnswerHelper implements
                $packageInstance = NetworkPackageFactory::createNetworkPackageInstance();
 
                // Next, feed the content in. The network package class is a pipe-through class.
-               $packageInstance->enqueueRawDataFromTemplate($this, NetworkPackage::PROTOCOL_TCP);
+               $packageInstance->enqueueRawDataFromTemplate($this);
        }
 }
 
index aa653358a01b38bd70c327a4d938ff1fc6ddf311..18fbcad0a3bd8a15cf286b5cb8c89199f4b637d3 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               Find an interface for hub helper
@@ -102,7 +102,7 @@ class NodeRequestNodeListMessageAnswerHelper extends BaseHubAnswerHelper impleme
                $packageInstance = NetworkPackageFactory::createNetworkPackageInstance();
 
                // Next, feed the content in. The network package class is a pipe-through class.
-               $packageInstance->enqueueRawDataFromTemplate($this, NetworkPackage::PROTOCOL_TCP);
+               $packageInstance->enqueueRawDataFromTemplate($this);
        }
 }
 
index 5e5e493eb6718afebf397372937f452bf4fbefed..7ba8c47541878805ce459d01296b6d1c8cedafac 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  * @todo               Find an interface for hub helper
@@ -75,7 +75,7 @@ class Node???Helper extends BaseNodeHelper implements HelpableNode {
                $packageInstance = NetworkPackageFactory::createNetworkPackageInstance();
 
                // Next, feed the content in. The network package class is a pipe-through class.
-               $packageInstance->enqueueRawDataFromTemplate($this, NetworkPackage::PROTOCOL_|||);
+               $packageInstance->enqueueRawDataFromTemplate($this);
        }
 }
 
index c93e6bc4434cb3f26c285f40f4e175c0dd948b3d..6eb146e1abd4f65fe4aa12536c0bd47aa2f4f53a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 97c7c551a62225507219ee82d52842dbc23f0f0d..a952cd4552c271d71f398d48da295b0d9cb98301 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               Find an interface for hub helper
@@ -92,7 +92,7 @@ class NodeSelfConnectHelper extends BaseNodeHelper implements HelpableNode {
                $packageInstance = NetworkPackageFactory::createNetworkPackageInstance();
 
                // Next, feed the content in. The network package class is a pipe-through class.
-               $packageInstance->enqueueRawDataFromTemplate($this, NetworkPackage::PROTOCOL_TCP);
+               $packageInstance->enqueueRawDataFromTemplate($this);
        }
 }
 
index 4429e58cb50c34ad7c0575577f75af02b2ac3702..c7f15c47336fadd68e1fdeba1e46b7090fc7b434 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               Find an interface for hub helper
@@ -92,7 +92,7 @@ class NodeRequestNodeListHelper extends BaseNodeHelper implements HelpableNode {
                $packageInstance = NetworkPackageFactory::createNetworkPackageInstance();
 
                // Next, feed the content in. The network package class is a pipe-through class.
-               $packageInstance->enqueueRawDataFromTemplate($this, NetworkPackage::PROTOCOL_TCP);
+               $packageInstance->enqueueRawDataFromTemplate($this);
        }
 }
 
index caccf429d8839550342cf8f72b6c91c8e2f54e67..3e82dbf0b79631fb3c5f63645f9640b22aa8d595 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 24b96b80ca2b09af8bf42a11fd728df80d897637..607baadd9a01e9dea5d1c9cff025c0002e946380 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 2ec9cc223cf0fe0df3b88a023db6197dc090e16b..23344d41f4ad4aa186c040453bac36f6670f9837 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               This current implementation is not recommended, use a
index 4ff42d2bac3ea6c885e594c868b1d0aa730e9d9a..f10d5d4ad8ef882951de4f1cc268442685256705 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index a7c6748904ea1d8adddff74b00534c25c70e3185..27a0eb550df76bce742d532e0bd72891e61ddb75 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 5fcdd99e54e3ebae23cccf57ee26c22ea8ca6d20..bef1dc844cd9a3cf0875cd194cfeae81d63bb21a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               This current implementation is not recommended, use a
index b8a35b78002f2558d988752cf96630472ed0cbf1..a538edd794ecfb7d0089a6402ed824280a2df3e3 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               This current implementation is not recommended, use a
index 9ee2371f5a801e0354bb9f95f5bbbfdd0eefad4d..5035027798134e6d04657303236aebf5b737a095 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 3eae4fedf792c8a88c6a9ddecefbd068995af045..9f5bf0700d75be67797dbb6770b71865c1ebd8d0 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 57719ca80639c9a008c8a728dfa50354f2037742..b11f10d860d6e13201bf5f3da12eb605f507f1eb 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               This current implementation is not recommended, use a
index cf356fc1455be0cd502a43cef29d8b939d7502b4..15a335ae633768a971436a501e3b808bccaeaa31 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index da51bb399b78e8b14bde82d15d48c1b68d721c2a..4e7b1528d3bd9d6e8f3706bc1b9be9585092238a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 2ee21895d569d7f40a04749153130e9e5e84b3dd..2aa6c6a9eb10b2eff2ac0f784d99a6b06f7fc7ff 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -33,11 +33,6 @@ class BaseListener extends BaseHubSystem implements Visitable {
        const EXCEPTION_FINAL_CHUNK_VERIFICATION         = 0xa07;
        const EXCEPTION_INVALID_DATA_CHECKSUM            = 0xa08;
 
-       /**
-        * Used protocol (Default: invalid, which is indeed invalid...)
-        */
-       private $protocol = 'invalid';
-
        /**
         * Address (IP mostly) we shall listen on
         */
@@ -131,15 +126,6 @@ class BaseListener extends BaseHubSystem implements Visitable {
                return $this->listenPort;
        }
 
-       /**
-        * Getter for port number to satify ProtocolHandler
-        *
-        * @return      $port   The port number
-        */
-       public final function getPort () {
-               return $this->getListenPort();
-       }
-
        /**
         * "Setter" to set listen address from configuration entry
         *
@@ -160,25 +146,6 @@ class BaseListener extends BaseHubSystem implements Visitable {
                $this->setListenPort($this->getConfigInstance()->getConfigEntry($configEntry));
        }
 
-       /**
-        * Setter for protocol
-        *
-        * @param       $protocol       Used protocol
-        * @return      void
-        */
-       protected final function setProtocol ($protocol) {
-               $this->protocol = (string) $protocol;
-       }
-
-       /**
-        * Getter for protocol
-        *
-        * @return      $protocol       Used protocol
-        */
-       public final function getProtocol () {
-               return $this->protocol;
-       }
-
        /**
         * Setter for blocking-mode
         *
@@ -272,7 +239,7 @@ class BaseListener extends BaseHubSystem implements Visitable {
         */
        public function accept (Visitor $visitorInstance) {
                // Debug message
-               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($this->getProtocol()) . '-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: ' . $visitorInstance->__toString() . ' has visited ' . $this->__toString() . ' - START');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($this->getProtocolName()) . '-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: ' . $visitorInstance->__toString() . ' has visited ' . $this->__toString() . ' - START');
 
                // Visit this listener
                $visitorInstance->visitListener($this);
@@ -283,7 +250,7 @@ class BaseListener extends BaseHubSystem implements Visitable {
                } // END - if
 
                // Debug message
-               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($this->getProtocol()) . '-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: ' . $visitorInstance->__toString() . ' has visited ' . $this->__toString() . ' - FINISHED');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($this->getProtocolName()) . '-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: ' . $visitorInstance->__toString() . ' has visited ' . $this->__toString() . ' - FINISHED');
        }
 
        /**
index 758ae306df739d3ea731c08ec241c72f97cd9a1e..e45a78111342945810eacaff0416fe9e8ca9787c 100644 (file)
@@ -1,10 +1,10 @@
 <?php
 /**
- * A decorator for the TcpListener to communicate to hubs
+ * A general decorator for listeners to communicate to hubs
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -56,24 +56,6 @@ class BaseListenerDecorator extends BaseDecorator implements Visitable {
                return $this->getListenerInstance()->getListenPort();
        }
 
-       /**
-        * Getter for port
-        *
-        * @return      $port   The port
-        */
-       public final function getPort () {
-               return $this->getListenerInstance()->getPort();
-       }
-
-       /**
-        * Getter for protocol
-        *
-        * @return      $protocol       The used protocol
-        */
-       public final function getProtocol () {
-               return $this->getListenerInstance()->getProtocol();
-       }
-
        /**
         * Accepts the visitor to process the visit "request"
         *
index 9324cf1fcdbf5688b9ea1c9208718368b3ed5d18..d954717600dc1623abe9a3d252bcab115c01cbda 100644 (file)
@@ -138,7 +138,7 @@ socket_close($mainSocket);
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 473db762f57bf0ee09ed8e2a8ee5f3a47ba20a43..560801e1160b8750ed6b13e350a974224e3ab426 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -32,7 +32,7 @@ class TcpListener extends BaseListener implements Listenable {
                parent::__construct(__CLASS__);
 
                // Set the protocol to TCP
-               $this->setProtocol('tcp');
+               $this->setProtocolName('tcp');
        }
 
        /**
@@ -286,7 +286,7 @@ class TcpListener extends BaseListener implements Listenable {
                        $packageData = array(
                                NetworkPackage::PACKAGE_DATA_SENDER    => $peerName . ':0',
                                NetworkPackage::PACKAGE_DATA_RECIPIENT => $this->getSessionId(),
-                               NetworkPackage::PACKAGE_DATA_PROTOCOL  => $this->getProtocol(),
+                               NetworkPackage::PACKAGE_DATA_PROTOCOL  => $this->getProtocolName(),
                                NetworkPackage::PACKAGE_DATA_STATUS    => NetworkPackage::PACKAGE_STATUS_FAKED
                        );
 
index c0af385a90175f8fdb5a13bafa4ea42d8b29a5f9..87f19300f6506e3ba803fbb1958d337f18b5a916 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -31,8 +31,9 @@ class ClientTcpListenerDecorator extends BaseListenerDecorator implements Listen
                // Call parent constructor
                parent::__construct(__CLASS__);
 
-               // Set listener type
+               // Set listener type and protocol name
                $this->setListenerType('peer');
+               $this->setProtocolName('tcp');
        }
 
        /**
index 9b1d072a897945bc8f2ffa920ec0aa8a2aab102e..71022812292d6a39a307afe139924ad1346c6f4a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -31,8 +31,9 @@ class HubTcpListenerDecorator extends BaseListenerDecorator implements Listenabl
                // Call parent constructor
                parent::__construct(__CLASS__);
 
-               // Set listener type
+               // Set listener type and protocol name
                $this->setListenerType('hub');
+               $this->setProtocolName('tcp');
        }
 
        /**
index 39be600bd95681ae26f9f2b43dffd0d002d4a34e..fa4a2c36b6835df8a627fd47173352df69c306a0 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 3e27edafd77e9b3c338974fefd553e6a52e866d7..ee686590f08bbb8e45c75a19087c795fc547c867 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -32,7 +32,7 @@ class UdpListener extends BaseListener implements Listenable {
                parent::__construct(__CLASS__);
 
                // Set the protocol to UDP
-               $this->setProtocol('udp');
+               $this->setProtocolName('udp');
        }
 
        /**
index f894ce35333ae71ba8ebe001f69bc00e8256b12f..a3c6fb12faa60da8d34e1cd267f392401dc3aa84 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -31,8 +31,9 @@ class ClientUdpListenerDecorator extends BaseListenerDecorator implements Listen
                // Call parent constructor
                parent::__construct(__CLASS__);
 
-               // Set listener type
+               // Set listener type and protocol name
                $this->setListenerType('peer');
+               $this->setProtocolName('udp');
        }
 
        /**
index 70a8a7a2a40c82f21c8aca9f1938ca908bbde215..45ee6e2b76982ee2f57fa1f59b4b0a571cc6bc4b 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -31,8 +31,9 @@ class HubUdpListenerDecorator extends BaseListenerDecorator implements Listenabl
                // Call parent constructor
                parent::__construct(__CLASS__);
 
-               // Set listener type
+               // Set listener type and protocol name
                $this->setListenerType('hub');
+               $this->setProtocolName('udp');
        }
 
        /**
index 3fd177aa7d49304efb221c6359303ec02ab5647c..ea43cd44e698e41ce012ce4e9ec78ca0dddac2a2 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index a2f0950109bcd6b045b72b089d72855f9ffa7b4f..db8699b7d0568e142de50da83ef47f5a63860031 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 7da5329f9a31da4660d6bb0f6d9fa3b4317f6a49..484709320b828a88d711b9fa6092590b0079966b 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 02b5baf9059694826eb84258098246d57953681f..ac4e2f1b7cb0a50095595236f8ecd30b903e7e25 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 39dcc9044d5669c33d91e9566c1c0f47c0c5ba52..ccfeec154f7832bb6f60e383df086671297bb70d 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 53323b4c030cc1dc19e88459b9dab3c0ced6489c..c3b1805a68ec113c1041388045b3157e486438fd 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -42,8 +42,8 @@ class RecipientList extends BaseList implements Listable, Registerable {
                $listInstance = new RecipientList();
 
                // Add groups:
-               // 1.) ip:port combinations
-               $listInstance->addGroup('ip_port');
+               // 1.) Universal Node Locators
+               $listInstance->addGroup('unl');
 
                // 2.) Session ids
                $listInstance->addGroup('session_id');
@@ -68,7 +68,7 @@ class RecipientList extends BaseList implements Listable, Registerable {
         */
        public function clearList () {
                // Clear both groups
-               $this->clearGroups(array('ip_port', 'session_id'));
+               $this->clearGroups(array('unl', 'session_id'));
        }
 }
 
index f2dfa3d07fe24d7b894876cf661f6faf388caa36..f87681b8cc4c236b24559e7a0b6acd1220e9bcdd 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index bc69c1d81be2cab9195d0f18a27a58a7cc6f046b..de02f5659b3065618e06997075c8b38deb6dbaf1 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -58,18 +58,24 @@ class HubBootNode extends BaseHubNode implements NodeHelper, Registerable {
         * @todo        add some more special bootstrap things for this boot node
         */
        public function doBootstrapping () {
+               // Get UNL
+               $unl = $this->detectOwnUniversalNodeLocator();
+
+               // Debug message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: unl=' . $unl);
+
                // Now check if the IP address matches one of the bootstrap nodes
-               if ($this->ifAddressMatchesBootstrapNodes($this->getConfigInstance()->detectServerAddress())) {
+               if ($this->ifAddressMatchesBootstrapNodes($unl)) {
                        // Get our port from configuration
                        $ourPort = $this->getConfigInstance()->getConfigEntry('node_listen_port');
 
                        // Extract port
-                       $bootPort = substr($this->getBootIpPort(), -strlen($ourPort), strlen($ourPort));
+                       $bootPort = substr($this->getBootUniversalNodeLocator(), -strlen($ourPort), strlen($ourPort));
 
                        // Is the port the same?
                        if ($bootPort == $ourPort) {
                                // It is the same!
-                               self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: IP/port matches bootstrap node ' . $this->getBootIpPort() . '.');
+                               self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: UNL matches bootstrap node ' . $this->getBootUniversalNodeLocator() . '.');
 
                                // Now, does the mode match
                                if ($this->getRequestInstance()->getRequestElement('mode') == self::NODE_TYPE_BOOT) {
@@ -81,11 +87,11 @@ class HubBootNode extends BaseHubNode implements NodeHelper, Registerable {
                                }
                        } else {
                                // IP does match, but no port
-                               self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: WARNING: Our IP ' . $this->getConfigInstance()->detectServerAddress() . ' does match a known bootstrap-node but not the port ' . $ourPort . '/' . $bootPort . '.');
+                               self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: WARNING: Our UNL ' . $unl . ' does match a known bootstrap-node but not the port ' . $ourPort . '/' . $bootPort . '.');
                        }
                } else {
                        // Node does not match any know bootstrap-node
-                       self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: WARNING: Our IP ' . $this->getConfigInstance()->detectServerAddress() . ' does not match any known bootstrap-nodes.');
+                       self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: WARNING: Our UNL ' . $unl . ' does not match any known bootstrap-nodes.');
                }
 
                // Enable acceptance of announcements
index cc4ea5e9ac83c1ce0d68739baceb233eafe0a1dd..e38510bebbbd39efa2844c51d7ded748cacca8fa 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 0094562c3a71f1829dcd07a582ec765ec8aa346e..2228b3114ae06925ebd20d19a5302e337421ec8e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -37,9 +37,9 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria {
        const OBJECT_LIST_SEPARATOR = ',';
 
        /**
-        * IP/port number of bootstrap node
+        * Universal node locator of bootstrap node
         */
-       private $bootIpPort = '';
+       private $bootUnl = '';
 
        /**
         * Whether this node is anncounced (keep on FALSE!)
@@ -98,33 +98,11 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria {
                NodeStateFactory::createNodeStateInstanceByName('init', $this);
        }
 
-       /**
-        * Generates a random string from various data inluding UUID if PECL
-        * extension uuid is installed.
-        *
-        * @param       $length                 Length of the random part
-        * @return      $randomString   Random string
-        * @todo        Make this code more generic and move it to CryptoHelper or
-        */
-       protected function generateRamdomString ($length) {
-               // Get an RNG instance
-               $rngInstance = ObjectFactory::createObjectByConfiguredName('rng_class');
-
-               // Generate a pseudo-random string
-               $randomString = $rngInstance->randomString($length) . ':' . $this->getBootIpPort() . ':' . $this->getRequestInstance()->getRequestElement('mode');
-
-               // Add UUID for even more entropy for the hasher
-               $randomString .= $this->getCryptoInstance()->createUuid();
-
-               // Return it
-               return $randomString;
-       }
-
        /**
         * Generates a private key and hashes it (for speeding up things)
         *
         * @param       $searchInstance         An instance of a LocalSearchCriteria class
-        * @return void
+        * @return      void
         */
        private function generatePrivateKeyAndHash (LocalSearchCriteria $searchInstance) {
                // Get an RNG instance
@@ -145,12 +123,34 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria {
        }
 
        /**
-        * Getter for boot IP/port combination
+        * Generates a random string from various data inluding UUID if PECL
+        * extension uuid is installed.
         *
-        * @return      $bootIpPort             The IP/port combination of the boot node
+        * @param       $length                 Length of the random part
+        * @return      $randomString   Random string
+        * @todo        Make this code more generic and move it to CryptoHelper or
         */
-       protected final function getBootIpPort () {
-               return $this->bootIpPort;
+       protected function generateRamdomString ($length) {
+               // Get an RNG instance
+               $rngInstance = ObjectFactory::createObjectByConfiguredName('rng_class');
+
+               // Generate a pseudo-random string
+               $randomString = $rngInstance->randomString($length) . ':' . $this->getBootUniversalNodeLocator() . ':' . $this->getRequestInstance()->getRequestElement('mode');
+
+               // Add UUID for even more entropy for the hasher
+               $randomString .= $this->getCryptoInstance()->createUuid();
+
+               // Return it
+               return $randomString;
+       }
+
+       /**
+        * Getter for boot UNL (Universal Node Locator)
+        *
+        * @return      $bootUnl        The UNL (Universal Node Locator) of the boot node
+        */
+       protected final function getBootUniversalNodeLocator () {
+               return $this->bootUnl;
        }
 
        /**
@@ -164,24 +164,21 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria {
                $isFound = FALSE;
 
                // Run through all configured IPs
-               foreach (explode(BaseHubSystem::BOOTSTRAP_NODES_SEPARATOR, $this->getConfigInstance()->getConfigEntry('hub_bootstrap_nodes')) as $ipPort) {
-                       // Split it up in IP/port
-                       $ipPortArray = explode(':', $ipPort);
-
+               foreach (explode(BaseHubSystem::BOOTSTRAP_NODES_SEPARATOR, $this->getConfigInstance()->getConfigEntry('hub_bootstrap_nodes')) as $unl) {
                        // Does it match?
-                       if ($ipPortArray[0] == $remoteAddr) {
+                       if ($unl == $remoteAddr) {
                                // Found it!
                                $isFound = TRUE;
 
-                               // Remember the port number
-                               $this->bootIpPort = $ipPort;
+                               // Remember the UNL
+                               $this->bootUnl = $unl;
 
                                // Output message
-                               self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: ' . __FUNCTION__ . '[' . __METHOD__ . ':' . __LINE__ . ']: IP matches remote address ' . $ipPort . '.');
+                               self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: ' . __FUNCTION__ . '[' . __METHOD__ . ':' . __LINE__ . ']: UNL matches remote address ' . $unl . '.');
 
                                // Stop further searching
                                break;
-                       } elseif ($ipPortArray[0] == $this->getConfigInstance()->getConfigEntry('node_listen_addr')) {
+                       } elseif ($unl == $this->getConfigInstance()->getConfigEntry('node_listen_addr')) {
                                /*
                                 * IP matches listen address. At this point we really don't care
                                 * if we can really listen on that address
@@ -189,10 +186,10 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria {
                                $isFound = TRUE;
 
                                // Remember the port number
-                               $this->bootIpPort = $ipPort;
+                               $this->bootUnl = $unl;
 
                                // Output message
-                               self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: ' . __FUNCTION__ . '[' . __METHOD__ . ':' . __LINE__ . ']: IP matches listen address ' . $ipPort . '.');
+                               self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: ' . __FUNCTION__ . '[' . __METHOD__ . ':' . __LINE__ . ']: UNL matches listen address ' . $unl . '.');
 
                                // Stop further searching
                                break;
@@ -203,6 +200,31 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria {
                return $isFound;
        }
 
+       /**
+        * Tries to detect own UNL (Universal Node Locator)
+        *
+        * @return      $unl    Node's own universal node locator
+        */
+       public function detectOwnUniversalNodeLocator () {
+               // Is "cache" set?
+               if (!isset($GLOBALS[__METHOD__])) {
+                       // Get the UNL array back
+                       $unlData = $this->getUniversalNodeLocatorArray();
+
+                       // There are 2 UNLs, internal and external.
+                       if ($this->getConfigInstance()->getConfigEntry('allow_publish_internal_address') == 'N') {
+                               // Public "external" UNL address
+                               $GLOBALS[__METHOD__] = $unlData[NodeInformationDatabaseWrapper::DB_COLUMN_EXTERNAL_UNL];
+                       } else {
+                               // Non-public "internal" UNL address
+                               $GLOBALS[__METHOD__] = $unlData[NodeInformationDatabaseWrapper::DB_COLUMN_INTERNAL_UNL];
+                       }
+               } // END - if
+
+               // Return it
+               return $GLOBALS[__METHOD__];
+       }
+
        /**
         * Outputs the console teaser. This should only be executed on startup or
         * full restarts. This method generates some space around the teaser.
@@ -216,7 +238,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria {
                // Output all lines
                self::createDebugInstance(__CLASS__)->debugOutput(' ');
                self::createDebugInstance(__CLASS__)->debugOutput($app->getAppName() . ' v' . $app->getAppVersion() . ' - ' . $this->getRequestInstance()->getRequestElement('mode') . ' mode active');
-               self::createDebugInstance(__CLASS__)->debugOutput('Copyright (c) 2007 - 2008 Roland Haeder, 2009 - 2012 Hub Developer Team');
+               self::createDebugInstance(__CLASS__)->debugOutput('Copyright (c) 2007 - 2008 Roland Haeder, 2009 - 2014 Hub Developer Team');
                self::createDebugInstance(__CLASS__)->debugOutput(' ');
                self::createDebugInstance(__CLASS__)->debugOutput('This program comes with ABSOLUTELY NO WARRANTY; for details see docs/COPYING.');
                self::createDebugInstance(__CLASS__)->debugOutput('This is free software, and you are welcome to redistribute it under certain');
@@ -334,7 +356,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria {
         * @return      void
         */
        public function addElementsToDataSet (StoreableCriteria $criteriaInstance, Requestable $requestInstance = NULL) {
-               // Make sure request instance is set as it is not optional
+               // Make sure the request instance is set as it is not optional.
                assert($requestInstance instanceof Requestable);
 
                // Add node number and type
@@ -354,6 +376,10 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria {
                        $criteriaInstance->addCriteria(NodeInformationDatabaseWrapper::DB_COLUMN_PRIVATE_KEY, base64_encode($this->getPrivateKey()));
                        $criteriaInstance->addCriteria(NodeInformationDatabaseWrapper::DB_COLUMN_PRIVATE_KEY_HASH, $this->getPrivateKeyHash());
                } // END - if
+
+               // Add own external and internal addresses as UNLs
+               $criteriaInstance->addCriteria(NodeInformationDatabaseWrapper::DB_COLUMN_INTERNAL_UNL, HubTools::determineOwnInternalAddress());
+               $criteriaInstance->addCriteria(NodeInformationDatabaseWrapper::DB_COLUMN_EXTERNAL_UNL, HubTools::determineOwnExternalAddress());
        }
 
        /**
@@ -684,29 +710,48 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria {
        }
 
        /**
-        * "Getter" for address:port combination
+        * Determines an instance of a LocateableNode class
         *
-        * @return      $addressPort    A address:port combination for this node
+        * @return      $unlInstance    An instance of a LocateableNode class for this node
         */
-       public final function getAddressPort () {
-               // Get IP and port
-               $addressPort = $this->getConfigInstance()->detectServerAddress() . ':' . $this->getConfigInstance()->getConfigEntry('node_listen_port');
+       public function determineUniversalNodeLocator () {
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!');
 
-               // Return it
-               return $addressPort;
+               // Determine UNL based on this node:
+               // 1) Get discovery class
+               $discoveryInstance = ObjectFactory::createObjectByConfiguredName('unl_discovery_class');
+
+               // 2) "Determine" it
+               $unlInstance = $discoveryInstance->discoverUniversalNodeLocatorByNode($this);
+
+               // 3) Return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: unlInstance= ' . $unlInstance->__toString() . ' - EXIT!');
+               return $unlInstance;
        }
 
        /**
-        * "Getter" for address:port array
+        * "Getter" for an array of an instance of a LocateableNode class
         *
-        * @return      $addressPortArray       An array of a address:port combination for this node
+        * @return      $unlData        An array from an instance of a LocateableNode class for this node
         */
-       public final function getAddressPortArray () {
-               // Get IP and port
-               $addressPortArray = explode(':', $this->getAddressPort());
+       public final function getUniversalNodeLocatorArray () {
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!');
+
+               // Get the Universal Node Locator (UNL) instance
+               $unlInstance = $this->determineUniversalNodeLocator();
+
+               // Make sure the instance is valid
+               // * DEBUG: */ $this->debugInstance('unlInstance[]=' . gettype($unlInstance));
+               assert($unlInstance instanceof LocateableNode);
+
+               // ... and the array from it
+               $unlData = $unlInstance->getUnlData();
 
                // Return it
-               return $addressPortArray;
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!');
+               return $unlData;
        }
 
        /**
index 98683ceeb298c9381e7a7a3e4bec29399cff8ad6..e35f739fce25c902e8b4b680ab796c886ca3d2d2 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 576d54a8cdbe314d17d2f329fc0b0dc373c4731c..91f05aa2d342d72a859c4a19bc7c4d4fe86b9026 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index cfbedc659b3031270706b97f0b4eddb43e7560fd..456505c2f913154ff1872d6cde01682d552c9181 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 855cf57f0a145d7cc32cddf6894fe796fc2b1988..3eecefaee0b42cc3499f4dc884f2926d4c0a1320 100644 (file)
@@ -5,7 +5,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 7d396a866993c2e7f3d9daf195ae6d0330f17d7a..dee97c6396165812c480d3bec86482baf6d2853d 100644 (file)
@@ -17,7 +17,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               Needs to add functionality for handling the object's type
@@ -97,7 +97,6 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R
         */
        const PACKAGE_DATA_SENDER    = 'sender';
        const PACKAGE_DATA_RECIPIENT = 'recipient';
-       const PACKAGE_DATA_PROTOCOL  = 'protocol';
        const PACKAGE_DATA_CONTENT   = 'content';
        const PACKAGE_DATA_STATUS    = 'status';
        const PACKAGE_DATA_SIGNATURE = 'signature';
@@ -451,6 +450,9 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R
                // Now get an iterator
                $iteratorInstance = $discoveryInstance->getIterator();
 
+               // Make sure the iterator instance is valid
+               assert($iteratorInstance instanceof Iterator);
+
                // Rewind back to the beginning
                $iteratorInstance->rewind();
 
@@ -460,7 +462,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R
                        $currentRecipient = $iteratorInstance->current();
 
                        // Debug message
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Setting recipient to ' . $currentRecipient . ',previous=' . $packageData[self::PACKAGE_DATA_RECIPIENT]);
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Setting recipient to ' . $currentRecipient . ',previous=' . $packageData[self::PACKAGE_DATA_RECIPIENT]);
 
                        // Set the recipient
                        $packageData[self::PACKAGE_DATA_RECIPIENT] = $currentRecipient;
@@ -469,7 +471,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R
                        $this->getStackInstance()->pushNamed(self::STACKER_NAME_DECLARED, $packageData);
 
                        // Debug message
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Package declared for recipient ' . $currentRecipient);
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Package declared for recipient ' . $currentRecipient);
 
                        // Skip to next entry
                        $iteratorInstance->next();
@@ -616,7 +618,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R
 
                // Is it the same?
                //$isSignatureValid = 
-               exit(__METHOD__.': signature='.$signature.chr(10).',decodedArray='.print_r($decodedArray, TRUE));
+               exit(__METHOD__ . ': signature=' . $signature . chr(10) . ',decodedArray=' . print_r($decodedArray, TRUE));
        }
 
        /**
@@ -624,11 +626,13 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R
         * from given helper's template instance and pushing it on the 'undeclared'
         * stack.
         *
-        * @param       $helperInstance         An instance of a Helper class
-        * @param       $protocol                       Name of used protocol (TCP/UDP)
+        * @param       $helperInstance         An instance of a HubHelper class
         * @return      void
         */
-       public function enqueueRawDataFromTemplate (Helper $helperInstance, $protocolName) {
+       public function enqueueRawDataFromTemplate (HubHelper $helperInstance) {
+               // Debug message
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': CALLED!');
+
                // Get the raw content ...
                $content = $helperInstance->getTemplateInstance()->getRawTemplateData();
                //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('content(' . strlen($content) . ')=' . $content);
@@ -654,15 +658,20 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R
                        $this->getHashFromContent($content)
                );
 
+               // Debug message
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': Enqueueing package for recipientType=' . $helperInstance->getRecipientType() . ' ...');
+
                // Now prepare the temporary array and push it on the 'undeclared' stack
                $this->getStackInstance()->pushNamed(self::STACKER_NAME_UNDECLARED, array(
                        self::PACKAGE_DATA_SENDER    => $this->getSessionId(),
                        self::PACKAGE_DATA_RECIPIENT => $helperInstance->getRecipientType(),
-                       self::PACKAGE_DATA_PROTOCOL  => $protocolName,
                        self::PACKAGE_DATA_CONTENT   => $packageContent,
                        self::PACKAGE_DATA_STATUS    => self::PACKAGE_STATUS_NEW,
                        self::PACKAGE_DATA_SIGNATURE => $this->generatePackageSignature($packageContent, $this->getSessionId())
                ));
+
+               // Debug message
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': EXIT!');
        }
 
        /**
@@ -728,6 +737,9 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R
         * @throws      NoTargetException       If no target can't be determined
         */
        public function declareEnqueuedPackage () {
+               // Debug message
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': CALLED!');
+
                // Make sure this method isn't working if there is no package enqueued
                if (!$this->isPackageEnqueued()) {
                        // This is not fatal but should be avoided
@@ -743,6 +755,9 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R
 
                // Declare the raw package data for delivery
                $this->declareRawPackageData($packageData);
+
+               // Debug message
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': EXIT!');
        }
 
        /**
@@ -753,6 +768,9 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R
         * @return      void
         */
        public function processDeclaredPackage () {
+               // Debug message
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': CALLED!');
+
                // Sanity check if we have packages declared
                if (!$this->isPackageDeclared()) {
                        // This is not fatal but should be avoided
@@ -780,6 +798,9 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R
                        // Mark the package with status failed
                        $this->changePackageStatus($packageData, self::STACKER_NAME_DECLARED, self::PACKAGE_STATUS_FAILED);
                }
+
+               // Debug message
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': EXIT!');
        }
 
        /**
@@ -788,6 +809,9 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R
         * @return      void
         */
        public function sendWaitingPackage () {
+               // Debug message
+               /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': CALLED!');
+
                // Sanity check if we have packages waiting for delivery
                if (!$this->isPackageWaitingForDelivery()) {
                        // This is not fatal but should be avoided
@@ -811,6 +835,9 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R
                        // Mark package as failed
                        $this->changePackageStatus($packageData, self::STACKER_NAME_OUTGOING, self::PACKAGE_STATUS_FAILED);
                }
+
+               // Debug message
+               /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': EXIT!');
        }
 
        /**
@@ -819,6 +846,9 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R
         * @return      void
         */
        public function sendEncodedData () {
+               // Debug message
+               /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': CALLED!');
+
                // Make sure there is pending encoded data
                assert($this->isEncodedDataPending());
 
@@ -878,6 +908,9 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R
 
                // Push array back in stack
                $this->getStackInstance()->pushNamed(self::STACKER_NAME_OUTGOING_STREAM, $encodedDataArray);
+
+               // Debug message
+               /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': EXIT!');
        }
 
        ///////////////////////////////////////////////////////////////////////////
index 1828c6516d4585fb301621f7caef45c8c0215de0..7e2943f50e7f2bca8de998bdc8c3a24d151e8d34 100644 (file)
@@ -13,7 +13,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index a13ee34987d23e4ac883ff734d79d553096ec67d..507d12cb5f36574efb7e850adcf513414e989048 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 67a3ed9e50253bca9a53105d5027590a7c29911c..9090a8be640f65461b3e7e5fe1ba99c8d47781c3 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -77,6 +77,11 @@ class BasePool extends BaseHubSystem implements Visitable {
         * @return      void
         */
        protected final function addInstance ($group, $poolName, Visitable $visitableInstance) {
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ']: group=' . $group . ',poolName=' . $poolName . ',visitableInstance=' . $visitableInstance->__toString() . ' - CALLED!');
+
+               // Make sure the group is not 'invalid'
+               assert($group != 'invalid');
+
                // Is the pool group there?
                if (!$this->getPoolEntriesInstance()->isGroupSet($group)) {
                        // Create the missing pool group
index ead076ddaba5e02dc9ad03fd0402187f26dd1859..b7a23ed038aac7d848ece652dc82498921dfcc14 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -57,7 +57,7 @@ class DefaultListenerPool extends BasePool implements PoolableListener {
         */
        public function addListener (Listenable $listenerInstance) {
                // Add this listener instance to the instance list
-               parent::addInstance($listenerInstance->getProtocol(), 'listener', $listenerInstance);
+               parent::addInstance($listenerInstance->getProtocolName(), 'listener', $listenerInstance);
 
                // Debug message
                self::createDebugInstance(__CLASS__)->debugOutput(
index de65ec4b2524a95a2d3650d2a09240c67caa0ea6..c0bfd31861b8d0ee79324dd0627acd83edf22e38 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -221,13 +221,14 @@ class DefaultPeerPool extends BasePool implements PoolablePeer {
                $socketResource = FALSE;
 
                // Temporary resolve recipient field
-               $recipientIpArray = explode(':', HubTools::resolveSessionId($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT]));
+               die(__METHOD__ . ': UNFINISHED!' . PHP_EOL);
+               $unlData = explode(':', HubTools::resolveSessionId($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT]));
 
-               // Make sure it is a valid ip:port array (2 elements)
-               assert(count($recipientIpArray) == 2);
+               // Make sure it is a valid Universal Node Locator array (3 elements)
+               assert(count($unlData) == 3);
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ']: Checking ' . count($this->getAllSockets()) . ' socket(s),recipientIpArray[0]=' . $recipientIpArray[0] . ',recipientIpArray[1]=' . $recipientIpArray[1] . ' ...');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ']: Checking ' . count($this->getAllSockets()) . ' socket(s),unlData[0]=' . $unlData[0] . ',unlData[1]=' . $unlData[1] . ' ...');
 
                // Default is all sockets
                $sockets = $this->getAllSockets();
@@ -258,7 +259,7 @@ class DefaultPeerPool extends BasePool implements PoolablePeer {
 
                        // Get
                        // If the "peer" IP and recipient is same, use it
-                       if ($peerIp == $recipientIpArray[0]) {
+                       if ($peerIp == $unlData[0]) {
                                // IPs match, so take the socket and quit this loop
                                $socketResource = $socketArray[self::SOCKET_ARRAY_RESOURCE];
 
index 79fc50c4509b32f58cab77e789f793572f35cc3f..12337e7fdb18be0f78700ad17dee8365767d5226 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 5e37579213f5753ca875f7c2d257c60100b08e97..a60634a899d7d3b157d811a6c6e002f4378769bb 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index af69bd73c3434fec780b5dc1dc2d7776a737809d..8d9566da8547dca881da818ccfe20bb999e808f7 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 1e3ecad7ba16afd0696d5b2136757a3e5bfa809e..c267d6352e694bf1068f56b173a7ebd447731983 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 02e92bccdcf57153c073eb87e0f8c29800708c25..e18cdf4a226ef592563e7ab71c339a74caed184d 100644 (file)
@@ -79,7 +79,7 @@ class CruncherKeyProducer extends BaseKeyProducer implements KeyProducer, Regist
                        return;
                } elseif (!$this->getIteratorInstance()->valid()) {
                        // This producer's iterator has finished its assignment
-                       self::createDebugInstance(__CLASS__)->debugOutput('PRODUCER: Finished creating keys. iteratorinstance=' . $this->getIteratorInstance()->__toString() . '');
+                       self::createDebugInstance(__CLASS__)->debugOutput('PRODUCER: Finished creating keys. iteratorInstance=' . $this->getIteratorInstance()->__toString() . '');
                        return;
                }
 
index a18f6e6e8cf9514a12326f4648f6ffaf214184f1..3d9449c3534eafbfb5f801c5654f43f937f9d989 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -46,7 +46,7 @@ class ???Recipient extends BaseRecipient implements Recipient {
        }
 
        /**
-        * Tries to resolve given recipient into session ids or ip:port combination
+        * Tries to resolve given recipient into session ids or Universal Node Locator
         * depending on implementation (hint: Template Method Pattern)
         *
         * @param       $recipient              Recipient to resolve (e.g. could be a virtual recipient or direct session id)
index 471751ea6d91c1f7f2a6398161591c1d4cd3fe84..0407e4fd8dfb01077ec52112c50c92d959b6458c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index d3da3800b434630525e623cf351e4a6770743e57..3ccba6b66418c007e44fbdb2292a02671fdd3b07 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -46,7 +46,7 @@ class DhtRecipient extends BaseRecipient implements Recipient {
        }
 
        /**
-        * Tries to resolve given recipient into session ids or ip:port combination
+        * Tries to resolve given recipient into session ids or Universal Node Locator
         * depending on implementation (hint: Template Method Pattern). This
         * implementation will add more than one recipient to the list as a DHT is
         * distributed and the package might go to more than one recipient.
@@ -73,15 +73,16 @@ class DhtRecipient extends BaseRecipient implements Recipient {
                // Now "walk" through all elements and add them to the list
                foreach ($recipients as $recipient) {
                        // These array elements must exist for this loop:
-                       assert(!empty($recipient[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_EXTERNAL_IP]));
-                       assert(!empty($recipient[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_LISTEN_PORT]));
+                       // @TODO Unfinished
+                       die(__METHOD__ . ':recipient=' . print_r($recipient, TRUE));
+                       assert(!empty($recipient[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_EXTERNAL_ADDRESS]));
 
                        // Put ip and port both together
-                       $ipPort = $recipient[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_EXTERNAL_IP] . ':' . $recipient[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_LISTEN_PORT];
+                       $unl = $recipient[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_EXTERNAL_ADDRESS];
 
                        // Add it to the list
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-RECIPIENT[' . __METHOD__ . ':' . __LINE__ . ']: Calling listInstance->addEntry(' . $ipPort . ') ...');
-                       $listInstance->addEntry('ip_port', $ipPort);
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-RECIPIENT[' . __METHOD__ . ':' . __LINE__ . ']: Calling listInstance->addEntry(' . $unl . ') ...');
+                       $listInstance->addEntry('unl', $unl);
                } // END - foreach
 
                // Debug message
index a34ac747162791798dd2c9909bb535285355da99..8c2423c22fdff3a8926b870a807cbfe15455dad7 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -46,7 +46,7 @@ class DirectRecipient extends BaseRecipient implements Recipient {
        }
 
        /**
-        * Tries to resolve given recipient into session ids or ip:port combination
+        * Tries to resolve given recipient into session ids or Universal Node Locator
         * depending on implementation (hint: Template Method Pattern)
         *
         * @param       $recipient              Recipient to resolve (e.g. could be a virtual recipient or direct session id)
@@ -57,7 +57,7 @@ class DirectRecipient extends BaseRecipient implements Recipient {
         */
        public function resolveRecipient ($recipient, Listable $listInstance, array $packageData) {
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DIRECT-RECIPIENT: recipient=' . $recipient);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DIRECT-RECIPIENT[' . __METHOD__ . ':' . __LINE__ . ']: recipient=' . $recipient);
 
                // "Explode" all recipients
                $recipients = explode(NetworkPackage::PACKAGE_RECIPIENT_SEPARATOR, $recipient);
@@ -68,10 +68,10 @@ class DirectRecipient extends BaseRecipient implements Recipient {
                // Try it on all
                foreach ($recipients as $recipient) {
                        // Try to sole a single recipient
-                       $ipPort = HubTools::resolveSessionId($recipient);
+                       $unlData = HubTools::resolveSessionId($recipient);
 
                        // Add it as recipient
-                       $listInstance->addEntry('ip_port', $ipPort);
+                       $listInstance->addEntry('unl', $unlData);
                } // END - foreach
        }
 }
index efedc12835962b062bc174fddc34e531f738d76b..7c2f8f51dc8679f84bf7720828cf0534eec9a94e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -46,7 +46,7 @@ class SelfRecipient extends BaseRecipient implements Recipient {
        }
 
        /**
-        * Tries to resolve given recipient into session ids or ip:port combination
+        * Tries to resolve given recipient into session ids or Universal Node Locator
         * depending on implementation (hint: Template Method Pattern)
         *
         * @param       $recipient              Recipient to resolve (e.g. could be a virtual recipient or direct session id)
@@ -57,19 +57,17 @@ class SelfRecipient extends BaseRecipient implements Recipient {
         */
        public function resolveRecipient ($recipient, Listable $listInstance, array $packageData) {
                // Make sure the recipient is valid
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SELF-RECIPIENT: recipient=' . $recipient);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SELF-RECIPIENT[' . __METHOD__ . ':' . __LINE__ . ']: recipient=' . $recipient);
+               // @TODO Add more checks on data
                assert($recipient == NetworkPackage::NETWORK_TARGET_SELF);
 
-               // Determine own port
-               $port = $this->getConfigInstance()->getConfigEntry('node_listen_port');
-
-               // Determine IP or 'external_ip' if set
-               $ip = HubTools::determineOwnExternalIp();
+               // Determine IP or 'external_address' if set
+               $unl = HubTools::determineOwnExternalAddress();
 
                // Is it not empty?
-               if (!empty($ip)) {
+               if (!empty($unl)) {
                        // Add it to the list
-                       $listInstance->addEntry('ip_port', $ip . ':' . $port);
+                       $listInstance->addEntry('unl', $unl);
                } // END - if
        }
 }
index 593ef5206355b38d4d7082cb4932d23d31caa7db..2690053365f5f51ca7ac14e2ffeec991b365322a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -46,7 +46,7 @@ class UpperRecipient extends BaseRecipient implements Recipient {
        }
 
        /**
-        * Tries to resolve given recipient into session ids or ip:port combination
+        * Tries to resolve given recipient into session ids or Universal Node Locator
         * depending on implementation (hint: Template Method Pattern)
         *
         * @param       $recipient              Recipient to resolve (e.g. could be a virtual recipient or direct session id)
@@ -61,21 +61,21 @@ class UpperRecipient extends BaseRecipient implements Recipient {
                assert($recipient == NetworkPackage::NETWORK_TARGET_UPPER);
 
                // Get all bootstrap nodes
-               foreach (explode(BaseHubSystem::BOOTSTRAP_NODES_SEPARATOR, $this->getConfigInstance()->getConfigEntry('hub_bootstrap_nodes')) as $ipPort) {
+               foreach (explode(BaseHubSystem::BOOTSTRAP_NODES_SEPARATOR, $this->getConfigInstance()->getConfigEntry('hub_bootstrap_nodes')) as $unlData) {
                        // Is maximum reached?
                        if ($listInstance->count() == $this->getConfigInstance()->getConfigEntry('package_recipient_max_count')) {
                                // Debug message
-                               /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-RESOLVER: Going to abort at maximum of ' . $this->getConfigInstance()->getConfigEntry('package_recipient_max_count') . ' recipients!');
+                               /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-RESOLVER[' . __METHOD__ . ':' . __LINE__ . ']: Going to abort at maximum of ' . $this->getConfigInstance()->getConfigEntry('package_recipient_max_count') . ' recipients!');
 
                                // Then stop adding more
                                break;
                        } // END - if
 
                        // Debug message
-                       /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-RESOLVER: Adding node ' . $ipPort . ' as recipient.');
+                       /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-RESOLVER[' . __METHOD__ . ':' . __LINE__ . ']: Adding node ' . print_r($unlData, TRUE) . ' as recipient.');
 
                        // Add the entry
-                       $listInstance->addEntry('ip_port', $ipPort);
+                       $listInstance->addEntry('unl', $unlData);
                } // END - foreach
        }
 }
index 92d66a03b4a69f7f16639ad116caeffe77b5a25b..2caf8fc76c882cdc17fab6acd57113bf7841b526 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -58,17 +58,17 @@ class ConnectionRegistry extends BaseRegistry implements Register, RegisterableC
 
        /**
         * "Getter" to get a string respresentation for a key for the sub-registry
-        * in this format: class:protocol:port
+        * in this format: class:type:port
         *
         * @param       $connectionInstance             An instance of a ConnectionHelper class
         * @return      $key                                    A string representation of the socket for the registry
         */
        private function getSubRegistryKey (ConnectionHelper $connectionInstance) {
-               // Get protocol and port number and add both together
-               $key = sprintf("%s:%s:%s",
+               // Get connection type and port number and add both together
+               $key = sprintf('%s:%s:%s',
                        $connectionInstance->__toString(),
-                       $connectionInstance->getProtocol(),
-                       $connectionInstance->getPort()
+                       $connectionInstance->getConnectionType(),
+                       $connectionInstance->getConnectionPort()
                );
 
                // Return resulting key
@@ -78,12 +78,12 @@ class ConnectionRegistry extends BaseRegistry implements Register, RegisterableC
        /**
         * "Getter" to get a string respresentation of the protocol
         *
-        * @param       $connectionInstance     An instance of a ConnectionHelper class
-        * @return      $key                            A string representation of the protocol for the registry
+        * @param       $connectionInstance             An instance of a ConnectionHelper class
+        * @return      $key                                    A string representation of the protocol for the registry
         */
-       private function getRegistryKeyFromProtocol (ConnectionHelper $connectionInstance) {
+       private function getRegistryKeyFromConnection (ConnectionHelper $connectionInstance) {
                // Get the key
-               $key = $connectionInstance->getProtocol();
+               $key = $connectionInstance->getProtocolName();
 
                // Return resulting key
                return $key;
@@ -95,9 +95,9 @@ class ConnectionRegistry extends BaseRegistry implements Register, RegisterableC
         * @param       $connectionInstance     An instance of a ConnectionHelper class
         * @return      $isRegistered           Whether the protocol is registered
         */
-       private function isProtocolRegistered (ConnectionHelper $connectionInstance) {
+       private function isConnectionRegistered (ConnectionHelper $connectionInstance) {
                // Get the key
-               $key = $this->getRegistryKeyFromProtocol($connectionInstance);
+               $key = $this->getRegistryKeyFromConnection($connectionInstance);
 
                // Determine it
                $isRegistered = $this->instanceExists($key);
@@ -119,9 +119,9 @@ class ConnectionRegistry extends BaseRegistry implements Register, RegisterableC
                $isRegistered = FALSE;
 
                // First, check for the instance, there can be only once
-               if ($this->isProtocolRegistered($connectionInstance)) {
+               if ($this->isConnectionRegistered($connectionInstance)) {
                        // That one is found so "get" a registry key from it
-                       $key = $this->getRegistryKeyFromProtocol($connectionInstance);
+                       $key = $this->getRegistryKeyFromConnection($connectionInstance);
 
                        // Get the registry
                        $registryInstance = $this->getInstance($key);
@@ -154,15 +154,15 @@ class ConnectionRegistry extends BaseRegistry implements Register, RegisterableC
                } // END - if
 
                // Does the instance exist?
-               if (!$this->isProtocolRegistered($connectionInstance)) {
+               if (!$this->isConnectionRegistered($connectionInstance)) {
                        // No, not found so we create a sub registry (not needed to configure!)
                        $registryInstance = SubRegistry::createSubRegistry();
 
                        // Now we can create the sub-registry for this protocol
-                       $this->addInstance($this->getRegistryKeyFromProtocol($connectionInstance), $registryInstance);
+                       $this->addInstance($this->getRegistryKeyFromConnection($connectionInstance), $registryInstance);
                } else {
                        // Get the sub-registry back
-                       $registryInstance = $this->getInstance($this->getRegistryKeyFromProtocol($connectionInstance));
+                       $registryInstance = $this->getInstance($this->getRegistryKeyFromConnection($connectionInstance));
                }
 
                // Get a key for sub-registries
@@ -191,7 +191,7 @@ class ConnectionRegistry extends BaseRegistry implements Register, RegisterableC
                } // END - if
 
                // Now get the key from the protocol
-               $key = $this->getRegistryKeyFromProtocol($connectionInstance);
+               $key = $this->getRegistryKeyFromConnection($connectionInstance);
 
                // And get the registry
                $registryInstance = $this->getInstance($key);
index 558d3be55c9f0d4a2390cdf9d2af82f1388b411c..980687afd62c2edc5ae88642e0be1d4b40a123fa 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 96ea11e9d926810667cfec922bdcc677b8b96feb..e20b0f98a04fad37b0a341d76bd9595bdd9f6793 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -58,34 +58,37 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
 
        /**
         * "Getter" to get a string respresentation for a key for the sub-registry
-        * in this format: class:protocol:port
+        * in this format: class:type:port
         *
-        * @param       $protocolInstance       An instance of a ProtocolHandler class
+        * @param       $connectionInstance     An instance of a Listenable class
         * @return      $key                            A string representation of the socket for the registry
         */
-       private function getSubRegistryKey (ProtocolHandler $protocolInstance) {
+       private function getSubRegistryKey (Listenable $connectionInstance) {
                // Default address is invalid
                $address = '*invalid*';
+               $port    = 0;
 
                // Which instance is it?
                // @TODO Tested again base class, rewrite it to a generic interface!
-               if ($protocolInstance instanceof BaseConnectionHelper) {
+               if ($connectionInstance instanceof BaseConnectionHelper) {
                        // Get address
-                       $address = $protocolInstance->getAddress();
-               } elseif ($protocolInstance instanceof BaseListener) {
+                       $address = $connectionInstance->getAddress();
+                       $port    = $connectionInstance->getConnectionPort();
+               } elseif ($connectionInstance instanceof BaseListener) {
                        // Get listen address
-                       $address = $protocolInstance->getListenAddress();
+                       $address = $connectionInstance->getListenAddress();
+                       $port    = $connectionInstance->getListenPort();
                } else {
                        // Not supported!
-                       $this->debugBackTrace('Unsupported protocolInstance=' . $protocolInstance->__toString() . ' detected. Please fix this!');
+                       $this->debugBackTrace('Unsupported connectionInstance=' . $connectionInstance->__toString() . ' detected. Please fix this!');
                }
 
-               // Get protocol and port number and add both together
-               $key = sprintf("%s:%s:%s:%s",
-                       $protocolInstance->__toString(),
-                       $protocolInstance->getProtocol(),
+               // Get connection type and port number and add both together
+               $key = sprintf('%s:%s:%s:%s',
+                       $connectionInstance->__toString(),
+                       $connectionInstance->getConnectionType(),
                        $address,
-                       $protocolInstance->getPort()
+                       $port
                );
 
                // Return resulting key
@@ -93,37 +96,37 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
        }
 
        /**
-        * "Getter" to get a string respresentation of the protocol
+        * "Getter" to get a string respresentation of the listener
         *
-        * @param       $protocolInstance       An instance of a ProtocolHandler class
-        * @return      $key                            A string representation of the protocol for the registry
+        * @param       $listenerInstance       An instance of a Listenable class
+        * @return      $key                            A string representation of the listener for the registry
         */
-       private function getRegistryKeyFromProtocol (ProtocolHandler $protocolInstance) {
+       private function getRegistryKeyFromListener (Listenable $listenerInstance) {
                // Get the key
-               $key = $protocolInstance->getProtocol();
+               $key = $listenerInstance->getConnectionType();
 
                // Return resulting key
                return $key;
        }
 
        /**
-        * Checks whether the given protocol is registered
+        * Checks whether the given listener is registered
         *
-        * @param       $protocolInstance       An instance of a ProtocolHandler class
-        * @return      $isRegistered           Whether the protocol is registered
+        * @param       $listenerInstance       An instance of a Listenable class
+        * @return      $isRegistered           Whether the listener is registered
         */
-       private function isProtocolRegistered (ProtocolHandler $protocolInstance) {
+       private function isListenerRegistered (Listenable $listenerInstance) {
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:protocol=' . $protocolInstance->getProtocol() . ' - ENTERED!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:listener=' . $listenerInstance->getConnectionType() . ' - ENTERED!');
 
                // Get the key
-               $key = $this->getRegistryKeyFromProtocol($protocolInstance);
+               $key = $this->getRegistryKeyFromListener($listenerInstance);
 
                // Determine it
                $isRegistered = $this->instanceExists($key);
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:protocol=' . $protocolInstance->getProtocol() . ',isRegistered=' . intval($isRegistered) . ' - EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:listener=' . $listenerInstance->getConnectionType() . ',isRegistered=' . intval($isRegistered) . ' - EXIT!');
 
                // Return result
                return $isRegistered;
@@ -133,33 +136,33 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
         * Checks whether given socket resource is registered. If $socketResource is
         * FALSE only the instance will be checked.
         *
-        * @param       $protocolInstance       An instance of a ProtocolHandler class
+        * @param       $listenerInstance       An instance of a Listenable class
         * @param       $socketResource         A valid socket resource
         * @return      $isRegistered           Whether the given socket resource is registered
         */
-       public function isSocketRegistered (ProtocolHandler $protocolInstance, $socketResource) {
+       public function isSocketRegistered (Listenable $listenerInstance, $socketResource) {
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:protocol=' . $protocolInstance->getProtocol() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ' - ENTERED!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:listener=' . $listenerInstance->getConnectionType() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ' - ENTERED!');
 
                // Default is not registered
                $isRegistered = FALSE;
 
                // First, check for the instance, there can be only once
-               if ($this->isProtocolRegistered($protocolInstance)) {
+               if ($this->isListenerRegistered($listenerInstance)) {
                        // That one is found so "get" a registry key from it
-                       $key = $this->getRegistryKeyFromProtocol($protocolInstance);
+                       $key = $this->getRegistryKeyFromListener($listenerInstance);
 
                        // Debug message
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: protocol=' . $protocolInstance->getProtocol() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',key=' . $key . ' - Trying to get instance ...');
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: listener=' . $listenerInstance->getConnectionType() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',key=' . $key . ' - Trying to get instance ...');
 
                        // Get the registry
                        $registryInstance = $this->getInstance($key);
 
                        // "Get" a key for the socket
-                       $socketKey = $this->getSubRegistryKey($protocolInstance);
+                       $socketKey = $this->getSubRegistryKey($listenerInstance);
 
                        // Debug message
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: protocol=' . $protocolInstance->getProtocol() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',key=' . $key . ',socketKey=' . $socketKey . ' - Checking existence ...');
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: listener=' . $listenerInstance->getConnectionType() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',key=' . $key . ',socketKey=' . $socketKey . ' - Checking existence ...');
 
                        // Is it there?
                        if ($registryInstance->instanceExists($socketKey)) {
@@ -178,7 +181,7 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
                } // END - if
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:protocol=' . $protocolInstance->getProtocol() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',isRegistered=' . intval($isRegistered) . ' - EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:listener=' . $listenerInstance->getConnectionType() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',isRegistered=' . intval($isRegistered) . ' - EXIT!');
 
                // Return the result
                return $isRegistered;
@@ -187,39 +190,39 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
        /**
         * Registeres given socket for listener or throws an exception if it is already registered
         *
-        * @param       $protocolInstance       An instance of a ProtocolHandler class
+        * @param       $listenerInstance       An instance of a Listenable class
         * @param       $socketResource         A valid socket resource
         * @param       $packageData            Optional raw package data
         * @throws      SocketAlreadyRegisteredException        If the given socket is already registered
         * @return      void
         */
-       public function registerSocket (ProtocolHandler $protocolInstance, $socketResource, array $packageData = array()) {
+       public function registerSocket (Listenable $listenerInstance, $socketResource, array $packageData = array()) {
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:protocol=' . $protocolInstance->getProtocol() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ' - ENTERED!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:listener=' . $listenerInstance->getConnectionType() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ' - ENTERED!');
 
                // Is the socket already registered?
-               if ($this->isSocketRegistered($protocolInstance, $socketResource)) {
+               if ($this->isSocketRegistered($listenerInstance, $socketResource)) {
                        // Throw the exception
-                       throw new SocketAlreadyRegisteredException(array($protocolInstance, $socketResource), BaseListener::EXCEPTION_SOCKET_ALREADY_REGISTERED);
+                       throw new SocketAlreadyRegisteredException(array($listenerInstance, $socketResource), BaseListener::EXCEPTION_SOCKET_ALREADY_REGISTERED);
                } // END - if
 
                // Does the instance exist?
-               if (!$this->isProtocolRegistered($protocolInstance)) {
+               if (!$this->isListenerRegistered($listenerInstance)) {
                        // No, not found so we create a sub registry (not needed to configure!)
                        $registryInstance = SubRegistry::createSubRegistry();
 
-                       // Now we can create the sub-registry for this protocol
-                       $this->addInstance($this->getRegistryKeyFromProtocol($protocolInstance), $registryInstance);
+                       // Now we can create the sub-registry for this listener
+                       $this->addInstance($this->getRegistryKeyFromListener($listenerInstance), $registryInstance);
                } else {
                        // Get the sub-registry back
-                       $registryInstance = $this->getInstance($this->getRegistryKeyFromProtocol($protocolInstance));
+                       $registryInstance = $this->getInstance($this->getRegistryKeyFromListener($listenerInstance));
                }
 
                // Get a key for sub-registries
-               $socketKey = $this->getSubRegistryKey($protocolInstance);
+               $socketKey = $this->getSubRegistryKey($listenerInstance);
 
                // Get a socket container
-               $socketInstance = ObjectFactory::CreateObjectByConfiguredName('socket_container_class', array($socketResource, $protocolInstance, $packageData));
+               $socketInstance = ObjectFactory::CreateObjectByConfiguredName('socket_container_class', array($socketResource, $listenerInstance, $packageData));
 
                // We have a sub-registry, the socket key and the socket, now we need to put all together
                /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: socketKey=' . $socketKey . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ' - adding socket container instance ...');
@@ -229,34 +232,34 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
        /**
         * Getter for given listener's socket resource
         *
-        * @param       $protocolInstance       An instance of a ProtocolHandler class
+        * @param       $listenerInstance       An instance of a Listenable class
         * @return      $socketResource         A valid socket resource
         * @throws      NoSocketRegisteredException             If the requested socket is not registered
         */
-       public function getRegisteredSocketResource (ProtocolHandler $protocolInstance) {
+       public function getRegisteredSocketResource (Listenable $listenerInstance) {
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:protocol=' . $protocolInstance->getProtocol() . ' - ENTERED!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:listener=' . $listenerInstance->getConnectionType() . ' - ENTERED!');
 
                // The socket must be registered before we can return it
-               if (!$this->isProtocolRegistered($protocolInstance)) {
+               if (!$this->isListenerRegistered($listenerInstance)) {
                        // Throw the exception
-                       throw new NoSocketRegisteredException ($protocolInstance, self::SOCKET_NOT_REGISTERED);
+                       throw new NoSocketRegisteredException ($listenerInstance, self::SOCKET_NOT_REGISTERED);
                } // END - if
 
-               // Now get the key from the protocol
-               $key = $this->getRegistryKeyFromProtocol($protocolInstance);
+               // Now get the key from the listener
+               $key = $this->getRegistryKeyFromListener($listenerInstance);
 
                // And get the registry
                $registryInstance = $this->getInstance($key);
 
                // Get a socket key
-               $socketKey = $this->getSubRegistryKey($protocolInstance);
+               $socketKey = $this->getSubRegistryKey($listenerInstance);
 
                // And the final socket resource
                $socketResource = $registryInstance->getInstance($socketKey)->getSocketResource();
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:protocol=' . $protocolInstance->getProtocol() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ' - EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:listener=' . $listenerInstance->getConnectionType() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ' - EXIT!');
 
                // Return the resource
                return $socketResource;
@@ -266,7 +269,7 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
         * "Getter" for protocol/connection instance from given package data
         *
         * @param       $packageData            Raw package data
-        * @return      $protocolInstance       An instance of a ProtocolHandler class
+        * @return      $protocolInstance       An instance of a HandleableProtocol class
         */
        public function getHandlerInstanceFromPackageData (array $packageData) {
                // Init protocol instance
index d2457d1e66cc16a08fda179626c35bc23b827b27..d998270310818af78ae2f429f89b35b3010c1199 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 3114ec072775573598d0acfdc88cb2bc785a7b10..e4a8ef16a8a5311971c2791b50dc99b1dd212a51 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index a8483d99a7f4c0bfde98ef3731235812c80b31d6..4638b96e02a9fb16f15bcbdcf661bb9996409e42 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
diff --git a/application/hub/main/resolver/protocol/.htaccess b/application/hub/main/resolver/protocol/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/resolver/protocol/class_ b/application/hub/main/resolver/protocol/class_
new file mode 100644 (file)
index 0000000..232d884
--- /dev/null
@@ -0,0 +1,84 @@
+<?php
+/**
+ * A !!! protocol resolver class
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 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 !!!ProtocolResolver extends BaseProtocolResolver implements ProtocolResolver, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of a !!! protocol resolver
+        *
+        * @return      $resolverInstance       The prepared command resolver instance
+        */
+       public static final function create!!!ProtocolResolver () {
+               // Create the new instance
+               $resolverInstance = new !!!ProtocolResolver();
+
+               // Return the prepared instance
+               return $resolverInstance;
+       }
+
+       /**
+        * Returns an instance of a LocateableNode class for a given NodeHelper
+        * instance or null if it was not found.
+        *
+        * @param       $nodeInstance   An instance of a NodeHelper class
+        * @return      $unlInstance    An instance of a LocateableNode class
+        * @todo        0% done
+        */
+       public function resolveUniversalNodeLocatorFromNodeHelper (NodeHelper $nodeInstance) {
+               $this->partialStub('Please implement this method. nodeInstance=' . $nodeInstance->__toString());
+       }
+
+       /**
+        * Returns the UNL as string from given configuration key.
+        *
+        * @param       $configKey      Configuration key for UNL address (valid: internal,external)
+        * @return      $unl            Universal node locator
+        * @todo        90% done
+        */
+       public function resolveUniversalNodeLocatorFromConfigKey ($configKey) {
+               // Put all together
+               $unl = sprintf('%s://%s',
+                       $this->getProtocolName(),
+                       $this->getConfigInstance()->getConfigEntry($configKey . '_address')
+               );
+
+               /*
+                * And return it. Please note that e.g. a FaxProtocolResolver will
+                * return a different UNL and therefore all protocol resolvers must do
+                * it on their own way.
+                */
+               return $unl;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/resolver/protocol/class_BaseProtocolResolver.php b/application/hub/main/resolver/protocol/class_BaseProtocolResolver.php
new file mode 100644 (file)
index 0000000..7db2800
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+/**
+ * A generic protocol resolver class
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 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 BaseProtocolResolver extends BaseHubSystem {
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/resolver/protocol/tcp/.htaccess b/application/hub/main/resolver/protocol/tcp/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/resolver/protocol/tcp/class_TcpProtocolResolver.php b/application/hub/main/resolver/protocol/tcp/class_TcpProtocolResolver.php
new file mode 100644 (file)
index 0000000..027f049
--- /dev/null
@@ -0,0 +1,129 @@
+<?php
+/**
+ * A TCP protocol resolver class
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 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 TcpProtocolResolver extends BaseProtocolResolver implements ProtocolResolver, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set protocol type
+               $this->setProtocolName('tcp');
+       }
+
+       /**
+        * Creates an instance of a TCP protocol resolver
+        *
+        * @return      $resolverInstance       The prepared command resolver instance
+        */
+       public static final function createTcpProtocolResolver () {
+               // Create the new instance
+               $resolverInstance = new TcpProtocolResolver();
+
+               // Return the prepared instance
+               return $resolverInstance;
+       }
+
+       /**
+        * Returns an instance of a LocateableNode class for a given NodeHelper
+        * instance or null if it was not found.
+        *
+        * @param       $nodeInstance   An instance of a NodeHelper class
+        * @return      $unlInstance    An instance of a LocateableNode class
+        * @todo        0% done
+        */
+       public function resolveUniversalNodeLocatorFromNodeHelper (NodeHelper $nodeInstance) {
+               // Get search instance (to lookup database result)
+               $searchInstance = $nodeInstance->getSearchInstance();
+
+               // Make sure the in stance is valid
+               assert($searchInstance instanceof SearchCriteria);
+
+               // Refetch and rewind iterator
+               $resultInstance = $nodeInstance->getWrapperInstance()->doSelectByCriteria($searchInstance);
+
+               // Is the result valid?
+               if ((!$resultInstance->valid()) || (! $resultInstance->next())) {
+                       // Node not found in database, this could mean that your database file is damaged.
+                       return NULL;
+               } // END - if
+
+               // Get current entry
+               $current = $resultInstance->current();
+
+               // This should always be the case, if not your database file might be damaged.
+               assert($nodeInstance->getNodeId() == $current[NodeInformationDatabaseWrapper::DB_COLUMN_NODE_ID]);
+
+               // Get UNL instance and handle over all data
+               $unlInstance = ObjectFactory::createObjectByConfiguredName('universal_node_locator_class', array($current));
+
+               // Return resolved instance
+               return $unlInstance;
+       }
+
+       /**
+        * Returns the UNL as string from given configuration key.
+        *
+        * @param       $configKey      Configuration key for UNL address (valid: internal,external)
+        * @return      $unl            Universal node locator
+        */
+       public function resolveUniversalNodeLocatorFromConfigKey ($configKey) {
+               // Get address
+               $address = $this->getConfigInstance()->getConfigEntry($configKey . '_address');
+
+               // Is the address empty?
+               if (empty($address)) {
+                       // Okay, then find it
+                       switch ($configKey) {
+                               case 'external': // External IP
+                                       $address = ConsoleTools::determineExternalAddress();
+                                       break;
+
+                               case 'internal': // Internal IP
+                                       $address = ConsoleTools::acquireSelfIPAddress();
+                                       break;
+                       } // END - switch
+               } // END - if
+
+               // Put all together
+               $unl = sprintf('%s://%s:%s',
+                       $this->getProtocolName(),
+                       $address,
+                       $this->getConfigInstance()->getConfigEntry('node_listen_port')
+               );
+
+               /*
+                * And return it. Please note that e.g. a FaxProtocolResolver will
+                * return a different UNL and therefore all protocol resolvers must do
+                * it on their own way.
+                */
+               return $unl;
+       }
+}
+
+// [EOF]
+?>
index 06b9963168675e6be4286cc3356e3eab08626f32..5d4e15146c1c25379a8c85b49a72d1e1a328f789 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 484edf07503e0bef5109c7ec1faacda99009706b..9b85b1fcccadf2568689e62ff7490a70d64c8fb2 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 6b8ba17d6f7fceb6f60488a87ba89c063c04fbcc..195c65bddbde4a87baf1a4b0524dadf4eea1815c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index d56b387ebb91fb63d46152f1fb1200276f5efdbe..665bfb24312ca0851d62a80da059ede31c329674 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 2441753bd8115bbf873de44e56aed5df0f0bcff7..dac1d2aab1d23365e6b6cf5799a62b30eb528e9a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 5c5b6ee8e21bfb5a56d5c4600fab3faa6ea9b231..0a9c498ea660c6758e10305c1a6ff089cf887468 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index f34b5e4609618dd0b59fc0910b835ca5f45dc6e1..7269884155675f09024422bba20edc50b7a2c49c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 118beed4eaa8f9d57a291efa10410c83821c6ce4..95bcbb83fed9aeb901423930f62a12ac3219ad1a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 80d029b8057dea449cecf6f92fcf439a11c2b6bc..395ae5685f76fa288c2b312936c041c43e7eb3d5 100644 (file)
@@ -57,7 +57,7 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R
                parent::__construct(__CLASS__);
 
                // "Cache" CSV path for faster usage
-               $this->csvFilePath = $this->getConfigInstance()->getConfigEntry('base_path') . '/' . $this->getConfigInstance()->getConfigEntry('csv_file_path');
+               $this->csvFilePath = $this->getConfigInstance()->getConfigEntry('base_path') . '/' . $this->getConfigInstance()->getConfigEntry('crawler_csv_file_path');
 
                // Initialize directory instance
                $directoryInstance = ObjectFactory::createObjectByConfiguredName('directory_class', array($this->csvFilePath));
@@ -73,32 +73,16 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R
        }
 
        /**
-        * Creates an instance of this class
-        *
-        * @return      $sourceInstance         An instance of a Source class
-        */
-       public final static function createCrawlerUploadedListUrlSource () {
-               // Get new instance
-               $sourceInstance = new CrawlerUploadedListUrlSource();
-
-               // Init source
-               $sourceInstance->initSource('crawler', 'uploaded_list');
-
-               // Return the prepared instance
-               return $sourceInstance;
-       }
-
-       /**
-        * Checks whether a CSV file is found
+        * Checks whether a CSV file is found in configured path
         *
         * @return      $isFound        Whether a CSV file is found
         */
        private function isCsvFileFound () {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: CALLED!');
 
-               // Is the instance valid?
+               // Is it valid?
                if (!$this->getDirectoryInstance()->getDirectoryIteratorInstance()->valid()) {
-                       // Then rewind it
+                       // Rewind to start
                        $this->getDirectoryInstance()->getDirectoryIteratorInstance()->rewind();
                } // END - if
 
@@ -106,9 +90,13 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: this->csvFileImported=' . print_r($this->csvFileImported, TRUE));
                $directoryEntry = $this->getDirectoryInstance()->readDirectoryExcept(array_merge(array('.htaccess', '.', '..'), $this->csvFileImported));
 
-               // The read entry has not to be empty and extension must be '.csv'
+               // Debug message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE[' . __METHOD__ . ':' . __LINE__ . '] directoryEntry(' . strlen($directoryEntry) . ')=' . $directoryEntry);
+
+               // Is it empty or wrong file extension?
                if ((empty($directoryEntry)) || (substr($directoryEntry, -4, 4) != '.csv')) {
                        // Skip further processing
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE[' . __METHOD__ . ':' . __LINE__ . '] directoryEntry(' . strlen($directoryEntry) . ')=' . $directoryEntry . ' - SKIPPED!');
                        return FALSE;
                } // END - if
 
@@ -122,6 +110,22 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R
                return TRUE;
        }
 
+       /**
+        * Creates an instance of this class
+        *
+        * @return      $sourceInstance         An instance of a Source class
+        */
+       public final static function createCrawlerUploadedListUrlSource () {
+               // Get new instance
+               $sourceInstance = new CrawlerUploadedListUrlSource();
+
+               // Init source
+               $sourceInstance->initSource('crawler', 'uploaded_list');
+
+               // Return the prepared instance
+               return $sourceInstance;
+       }
+
        /**
         * Checks whether a CSV file has been loaded (added to the stack)
         *
index 7ec108cd3088a08cfd9ce0514989a75a4c8dad70..f9ca32e2bd5d026733ef7aa1ff8c64309cb7d892 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 39f7de4ffd6d54ca0ff1e07454173c82479f7d9f..5336e8506de12406cf33e1ce698a27846a6e38cf 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index e6a30e1dbca2d18f026042985a94db2a641e1ee4..ff8e9e7cd9c18c4db248d794be08d4c25267e804 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index d0c89c0ca26fb26204cd4c687142aa9341fbeaf4..f24da293a15e01405a50304cac71d2d47f24f6ae 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index cac3289c0a9bd57884c1c00682b837dffbd8ad61..d81e7853378cc9ca3a47af619518e98385ac35b4 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index a3121e8cb4123d81738d9cc712524e21907e2d80..a6e46e54490f01f95d4b4d13d4171885db8d682e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index c6d6b8b89f98b3a39687bf32854d434e459941b6..e70e4832ed1bde693227913c26b135800bd02905 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 2ad6200ce1e19f0a7530cc65bf4e669d6091e322..c7f5b70fcb324b5dcda021417e3e5f13ccc9d04d 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index d7fe2cacee9c003af592032e8174ef9fd95551dc..c9263b93ad35fa6559a946c5cefed661bbbc31bd 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 0ea1c57f3bedfe39d3788f894a5e0b48eb85116d..91e9fb0fb9ce65e662ce6955c41c12b3464dbc02 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 78b10f3cf47b4571918a464ee4b3a0af657c0c08..47782e3050be3d1e50df4782246986d3518bbd12 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               Create generic DHT interface
index a4eb1acabaf0a6c1eef33edbdda42bd79716f1dc..9faa6109b3a5bd4fe58c910f6d0277b715466931 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index a7f0b951a071e3a42d4bce1b2c75463aa3e5d1d2..6a77a1ecc3c057d7944bb5549a01fff61ebfa15a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 985f2b0884b9cd70364b67bfaa7c3fd9a4249a53..f081074b3f17fb3b42cbb561a66195016a68bf38 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index a28bdafb6ace17ecd0a7379aa1fca2d0b1b038f9..f8c64b418d0e287bdb0ef848f5fe3be318bfeb96 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index cb8bb08287239c906b29873034e9f28649564989..2805c437a7e8ad13274ef73e0cfd118e3971bee2 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 4a4161db313b635fc80424b3669a2fd670ed1228..7fc2c55bd6bf7fb1713907785f8e717db0665e0c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 90e8fbd3a7a749f7af19ecd63b0549b657791989..e60b87c99c19e1d09d07cbd6df865b099d3321e4 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 3ae0c21b56835104c0b7aed68522dfb694081bd4..df88b8ede06f8aa2b38b5b8ffc9732a8f7b4e970 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 65a4f3e3066417066d8e26950f245ab1d922c378..aee5957580740bebe137801752ada2489dd9f00b 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index f9941b8d16491ccb248a7483d5fc08943c8581ba..b114920e0c7052dff3cea3abd3dd44cb1c66e9a7 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 997e813d6c66cba65c21907c5f577f55dd7ee18c..dde14d41168087937648b323dee66e7d7c590b56 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 9f2717f4c087fa4941e815bcf33b8067f5942a5b..a8aca10cbecd2d9557e2efd8064616a6fdd8ecc2 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index ceb5e9a56173922726cc88f0af520036c9834cd8..f87e781f48d4ea76787f43b061c30031aa1ad91b 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 1b21dbb0c92b759945e13fcd87ac0e7fb7b8af1d..e3cad7484418bcc7ccccc94ee9942a81990ba7c5 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index e74d4a8ac945bee9c0a281cf1da47f81575126a9..d69269e4b31ee6077847e6e8d52ae626d0c12eeb 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 2e24883ff6aef150749d27c50e2295179efa2465..304545fe1b43239eed301722809f3ac40b72b66f 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 9266e618030597794c984be37033d9dd2d53d471..4ed429528af9af54bb5c07b82ae79a2cb8ca6502 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 300242f2f217ed7e6cef5d4aec39fff819ef75f7..2e2e3924d63239fe74f61e6f0fb23aaa9a5117c8 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 3e221df26d3d06eb120568639ab7670905b52ba2..4e07902b4a881bc5301d6b539262dcd80ab59b7a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 726cca7389f322e2768a93063f2d08bc2aa6aabb..cc2f4abc80dbcdbafc510798702353293ae44d9e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 29e5df2d1395fe4780e4b747c3eb335bc25e822a..d04835a0ca0b4749b494d4dd56a4e5a748aab516 100644 (file)
@@ -5,7 +5,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               Find an interface for hub helper
@@ -26,6 +26,7 @@
 class ConnectionStatisticsHelper extends BaseHubSystem {
        /**
         * Statistics array
+        * @TODO Add more protocols to use
         */
        private static $connectionStatistics = array(
                // Statistics for TCP connections
@@ -59,14 +60,14 @@ class ConnectionStatisticsHelper extends BaseHubSystem {
        public static function isConnectRetryExhausted (ConnectionHelper $helperInstance) {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-STATISTICS[' . __METHOD__ . ':' . __LINE__ . ']: helperInstance=' . $helperInstance->__toString() . ' - ENTERED!');
                // Construct config entry
-               $configEntry = $helperInstance->getProtocol() . '_connect_retry_max';
+               $configEntry = $helperInstance->getProtocolName() . '_connect_retry_max';
 
                // Check it out
                $isExhausted = (
                        (
-                               isset(self::$connectionStatistics[$helperInstance->getProtocol()][$helperInstance->__toString()]['retry_count'])
+                               isset(self::$connectionStatistics[$helperInstance->getProtocolName()][$helperInstance->__toString()]['retry_count'])
                        ) && (
-                               self::$connectionStatistics[$helperInstance->getProtocol()][$helperInstance->__toString()]['retry_count'] >= $helperInstance->getConfigInstance()->getConfigEntry($configEntry)
+                               self::$connectionStatistics[$helperInstance->getProtocolName()][$helperInstance->__toString()]['retry_count'] >= $helperInstance->getConfigInstance()->getConfigEntry($configEntry)
                        )
                );
 
@@ -84,19 +85,19 @@ class ConnectionStatisticsHelper extends BaseHubSystem {
        public static function increaseConnectRetry (ConnectionHelper $helperInstance) {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-STATISTICS[' . __METHOD__ . ':' . __LINE__ . ']: helperInstance=' . $helperInstance->__toString() . ' - ENTERED!');
                // Is the counter there
-               if (!isset(self::$connectionStatistics[$helperInstance->getProtocol()][$helperInstance->__toString()]['retry_count'])) {
+               if (!isset(self::$connectionStatistics[$helperInstance->getProtocolName()][$helperInstance->__toString()]['retry_count'])) {
                        // First attempt
                        //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-STATISTICS[' . __METHOD__ . ':' . __LINE__ . ']: helperInstance=' . $helperInstance->__toString() . ' - FIRST!');
-                       self::$connectionStatistics[$helperInstance->getProtocol()][$helperInstance->__toString()]['retry_count'] = 1;
+                       self::$connectionStatistics[$helperInstance->getProtocolName()][$helperInstance->__toString()]['retry_count'] = 1;
                } else {
                        // Next attempt
                        //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-STATISTICS[' . __METHOD__ . ':' . __LINE__ . ']: helperInstance=' . $helperInstance->__toString() . ' - INCREMENT!');
-                       self::$connectionStatistics[$helperInstance->getProtocol()][$helperInstance->__toString()]['retry_count']++;
+                       self::$connectionStatistics[$helperInstance->getProtocolName()][$helperInstance->__toString()]['retry_count']++;
                }
 
                // Create/update 'last_update' for purging
                // @TODO last_update is not being used at the moment
-               self::$connectionStatistics[$helperInstance->getProtocol()][$helperInstance->__toString()]['last_update'] = time();
+               self::$connectionStatistics[$helperInstance->getProtocolName()][$helperInstance->__toString()]['last_update'] = time();
        }
 }
 
index 415a0831b3b8fb3ec5acf5cee2926d8d5d4a7abf..ac0c00dc9a6f4b63072e1d1b6b8fa58c96dd3ba5 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 7bd746e754a0600f7161c953d897157d118c0f63..4726d7a6e59e5ed4acd91ba33bb4a3c44040df61 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 7fe9930859437b0e8d5822159b350c83d3853b6a..242511c8fd01b86e937795f852e0e2fdadeac9f3 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -26,9 +26,9 @@ class PackageTags extends BaseTags implements Tagable {
        const EXCEPTION_INVALID_TAG = 0x160;
 
        /**
-        * Last found protocol
+        * Last found protocol instance
         */
-       private $lastProtocol = 'invalid';
+       private $lastProtocol = NULL;
 
        /**
         * Last found recipient type
@@ -97,6 +97,9 @@ class PackageTags extends BaseTags implements Tagable {
         * @return      void
         */
        private function extractTagsFromPackageData (array $packageData) {
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TAGS[' . __METHOD__ . ':' . __LINE__ . ']: packageData=' . print_r($packageData, TRUE));
+
                /*
                 * We take a look at the tags (in most cases only one is needed) so
                 * first we need the content data splitted up into all it's parts.
@@ -113,10 +116,11 @@ class PackageTags extends BaseTags implements Tagable {
         * shared over the whole hub-network. So if the "tag" (let's better say
         * object type) isn't found in that XML the package won't be distributed.
         *
+        * @param       $packageData                    Raw package data
         * @return      void
         * @throws      InvalidTagException             If a provided tag from the package data is invalid
         */
-       private function verifyAllTags () {
+       private function verifyAllTags (array $packageData) {
                // Get the registry
                $objectRegistryInstance = ObjectTypeRegistryFactory::createObjectTypeRegistryInstance();
 
@@ -135,7 +139,7 @@ class PackageTags extends BaseTags implements Tagable {
                        } // END - if
 
                        // Now save the last discovered protocol/recipient type
-                       $this->lastProtocol      = $entry[XmlObjectRegistryTemplateEngine::OBJECT_TYPE_DATA_PROTOCOL];
+                       $this->lastProtocol      = ProtocolHandlerFactory::createProtocolHandlerFromPackageData($packageData);
                        $this->lastRecipientType = $entry[XmlObjectRegistryTemplateEngine::OBJECT_TYPE_DATA_RECIPIENT_TYPE];
                } // END - foreach
        }
@@ -144,20 +148,17 @@ class PackageTags extends BaseTags implements Tagable {
         * Chooses the right protocol from given package data
         *
         * @param       $packageData    Raw package data
-        * @return      $protocolName   Name of the choosen procotol
+        * @return      $lastProtocol   An instance of the last used HandleableProtocol class
         */
        public function chooseProtocolFromPackageData (array $packageData) {
                // Extract the tags
                $this->extractTagsFromPackageData($packageData);
 
                // Now we need to verify every single tag
-               $this->verifyAllTags();
-
-               // Use the last found protocol for transmission
-               $protocolName = $this->lastProtocol;
+               $this->verifyAllTags($packageData);
 
-               // Return it
-               return $protocolName;
+               // Return the last (and only) found protocol (e.g. 'tcp' is very usual)
+               return $this->lastProtocol;
        }
 
        /**
@@ -172,7 +173,7 @@ class PackageTags extends BaseTags implements Tagable {
                $this->extractTagsFromPackageData($packageData);
 
                // Now we need to verify every single tag
-               $this->verifyAllTags();
+               $this->verifyAllTags($packageData);
 
                // Now simply check it out
                $accepts = (($this->lastRecipientType == $listenerInstance->getListenerType()) && ($listenerInstance->getListenerType() != 'invalid'));
index 462ea82fc938d50cc4833bb2f19e0fb9fb134b74..e9d12c8920989b0191a24edddadd31d709a3a506 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index ac7a6707f7711cd8126e36de41b38ea24224c837..c72f7d354a596e3df425783a82b48aa1bd232359 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index c915f8e994933369f5c84028f83246e28c9bc995..b9b4e0d8aa8238643b84dfafcd4d9831185f020e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index a4c5b40a0f8a653307b8a40ef3ef54ccee8920e0..7f9ef8675f04900ce8312d6eb2b87ddd2beb728e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 820a0d9ac5c34613aba8db0b6398ea50ba6a3edb..da1a84a49097493c2e7fc01d106228c834833aab 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 49a9d2d845f415d7f7b7a5bcb85b676de239221e..2af36715572230d030b8d87ea194673601f0cd89 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 386439a196632b3bc0617acbf5b57d309fbf61f4..73689b36350435c3256dcc0b1709edc29e7e68f8 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 1ab05fd3d6a1f89739639e65949e8c21a3102baf..e3e403f4311163775a6d9b3df71e9d749ae41d67 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 3c79af08e6f7dcaba33bf8866f7b6f77c8db59d4..32740d3d427148a470206c8c10cc8a81843a2d92 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 491b56093709099ad7dbc211389a049bad9c0660..d07737de9c6d4e77eb29a12d0549424394af489f 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 73dedd4d400f0a1b0df6e0579d46a9a2afd02afa..8f4cfaa0d2f63b5fdf0bf04f90937d05fb0f28d2 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 7daf578413f0332ade27407072c14cafc440ea4a..4a5e39919e2532f2623040462c60361f8536f17a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 6b1cd617403831c6c6c583d3f9e1ed623ac50d5b..1687332a40563cc9de75d97f6287282ee69fc536 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index cfa8b4753e2bba66a3f5c0ea3b229f403c9ec032..9dcfeb2db41a42b9bfc39751d5f5d5bbf60946ea 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index d4486239513e67f8b0aba30dce6b953177c7a1c9..c308ad9433dfb56e89f1424d3c0b795c39908b46 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 55576e718edc52094d0650aa1c3614c421d1b031..2a6491c88bbfe10755e2ac601952ab2aee35b58f 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 1fba9629cb5ea1a4ff8c0a8d1ce01a5aed9c280e..ff763a7365c3c1ce293ac1255a041c5d7e56d296 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index fd793f6623e2332cdeb93764563460a4d5c52d9b..579149520ffecc41a868b160dda556c31ab5fd4f 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 74133b6a01ab2e04f44741899465b64d25109a9a..1fc72785e30aa956ddb9d9cd4f9f4cb606f79cb2 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index f04e8be2829cf4945b7cf1018fe6303426fffc43..5e10563b498dc5e81e56d046b47187f440496aa1 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 819d07909c55f75fe04179bc0a7b1763925db108..51b88327f378402cb72d454ff7bf57b51b1d4880 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 5d75382d96d2d17213ece7039406653f44f77169..0da0cc86bd8335abcd6099c70b8606a1a30a1256 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               This template engine does not make use of setTemplateType()
@@ -26,12 +26,11 @@ class XmlAnnouncementTemplateEngine extends BaseXmlTemplateEngine implements Com
        /**
         * Some XML nodes must be available for later data extraction
         */
-       const ANNOUNCEMENT_DATA_SESSION_ID  = 'session-id';
-       const ANNOUNCEMENT_DATA_NODE_STATUS = 'node-status';
-       const ANNOUNCEMENT_DATA_NODE_MODE   = 'node-mode';
-       const ANNOUNCEMENT_DATA_EXTERNAL_IP = 'external-ip';
-       const ANNOUNCEMENT_DATA_INTERNAL_IP = 'internal-ip';
-       const ANNOUNCEMENT_DATA_LISTEN_PORT = 'listen-port';
+       const ANNOUNCEMENT_DATA_SESSION_ID       = 'session-id';
+       const ANNOUNCEMENT_DATA_NODE_STATUS      = 'node-status';
+       const ANNOUNCEMENT_DATA_NODE_MODE        = 'node-mode';
+       const ANNOUNCEMENT_DATA_EXTERNAL_ADDRESS = 'external-address';
+       const ANNOUNCEMENT_DATA_INTERNAL_ADDRESS = 'internal-address';
 
        /**
         * Protected constructor
@@ -48,10 +47,9 @@ class XmlAnnouncementTemplateEngine extends BaseXmlTemplateEngine implements Com
                        'listener',
                        self::ANNOUNCEMENT_DATA_NODE_STATUS,
                        self::ANNOUNCEMENT_DATA_NODE_MODE,
-                       self::ANNOUNCEMENT_DATA_LISTEN_PORT,
                        self::ANNOUNCEMENT_DATA_SESSION_ID,
-                       self::ANNOUNCEMENT_DATA_EXTERNAL_IP,
-                       self::ANNOUNCEMENT_DATA_INTERNAL_IP,
+                       self::ANNOUNCEMENT_DATA_EXTERNAL_ADDRESS,
+                       self::ANNOUNCEMENT_DATA_INTERNAL_ADDRESS,
                        'object-type-list',
                );
        }
@@ -161,16 +159,6 @@ class XmlAnnouncementTemplateEngine extends BaseXmlTemplateEngine implements Com
                $this->getStackInstance()->pushNamed('node_announcement', 'listener');
        }
 
-       /**
-        * Starts the TCP/UDP listen port
-        *
-        * @return      void
-        */
-       protected function startListenPort () {
-               // Push the node name on the stacker
-               $this->getStackInstance()->pushNamed('node_announcement', self::ANNOUNCEMENT_DATA_LISTEN_PORT);
-       }
-
        /**
         * Starts the session id
         *
@@ -186,9 +174,9 @@ class XmlAnnouncementTemplateEngine extends BaseXmlTemplateEngine implements Com
         *
         * @return      void
         */
-       protected function startExternalIp () {
+       protected function startExternalAddress () {
                // Push the node name on the stacker
-               $this->getStackInstance()->pushNamed('node_announcement', self::ANNOUNCEMENT_DATA_EXTERNAL_IP);
+               $this->getStackInstance()->pushNamed('node_announcement', self::ANNOUNCEMENT_DATA_EXTERNAL_ADDRESS);
        }
 
        /**
@@ -196,9 +184,9 @@ class XmlAnnouncementTemplateEngine extends BaseXmlTemplateEngine implements Com
         *
         * @return      void
         */
-       protected function startInternalIp () {
+       protected function startInternalAddress () {
                // Push the node name on the stacker
-               $this->getStackInstance()->pushNamed('node_announcement', self::ANNOUNCEMENT_DATA_INTERNAL_IP);
+               $this->getStackInstance()->pushNamed('node_announcement', self::ANNOUNCEMENT_DATA_INTERNAL_ADDRESS);
        }
 
        /**
@@ -256,7 +244,7 @@ class XmlAnnouncementTemplateEngine extends BaseXmlTemplateEngine implements Com
         *
         * @return      void
         */
-       protected function finishInternalIp () {
+       protected function finishInternalAddress () {
                // Pop the last entry
                $this->getStackInstance()->popNamed('node_announcement');
        }
@@ -266,17 +254,7 @@ class XmlAnnouncementTemplateEngine extends BaseXmlTemplateEngine implements Com
         *
         * @return      void
         */
-       protected function finishExternalIp () {
-               // Pop the last entry
-               $this->getStackInstance()->popNamed('node_announcement');
-       }
-
-       /**
-        * Finishes the TCP/UDP listen port
-        *
-        * @return      void
-        */
-       protected function finishListenPort () {
+       protected function finishExternalAddress () {
                // Pop the last entry
                $this->getStackInstance()->popNamed('node_announcement');
        }
index c54dc98346cefd67e2b1f43a759c72ffc8443b4c..f70a05f554e587e0b46db912e86b5d4660845160 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               This template engine does not make use of setTemplateType()
@@ -26,11 +26,10 @@ class XmlAnnouncementAnswerTemplateEngine extends BaseXmlAnswerTemplateEngine im
        /**
         * Some XML nodes must be available for later data extraction
         */
-       const ANNOUNCEMENT_DATA_SESSION_ID    = 'my-session-id';
-       const ANNOUNCEMENT_DATA_NODE_STATUS   = 'my-status';
-       const ANNOUNCEMENT_DATA_EXTERNAL_IP   = 'my-external-ip';
-       const ANNOUNCEMENT_DATA_INTERNAL_IP   = 'my-internal-ip';
-       const ANNOUNCEMENT_DATA_LISTEN_PORT      = 'my-listen-port';
+       const ANNOUNCEMENT_DATA_SESSION_ID       = 'my-session-id';
+       const ANNOUNCEMENT_DATA_NODE_STATUS      = 'my-status';
+       const ANNOUNCEMENT_DATA_EXTERNAL_ADDRESS = 'my-external-address';
+       const ANNOUNCEMENT_DATA_INTERNAL_ADDRESS = 'my-internal-address';
 
        /**
         * Protected constructor
@@ -47,14 +46,13 @@ class XmlAnnouncementAnswerTemplateEngine extends BaseXmlAnswerTemplateEngine im
                        'my-data',
                        'your-data',
                        // Data from *this* node
-                       self::ANNOUNCEMENT_DATA_EXTERNAL_IP,
-                       self::ANNOUNCEMENT_DATA_INTERNAL_IP,
-                       self::ANNOUNCEMENT_DATA_LISTEN_PORT,
+                       self::ANNOUNCEMENT_DATA_EXTERNAL_ADDRESS,
+                       self::ANNOUNCEMENT_DATA_INTERNAL_ADDRESS,
                        self::ANNOUNCEMENT_DATA_NODE_STATUS,
                        self::ANNOUNCEMENT_DATA_SESSION_ID,
                        // Data from other node
-                       'your-external-ip',
-                       'your-internal-ip',
+                       'your-external-address',
+                       'your-internal-address',
                        'your-session-id',
                        // Answer status (generic field)
                        self::ANSWER_STATUS,
@@ -138,33 +136,23 @@ class XmlAnnouncementAnswerTemplateEngine extends BaseXmlAnswerTemplateEngine im
        }
 
        /**
-        * Starts the my-external-ip
+        * Starts the my-external-address
         *
         * @return      void
         */
-       protected function startMyExternalIp () {
+       protected function startMyExternalAddress () {
                // Push the node name on the stacker
-               $this->getStackInstance()->pushNamed('node_announcement_answer', self::ANNOUNCEMENT_DATA_EXTERNAL_IP);
+               $this->getStackInstance()->pushNamed('node_announcement_answer', self::ANNOUNCEMENT_DATA_EXTERNAL_ADDRESS);
        }
 
        /**
-        * Starts the my-internal-ip
+        * Starts the my-internal-address
         *
         * @return      void
         */
-       protected function startMyInternalIp () {
+       protected function startMyInternalAddress () {
                // Push the node name on the stacker
-               $this->getStackInstance()->pushNamed('node_announcement_answer', self::ANNOUNCEMENT_DATA_INTERNAL_IP);
-       }
-
-       /**
-        * Starts the my-tcp-port
-        *
-        * @return      void
-        */
-       protected function startMyListenPort () {
-               // Push the node name on the stacker
-               $this->getStackInstance()->pushNamed('node_announcement_answer', self::ANNOUNCEMENT_DATA_LISTEN_PORT);
+               $this->getStackInstance()->pushNamed('node_announcement_answer', self::ANNOUNCEMENT_DATA_INTERNAL_ADDRESS);
        }
 
        /**
@@ -208,31 +196,21 @@ class XmlAnnouncementAnswerTemplateEngine extends BaseXmlAnswerTemplateEngine im
        }
 
        /**
-        * Finishes the my-tcp-port
-        *
-        * @return      void
-        */
-       protected function finishMyListenPort () {
-               // Pop the last entry
-               $this->getStackInstance()->popNamed('node_announcement_answer');
-       }
-
-       /**
-        * Finishes the my-internal-ip
+        * Finishes the my-internal-address
         *
         * @return      void
         */
-       protected function finishMyInternalIp () {
+       protected function finishMyInternalAddress () {
                // Pop the last entry
                $this->getStackInstance()->popNamed('node_announcement_answer');
        }
 
        /**
-        * Finishes the my-external-ip
+        * Finishes the my-external-address
         *
         * @return      void
         */
-       protected function finishMyExternalIp () {
+       protected function finishMyExternalAddress () {
                // Pop the last entry
                $this->getStackInstance()->popNamed('node_announcement_answer');
        }
@@ -258,23 +236,23 @@ class XmlAnnouncementAnswerTemplateEngine extends BaseXmlAnswerTemplateEngine im
        }
 
        /**
-        * Starts the your-external-ip
+        * Starts the your-external-address
         *
         * @return      void
         */
-       protected function startYourExternalIp () {
+       protected function startYourExternalAddress () {
                // Push the node name on the stacker
-               $this->getStackInstance()->pushNamed('node_announcement_answer', 'your-external-ip');
+               $this->getStackInstance()->pushNamed('node_announcement_answer', 'your-external-address');
        }
 
        /**
-        * Starts the your-internal-ip
+        * Starts the your-internal-address
         *
         * @return      void
         */
-       protected function startYourInternalIp () {
+       protected function startYourInternalAddress () {
                // Push the node name on the stacker
-               $this->getStackInstance()->pushNamed('node_announcement_answer', 'your-internal-ip');
+               $this->getStackInstance()->pushNamed('node_announcement_answer', 'your-internal-address');
        }
 
        /**
@@ -298,21 +276,21 @@ class XmlAnnouncementAnswerTemplateEngine extends BaseXmlAnswerTemplateEngine im
        }
 
        /**
-        * Finishes the your-internal-ip
+        * Finishes the your-internal-address
         *
         * @return      void
         */
-       protected function finishYourInternalIp () {
+       protected function finishYourInternalAddress () {
                // Pop the last entry
                $this->getStackInstance()->popNamed('node_announcement_answer');
        }
 
        /**
-        * Finishes the your-external-ip
+        * Finishes the your-external-address
         *
         * @return      void
         */
-       protected function finishYourExternalIp () {
+       protected function finishYourExternalAddress () {
                // Pop the last entry
                $this->getStackInstance()->popNamed('node_announcement_answer');
        }
index 40957e9287cd92b3a9dcfae913b5e9c3908dfd33..d0890388e2c5ee7a99f59a6a614b5efc790dd3e8 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  * @todo               This template engine does not make use of setTemplateType()
index c0dc7640a602d05b8755cc4fec2ae27d953451c2..8c1f95598dd8ea2c6e84fe671303fd7d8668e1b4 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               This template engine does not make use of setTemplateType()
index 93a6731c7af1cce997cb51e3b3f6aa339a244ab9..b9a94872bd1b4c887af6145bc5cafb1083b0d153 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               This template engine does not make use of setTemplateType()
@@ -26,12 +26,11 @@ class XmlDhtBootstrapAnswerTemplateEngine extends BaseXmlAnswerTemplateEngine im
        /**
         * Some XML nodes must be available for later data extraction
         */
-       const DHT_BOOTSTRAP_DATA_SESSION_ID    = 'my-session-id';
-       const DHT_BOOTSTRAP_DATA_NODE_STATUS   = 'my-status';
-       const DHT_BOOTSTRAP_DATA_EXTERNAL_IP   = 'my-external-ip';
-       const DHT_BOOTSTRAP_DATA_INTERNAL_IP   = 'my-internal-ip';
-       const DHT_BOOTSTRAP_DATA_LISTEN_PORT   = 'my-listen-port';
-       const DHT_BOOTSTRAP_DATA_NODE_LIST     = 'dht-nodes-list';
+       const DHT_BOOTSTRAP_DATA_SESSION_ID       = 'my-session-id';
+       const DHT_BOOTSTRAP_DATA_NODE_STATUS      = 'my-status';
+       const DHT_BOOTSTRAP_DATA_EXTERNAL_ADDRESS = 'my-external-address';
+       const DHT_BOOTSTRAP_DATA_INTERNAL_ADDRESS = 'my-internal-address';
+       const DHT_BOOTSTRAP_DATA_NODE_LIST        = 'dht-nodes-list';
 
        /**
         * Protected constructor
@@ -48,14 +47,13 @@ class XmlDhtBootstrapAnswerTemplateEngine extends BaseXmlAnswerTemplateEngine im
                        'my-data',
                        'your-data',
                        // Data from *this* node
-                       self::DHT_BOOTSTRAP_DATA_EXTERNAL_IP,
-                       self::DHT_BOOTSTRAP_DATA_INTERNAL_IP,
-                       self::DHT_BOOTSTRAP_DATA_LISTEN_PORT,
+                       self::DHT_BOOTSTRAP_DATA_EXTERNAL_ADDRESS,
+                       self::DHT_BOOTSTRAP_DATA_INTERNAL_ADDRESS,
                        self::DHT_BOOTSTRAP_DATA_NODE_STATUS,
                        self::DHT_BOOTSTRAP_DATA_SESSION_ID,
                        // Data from other node
-                       'your-external-ip',
-                       'your-internal-ip',
+                       'your-external-address',
+                       'your-internal-address',
                        'your-session-id',
                        // Answer status (generic field)
                        self::ANSWER_STATUS,
@@ -141,33 +139,23 @@ class XmlDhtBootstrapAnswerTemplateEngine extends BaseXmlAnswerTemplateEngine im
        }
 
        /**
-        * Starts the my-external-ip
+        * Starts the my-external-address
         *
         * @return      void
         */
-       protected function startMyExternalIp () {
+       protected function startMyExternalAddress () {
                // Push the node name on the stacker
-               $this->getStackInstance()->pushNamed('node_dht_bootstrap_answer', self::DHT_BOOTSTRAP_DATA_EXTERNAL_IP);
+               $this->getStackInstance()->pushNamed('node_dht_bootstrap_answer', self::DHT_BOOTSTRAP_DATA_EXTERNAL_ADDRESS);
        }
 
        /**
-        * Starts the my-internal-ip
+        * Starts the my-internal-address
         *
         * @return      void
         */
-       protected function startMyInternalIp () {
+       protected function startMyInternalAddress () {
                // Push the node name on the stacker
-               $this->getStackInstance()->pushNamed('node_dht_bootstrap_answer', self::DHT_BOOTSTRAP_DATA_INTERNAL_IP);
-       }
-
-       /**
-        * Starts the my-tcp-port
-        *
-        * @return      void
-        */
-       protected function startMyListenPort () {
-               // Push the node name on the stacker
-               $this->getStackInstance()->pushNamed('node_dht_bootstrap_answer', self::DHT_BOOTSTRAP_DATA_LISTEN_PORT);
+               $this->getStackInstance()->pushNamed('node_dht_bootstrap_answer', self::DHT_BOOTSTRAP_DATA_INTERNAL_ADDRESS);
        }
 
        /**
@@ -231,31 +219,21 @@ class XmlDhtBootstrapAnswerTemplateEngine extends BaseXmlAnswerTemplateEngine im
        }
 
        /**
-        * Finishes the my-tcp-port
-        *
-        * @return      void
-        */
-       protected function finishMyListenPort () {
-               // Pop the last entry
-               $this->getStackInstance()->popNamed('node_dht_bootstrap_answer');
-       }
-
-       /**
-        * Finishes the my-internal-ip
+        * Finishes the my-internal-address
         *
         * @return      void
         */
-       protected function finishMyInternalIp () {
+       protected function finishMyInternalAddress () {
                // Pop the last entry
                $this->getStackInstance()->popNamed('node_dht_bootstrap_answer');
        }
 
        /**
-        * Finishes the my-external-ip
+        * Finishes the my-external-address
         *
         * @return      void
         */
-       protected function finishMyExternalIp () {
+       protected function finishMyExternalAddress () {
                // Pop the last entry
                $this->getStackInstance()->popNamed('node_dht_bootstrap_answer');
        }
@@ -281,23 +259,23 @@ class XmlDhtBootstrapAnswerTemplateEngine extends BaseXmlAnswerTemplateEngine im
        }
 
        /**
-        * Starts the your-external-ip
+        * Starts the your-external-address
         *
         * @return      void
         */
-       protected function startYourExternalIp () {
+       protected function startYourExternalAddress () {
                // Push the node name on the stacker
-               $this->getStackInstance()->pushNamed('node_dht_bootstrap_answer', 'your-external-ip');
+               $this->getStackInstance()->pushNamed('node_dht_bootstrap_answer', 'your-external-address');
        }
 
        /**
-        * Starts the your-internal-ip
+        * Starts the your-internal-address
         *
         * @return      void
         */
-       protected function startYourInternalIp () {
+       protected function startYourInternalAddress () {
                // Push the node name on the stacker
-               $this->getStackInstance()->pushNamed('node_dht_bootstrap_answer', 'your-internal-ip');
+               $this->getStackInstance()->pushNamed('node_dht_bootstrap_answer', 'your-internal-address');
        }
 
        /**
@@ -321,21 +299,21 @@ class XmlDhtBootstrapAnswerTemplateEngine extends BaseXmlAnswerTemplateEngine im
        }
 
        /**
-        * Finishes the your-internal-ip
+        * Finishes the your-internal-address
         *
         * @return      void
         */
-       protected function finishYourInternalIp () {
+       protected function finishYourInternalAddress () {
                // Pop the last entry
                $this->getStackInstance()->popNamed('node_dht_bootstrap_answer');
        }
 
        /**
-        * Finishes the your-external-ip
+        * Finishes the your-external-address
         *
         * @return      void
         */
-       protected function finishYourExternalIp () {
+       protected function finishYourExternalAddress () {
                // Pop the last entry
                $this->getStackInstance()->popNamed('node_dht_bootstrap_answer');
        }
index 850644020d2e4126878744ec92306ac8d15f76f6..f2aa8dcab033d0177412847b3fed7d4269630348 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               This template engine does not make use of setTemplateType()
index 6abb3f32e988f5278b32cdf955d9a3107c9b1adc..9bacd4add760ce43781d29854788d6da0c6fe610 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  * @todo               This template engine does not make use of setTemplateType()
index 8d2c54de53f2a064553848775ff4cd00f84e344d..2f60e58e26da55dc5fe23e4dba287a9f6f2f44ed 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               This template engine does not make use of setTemplateType()
@@ -222,14 +222,14 @@ class BaseXmlTemplateEngine extends BaseTemplateEngine {
        }
 
        /**
-        * Handles the template dependency for given node
+        * Handles the template dependency for given XML node
         *
-        * @param       $node                                   The node we should load a dependency template
+        * @param       $node                                   The XML node we should load a dependency template
         * @param       $templateDependency             A template to load to satisfy dependencies
         * @return      void
         */
        protected function handleTemplateDependency ($node, $templateDependency) {
-               // Check that node is not empty
+               // Check that the XML node is not empty
                assert(!empty($node));
 
                // Is the template dependency set?
index b971ee658756294241b234c59677ac5790e960c4..17f2be09fafd05b09d746d215fb885e2a21e50db 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               This template engine does not make use of setTemplateType()
index 35a856e0175ae5db3f7e239c2b6cda09eb929ee5..9b95cc37c5a7a32f9b559f91fe296a80e1b51f76 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               This template engine does not make use of setTemplateType()
@@ -26,13 +26,12 @@ class XmlDhtBootstrapTemplateEngine extends BaseXmlTemplateEngine implements Com
        /**
         * Some XML nodes must be available for later data extraction
         */
-       const DHT_BOOTSTRAP_DATA_BOOTSTRAP_DATA = 'dht-bootstrap-data';
-       const DHT_BOOTSTRAP_DATA_SESSION_ID     = 'session-id';
-       const DHT_BOOTSTRAP_DATA_NODE_STATUS    = 'node-status';
-       const DHT_BOOTSTRAP_DATA_NODE_MODE      = 'node-mode';
-       const DHT_BOOTSTRAP_DATA_EXTERNAL_IP    = 'external-ip';
-       const DHT_BOOTSTRAP_DATA_INTERNAL_IP    = 'internal-ip';
-       const DHT_BOOTSTRAP_DATA_LISTEN_PORT    = 'listen-port';
+       const DHT_BOOTSTRAP_DATA_BOOTSTRAP_DATA   = 'dht-bootstrap-data';
+       const DHT_BOOTSTRAP_DATA_SESSION_ID       = 'session-id';
+       const DHT_BOOTSTRAP_DATA_NODE_STATUS      = 'node-status';
+       const DHT_BOOTSTRAP_DATA_NODE_MODE        = 'node-mode';
+       const DHT_BOOTSTRAP_DATA_EXTERNAL_ADDRESS = 'external-address';
+       const DHT_BOOTSTRAP_DATA_INTERNAL_ADDRESS = 'internal-address';
 
        /**
         * Protected constructor
@@ -49,10 +48,9 @@ class XmlDhtBootstrapTemplateEngine extends BaseXmlTemplateEngine implements Com
                        'listener',
                        self::DHT_BOOTSTRAP_DATA_NODE_STATUS,
                        self::DHT_BOOTSTRAP_DATA_NODE_MODE,
-                       self::DHT_BOOTSTRAP_DATA_LISTEN_PORT,
                        self::DHT_BOOTSTRAP_DATA_SESSION_ID,
-                       self::DHT_BOOTSTRAP_DATA_EXTERNAL_IP,
-                       self::DHT_BOOTSTRAP_DATA_INTERNAL_IP
+                       self::DHT_BOOTSTRAP_DATA_EXTERNAL_ADDRESS,
+                       self::DHT_BOOTSTRAP_DATA_INTERNAL_ADDRESS
                );
        }
 
@@ -161,24 +159,14 @@ class XmlDhtBootstrapTemplateEngine extends BaseXmlTemplateEngine implements Com
                $this->getStackInstance()->pushNamed('dht_bootstrap', 'listener');
        }
 
-       /**
-        * Starts the TCP/UDP listen port
-        *
-        * @return      void
-        */
-       protected function startListenPort () {
-               // Push the node name on the stacker
-               $this->getStackInstance()->pushNamed('dht_bootstrap', self::DHT_BOOTSTRAP_DATA_LISTEN_PORT);
-       }
-
        /**
         * Starts the public ip
         *
         * @return      void
         */
-       protected function startExternalIp () {
+       protected function startExternalAddress () {
                // Push the node name on the stacker
-               $this->getStackInstance()->pushNamed('dht_bootstrap', self::DHT_BOOTSTRAP_DATA_EXTERNAL_IP);
+               $this->getStackInstance()->pushNamed('dht_bootstrap', self::DHT_BOOTSTRAP_DATA_EXTERNAL_ADDRESS);
        }
 
        /**
@@ -186,9 +174,9 @@ class XmlDhtBootstrapTemplateEngine extends BaseXmlTemplateEngine implements Com
         *
         * @return      void
         */
-       protected function startInternalIp () {
+       protected function startInternalAddress () {
                // Push the node name on the stacker
-               $this->getStackInstance()->pushNamed('dht_bootstrap', self::DHT_BOOTSTRAP_DATA_INTERNAL_IP);
+               $this->getStackInstance()->pushNamed('dht_bootstrap', self::DHT_BOOTSTRAP_DATA_INTERNAL_ADDRESS);
        }
 
        /**
@@ -216,7 +204,7 @@ class XmlDhtBootstrapTemplateEngine extends BaseXmlTemplateEngine implements Com
         *
         * @return      void
         */
-       protected function finishInternalIp () {
+       protected function finishInternalAddress () {
                // Pop the last entry
                $this->getStackInstance()->popNamed('dht_bootstrap');
        }
@@ -226,17 +214,7 @@ class XmlDhtBootstrapTemplateEngine extends BaseXmlTemplateEngine implements Com
         *
         * @return      void
         */
-       protected function finishExternalIp () {
-               // Pop the last entry
-               $this->getStackInstance()->popNamed('dht_bootstrap');
-       }
-
-       /**
-        * Finishes the TCP/UDP listen port
-        *
-        * @return      void
-        */
-       protected function finishListenPort () {
+       protected function finishExternalAddress () {
                // Pop the last entry
                $this->getStackInstance()->popNamed('dht_bootstrap');
        }
index 568bb9440d88a8a60a320a2b7df151f521b5a012..126b5f77f17eff78a97d6e4b86fdbf71975aa98c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               This template engine does not make use of setTemplateType()
index 3c9795027582b3855d984217a85e7f2ff6082b1d..66ef63bdbff05c49628fc441650b58a6ff8182f9 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               This template engine does not make use of setTemplateType()
index fb98fa8f661751b90b53b796354675ad7d036e67..0360090adc68d16a5b382a426ede87f7bbde305d 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               This template engine does not make use of setTemplateType()
@@ -30,8 +30,7 @@ class XmlDhtPublishEntryTemplateEngine extends BaseXmlTemplateEngine implements
        const PUBLISH_DATA_SESSION_ID            = 'session-id';
        const PUBLISH_DATA_NODE_STATUS           = 'node-status';
        const PUBLISH_DATA_NODE_MODE             = 'node-mode';
-       const PUBLISH_DATA_EXTERNAL_IP           = 'external-ip';
-       const PUBLISH_DATA_LISTEN_PORT           = 'listen-port';
+       const PUBLISH_DATA_EXTERNAL_ADDRESS      = 'external-address';
        const PUBLISH_DATA_PRIVATE_KEY_HASH      = 'private-key-hash';
        const PUBLISH_DATA_ACCEPTED_OBJECT_TYPES = 'accepted-object-types';
 
@@ -50,12 +49,11 @@ class XmlDhtPublishEntryTemplateEngine extends BaseXmlTemplateEngine implements
                        'listener',
                        self::PUBLISH_DATA_NODE_STATUS,
                        self::PUBLISH_DATA_NODE_MODE,
-                       self::PUBLISH_DATA_LISTEN_PORT,
                        self::PUBLISH_DATA_PRIVATE_KEY_HASH,
                        self::PUBLISH_DATA_ACCEPTED_OBJECT_TYPES,
                        self::PUBLISH_DATA_NODE_ID,
                        self::PUBLISH_DATA_SESSION_ID,
-                       self::PUBLISH_DATA_EXTERNAL_IP,
+                       self::PUBLISH_DATA_EXTERNAL_ADDRESS,
                        'object-type-list',
                );
        }
@@ -165,16 +163,6 @@ class XmlDhtPublishEntryTemplateEngine extends BaseXmlTemplateEngine implements
                $this->getStackInstance()->pushNamed('dht_publish', 'listener');
        }
 
-       /**
-        * Starts the TCP/UDP listen port
-        *
-        * @return      void
-        */
-       protected function startListenPort () {
-               // Push the node name on the stacker
-               $this->getStackInstance()->pushNamed('dht_publish', self::PUBLISH_DATA_LISTEN_PORT);
-       }
-
        /**
         * Starts accepted object types
         *
@@ -220,9 +208,9 @@ class XmlDhtPublishEntryTemplateEngine extends BaseXmlTemplateEngine implements
         *
         * @return      void
         */
-       protected function startExternalIp () {
+       protected function startExternalAddress () {
                // Push the node name on the stacker
-               $this->getStackInstance()->pushNamed('dht_publish', self::PUBLISH_DATA_EXTERNAL_IP);
+               $this->getStackInstance()->pushNamed('dht_publish', self::PUBLISH_DATA_EXTERNAL_ADDRESS);
        }
 
        /**
@@ -290,17 +278,7 @@ class XmlDhtPublishEntryTemplateEngine extends BaseXmlTemplateEngine implements
         *
         * @return      void
         */
-       protected function finishExternalIp () {
-               // Pop the last entry
-               $this->getStackInstance()->popNamed('dht_publish');
-       }
-
-       /**
-        * Finishes the TCP/UDP listen port
-        *
-        * @return      void
-        */
-       protected function finishListenPort () {
+       protected function finishExternalAddress () {
                // Pop the last entry
                $this->getStackInstance()->popNamed('dht_publish');
        }
index 04dd6c623f4d4e9585e52f9a2cec15d097b0b6cf..1ada53e004e9b4168db19f1054039e5f90f264fc 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               This template engine does not make use of setTemplateType()
index d59db66541245e3eee2abeebcde2674c6a514a4c..9929662b47bf97ee3ce4371728d8e52dbfb5c0c1 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -86,118 +86,99 @@ class HubTools extends BaseHubSystem {
        }
 
        /**
-        * Resolves a session id into an ip:port combination. The opposite method
-        * is resolveSessionIdByIpPort()
+        * Resolves a session id into an instance of a LocateableNode class. The opposite method
+        * is resolveSessionIdByUniversalNodeLocator()
         *
         * @param       $sessionId                      A valid session id
-        * @return      $recipientIpPort        Recipient as ip:port combination
+        * @return      $recipientUniversalNodeLocator  Recipient as Universal Node Locator
         */
-       protected function resolveIpPortBySessionId ($sessionId) {
+       protected function resolveUniversalNodeLocatorBySessionId ($sessionId) {
                // Init variable
-               $recipientIpPort = 'invalid:invalid';
+               die(__METHOD__ . ': UNFINISHED: sessionId=' . $sessionId . PHP_EOL);
+               $recipientUniversalNodeLocator = 'invalid://invalid:invalid';
 
-               // And ask it for ip:port by given session id
+               // And ask it for Universal Node Locator by given session id
                $recipient = $this->getDhtInstance()->findNodeLocalBySessionId($sessionId);
 
                // Is the recipient valid?
-               if ((isset($recipient[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_EXTERNAL_IP])) && (isset($recipient[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_LISTEN_PORT]))) {
+               if (isset($recipient[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_EXTERNAL_ADDRESS])) {
                        // Then use this
-                       $recipientIpPort = $recipient[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_EXTERNAL_IP] . ':' . $recipient[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_LISTEN_PORT];
+                       $recipientUniversalNodeLocator = $recipient[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_EXTERNAL_ADDRESS];
                } else {
                        // Get the instance, this might throw a NPE
                        $nodeInstance = NodeObjectFactory::createNodeInstance();
 
                        // Is the session id the same?
                        if ($nodeInstance->getSessionId() == $sessionId) {
-                               // Then get the ip:port from it, assume TCP by default
-                               $recipientIpPort = self::determineOwnExternalIp() . ':' . $nodeInstance->getConfigInstance()->getConfigEntry('node_listen_port');
+                               // Then get an instance of a LocateableNode class from it, assume TCP by default
+                               $recipientUniversalNodeLocator = self::determineOwnExternalAddress() . ':' . $nodeInstance->getConfigInstance()->getConfigEntry('node_listen_port');
                        } // END - if
                }
 
                // Return result
-               return $recipientIpPort;
+               return $recipientUniversalNodeLocator;
        }
 
        /**
-        * Resolves a ip:port combination into a session id. The "opposite" method
-        * is resolveIpPortBySessionId().
+        * Resolves a Universal Node Locator into a session id. The "opposite" method
+        * is resolveUniversalNodeLocatorBySessionId().
         *
-        * @param       $ipPort         Ip:port combination
-        * @return      $sessionId      Valid session id
+        * @param       $unlInstance    Universal Node Locator
+        * @return      $sessionId              Valid session id
         */
-       public static function resolveSessionIdByIpPort ($ipPort) {
+       public static function resolveSessionIdByUniversalNodeLocator (LocateableNode $unlInstance) {
                // Get an own instance
                $selfInstance = self::getSelfInstance();
 
-               // And ask it for session id by given ip:port
-               $recipient = $selfInstance->getDhtInstance()->findNodeByIpPort($ipPort);
-               die(__METHOD__.':recipient=<pre>'.print_r($recipient, TRUE).'</pre>' . PHP_EOL);
+               // And ask it for session id by given Universal Node Locator
+               $recipient = $selfInstance->getDhtInstance()->findNodeByUniversalNodeLocator($unlInstance);
+               die(__METHOD__.':recipient='.print_r($recipient, TRUE));
 
                // Return result
                return $sessionId;
        }
 
        /**
-        * Resolves given session id into an ip:port combination, if ip:port is set, it won't be translated
+        * Resolves given session id into an instance of a LocateableNode class, if Universal Node Locator is set, it won't be translated
         *
-        * @param       $sessionId      Session id or ip:port combination
-        * @return      $recipient      Recipient as ip:port combination
-        * @throws      InvalidSessionIdException       If the provided session id is invalid (and no ip:port combination)
+        * @param       $address        Session id or Universal Node Locator
+        * @return      $recipient      Recipient as Universal Node Locator
+        * @throws      InvalidSessionIdException       If the provided session id is invalid (and no Universal Node Locator)
         * @throws      NoValidHostnameException        If the provided hostname cannot be resolved into an IP address
         */
-       public static function resolveSessionId ($sessionId) {
+       public static function resolveSessionId ($address) {
                // Get an own instance
                $selfInstance = self::getSelfInstance();
 
-               // Default is direct ip:port
-               $recipient = $sessionId;
+               // Default is direct Universal Node Locator
+               $recipient = $address;
 
-               // Does it match a direct ip:port? (hint: see www.regexlib.com for the regular expression)
-               if (preg_match('/((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])):([0-9]{3,5})/', $sessionId)) {
-                       // Direct ip:port found
-                       self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: Direct ip:port ' . $sessionId . ' detected.');
-               } elseif (isset($selfInstance->sessionIdCache[$sessionId])) {
+               // Does it match a direct Universal Node Locator? (hint: see www.regexlib.com for the regular expression)
+               if (preg_match('/([a-z0-9]{3,10})\/\/:([a-z0-9\.]{5,})/', $address)) {
+                       // @TODO ((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])):([0-9]{3,5})
+                       // Direct Universal Node Locator found
+                       self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: Direct Universal Node Locator ' . $address . ' detected.');
+               } elseif (isset($selfInstance->sessionIdCache[$address])) {
                        // Debug message
                        self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: Using entry from sessionIdCache[] array.');
 
                        // Found in cache!
-                       $recipient = $selfInstance->sessionIdCache[$sessionId];
+                       $recipient = $selfInstance->sessionIdCache[$address];
 
                        // Debug message
-                       self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: sessionIdCache[' . $sessionId . ']=' . $recipient);
-               } elseif (preg_match('/([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}:([0-9]{3,5})/', $sessionId)) {
-                       // Hostname:port found
-                       self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: hostname:port ' . $sessionId . ' detected.');
-
-                       // Hostname:port found
-                       $hostnameArray = explode(':', $sessionId);
-
-                       /*
-                        * Try to resolve it and add port again
-                        * @TODO Please try to encapsulate this PHP call into an own class
-                        */
-                       $recipient = gethostbyname($hostnameArray[0]) . ':' . $hostnameArray[1];
-
-                       // Is it valid?
-                       if ($recipient == $sessionId) {
-                               // Resolving hostname->IP failed!
-                               throw new NoValidHostnameException($hostnameArray, self::EXCEPTION_HOSTNAME_NOT_FOUND);
-                       } // END - if
-
-                       // Debug message
-                       self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: hostname:port ' . $sessionId . ' resolved to ' . $recipient);
-               } elseif (preg_match('/([a-f0-9]{' . $selfInstance->getSessionIdLength() . '})/', $sessionId)) {
+                       self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: sessionIdCache[' . $address . ']=' . $recipient);
+               } elseif (preg_match('/([a-f0-9]{' . $selfInstance->getSessionIdLength() . '})/', $address)) {
                        // Debug message
                        self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: Using internal session id resolver.');
 
-                       // Resolve session id into a ip:port combination
-                       $recipient = $selfInstance->resolveIpPortBySessionId($sessionId);
+                       // Resolve session id into an instance of a LocateableNode class
+                       $recipient = $selfInstance->resolveUniversalNodeLocatorBySessionId($address);
 
                        // Debug message
-                       self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: Session id ' . $sessionId . ' resolved to ' . $recipient);
+                       self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: Session id ' . $address . ' resolved to ' . $recipient);
                } else {
-                       // Invalid session id
-                       throw new InvalidSessionIdException($sessionId, self::EXCEPTION_SESSION_ID_IS_INVALID);
+                       // Invalid session id/UNL
+                       throw new InvalidSessionIdException($address, self::EXCEPTION_SESSION_ID_IS_INVALID);
                }
 
                // Return it
@@ -205,44 +186,100 @@ class HubTools extends BaseHubSystem {
        }
 
        /**
-        * Determine IP or 'external_ip' if set
+        * Determine UNL or 'external_address' if set
         *
-        * @return      $ip             The determined external ip of this node
+        * @return      $unl    The determined external UNL of this node
         */
-       public static function determineOwnExternalIp () {
-               // Is the external_ip config entry set?
-               if (FrameworkConfiguration::getSelfInstance()->getConfigEntry('external_ip') != '') {
-                       // Use it as external ip
-                       $ip = FrameworkConfiguration::getSelfInstance()->getConfigEntry('external_ip');
+       public static function determineOwnExternalAddress () {
+               // Is the external_address config entry set?
+               if (FrameworkConfiguration::getSelfInstance()->getConfigEntry('external_address') != '') {
+                       // Use it as external address
+                       $unl = FrameworkConfiguration::getSelfInstance()->getConfigEntry('external_address');
                } else {
-                       // Determine own external ip by connecting to my (coder) server at 188.138.90.169
-                       $ip = ConsoleTools::determineExternalIp();
+                       // Determine own external address by connecting to my (coder) server at 188.138.90.169
+                       $unl = self::determineExternalUniversalNodeLocator();
                }
 
                // Return it
-               return $ip;
+               return $unl;
        }
 
        /**
-        * Determine IP or 'internal_ip' if set
+        * Determine UNL or 'internal_address' if set
         *
-        * @return      $ip             The determined external ip of this node
+        * @return      $unl    The determined internal UNL of this node
         */
-       public static function determineOwnInternalIp () {
-               // Is the internal_ip config entry set?
-               if (FrameworkConfiguration::getSelfInstance()->getConfigEntry('allow_publish_internal_ip') == 'N') {
-                       // Not allowed to publish internal IP, so use external
-                       $ip = self::determineOwnExternalIp();
-               } elseif (FrameworkConfiguration::getSelfInstance()->getConfigEntry('internal_ip') != '') {
-                       // Use it as internal ip
-                       $ip = FrameworkConfiguration::getSelfInstance()->getConfigEntry('internal_ip');
+       public static function determineOwnInternalAddress () {
+               // Is the internal_address config entry set?
+               if (FrameworkConfiguration::getSelfInstance()->getConfigEntry('allow_publish_internal_address') == 'N') {
+                       // Not allowed to publish internal address, so use external
+                       $unl = self::determineOwnExternalAddress();
+               } elseif (FrameworkConfiguration::getSelfInstance()->getConfigEntry('internal_address') != '') {
+                       // Use it as internal address
+                       $unl = FrameworkConfiguration::getSelfInstance()->getConfigEntry('internal_address');
                } else {
-                       // Determine own internal ip by connecting to my (coder) server at 188.138.90.169
-                       $ip = ConsoleTools::acquireSelfIPAddress();
+                       // Determine own internal address by connecting to my (coder) server at 188.138.90.169
+                       $unl = self::determineInternalUniversalNodeLocator();
                }
 
                // Return it
-               return $ip;
+               return $unl;
+       }
+
+       /**
+        * Determines the UNL (Universal Node Locator) for the internal address
+        *
+        * @return      $internalUnl    Internal UNL
+        */
+       public static function determineInternalUniversalNodeLocator () {
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!');
+
+               // Is there cache? (This shortens a lot calls)
+               if (!isset($GLOBALS[__METHOD__])) {
+                       // Determine UNL based on this node:
+                       // 1) Get discovery class
+                       $discoveryInstance = ObjectFactory::createObjectByConfiguredName('unl_discovery_class');
+
+                       // 2) "Determine" it
+                       $GLOBALS[__METHOD__] = $discoveryInstance->discoverUniversalNodeLocatorByConfiguredAddress('internal');
+
+                       // Make sure it is valid
+                       // @TODO Find a better validation than empty()
+                       assert(!empty($GLOBALS[__METHOD__]));
+               } // END - if
+
+               // Return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: unl=' . $GLOBALS[__METHOD__] . ' - EXIT!');
+               return $GLOBALS[__METHOD__];
+       }
+
+       /**
+        * Determines the UNL (Universal Node Locator) for the external address
+        *
+        * @return      $externalUnl    External UNL
+        */
+       public static function determineExternalUniversalNodeLocator () {
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!');
+
+               // Is there cache? (This shortens a lot calls)
+               if (!isset($GLOBALS[__METHOD__])) {
+                       // Determine UNL based on this node:
+                       // 1) Get discovery class
+                       $discoveryInstance = ObjectFactory::createObjectByConfiguredName('unl_discovery_class');
+
+                       // 2) "Determine" it
+                       $GLOBALS[__METHOD__] = $discoveryInstance->discoverUniversalNodeLocatorByConfiguredAddress('external');
+
+                       // Make sure it is valid
+                       // @TODO Find a better validation than empty()
+                       assert(!empty($GLOBALS[__METHOD__]));
+               } // END - if
+
+               // Return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: unl=' . $GLOBALS[__METHOD__] . ' - EXIT!');
+               return $GLOBALS[__METHOD__];
        }
 }
 
diff --git a/application/hub/main/unl/.htaccess b/application/hub/main/unl/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/unl/class_UniversalNodeLocator.php b/application/hub/main/unl/class_UniversalNodeLocator.php
new file mode 100644 (file)
index 0000000..7f857a0
--- /dev/null
@@ -0,0 +1,98 @@
+<?php
+/**
+ * A UniversalNodeLocator
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.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 UniversalNodeLocator extends BaseFrameworkSystem implements LocateableNode {
+       /**
+        * UNL data array
+        */
+       private $unlData = array();
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $current                An array with "raw" data from the database layer for the UNL. This parameter is optional.
+        * @return      $unlInstance    An instance of a LocateableNode class
+        */
+       public final static function createUniversalNodeLocator (array $current = array()) {
+               // Get new instance
+               $unlInstance = new UniversalNodeLocator();
+
+               // Init instance
+               $unlInstance->initUniversalNodeLocator($current);
+
+               // Return the prepared instance
+               return $unlInstance;
+       }
+
+       /**
+        * Initializes the UNL instance by givena array. If an entry is found, it
+        * will be copied, otherwise the entry is set empty.
+        *
+        * @param       $current        An array with "raw" data from the database layer for the UNL. This parameter is optional.
+        * @return      void
+        */
+       private function initUniversalNodeLocator (array $current = array()) {
+               // Init UNL array
+               $this->unlData = array();
+
+               // Copy all found entries
+               foreach (array(
+                       NodeInformationDatabaseWrapper::DB_COLUMN_NODE_ID,
+                       NodeInformationDatabaseWrapper::DB_COLUMN_SESSION_ID,
+                       NodeInformationDatabaseWrapper::DB_COLUMN_PRIVATE_KEY_HASH,
+                       NodeInformationDatabaseWrapper::DB_COLUMN_NODE_MODE,
+                       NodeInformationDatabaseWrapper::DB_COLUMN_INTERNAL_UNL,
+                       NodeInformationDatabaseWrapper::DB_COLUMN_EXTERNAL_UNL) as $key) {
+                               // Init entry
+                               $this->unlData[$key] = NULL;
+
+                               // Is the key found?
+                               if (isset($current[$key])) {
+                                       // The copy the entry
+                                       $this->unlData[$key] = $current[$key];
+                               } // END - if
+               } // END - foreach
+       }
+
+       /**
+        * Getter for UNL data array
+        *
+        * @return      $unlData        An array with UNL data
+        */
+       public final function getUnlData () {
+               return $this->unlData;
+       }
+}
+
+// [EOF]
+?>
index 362266063f2b43703f008ebf7d05e473679599ba..e5d4ce5e77727a5ce7b2ffd8e81d15234c227025 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index e0e89d4f09f9d6fdba2dd87bf2d0846b958c8d30..4bbf1e54a3379f3fd79b59f7f873e715a9b2cc3a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 727a992e0681f37c253d2626da68d56675c1b4e6..92c188f1b4ca517617685033c74b4847864a7ef3 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index dfe1bafc7fd6dfa9687a4391ccb21b6557138ea1..4b0943b256a05d2d805216f912b881c1f497738c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 209bd6d6e12eee63795c1d2e2eaadbfdb27aaf92..2d2c18e10af0cde7142591b4627ac1ac21480190 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 3f00ece55f8a263dfc77e15a637b9141f1f82b73..5f921372c3e7455ad36d87cb1931545fbe958aa6 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub; Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub; Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index fbc41f585e7d50f95b456caa8d523ecbad38fcf1..b1f1931b1ac84dd9eec08d50607f4f5fb7bbbe69 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 1fee9c6c5da869776df57e080608c610babf5c97..ee09eb39b5a16c17705cedb2bf91576bd0c7d8a8 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index fbcd19c49bc9c955ba31323a8e17239d3e4bccfc..31ce73535d8241c38ad3f3be175abd0a4cf766f8 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index fbc1ddad4e8076999655d77343c5587270f94108..5aa70f3d48b4589d96bbecf6dd871bf8ab5e60c8 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 1eef929e16841b195b5c01fbeab40ae8b0266ca2..bcabb7ce957fbbd802c23caaf386595a8f390e05 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 7e5921d74b3cbdbd8a0f46f39a5c0c15d1ebc3e5..9a61f38d8b0429490ebb83f82a3dddfbfa7182f6 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -33,8 +33,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
        // Constants for database column names
        const DB_COLUMN_NODE_ID            = 'node_id';
        const DB_COLUMN_SESSION_ID         = 'session_id';
-       const DB_COLUMN_EXTERNAL_IP        = 'external_ip';
-       const DB_COLUMN_LISTEN_PORT        = 'listen_port';
+       const DB_COLUMN_EXTERNAL_ADDRESS   = 'external_address';
        const DB_COLUMN_PRIVATE_KEY_HASH   = 'private_key_hash';
        const DB_COLUMN_NODE_MODE          = 'node_mode';
        const DB_COLUMN_ACCEPTED_OBJECTS   = 'accepted_object_types';
@@ -86,8 +85,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
                $elements = array(
                        self::DB_COLUMN_NODE_ID,
                        self::DB_COLUMN_SESSION_ID,
-                       self::DB_COLUMN_EXTERNAL_IP,
-                       self::DB_COLUMN_LISTEN_PORT,
+                       self::DB_COLUMN_EXTERNAL_ADDRESS,
                        self::DB_COLUMN_PRIVATE_KEY_HASH,
                        self::DB_COLUMN_NODE_MODE,
                        self::DB_COLUMN_ACCEPTED_OBJECTS,
@@ -105,6 +103,9 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
         * @return      $searchInstance         An instance of a SearchCriteria class
         */
        private function prepareSearchInstance (array $nodeData) {
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!');
+
                // Assert on array elements
                assert(isset($nodeData[self::DB_COLUMN_NODE_ID]));
 
@@ -115,6 +116,9 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
                $searchInstance->addCriteria(self::DB_COLUMN_NODE_ID, $nodeData[self::DB_COLUMN_NODE_ID]);
                $searchInstance->setLimit(1);
 
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!');
+
                // Return it
                return $searchInstance;
        }
@@ -136,6 +140,9 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
         * @return      $dataSetInstance        An instance of a StoreableCriteria class
         */
        private function prepareLocalDataSetInstance () {
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!');
+
                // Get node/request instances
                $nodeInstance = NodeObjectFactory::createNodeInstance();
                $requestInstance = ApplicationHelper::getSelfInstance()->getRequestInstance();
@@ -146,11 +153,16 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
                // Set the primary key
                $dataSetInstance->setUniqueKey(self::DB_COLUMN_NODE_ID);
 
-               // Get ip:port combination and "explode" it
-               $ipPort = $nodeInstance->getAddressPortArray();
+               // Get Universal Node Locator and "explode" it
+               $unlInstance = $nodeInstance->determineUniversalNodeLocator();
+
+               // Get UNL data from it
+               $unlData = $unlInstance->getUnlData();
 
                // Make sure both is valid
-               assert(($ipPort[0] !== 'invalid') && ($ipPort[1] !== 'invalid'));
+               // @TODO Bad check on UNL, better use a proper validator
+               assert(isset($unlData[NodeInformationDatabaseWrapper::DB_COLUMN_EXTERNAL_UNL]));
+               assert($unlData[NodeInformationDatabaseWrapper::DB_COLUMN_EXTERNAL_UNL] !== 'invalid');
 
                // Get an array of all accepted object types
                $objectList = $nodeInstance->getListFromAcceptedObjectTypes();
@@ -160,26 +172,29 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
 
                // Add public node data
                $dataSetInstance->addCriteria(self::DB_COLUMN_NODE_MODE       , $requestInstance->getRequestElement('mode'));
-               $dataSetInstance->addCriteria(self::DB_COLUMN_EXTERNAL_IP     , $ipPort[0]);
-               $dataSetInstance->addCriteria(self::DB_COLUMN_LISTEN_PORT     , $ipPort[1]);
+               $dataSetInstance->addCriteria(self::DB_COLUMN_EXTERNAL_ADDRESS, $unlData[NodeInformationDatabaseWrapper::DB_COLUMN_EXTERNAL_UNL]);
                $dataSetInstance->addCriteria(self::DB_COLUMN_NODE_ID         , $nodeInstance->getNodeId());
                $dataSetInstance->addCriteria(self::DB_COLUMN_SESSION_ID      , $nodeInstance->getSessionId());
                $dataSetInstance->addCriteria(self::DB_COLUMN_PRIVATE_KEY_HASH, $nodeInstance->getPrivateKeyHash());
                $dataSetInstance->addCriteria(self::DB_COLUMN_ACCEPTED_OBJECTS, implode(BaseHubNode::OBJECT_LIST_SEPARATOR, $objectList));
                $dataSetInstance->addCriteria(self::DB_COLUMN_ACCEPT_BOOTSTRAP, $this->translateBooleanToYesNo($nodeInstance->isAcceptingDhtBootstrap()));
 
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!');
+
                // Return it
                return $dataSetInstance;
        }
 
        /**
         * Checks whether the local (*this*) node is registered in the DHT by
-        * checking if the external ip/port is found.
+        * checking if the external address is found.
         *
         * @return      $isRegistered   Whether *this* node is registered in the DHT
         */
        public function isLocalNodeRegistered () {
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!');
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!');
 
                // Get a search criteria instance
                $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
@@ -187,20 +202,18 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
                // Get node instance
                $nodeInstance = NodeObjectFactory::createNodeInstance();
 
-               // Get ip:port combination and "explode" it
-               $ipPort = $nodeInstance->getAddressPortArray();
+               // Get Universal Node Locator and "explode" it
+               $unlData = $nodeInstance->getUniversalNodeLocatorArray();
 
-               /*
-                * Make sure both is not 'invalid' which means that the resolver
-                * didn't work.
-                */
-               assert(($ipPort[0] !== 'invalid') && ($ipPort[1] !== 'invalid'));
+               // Make sure the external address is set and not invalid
+               // @TODO Bad check on UNL, better use a proper validator
+               assert(isset($unlData[NodeInformationDatabaseWrapper::DB_COLUMN_EXTERNAL_UNL]));
+               assert($unlData[NodeInformationDatabaseWrapper::DB_COLUMN_EXTERNAL_UNL] != 'invalid');
 
-               // Add ip:port/node id as criteria
-               $searchInstance->addCriteria(self::DB_COLUMN_EXTERNAL_IP, $ipPort[0]);
-               $searchInstance->addCriteria(self::DB_COLUMN_LISTEN_PORT, $ipPort[1]);
-               $searchInstance->addCriteria(self::DB_COLUMN_NODE_ID    , $nodeInstance->getNodeId());
-               $searchInstance->addCriteria(self::DB_COLUMN_SESSION_ID , $nodeInstance->getSessionId());
+               // Add Universal Node Locator/node id as criteria
+               $searchInstance->addCriteria(self::DB_COLUMN_EXTERNAL_ADDRESS, $unlData[NodeInformationDatabaseWrapper::DB_COLUMN_EXTERNAL_UNL]);
+               $searchInstance->addCriteria(self::DB_COLUMN_NODE_ID         , $nodeInstance->getNodeId());
+               $searchInstance->addCriteria(self::DB_COLUMN_SESSION_ID      , $nodeInstance->getSessionId());
                $searchInstance->setLimit(1);
 
                // Query database and get a result instance back
@@ -209,7 +222,8 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
                // Cache result of if there is an entry, valid() will tell us if an entry is there
                $isRegistered = $resultInstance->valid();
 
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: isRegistered=' . intval($isRegistered) . ' - EXIT!');
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: isRegistered=' . intval($isRegistered) . ' - EXIT!');
 
                // Return result
                return $isRegistered;
@@ -221,7 +235,8 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
         * @return      void
         */
        public function registerLocalNode () {
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!');
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!');
 
                // Assert to make sure this method is called with no record in DB (the actual backend of the DHT)
                assert(!$this->isLocalNodeRegistered());
@@ -232,7 +247,8 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
                // "Insert" this dataset instance completely into the database
                $this->queryInsertDataSet($dataSetInstance);
 
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!');
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!');
        }
 
        /**
@@ -242,7 +258,8 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
         * @return      void
         */
        public function updateLocalNode () {
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!');
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!');
 
                // Assert to make sure this method is called with one record in DB (the actual backend of the DHT)
                assert($this->isLocalNodeRegistered());
@@ -266,7 +283,8 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
                // Update DHT database record
                $this->queryUpdateDataSet($dataSetInstance);
 
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!');
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!');
        }
 
        /**
@@ -276,7 +294,8 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
         * @return      $nodeData       Node data array
         */
        public function findNodeLocalBySessionId ($sessionId) {
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: sessionId=' . $sessionId . ' - CALLED!');
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: sessionId=' . $sessionId . ' - CALLED!');
 
                // Get search criteria
                $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
@@ -288,8 +307,10 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
                // Query database and get a result instance back
                $resultInstance = $this->doSelectByCriteria($searchInstance);
 
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: resultInstance->valid()=' . intval($resultInstance->valid()) . ' - EXIT!');
+
                // Return result instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: resultInstance->valid()=' . intval($resultInstance->valid()) . ' - EXIT!');
                return $resultInstance;
        }
 
@@ -297,11 +318,12 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
         * Registeres a node by given message data.
         *
         * @param       $messageData            An array of all message data
-        * @param       $handlerInstance        An instance of a Handleable class
+        * @param       $handlerInstance        An instance of a HandleableDataSet class
         * @return      void
         */
-       public function registerNodeByMessageData (array $messageData, Handleable $handlerInstance) {
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: handlerInstance=' . $handlerInstance->__toString() . ' - CALLED!');
+       public function registerNodeByMessageData (array $messageData, HandleableDataSet $handlerInstance) {
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: handlerInstance=' . $handlerInstance->__toString() . ' - CALLED!');
 
                // Get a data set instance
                $dataSetInstance = ObjectFactory::createObjectByConfiguredName('dataset_criteria_class', array(self::DB_TABLE_NODE_DHT));
@@ -318,19 +340,21 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
                // Run the "INSERT" query
                $this->queryInsertDataSet($dataSetInstance);
 
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . '] - EXIT!');
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . '] - EXIT!');
        }
 
        /**
         * Updates an existing entry in node list
         *
         * @param       $messageData            An array of all message data
-        * @param       $handlerInstance        An instance of a Handleable class
+        * @param       $handlerInstance        An instance of a HandleableDataSet class
         * @param       $searchInstance         An instance of LocalSearchCriteria class
         * @return      void
         */
-       public function updateNodeByMessageData (array $messageData, Handleable $handlerInstance, LocalSearchCriteria $searchInstance) {
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!');
+       public function updateNodeByMessageData (array $messageData, HandleableDataSet $handlerInstance, LocalSearchCriteria $searchInstance) {
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!');
 
                // Get a data set instance
                $dataSetInstance = ObjectFactory::createObjectByConfiguredName('dataset_criteria_class', array(self::DB_TABLE_NODE_DHT));
@@ -350,7 +374,8 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
                // Run the "UPDATE" query
                $this->queryUpdateDataSet($dataSetInstance);
 
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!');
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!');
        }
 
        /**
@@ -360,12 +385,14 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
         * @return      $isRegistered   Whether the given node data is already inserted
         */
        public function isNodeRegistered (array $nodeData) {
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!');
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!');
 
                // Assert on array elements
                assert(isset($nodeData[self::DB_COLUMN_NODE_ID]));
 
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: node-id=' . $nodeData[self::DB_COLUMN_NODE_ID]);
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: node-id=' . $nodeData[self::DB_COLUMN_NODE_ID]);
 
                // Get search criteria
                $searchInstance = $this->prepareSearchInstance($nodeData);
@@ -376,16 +403,16 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
                        $searchInstance,
                        // Only look for these array elements ("keys")
                        array(
-                               self::DB_COLUMN_NODE_ID     => TRUE,
-                               self::DB_COLUMN_EXTERNAL_IP => TRUE,
-                               self::DB_COLUMN_LISTEN_PORT => TRUE,
+                               self::DB_COLUMN_NODE_ID          => TRUE,
+                               self::DB_COLUMN_EXTERNAL_ADDRESS => TRUE
                        )
                );
 
                // Check if there is an entry
                $isRegistered = $resultInstance->valid();
 
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: isRegistered=' . intval($isRegistered) . ' - EXIT!');
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: isRegistered=' . intval($isRegistered) . ' - EXIT!');
 
                // Return registration status
                return $isRegistered;
@@ -400,6 +427,9 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
         * @throws      NodeAlreadyRegisteredException  If the node is already registered
         */
        public function registerNode (array $nodeData) {
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!');
+
                // Assert on array elements
                assert(isset($nodeData[self::DB_COLUMN_NODE_ID]));
 
@@ -411,6 +441,9 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
 
                // @TODO Unimplemented part
                $this->partialStub('nodeData=' . print_r($nodeData, TRUE));
+
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!');
        }
 
        /**
@@ -423,11 +456,14 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
         * @throws      NodeDataMissingException        If the node's data is missing
         */
        public function updateNode (array $nodeData) {
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!');
+
                // Assert on array elements
                assert(isset($nodeData[self::DB_COLUMN_NODE_ID]));
 
                // Debug message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: Updating DHT entry for node-id=' . $nodeData[self::DB_COLUMN_NODE_ID] . ' ...');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: Updating DHT entry for node-id=' . $nodeData[self::DB_COLUMN_NODE_ID] . ' ...');
 
                // Is the node registered?
                if (!$this->isNodeRegistered($nodeData)) {
@@ -451,7 +487,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
                $nodeInstance = NodeObjectFactory::createNodeInstance();
 
                // Debug message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: nodeData=' . print_r($nodeData, TRUE));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: nodeData=' . print_r($nodeData, TRUE));
 
                // Add all array elements
                $nodeInstance->addArrayToDataSet($dataSetInstance, $nodeData);
@@ -461,6 +497,9 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
 
                // Run the "UPDATE" query
                $this->queryUpdateDataSet($dataSetInstance);
+
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!');
        }
 
        /**
@@ -485,6 +524,9 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
                // Check pending entries
                $hasUnpublished = $this->unpublishedEntriesInstance->valid();
 
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!');
+
                // Return it
                return $hasUnpublished;
        }
@@ -498,6 +540,9 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
         * @todo        Add timestamp to dataset instance
         */
        public function initEntryPublication () {
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!');
+
                /*
                 * Make sure that hasUnpublishedEntries() has been called first by
                 * asserting on the "cached" object instance. This "caching" saves some
@@ -526,6 +571,9 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
 
                // Run the "UPDATE" query
                $this->queryUpdateDataSet($dataSetInstance);
+
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!');
        }
 
        /**
@@ -551,7 +599,8 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
         * @return      $recipients             An indexed array with DHT recipients
         */
        public function getResultFromExcludedSender (array $packageData) {
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!');
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!');
 
                // Assert on required array field
                assert(isset($packageData[NetworkPackage::PACKAGE_DATA_SENDER]));
@@ -571,7 +620,8 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
                // Get a result instance back from DHT database wrapper.
                $resultInstance = $this->doSelectByCriteria($searchInstance);
 
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!');
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!');
 
                // Return result instance
                return $resultInstance;
@@ -586,6 +636,9 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
         * @return      $recipients             An indexed array with DHT recipients
         */
        public function getResultFromKeyValue ($key, $value) {
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!');
+
                // Get max recipients
                $maxRecipients = $this->getConfigInstance()->getConfigEntry('max_dht_recipients');
 
@@ -598,6 +651,9 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
                // Get a result instance back from DHT database wrapper.
                $resultInstance = $this->doSelectByCriteria($searchInstance);
 
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!');
+
                // Return result instance
                return $resultInstance;
        }
index 79a5c701a8527e35de66f7783aa74082386742bf..a7632edb8dd237b9ee68381c716d06916e37d469 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -32,6 +32,8 @@ class NodeInformationDatabaseWrapper extends BaseDatabaseWrapper implements Node
        const DB_COLUMN_PRIVATE_KEY      = 'private_key';
        const DB_COLUMN_PRIVATE_KEY_HASH = 'private_key_hash';
        const DB_COLUMN_NODE_MODE        = 'node_mode';
+       const DB_COLUMN_INTERNAL_UNL     = 'internal_unl';
+       const DB_COLUMN_EXTERNAL_UNL     = 'external_unl';
 
        /**
         * Protected constructor
index 1c740fdb0a0ebd7730ff90e9f7677fbb634dd3aa..63ef594b458b57b1ff537da8d930602173d37357 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -188,7 +188,7 @@ class PeerStateLookupDatabaseWrapper extends BaseDatabaseWrapper implements Look
                $senderData = explode(':', HubTools::resolveSessionId($packageData[NetworkPackage::PACKAGE_DATA_SENDER]));
 
                // Just make sure that 'invalid:invalid' is not being processed
-               assert(($senderData[0] != 'invalid') && ($senderData[1] != 'invalid'));
+               assert(($senderData[0] != 'invalid') && ($senderData[1] != 'invalid') && ($senderData[2] != 'invalid'));
 
                // Add ip address and port
                $dataSetInstance->addCriteria(self::DB_COLUMN_PEER_IP  , $senderData[0]);
index 136a8a8993d84add6e694f75ebbf438ae3d4dd2a..a5b83f22fbf1f280a534d0825d54b7bc5d02672e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 329bedd5a94590958e094855f39100a219a6f53e..ef84ef3071ebe716f8392f9741e9f3f88c363624 100644 (file)
@@ -4,7 +4,7 @@
 
 @author                Roland Haeder <webmaster@ship-simu.org>
 @version       0.0.0
-@copyright     Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+@copyright     Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
 @license       GNU GPL 3.0 or any newer version
 @link          http://www.ship-simu.org
 
index 0243619748b0beaee261d09c912ff3b31af4ba92..b8c1dcb320017103e218149ec0f71223319a366c 100644 (file)
@@ -5,7 +5,7 @@ Please use config.php/config-local.php files at application/hub/ instead.
 
 @author                Roland Haeder <webmaster@ship-simu.org>
 @version       0.0.0
-@copyright     Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+@copyright     Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
 @license       GNU GPL 3.0 or any newer version
 @link          http://www.ship-simu.org
 
@@ -33,12 +33,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
                <session-id>{?session_id?}</session-id>
                <!-- Data from our listeners (e.g. which port) //-->
                <listener>
-                       <!-- Public external IP address //-->
-                       <external-ip>{?external_ip?}</external-ip>
-                       <!-- Private internal IP address //-->
-                       <internal-ip>{?internal_ip?}</internal-ip>
-                       <!-- Listener ports for both connections //-->
-                       <listen-port>{?node_listen_port?}</listen-port>
+                       <!-- Public external address //-->
+                       <external-address>{?external_address?}</external-address>
+                       <!-- Private internal address //-->
+                       <internal-address>{?internal_address?}</internal-address>
                </listener>
        </announcement-data>
 </announcement>
index cf57528d62e83115d0990467a4f0f4dee371aaf4..ce2e18eee397c2a53b54899616e662d7fa0e5777 100644 (file)
@@ -5,7 +5,7 @@ be used to indicate that this node does not want to receive announcements.
 
 @author                Roland Haeder <webmaster@ship-simu.org>
 @version       0.0.0
-@copyright     Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+@copyright     Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
 @license       GNU GPL 3.0 or any newer version
 @link          http://www.ship-simu.org
 
@@ -28,17 +28,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
        //-->
        <my-data>
                <!--
-               This node's external IP/hostname
+               This node's external address
                //-->
-               <my-external-ip>{?my_external_ip?}</my-external-ip>
+               <my-external-address>{?my_external_address?}</my-external-address>
                <!--
-               This node's internal IP/hostname
+               This node's internal address
                //-->
-               <my-internal-ip>{?my_internal_ip?}</my-internal-ip>
-               <!--
-               This node's TCP/UDP listen port
-               //-->
-               <my-listen-port>{?my_listen_port?}</my-listen-port>
+               <my-internal-address>{?my_internal_address?}</my-internal-address>
                <!--
                This node's session id
                //-->
@@ -54,13 +50,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
        //-->
        <your-data>
                <!--
-               Other node's external IP/hostname
+               Other node's external address
                //-->
-               <your-external-ip>{?your_external_ip?}</your-external-ip>
+               <your-external-address>{?your_external_address?}</your-external-address>
                <!--
-               Other node's internal IP/hostname
+               Other node's internal address
                //-->
-               <your-internal-ip>{?your_internal_ip?}</your-internal-ip>
+               <your-internal-address>{?your_internal_address?}</your-internal-address>
                <!--
                Other node's session id
                //-->
index e4b40d099724d606aa8cc4112e3a0f622a433f37..d30993ad7ccff6bea71ad5529591acfbf4335952 100644 (file)
@@ -6,7 +6,7 @@ DHT bootstrap requests.
 
 @author                Roland Haeder <webmaster@ship-simu.org>
 @version       0.0.0
-@copyright     Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+@copyright     Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
 @license       GNU GPL 3.0 or any newer version
 @link          http://www.ship-simu.org
 
@@ -29,17 +29,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
        //-->
        <my-data>
                <!--
-               This node's external IP/hostname
+               This node's external address
                //-->
-               <my-external-ip>{?my_external_ip?}</my-external-ip>
+               <my-external-address>{?my_external_address?}</my-external-address>
                <!--
-               This node's internal IP/hostname
+               This node's internal address
                //-->
-               <my-internal-ip>{?my_internal_ip?}</my-internal-ip>
-               <!--
-               This node's TCP/UDP listen port
-               //-->
-               <my-listen-port>{?my_listen_port?}</my-listen-port>
+               <my-internal-address>{?my_internal_address?}</my-internal-address>
                <!--
                This node's session id
                //-->
@@ -55,13 +51,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
        //-->
        <your-data>
                <!--
-               Other node's external IP/hostname
+               Other node's external address
                //-->
-               <your-external-ip>{?your_external_ip?}</your-external-ip>
+               <your-external-address>{?your_external_address?}</your-external-address>
                <!--
-               Other node's internal IP/hostname
+               Other node's internal address
                //-->
-               <your-internal-ip>{?your_internal_ip?}</your-internal-ip>
+               <your-internal-address>{?your_internal_address?}</your-internal-address>
                <!--
                Other node's session id
                //-->
index c9407b0ae6878b2df9b4b3605a64dd4b74075ade..f795ce423ca02c4cc987816faac9c53e6641fe8a 100644 (file)
@@ -4,7 +4,7 @@ An XML template for answering node-list requests
 
 @author                Roland Haeder <webmaster@ship-simu.org>
 @version       0.0.0
-@copyright     Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+@copyright     Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
 @license       GNU GPL 3.0 or any newer version
 @link          http://www.ship-simu.org
 
index 5342f2914c347bc7332b8b28be9d8d4e7e55ecf3..75d26009a0322c7cdf94e17a42250168fcfd3e45 100644 (file)
@@ -4,7 +4,7 @@ A XML template for the producer to produce test units
 
 @author                Roland Haeder <webmaster@ship-simu.org>
 @version       0.0.0
-@copyright     Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+@copyright     Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
 @license       GNU GPL 3.0 or any newer version
 @link          http://www.ship-simu.org
 
index 7268d6dfcb40fdd1f0ddbb926986d418f5886c01..ee9460fd3f6c1ff1c873144d5cf14cff13373697 100644 (file)
@@ -4,7 +4,7 @@ A XML template for the producer to produce work units
 
 @author                Roland Haeder <webmaster@ship-simu.org>
 @version       0.0.0
-@copyright     Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+@copyright     Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
 @license       GNU GPL 3.0 or any newer version
 @link          http://www.ship-simu.org
 
index e3ca8e6b90b807dccb24e5db8170c0d84f3799b7..ba0a81ea1b1eb59289ffadc121208fd967303d41 100644 (file)
@@ -4,7 +4,7 @@ An XML for DHT bootstrapping
 
 @author                Roland Haeder <webmaster@ship-simu.org>
 @version       0.0.0
-@copyright     Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+@copyright     Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
 @license       GNU GPL 3.0 or any newer version
 @link          http://www.ship-simu.org
 
@@ -42,12 +42,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
                <session-id>{?session_id?}</session-id>
                <!-- Data from our listeners (e.g. which port) //-->
                <listener>
-                       <!-- Public external IP address //-->
-                       <external-ip>{?external_ip?}</external-ip>
-                       <!-- Private internal IP address //-->
-                       <internal-ip>{?internal_ip?}</internal-ip>
-                       <!-- Listener ports for both connections //-->
-                       <listen-port>{?node_listen_port?}</listen-port>
+                       <!-- Public external address //-->
+                       <external-address>{?external_address?}</external-address>
+                       <!-- Private internal address //-->
+                       <internal-address>{?internal_address?}</internal-address>
                </listener>
        </dht-bootstrap-data>
 </dht-bootstrap>
index 0d2ad9ef2133f937da9bff869c2a3a320d3bf4d3..156f0d249f3f1e206d10c51c20f35c11035bd720 100644 (file)
@@ -4,7 +4,7 @@ An XML for DHTs publishing their entries
 
 @author                Roland Haeder <webmaster@ship-simu.org>
 @version       0.0.0
-@copyright     Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+@copyright     Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
 @license       GNU GPL 3.0 or any newer version
 @link          http://www.ship-simu.org
 
@@ -37,7 +37,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
 Array
 (
     [node_mode] => regular
-    [external_ip] => 192.168.2.3
+    [external_address] => 192.168.2.3
     [listen_port] => 9061
     [node_id] => 38fc625d3d9aa05654bfc90a7aea7ff72c883f1573
     [session_id] => 38fc625d3dabe9ff09b54253b298e91985191472a3
@@ -61,10 +61,8 @@ Array
                <accepted-object-types>{?accepted_object_types?}</accepted-object-types>
                <!-- Data from our listeners (e.g. which port) //-->
                <listener>
-                       <!-- Public external IP address //-->
-                       <external-ip>{?external_ip?}</external-ip>
-                       <!-- Listener ports for both connections //-->
-                       <listen-port>{?listen_port?}</listen-port>
+                       <!-- Public external address //-->
+                       <external-address>{?external_address?}</external-address>
                </listener>
        </publish-data>
 </publish>
index f957d1e88694de0608be8c446261523caeff8b29..b8c8db0a935753ec3766ae99c786816896b496eb 100644 (file)
@@ -4,7 +4,7 @@ All valid node status.
 
 @author                Roland Haeder <webmaster@ship-simu.org>
 @version       0.0.0
-@copyright     Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+@copyright     Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
 @license       GNU GPL 3.0 or any newer version
 @link          http://www.ship-simu.org
 
index a83a1838019afc4e9ea7df946b508eb3dff45c7a..cb8966b5ba1503036f530061df604e62befbf759 100644 (file)
@@ -5,7 +5,7 @@ here.
 
 @author                Roland Haeder <webmaster@ship-simu.org>
 @version       0.0.0
-@copyright     Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+@copyright     Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
 @license       GNU GPL 3.0 or any newer version
 @link          http://www.ship-simu.org
 
@@ -56,8 +56,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
                        //-->
                        <object-max-spread>1</object-max-spread>
                        <!--
-                       The protocol we should use for transmission. Valid values can be
-                       'tcp' or 'udp', without the quotes.
+                       The protocol we should use for transmission. Valid is 'unl' without
+                       the quotes.
                        //-->
                        <object-protocol>tcp</object-protocol>
                        <!--
@@ -74,49 +74,49 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
                        <object-name>self_connect</object-name>
                        <object-recipient-limitation>self</object-recipient-limitation>
                        <object-max-spread>self</object-max-spread>
-                       <object-protocol>tcp</object-protocol>
+                       <object-protocol>unl</object-protocol>
                        <object-recipient-type>hub</object-recipient-type>
                </object-list-entry>
                <object-list-entry>
                        <object-name>announcement_answer</object-name>
                        <object-recipient-limitation>direct</object-recipient-limitation>
                        <object-max-spread>1</object-max-spread>
-                       <object-protocol>tcp</object-protocol>
+                       <object-protocol>unl</object-protocol>
                        <object-recipient-type>hub</object-recipient-type>
                </object-list-entry>
                <object-list-entry>
                        <object-name>request_node_list</object-name>
                        <object-recipient-limitation>upper</object-recipient-limitation>
                        <object-max-spread>1</object-max-spread>
-                       <object-protocol>tcp</object-protocol>
+                       <object-protocol>unl</object-protocol>
                        <object-recipient-type>hub</object-recipient-type>
                </object-list-entry>
                <object-list-entry>
                        <object-name>request_node_list_answer</object-name>
                        <object-recipient-limitation>direct</object-recipient-limitation>
                        <object-max-spread>1</object-max-spread>
-                       <object-protocol>tcp</object-protocol>
+                       <object-protocol>unl</object-protocol>
                        <object-recipient-type>hub</object-recipient-type>
                </object-list-entry>
                <object-list-entry>
                        <object-name>dht_bootstrap</object-name>
                        <object-recipient-limitation>all</object-recipient-limitation>
                        <object-max-spread>3</object-max-spread>
-                       <object-protocol>tcp</object-protocol>
-                       <object-recipient-type>all</object-recipient-type>
+                       <object-protocol>unl</object-protocol>
+                       <object-recipient-type>hub</object-recipient-type>
                </object-list-entry>
                <object-list-entry>
                        <object-name>dht_bootstrap_answer</object-name>
                        <object-recipient-limitation>direct</object-recipient-limitation>
                        <object-max-spread>1</object-max-spread>
-                       <object-protocol>tcp</object-protocol>
+                       <object-protocol>unl</object-protocol>
                        <object-recipient-type>hub</object-recipient-type>
                </object-list-entry>
                <object-list-entry>
                        <object-name>dht_publish_entry</object-name>
                        <object-recipient-limitation>all</object-recipient-limitation>
                        <object-max-spread>4</object-max-spread>
-                       <object-protocol>tcp</object-protocol>
+                       <object-protocol>unl</object-protocol>
                        <object-recipient-type>hub</object-recipient-type>
                </object-list-entry>
        </object-list>
index b778d99f7217fe3acd2c36ff7e06706d05ffc46a..7d71b8223fc8c62c39b8322d13ac5583697faa1e 100644 (file)
@@ -5,7 +5,7 @@ transmitted.
 
 @author                Roland Haeder <webmaster@ship-simu.org>
 @version       0.0.0
-@copyright     Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+@copyright     Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
 @license       GNU GPL 3.0 or any newer version
 @link          http://www.ship-simu.org
 
index 6e2a70ff4bb60e11b4915b9433bb0496767e4de4..236ef9e8b931441eb630ff6ed7f924495fa3b1d2 100644 (file)
@@ -4,7 +4,7 @@ A descriptor XML file for self-connect attempts
 
 @author                Roland Haeder <webmaster@ship-simu.org>
 @version       0.0.0
-@copyright     Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+@copyright     Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
 @license       GNU GPL 3.0 or any newer version
 @link          http://www.ship-simu.org
 
diff --git a/core b/core
index 7c82fc25abc53c41e45953f4c3d9f50ed982b75c..3288f03df9e42997670846535cc0390f080599e5 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit 7c82fc25abc53c41e45953f4c3d9f50ed982b75c
+Subproject commit 3288f03df9e42997670846535cc0390f080599e5
diff --git a/find-bad-php.sh b/find-bad-php.sh
new file mode 100755 (executable)
index 0000000..1d530b3
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+echo "$0: Searching for PHP scripts (except 3rd party) ..."
+PHP=`find -type f -name "*.php" | grep -v "third_party"`
+
+for SCRIPT in ${PHP};
+do
+       HEADER=`cat ${SCRIPT} | head -n 1 | grep -v "<?"`
+
+       FOOTER=`cat ${SCRIPT} | tail -n 1 | grep -v "?>"`
+
+       if [ -n "${HEADER}" ];
+       then
+               echo "$0: Script '${SCRIPT}' has non-typical header."
+       fi
+
+       if [ -n "${FOOTER}" ];
+       then
+               echo "$0: Script '${SCRIPT}' has non-typical footer."
+       fi
+done
+
+echo "$0: All done."
+exit 0
index 7f50305198824161c6ac9ff68dd394583e2721c2..ebd9cba1dde5e71fe9d8797d27013e7c699d3106 100644 (file)
--- a/index.php
+++ b/index.php
@@ -9,7 +9,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *