Package org.astrogrid.samp.test
Class HubTester.TestCallableClient
- java.lang.Object
-
- org.astrogrid.samp.test.ReplyCollector
-
- org.astrogrid.samp.test.HubTester.TestCallableClient
-
- All Implemented Interfaces:
CallableClient
- Enclosing class:
- HubTester
private static class HubTester.TestCallableClient extends ReplyCollector implements CallableClient
CallableClient implementation for testing.
-
-
Field Summary
Fields Modifier and Type Field Description private HubConnectionconnection_private intpingCount_static SubscriptionsSUBS
-
Constructor Summary
Constructors Constructor Description TestCallableClient(HubConnection connection)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static SubscriptionsgetSubscriptions()Returns the subscriptions object for this client.private java.util.MapprocessCall(java.lang.String senderId, Message msg)Do the work of responding to a given SAMP message.voidreceiveCall(java.lang.String senderId, java.lang.String msgId, Message msg)Receives a message for which a response is required.voidreceiveNotification(java.lang.String senderId, Message msg)Receives a message for which no response is required.-
Methods inherited from class org.astrogrid.samp.test.ReplyCollector
call, callAll, getReply, getReplyCount, receiveResponse, setAllowTagReuse, waitForReply
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.astrogrid.samp.client.CallableClient
receiveResponse
-
-
-
-
Field Detail
-
connection_
private final HubConnection connection_
-
pingCount_
private int pingCount_
-
SUBS
public static final Subscriptions SUBS
-
-
Constructor Detail
-
TestCallableClient
TestCallableClient(HubConnection connection)
Constructor.- Parameters:
connection- hub connection
-
-
Method Detail
-
receiveNotification
public void receiveNotification(java.lang.String senderId, Message msg)Description copied from interface:CallableClientReceives a message for which no response is required.- Specified by:
receiveNotificationin interfaceCallableClient- Parameters:
senderId- public ID of sending clientmsg- message
-
receiveCall
public void receiveCall(java.lang.String senderId, java.lang.String msgId, Message msg) throws SampExceptionDescription copied from interface:CallableClientReceives a message for which a response is required. The implementation must take care to call the hub'sreplymethod at some future point.- Specified by:
receiveCallin interfaceCallableClient- Parameters:
senderId- public ID of sending clientmsgId- message identifier for later use with replymsg- message- Throws:
SampException
-
processCall
private java.util.Map processCall(java.lang.String senderId, Message msg)Do the work of responding to a given SAMP message.- Parameters:
senderId- sender public IDmsg- message object- Returns:
- content of the successful reply's samp.result entry
-
getSubscriptions
private static Subscriptions getSubscriptions()
Returns the subscriptions object for this client.- Returns:
- subscriptions
-
-