Package jadex.platform.service.registry
Class SuperpeerClientAgent.NetworkManager
- java.lang.Object
-
- jadex.platform.service.registry.SuperpeerClientAgent.NetworkManager
-
- Enclosing class:
- SuperpeerClientAgent
protected class SuperpeerClientAgent.NetworkManager extends java.lang.Object
Manage the connection to a superpeer for a given network.
-
-
Field Summary
Fields Modifier and Type Field Description protected ISubscriptionIntermediateFuture<java.lang.Void>
connection
The connection to the super peer.protected boolean
global
The flag indicating that the network is actually the global network (cached for speed/readability).protected ISubscriptionIntermediateFuture<ServiceEvent<IServiceIdentifier>>
localquery
Query on the local registry used to transmit changes to super peer.protected java.lang.String
networkname
The managed network (i.e.protected boolean
running
The flag to indicate the manager should be active.protected ISuperpeerService
superpeer
The current super peer connections for each network (only set when found, i.e.protected ISubscriptionIntermediateFuture<ISuperpeerService>
superpeerquery
The current query future for available super peers for a given network (only set while searching for the network).
-
Constructor Summary
Constructors Modifier Constructor Description protected
NetworkManager(java.lang.String networkname)
Create and start a network manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T> void
addWaitingQuery(SuperpeerClientAgent.QueryManager<T> qmanager)
When no connection to network -> remember query until connection established.protected <T> void
removeWaitingQuery(SuperpeerClientAgent.QueryManager<T> qmanager)
Maybe remove query, if still waiting but terminated by user.protected void
startSuperpeerSearch()
Find a super peer for a given network.protected void
stop()
Disconnect and stop all activity, if any.
-
-
-
Field Detail
-
networkname
protected java.lang.String networkname
The managed network (i.e. network name).
-
global
protected boolean global
The flag indicating that the network is actually the global network (cached for speed/readability).
-
running
protected boolean running
The flag to indicate the manager should be active.
-
superpeerquery
protected ISubscriptionIntermediateFuture<ISuperpeerService> superpeerquery
The current query future for available super peers for a given network (only set while searching for the network).
-
superpeer
protected ISuperpeerService superpeer
The current super peer connections for each network (only set when found, i.e. when not searching for the network).
-
connection
protected ISubscriptionIntermediateFuture<java.lang.Void> connection
The connection to the super peer.
-
localquery
protected ISubscriptionIntermediateFuture<ServiceEvent<IServiceIdentifier>> localquery
Query on the local registry used to transmit changes to super peer.
-
-
Method Detail
-
stop
protected void stop()
Disconnect and stop all activity, if any.
-
startSuperpeerSearch
protected void startSuperpeerSearch()
Find a super peer for a given network. Query is automatically restarted on failure.- Parameters:
networkname
- The network.
-
addWaitingQuery
protected <T> void addWaitingQuery(SuperpeerClientAgent.QueryManager<T> qmanager)
When no connection to network -> remember query until connection established.
-
removeWaitingQuery
protected <T> void removeWaitingQuery(SuperpeerClientAgent.QueryManager<T> qmanager)
Maybe remove query, if still waiting but terminated by user.
-
-