Package jadex.platform.service.registry
Class SuperpeerRegistryAgent
- java.lang.Object
- 
- jadex.platform.service.registry.SuperpeerRegistryAgent
 
- 
- All Implemented Interfaces:
- IRemoteRegistryService,- ISuperpeerCollaborationService,- ISuperpeerService,- ISuperpeerStatusService
 
 public class SuperpeerRegistryAgent extends java.lang.Object implements ISuperpeerService, ISuperpeerCollaborationService, ISuperpeerStatusService Super peer collects services from client and answers search requests and queries.
- 
- 
Field SummaryFields Modifier and Type Field Description protected IInternalAccessagentThe agent.protected MultiCollection<IComponentIdentifier,ServiceQueryInfo<?>>clientqueriesQueries received from client.protected java.util.Set<IComponentIdentifier>clientsprotected MultiCollection<java.lang.String,IServiceRegistry>peercachesLookup for remote peer caches by network.protected java.util.Set<SubscriptionIntermediateFuture<IComponentIdentifier>>reglistenersprotected IServiceRegistryserviceregistryThe superpeer service registryprotected booleanunrestricted- 
Fields inherited from interface jadex.bridge.service.types.registry.IRemoteRegistryServiceREMOTE_REGISTRY_NAME
 
- 
 - 
Constructor SummaryConstructors Constructor Description SuperpeerRegistryAgent()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> ISubscriptionIntermediateFuture<T>addIntransitiveQuery(ServiceQuery<T> query)Add a service query to the superpeer registry only.protected voidaddPeer(ISuperpeerCollaborationService peer)Adds a peer.<T> ISubscriptionIntermediateFuture<T>addQuery(ServiceQuery<T> query)Add a service query to the registry.protected voiddispatchEventToRegistry(IServiceRegistry registry, ServiceEvent<IServiceIdentifier> event)Dispatches a service event to a target registry.protected voiddoRemoveQuery(IComponentIdentifier client, ServiceQuery<?> query)protected java.util.Set<IServiceRegistry>getApplicablePeers(ServiceQuery<?> query)Returns all peers applicable to a query.ISubscriptionIntermediateFuture<IComponentIdentifier>getRegisteredClients()Get the clients that are currently registered to super peer.IFuture<IServiceIdentifier>intransitiveSearchService(ServiceQuery<?> query)Search superpeer for a single service, restricted to the called superpeer.IFuture<java.util.Set<IServiceIdentifier>>intransitiveSearchServices(ServiceQuery<?> query)Search superpeer for services, restricted to the called superpeer.ISubscriptionIntermediateFuture<java.lang.Void>registerClient(java.lang.String networkname)Initiates the client registration procedure (super peer will answer initially with an empty intermediate result, client will send updates with backward commands).IFuture<IServiceIdentifier>searchService(ServiceQuery<?> query)Search remote registry for a single service.IFuture<java.util.Set<IServiceIdentifier>>searchServices(ServiceQuery<?> query)Search remote registry for services.
 
- 
- 
- 
Field Detail- 
agentprotected IInternalAccess agent The agent.
 - 
serviceregistryprotected IServiceRegistry serviceregistry The superpeer service registry
 - 
unrestrictedprotected boolean unrestricted 
 - 
clientqueriesprotected MultiCollection<IComponentIdentifier,ServiceQueryInfo<?>> clientqueries Queries received from client.
 - 
peercachesprotected MultiCollection<java.lang.String,IServiceRegistry> peercaches Lookup for remote peer caches by network.
 - 
reglistenersprotected java.util.Set<SubscriptionIntermediateFuture<IComponentIdentifier>> reglisteners 
 - 
clientsprotected java.util.Set<IComponentIdentifier> clients 
 
- 
 - 
Method Detail- 
registerClientpublic ISubscriptionIntermediateFuture<java.lang.Void> registerClient(java.lang.String networkname) Initiates the client registration procedure (super peer will answer initially with an empty intermediate result, client will send updates with backward commands).- Specified by:
- registerClientin interface- ISuperpeerService
- Parameters:
- networkname- Network for this connection.
- Returns:
- Does not return any more results while connection is running.
 
 - 
searchServicepublic IFuture<IServiceIdentifier> searchService(ServiceQuery<?> query) Search remote registry for a single service.- Specified by:
- searchServicein interface- IRemoteRegistryService
- Parameters:
- query- The search query.
- Returns:
- The first matching service or null if not found.
 
 - 
searchServicespublic IFuture<java.util.Set<IServiceIdentifier>> searchServices(ServiceQuery<?> query) Search remote registry for services.- Specified by:
- searchServicesin interface- IRemoteRegistryService
- Parameters:
- query- The search query.
- Returns:
- The matching services or empty set if none are found.
 
 - 
addQuerypublic <T> ISubscriptionIntermediateFuture<T> addQuery(ServiceQuery<T> query) Add a service query to the registry.- Specified by:
- addQueryin interface- ISuperpeerService
- Parameters:
- query- The service query.
- Returns:
- Subscription to matching services.
 
 - 
intransitiveSearchServicepublic IFuture<IServiceIdentifier> intransitiveSearchService(ServiceQuery<?> query) Search superpeer for a single service, restricted to the called superpeer.- Specified by:
- intransitiveSearchServicein interface- ISuperpeerCollaborationService
- Parameters:
- query- The search query.
- Returns:
- The first matching service or null if not found.
 
 - 
intransitiveSearchServicespublic IFuture<java.util.Set<IServiceIdentifier>> intransitiveSearchServices(ServiceQuery<?> query) Search superpeer for services, restricted to the called superpeer.- Specified by:
- intransitiveSearchServicesin interface- ISuperpeerCollaborationService
- Parameters:
- query- The search query.
- Returns:
- The matching services or empty set if none are found.
 
 - 
addIntransitiveQuerypublic <T> ISubscriptionIntermediateFuture<T> addIntransitiveQuery(ServiceQuery<T> query) Add a service query to the superpeer registry only.- Specified by:
- addIntransitiveQueryin interface- ISuperpeerCollaborationService
- Parameters:
- query- The service query.
- Returns:
- Subscription to matching services.
 
 - 
doRemoveQueryprotected void doRemoveQuery(IComponentIdentifier client, ServiceQuery<?> query) 
 - 
addPeerprotected void addPeer(ISuperpeerCollaborationService peer) Adds a peer.- Parameters:
- peer- The peer.
 
 - 
getApplicablePeersprotected java.util.Set<IServiceRegistry> getApplicablePeers(ServiceQuery<?> query) Returns all peers applicable to a query.- Parameters:
- query- The query.
- Returns:
- Applicable peers.
 
 - 
dispatchEventToRegistryprotected void dispatchEventToRegistry(IServiceRegistry registry, ServiceEvent<IServiceIdentifier> event) Dispatches a service event to a target registry.- Parameters:
- registry- The registry.
- event- The service event.
 
 - 
getRegisteredClientspublic ISubscriptionIntermediateFuture<IComponentIdentifier> getRegisteredClients() Get the clients that are currently registered to super peer.- Specified by:
- getRegisteredClientsin interface- ISuperpeerStatusService
 
 
- 
 
-