class HubCallableClient extends java.lang.Object implements CallableClient
Modifier and Type | Field and Description |
---|---|
private HubConnection |
connection_ |
private AbstractMessageHandler[] |
handlers_ |
Constructor and Description |
---|
HubCallableClient(HubConnection connection,
AbstractMessageHandler[] handlers)
Constructs a HubCallableClient with a given set of handlers.
|
Modifier and Type | Method and Description |
---|---|
private AbstractMessageHandler |
getHandler(java.lang.String mtype)
Returns a handler owned by this callable client which can handle
a given MType.
|
Subscriptions |
getSubscriptions()
Returns the subscriptions corresponding to the messages that this
receiver can deal with.
|
void |
receiveCall(java.lang.String senderId,
java.lang.String msgId,
Message msg)
Receives a message for which a response is required.
|
void |
receiveNotification(java.lang.String senderId,
Message msg)
Receives a message for which no response is required.
|
void |
receiveResponse(java.lang.String responderId,
java.lang.String msgTag,
Response response)
Receives a response to a message previously sent by this client.
|
private final HubConnection connection_
private final AbstractMessageHandler[] handlers_
public HubCallableClient(HubConnection connection, AbstractMessageHandler[] handlers)
connection
- connection to hub servicehandlers
- array of message handlerspublic void receiveCall(java.lang.String senderId, java.lang.String msgId, Message msg) throws SampException
CallableClient
reply
method at some future point.receiveCall
in interface CallableClient
senderId
- public ID of sending clientmsgId
- message identifier for later use with replymsg
- messageSampException
public void receiveNotification(java.lang.String senderId, Message msg) throws SampException
CallableClient
receiveNotification
in interface CallableClient
senderId
- public ID of sending clientmsg
- messageSampException
public void receiveResponse(java.lang.String responderId, java.lang.String msgTag, Response response) throws SampException
CallableClient
receiveResponse
in interface CallableClient
responderId
- public ID of responding clientmsgTag
- client-defined tag labelling previously-sent messageresponse
- returned response objectSampException
public Subscriptions getSubscriptions()
private AbstractMessageHandler getHandler(java.lang.String mtype) throws SampException
mtype
- MType to handlemtype
SampException
- if no suitable handler exists