|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.universAAL.middleware.bus.model.AbstractBus
org.universAAL.middleware.service.impl.ServiceBusImpl
public class ServiceBusImpl
Field Summary |
---|
Fields inherited from class org.universAAL.middleware.bus.model.AbstractBus |
---|
aalSpaceManager, busStrategy, communicationModule, context, registry |
Fields inherited from interface org.universAAL.middleware.service.ServiceBus |
---|
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, uAAL_SERVICE_BUS_MODULE_CONTEXT |
Method Summary | |
---|---|
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)
Registers (advertises) new services (by providing descriptions of them) that will be provided by the ServiceCalee 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 |
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()
|
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(Container c,
ModuleContext mc,
Object[] serviceBusShareParams,
Object[] serviceBusFetchParams)
|
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. |
Methods inherited from class org.universAAL.middleware.bus.model.AbstractBus |
---|
addRegistryListener, brokerMessage, createRegistry, dispose, getBrokerName, getBusMember, getBusMemberID, getBusMembers, getBusMembersByID, getCurrentNumberOfPeers, getPeerCard, getPeerFromBusResourceURI, getURI, init, initBrokerage, isBusResourceURI, isValidMember, messageReceived, register, removeRegistryListener, unmarshall |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Object[] getServiceBusFetchParams()
public void assessContentSerialization(Resource content)
public static void startModule(Container c, ModuleContext mc, Object[] serviceBusShareParams, Object[] serviceBusFetchParams)
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)
ServiceBus
addNewServiceProfiles
in interface ServiceBus
calleeID
- the ID of the ServiceCalee that is advertising new services on
the service bus.realizedServices
- the description of the new services in terms of an array of
service profiles.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 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |