Class InternalClient

    • Constructor Summary

      Constructors 
      Constructor Description
      InternalClient​(java.net.URL endpoint)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void callAndForget​(java.lang.String method, java.util.List params)
      Sends a call, but does not wait around for the response.
      java.lang.Object callAndWait​(java.lang.String method, java.util.List params)
      Makes a synchronous call, waiting for the response and returning the result.
      protected java.lang.Object deserializeResponse​(java.io.InputStream in)
      Deserializes an XML-RPC methodResponse document to a Java object.
      protected byte[] serializeCall​(java.lang.String method, java.util.List paramList)
      Generates the XML methodCall document corresponding to an XML-RPC method call.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InternalClient

        public InternalClient​(java.net.URL endpoint)
        Constructor.
        Parameters:
        endpoint - endpoint
    • Method Detail

      • callAndWait

        public java.lang.Object callAndWait​(java.lang.String method,
                                            java.util.List params)
                                     throws java.io.IOException
        Description copied from interface: SampXmlRpcClient
        Makes a synchronous call, waiting for the response and returning the result.
        Specified by:
        callAndWait in interface SampXmlRpcClient
        Parameters:
        method - XML-RPC method name
        params - parameters for XML-RPC call (SAMP-compatible)
        Returns:
        XML-RPC call return value (SAMP-compatible)
        Throws:
        java.io.IOException
      • callAndForget

        public void callAndForget​(java.lang.String method,
                                  java.util.List params)
                           throws java.io.IOException
        Description copied from interface: SampXmlRpcClient
        Sends 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:
        callAndForget in interface SampXmlRpcClient
        Parameters:
        method - XML-RPC method name
        params - parameters for XML-RPC call (SAMP-compatible)
        Throws:
        java.io.IOException
      • serializeCall

        protected byte[] serializeCall​(java.lang.String method,
                                       java.util.List paramList)
                                throws java.io.IOException
        Generates the XML methodCall document corresponding to an XML-RPC method call.
        Parameters:
        method - methodName string
        paramList - list of XML-RPC parameters
        Returns:
        XML document as byte array
        Throws:
        java.io.IOException
      • deserializeResponse

        protected java.lang.Object deserializeResponse​(java.io.InputStream in)
                                                throws java.io.IOException
        Deserializes an XML-RPC methodResponse document to a Java object.
        Parameters:
        in - input stream containing response document
        Throws:
        java.io.IOException