public final class ServiceBusImpl extends AbstractBus implements ServiceBus
Modifier and Type | Class and Description |
---|---|
static class |
ServiceBusImpl.CallInjectorImpl |
ServiceBus.CallInjector
busStrategy, communicationModule, context, OPTIONAL_URI_PREFIX, registry, spaceManager
LOG_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, unmarshall
public 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)
ServiceBus
addAvailabilitySubscription
in interface ServiceBus
callerID
- 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)
ServiceBus
addNewServiceProfiles
in interface ServiceBus
calleeID
- 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)
ServiceBus
getAllServices
in interface ServiceBus
callerID
- the ID of the caller that is asking the service bus.ServiceBus.getAllServices(String)
public ServiceProfile[] getMatchingServices(String callerID, Service s)
ServiceBus
getMatchingServices
in interface ServiceBus
callerID
- 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)
ServiceBus
getMatchingServices
in interface ServiceBus
callerID
- 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)
ServiceBus
getMatchingServices
in interface ServiceBus
s
- the URI of the desired service class.ServiceBus#getMatchingService(String)
public ServiceProfile[] getMatchingServices(String callerID, String[] keywords)
ServiceBus
getMatchingServices
in interface ServiceBus
callerID
- 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)
ServiceBus
addAvailabilitySubscription
method.removeAvailabilitySubscription
in interface ServiceBus
callerID
- 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)
ServiceBus
removeMatchingProfiles
in interface ServiceBus
calleeID
- 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)
ServiceBus
brokerReply
in interface ServiceBus
calleeID
- 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)
ServiceBus
ServiceBus.brokerReply(String, BusMessage)
. The bus
will then inform the original requester (the ServiceCaller that has
called this method) about the result.brokerRequest
in interface ServiceBus
callerID
- 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)
ServiceBus
unregister
in interface ServiceBus
calleeID
- 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)
ServiceBus
unregister
in interface ServiceBus
callerID
- 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)
AbstractBus
unregister
in class AbstractBus
protected BusStrategy createBusStrategy(CommunicationModule commModule)
createBusStrategy
in class AbstractBus
public void handleSendError(ChannelMessage message, CommunicationConnectorException e)
MessageListener
handleSendError
in interface MessageListener
Copyright © 2018 universAAL Consortium. All rights reserved.