private static class HubTester.ClientWatcher extends java.lang.Object implements CallableClient
Modifier and Type | Field and Description |
---|---|
private java.util.Map |
clientMap_ |
private HubConnection |
connection_ |
private java.lang.Throwable |
error_ |
Constructor and Description |
---|
ClientWatcher(HubConnection connection)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
HubTester.WatchedClient |
getClient(java.lang.String id)
Returns a WatchedClient object corresponding to a given client
public ID.
|
HubConnection |
getConnection()
Returns the hub connection used by this client.
|
java.lang.Throwable |
getError()
Returns an error if any error has been thrown during processing
of hub event messages.
|
static Metadata |
getMetadata()
Returns a suitable metadata object for this client.
|
static Subscriptions |
getSubscriptions()
Returns a suitable subscriptions object for this client.
|
private void |
processMessage(java.lang.String senderId,
Message msg) |
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 java.util.Map clientMap_
private java.lang.Throwable error_
ClientWatcher(HubConnection connection)
connection
- hub connectionpublic HubTester.WatchedClient getClient(java.lang.String id)
id
- public id of a client which has been registeredid
, otherwise nullpublic java.lang.Throwable getError()
public HubConnection getConnection()
public void receiveCall(java.lang.String senderId, java.lang.String msgId, Message msg)
CallableClient
reply
method at some future point.receiveCall
in interface CallableClient
senderId
- public ID of sending clientmsgId
- message identifier for later use with replymsg
- messagepublic void receiveNotification(java.lang.String senderId, Message msg)
CallableClient
receiveNotification
in interface CallableClient
senderId
- public ID of sending clientmsg
- messageprivate void processMessage(java.lang.String senderId, Message msg) throws java.io.IOException
java.io.IOException
public void receiveResponse(java.lang.String responderId, java.lang.String msgTag, Response response)
CallableClient
receiveResponse
in interface CallableClient
responderId
- public ID of responding clientmsgTag
- client-defined tag labelling previously-sent messageresponse
- returned response objectpublic static Subscriptions getSubscriptions()
public static Metadata getMetadata()