Class ClientXmlRpcHandler.ClientActorImpl

  • All Implemented Interfaces:
    ClientActor
    Enclosing class:
    ClientXmlRpcHandler

    private static class ClientXmlRpcHandler.ClientActorImpl
    extends java.lang.Object
    implements ClientActor
    Implementation of the ClientActor 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.
      • Methods inherited from class java.lang.Object

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

      • entryMap_

        private java.util.Map entryMap_
    • Constructor Detail

      • ClientActorImpl

        private ClientActorImpl()
    • 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 interface ClientActor
        Parameters:
        privateKey - private key for hub-client communication
        senderId - public ID of sending client
        msg - 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's reply method at some future point.
        Specified by:
        receiveCall in interface ClientActor
        Parameters:
        privateKey - private key for hub-client communication
        senderId - public ID of sending client
        msgId - message identifier for later use with reply
        msg - 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 interface ClientActor
        Parameters:
        privateKey - private key for hub-client communication
        responderId - public ID of responding client
        msgTag - client-defined tag labelling previously-sent message
        resp - 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 - if privateKey is unknown