
public final class ServiceBusImpl extends AbstractBus implements ServiceBus
| Modifier and Type | Class and Description |
|---|---|
static class |
ServiceBusImpl.CallInjectorImpl |
ServiceBus.CallInjectorbusStrategy, communicationModule, context, OPTIONAL_URI_PREFIX, registry, spaceManagerLOG_MATCHING_END, LOG_MATCHING_MISMATCH, LOG_MATCHING_MISMATCH_CODE, LOG_MATCHING_MISMATCH_DETAILS, LOG_MATCHING_NOSUCCESS, LOG_MATCHING_PROFILE, LOG_MATCHING_PROFILES_END, LOG_MATCHING_PROVIDER_END, LOG_MATCHING_START, LOG_MATCHING_SUCCESS| Modifier and Type | Method and Description |
|---|---|
void |
addAvailabilitySubscription(String callerID,
AvailabilitySubscriber subscriber,
ServiceRequest request)
Adds an availability subscription, in other words a listener, to receive
events about the availability of services matching the given request.
|
void |
addNewServiceProfiles(String calleeID,
ServiceProfile[] realizedServices,
boolean throwOnDuplicateReg)
Registers (advertises) new services (by providing descriptions of them)
that will be provided by the ServiceCallee with the specified ID.
|
void |
assessContentSerialization(Resource content) |
void |
brokerReply(String calleeID,
BusMessage response)
Can be used by ServiceCallees to send a response to the bus which will be
delivered to the caller who initiated the initial request.
|
void |
brokerRequest(String callerID,
BusMessage request)
Can be used by ServiceCallers to send a request to the bus.
|
protected BusStrategy |
createBusStrategy(CommunicationModule commModule) |
ServiceProfile[] |
getAllServices(String callerID)
A method used to retrieve the descriptions of all services advertised on
the service bus.
|
HashMap<String,List<ServiceProfile>> |
getMatchingServices(String s)
Get all service profiles that describe services of the given service
class.
|
ServiceProfile[] |
getMatchingServices(String callerID,
Service s)
Get all service profiles that describe services that match the given
template in terms of "query by example".
|
ServiceProfile[] |
getMatchingServices(String callerID,
String s)
Get all service profiles that describe services of the given service
class.
|
ServiceProfile[] |
getMatchingServices(String callerID,
String[] keywords)
This version of the method accepts simple keyword-based queries about
registered services.
|
static ModuleContext |
getModuleContext() |
static Object[] |
getServiceBusFetchParams() |
static Object[] |
getServiceBusInjectFetchParams() |
void |
handleSendError(ChannelMessage message,
CommunicationConnectorException e)
Callback for error handling
|
void |
removeAvailabilitySubscription(String callerID,
AvailabilitySubscriber subscriber,
String requestURI)
Removes an availability subscription from the bus, which was previously
added using
addAvailabilitySubscription method. |
void |
removeMatchingProfiles(String calleeID,
ServiceProfile[] realizedServices)
Removes specified service profiles that were previously registered by the
ServiceCalee with the specified ID.
|
static void |
startModule(ModuleContext mc,
Object[] serviceBusShareParams,
Object[] serviceBusFetchParams,
Object[] serviceBusInjectShareParams,
Object[] serviceBusInjectFetchParams) |
static void |
stopModule() |
void |
unregister(String memberID,
BusMember m)
Unregisters bus member from the bus (if the bus member with given ID
exists).
|
void |
unregister(String calleeID,
ServiceCallee callee)
Unregisters a service callee from the bus.
|
void |
unregister(String callerID,
ServiceCaller caller)
Unregisters a service caller from the bus.
|
addRegistryListener, brokerMessage, createBusSpecificID, createRegistry, dispose, getBrokerName, getBusMember, getBusMemberID, getBusMembers, getBusMembersByID, getCurrentNumberOfPeers, getPeerCard, getPeerFromBusResourceURI, getURI, init, initBrokerage, isBusResourceURI, isValidMember, messageReceived, register, removeRegistryListener, unmarshallpublic static Object[] getServiceBusFetchParams()
public static Object[] getServiceBusInjectFetchParams()
public void assessContentSerialization(Resource content)
public static void startModule(ModuleContext mc, Object[] serviceBusShareParams, Object[] serviceBusFetchParams, Object[] serviceBusInjectShareParams, Object[] serviceBusInjectFetchParams)
public static void stopModule()
public static ModuleContext getModuleContext()
public void addAvailabilitySubscription(String callerID, AvailabilitySubscriber subscriber, ServiceRequest request)
ServiceBusaddAvailabilitySubscription in interface ServiceBuscallerID - the ID of the caller that is registering a subscriber.subscriber - the object which will be notified when matching services are
advertised or removed from the service bus.request - the request to which newly registered or unregistered services
must match in order to notify the subscriber about the
corresponding events.ServiceBus.addAvailabilitySubscription(String,
AvailabilitySubscriber, ServiceRequest)public void addNewServiceProfiles(String calleeID, ServiceProfile[] realizedServices, boolean throwOnDuplicateReg)
ServiceBusaddNewServiceProfiles in interface ServiceBuscalleeID - the ID of the ServiceCallee that is advertising new services
on the service bus.realizedServices - the description of the new services in terms of an array of
service profiles.throwOnDuplicateReg - Specifies whether this method should throw an exception or
just ignore it when a profile is registered with a process URI
that is already registered.org.universAAL.middleware.service.ServiceBus#addNewServiceProfiles(String,
ServiceProfile[])public ServiceProfile[] getAllServices(String callerID)
ServiceBusgetAllServices in interface ServiceBuscallerID - the ID of the caller that is asking the service bus.ServiceBus.getAllServices(String)public ServiceProfile[] getMatchingServices(String callerID, Service s)
ServiceBusgetMatchingServices in interface ServiceBuscallerID - the ID of the caller that is asking the service bus.s - the template to be used for making a "query by example"..ServiceBus.getMatchingServices(String, Service)public ServiceProfile[] getMatchingServices(String callerID, String s)
ServiceBusgetMatchingServices in interface ServiceBuscallerID - the ID of the caller that is asking the service bus.s - the URI of the desired service class.ServiceBus#getMatchingService(String, String)public HashMap<String,List<ServiceProfile>> getMatchingServices(String s)
ServiceBusgetMatchingServices in interface ServiceBuss - the URI of the desired service class.ServiceBus#getMatchingService(String)public ServiceProfile[] getMatchingServices(String callerID, String[] keywords)
ServiceBusgetMatchingServices in interface ServiceBuscallerID - the ID of the caller that is asking the service bus.keywords - the set of keywords to be used for textual match.ServiceBus.getMatchingServices(String, String[])public void removeAvailabilitySubscription(String callerID, AvailabilitySubscriber subscriber, String requestURI)
ServiceBusaddAvailabilitySubscription method.removeAvailabilitySubscription in interface ServiceBuscallerID - the ID of the caller that owns the listenersubscriber - the listeners registered by the callerrequestURI - the URI of the request used previously for subscriptionServiceBus.removeAvailabilitySubscription(String,
AvailabilitySubscriber, String)public void removeMatchingProfiles(String calleeID, ServiceProfile[] realizedServices)
ServiceBusremoveMatchingProfiles in interface ServiceBuscalleeID - the ID of the ServiceCalee that owns the service profiles.realizedServices - the service profiles to be removed.ServiceBus#removeMatchingRegParams(String, ServiceProfile[])public void brokerReply(String calleeID, BusMessage response)
ServiceBusbrokerReply in interface ServiceBuscalleeID - the ID of the service callee which processed the request.response - the actual response message.AbstractBus.brokerMessage(String, BusMessage)public void brokerRequest(String callerID, BusMessage request)
ServiceBusServiceBus.brokerReply(String, BusMessage). The bus
will then inform the original requester (the ServiceCaller that has
called this method) about the result.brokerRequest in interface ServiceBuscallerID - the ID of the caller that is sending the request.request - the actual request message.AbstractBus.brokerMessage(String, BusMessage)public void unregister(String calleeID, ServiceCallee callee)
ServiceBusunregister in interface ServiceBuscalleeID - the ID of the callee to be unregistered.callee - the ServiceCallee object to be unregistered.ServiceBus.unregister(String, ServiceCallee)public void unregister(String callerID, ServiceCaller caller)
ServiceBusunregister in interface ServiceBuscallerID - the ID of the caller to be unregistered.caller - the ServiceCaller object to be unregistered.ServiceBus.unregister(String, ServiceCaller)public void unregister(String memberID, BusMember m)
AbstractBusunregister in class AbstractBusprotected BusStrategy createBusStrategy(CommunicationModule commModule)
createBusStrategy in class AbstractBuspublic void handleSendError(ChannelMessage message, CommunicationConnectorException e)
MessageListenerhandleSendError in interface MessageListenerCopyright © 2018 universAAL Consortium. All rights reserved.