Class 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void exec​(java.lang.String methodName, java.lang.Object[] params)
      Makes an XML-RPC call to the SAMP callable client represented by this receiver.
      private void rawExec​(java.lang.String fqName, java.util.List paramList)
      Actually makes an XML-RPC call to the SAMP callable client represented by this receiver.
      void receiveCall​(java.lang.String senderId, java.lang.String msgId, Message msg)
      Receives a message for which a response is required.
      void receiveNotification​(java.lang.String senderId, Message msg)
      Receives a message for which no response is required.
      void receiveResponse​(java.lang.String responderId, java.lang.String msgTag, Response response)
      Receives a response to a message previously sent by this client.
      • Methods inherited from class java.lang.Object

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

      • 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 implementation
        SAMP - client's private key
    • Method Detail

      • receiveCall

        public void receiveCall​(java.lang.String senderId,
                                java.lang.String msgId,
                                Message msg)
                         throws SampException
        Description copied from interface: CallableClient
        Receives a message for which a response is required. The implementation must take care to call the hub's reply method at some future point.
        Specified by:
        receiveCall in interface CallableClient
        Parameters:
        senderId - public ID of sending client
        msgId - message identifier for later use with reply
        msg - message
        Throws:
        SampException
      • receiveResponse

        public void receiveResponse​(java.lang.String responderId,
                                    java.lang.String msgTag,
                                    Response response)
                             throws SampException
        Description copied from interface: CallableClient
        Receives a response to a message previously sent by this client.
        Specified by:
        receiveResponse in interface CallableClient
        Parameters:
        responderId - public ID of responding client
        msgTag - client-defined tag labelling previously-sent message
        response - returned response object
        Throws:
        SampException
      • exec

        private void exec​(java.lang.String methodName,
                          java.lang.Object[] params)
                   throws SampException
        Makes an XML-RPC call to the SAMP callable client represented by this receiver.
        Parameters:
        methodName - unqualified SAMP callable client API method name
        params - array of method parameters
        Throws:
        SampException
      • rawExec

        private void rawExec​(java.lang.String fqName,
                             java.util.List paramList)
                      throws java.io.IOException
        Actually makes an XML-RPC call to the SAMP callable client represented by this receiver.
        Parameters:
        fqName - fully qualified SAMP callable client API method name
        paramList - list of method parameters
        Throws:
        java.io.IOException