Class InternalClient
java.lang.Object
org.astrogrid.samp.xmlrpc.internal.InternalClient
- All Implemented Interfaces:
SampXmlRpcClient
- Direct Known Subclasses:
RpcLoggingInternalClient,XmlLoggingInternalClient
XML-RPC client implementation suitable for use with SAMP.
This implementation is completely freestanding and requires no other
libraries.
- Since:
- 26 Aug 2008
- Author:
- Mark Taylor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcallAndForget(String method, List params) Sends a call, but does not wait around for the response.callAndWait(String method, List params) Makes a synchronous call, waiting for the response and returning the result.protected ObjectDeserializes an XML-RPCmethodResponsedocument to a Java object.protected byte[]serializeCall(String method, List paramList) Generates the XMLmethodCalldocument corresponding to an XML-RPC method call.
-
Constructor Details
-
InternalClient
Constructor.- Parameters:
endpoint- endpoint
-
-
Method Details
-
callAndWait
Description copied from interface:SampXmlRpcClientMakes a synchronous call, waiting for the response and returning the result.- Specified by:
callAndWaitin interfaceSampXmlRpcClient- Parameters:
method- XML-RPC method nameparams- parameters for XML-RPC call (SAMP-compatible)- Returns:
- XML-RPC call return value (SAMP-compatible)
- Throws:
IOException
-
callAndForget
Description copied from interface:SampXmlRpcClientSends a call, but does not wait around for the response. If possible, this method should complete quickly.NOTE: it seems to be difficult to implement this method in a way which is faster than
SampXmlRpcClient.callAndWait(java.lang.String, java.util.List)but does not cause problems elsewhere (incomplete HTTP responses). It is probably a good idea to avoid using it if possible.- Specified by:
callAndForgetin interfaceSampXmlRpcClient- Parameters:
method- XML-RPC method nameparams- parameters for XML-RPC call (SAMP-compatible)- Throws:
IOException
-
serializeCall
Generates the XMLmethodCalldocument corresponding to an XML-RPC method call.- Parameters:
method- methodName stringparamList- list of XML-RPC parameters- Returns:
- XML document as byte array
- Throws:
IOException
-
deserializeResponse
Deserializes an XML-RPCmethodResponsedocument to a Java object.- Parameters:
in- input stream containing response document- Throws:
IOException
-