Package org.astrogrid.samp.xmlrpc
Class XmlRpcCallableClient
- java.lang.Object
-
- org.astrogrid.samp.xmlrpc.XmlRpcCallableClient
-
- All Implemented Interfaces:
CallableClient
class XmlRpcCallableClient extends java.lang.Object implements CallableClient
CallableClient implementation used to communicate with XML-RPC-based callable clients.- Since:
- 28 Jan 2011
- Author:
- Mark Taylor
-
-
Field Summary
Fields Modifier and Type Field Description private static booleanisShutdown_private java.lang.StringprivateKey_private SampXmlRpcClientxClient_
-
Constructor Summary
Constructors Constructor Description XmlRpcCallableClient(SampXmlRpcClient xClient, java.lang.String privateKey)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidexec(java.lang.String methodName, java.lang.Object[] params)Makes an XML-RPC call to the SAMP callable client represented by this receiver.private voidrawExec(java.lang.String fqName, java.util.List paramList)Actually makes an XML-RPC call to the SAMP callable client represented by this receiver.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.voidreceiveResponse(java.lang.String responderId, java.lang.String msgTag, Response response)Receives a response to a message previously sent by this client.
-
-
-
Field Detail
-
xClient_
private final SampXmlRpcClient xClient_
-
privateKey_
private final java.lang.String privateKey_
-
isShutdown_
private static volatile boolean isShutdown_
-
-
Constructor Detail
-
XmlRpcCallableClient
public XmlRpcCallableClient(SampXmlRpcClient xClient, java.lang.String privateKey)
Constructor.- Parameters:
xClient- XML-RPC client implementationSAMP- client's private key
-
-
Method Detail
-
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
-
receiveNotification
public void receiveNotification(java.lang.String senderId, Message msg) throws SampExceptionDescription copied from interface:CallableClientReceives a message for which no response is required.- Specified by:
receiveNotificationin interfaceCallableClient- Parameters:
senderId- public ID of sending clientmsg- message- Throws:
SampException
-
receiveResponse
public void receiveResponse(java.lang.String responderId, java.lang.String msgTag, Response response) throws SampExceptionDescription copied from interface:CallableClientReceives a response to a message previously sent by this client.- Specified by:
receiveResponsein interfaceCallableClient- Parameters:
responderId- public ID of responding clientmsgTag- client-defined tag labelling previously-sent messageresponse- returned response object- Throws:
SampException
-
exec
private void exec(java.lang.String methodName, java.lang.Object[] params) throws SampExceptionMakes an XML-RPC call to the SAMP callable client represented by this receiver.- Parameters:
methodName- unqualified SAMP callable client API method nameparams- array of method parameters- Throws:
SampException
-
rawExec
private void rawExec(java.lang.String fqName, java.util.List paramList) throws java.io.IOExceptionActually makes an XML-RPC call to the SAMP callable client represented by this receiver.- Parameters:
fqName- fully qualified SAMP callable client API method nameparamList- list of method parameters- Throws:
java.io.IOException
-
-