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 theClientActor
interface 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.Map
entryMap_
-
Constructor Summary
Constructors Modifier Constructor Description private
ClientActorImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private ClientXmlRpcHandler.Entry
getEntry(java.lang.String privateKey)
Returns the CallableClient corresponding to a given private key.void
receiveCall(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.void
receiveNotification(java.lang.String privateKey, java.lang.String senderId, java.util.Map msg)
Receives a message for which no response is required.void
receiveResponse(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:ClientActor
Receives a message for which no response is required.- Specified by:
receiveNotification
in 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.Exception
Description copied from interface:ClientActor
Receives a message for which a response is required. The implementation must take care to call the hub'sreply
method at some future point.- Specified by:
receiveCall
in 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.Exception
Description copied from interface:ClientActor
Receives a response to a message previously sent by this client.- Specified by:
receiveResponse
in 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
- ifprivateKey
is unknown
-
-