private class MessageTrackerHubConnector.MessageTrackerHubConnection extends WrapperHubConnection
Modifier and Type | Field and Description |
---|---|
private Client |
selfClient_ |
Constructor and Description |
---|
MessageTrackerHubConnection(HubConnection base)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
call(java.lang.String recipientId,
java.lang.String msgTag,
java.util.Map msg)
Sends a message to a given client expecting a response.
|
java.util.Map |
callAll(java.lang.String msgTag,
java.util.Map msg)
Sends a message to all subscribed clients expecting responses.
|
Response |
callAndWait(java.lang.String recipientId,
java.util.Map msg,
int timeout)
Sends a message synchronously to a client, waiting for the response.
|
(package private) Client |
getSelfClient()
Returns a Client object for use in Transmission objects
which represents this connection's owner.
|
void |
notify(java.lang.String recipientId,
java.util.Map msg)
Sends a message to a given client without wanting a response.
|
java.util.List |
notifyAll(java.util.Map msg)
Sends a message to all subscribed clients without wanting a response.
|
void |
reply(java.lang.String msgId,
java.util.Map response)
Supplies a response to a previously received message.
|
void |
setCallable(CallableClient callable)
Tells the hub how it can perform callbacks on the client by providing
a CallableClient object.
|
declareMetadata, declareSubscriptions, getMetadata, getRegInfo, getRegisteredClients, getSubscribedClients, getSubscriptions, ping, unregister
private Client selfClient_
MessageTrackerHubConnection(HubConnection base)
base
- connection on which this one is basedClient getSelfClient()
public void notify(java.lang.String recipientId, java.util.Map msg) throws SampException
HubConnection
notify
in interface HubConnection
notify
in class WrapperHubConnection
recipientId
- public-id of client to receive messagemsg
- Message
-like mapSampException
public java.util.List notifyAll(java.util.Map msg) throws SampException
HubConnection
notifyAll
in interface HubConnection
notifyAll
in class WrapperHubConnection
msg
- Message
-like mapSampException
public java.lang.String call(java.lang.String recipientId, java.lang.String msgTag, java.util.Map msg) throws SampException
HubConnection
receiveResponse
method of this connection's
CallableClient
will be called with a
response at some time in the future.
Only permitted if this client is already callable.
call
in interface HubConnection
call
in class WrapperHubConnection
recipientId
- public-id of client to receive messagemsgTag
- arbitrary string tagging this message for caller's
benefitmsg
- Message
-like mapSampException
public java.util.Map callAll(java.lang.String msgTag, java.util.Map msg) throws SampException
HubConnection
receiveResponse
method of this connection's
CallableClient
will be called with responses at some
time in the future.
Only permitted if this client is already callable.
callAll
in interface HubConnection
callAll
in class WrapperHubConnection
msgTag
- arbitrary string tagging this message for caller's
benefitmsg
- Message
-like mapSampException
public Response callAndWait(java.lang.String recipientId, java.util.Map msg, int timeout) throws SampException
HubConnection
timeout
parameter, an exception will result.callAndWait
in interface HubConnection
callAndWait
in class WrapperHubConnection
recipientId
- public-id of client to receive messagemsg
- Message
-like maptimeout
- timeout in seconds, or <0 for no timeoutSampException
public void reply(java.lang.String msgId, java.util.Map response) throws SampException
HubConnection
reply
in interface HubConnection
reply
in class WrapperHubConnection
msgId
- ID associated with earlier sendresponse
- Response
-like mapSampException
public void setCallable(CallableClient callable) throws SampException
HubConnection
setCallable
in interface HubConnection
setCallable
in class WrapperHubConnection
callable
- callable clientSampException