Package org.astrogrid.samp.xmlrpc
Class ClientXmlRpcHandler.ClientActorImpl
- java.lang.Object
-
- org.astrogrid.samp.xmlrpc.ClientXmlRpcHandler.ClientActorImpl
-
- All Implemented Interfaces:
ClientActor
- Enclosing class:
- ClientXmlRpcHandler
private static class ClientXmlRpcHandler.ClientActorImpl extends java.lang.Object implements ClientActor
Implementation of theClientActorinterface which does the work for this class. The correct CallableClient is determined from the private key, and the work is then delegated to it.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.MapentryMap_
-
Constructor Summary
Constructors Modifier Constructor Description privateClientActorImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private ClientXmlRpcHandler.EntrygetEntry(java.lang.String privateKey)Returns the CallableClient corresponding to a given private key.voidreceiveCall(java.lang.String privateKey, java.lang.String senderId, java.lang.String msgId, java.util.Map msg)Receives a message for which a response is required.voidreceiveNotification(java.lang.String privateKey, java.lang.String senderId, java.util.Map msg)Receives a message for which no response is required.voidreceiveResponse(java.lang.String privateKey, java.lang.String responderId, java.lang.String msgTag, java.util.Map resp)Receives a response to a message previously sent by this client.
-
-
-
Method Detail
-
receiveNotification
public void receiveNotification(java.lang.String privateKey, java.lang.String senderId, java.util.Map msg)Description copied from interface:ClientActorReceives a message for which no response is required.- Specified by:
receiveNotificationin interfaceClientActor- Parameters:
privateKey- private key for hub-client communicationsenderId- public ID of sending clientmsg- message
-
receiveCall
public void receiveCall(java.lang.String privateKey, java.lang.String senderId, java.lang.String msgId, java.util.Map msg) throws java.lang.ExceptionDescription copied from interface:ClientActorReceives 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 interfaceClientActor- Parameters:
privateKey- private key for hub-client communicationsenderId- public ID of sending clientmsgId- message identifier for later use with replymsg- message- Throws:
java.lang.Exception
-
receiveResponse
public void receiveResponse(java.lang.String privateKey, java.lang.String responderId, java.lang.String msgTag, java.util.Map resp) throws java.lang.ExceptionDescription copied from interface:ClientActorReceives a response to a message previously sent by this client.- Specified by:
receiveResponsein interfaceClientActor- Parameters:
privateKey- private key for hub-client communicationresponderId- public ID of responding clientmsgTag- client-defined tag labelling previously-sent messageresp- returned response object- Throws:
java.lang.Exception
-
getEntry
private ClientXmlRpcHandler.Entry getEntry(java.lang.String privateKey)
Returns the CallableClient corresponding to a given private key.- Parameters:
privateKey- private key for client- Returns:
- entry identified by privateKey
- Throws:
java.lang.IllegalStateException- ifprivateKeyis unknown
-
-