Class ChannelClient

    • Method Detail

      • dispatch

        public void dispatch​(java.lang.String action,
                             org.json.JSONObject actionPayload,
                             AckListener ackListener)
        Dispatch the given action to the channel provider.
        Parameters:
        action - Name of the action to be invoked by the channel provider.
        actionPayload - Payload to be sent along with the action.
        ackListener - AckListener for the request
      • dispatchAsync

        public java.util.concurrent.CompletableFuture<Ack> dispatchAsync​(java.lang.String action,
                                                                         java.lang.Object actionPayload)
        Dispatch an action to a specified client.
        Parameters:
        action - Name of the action to be invoked by the client.
        actionPayload - Payload to be sent along with the action.
        Returns:
        CompletableFuture with Ack object
        See Also:
        Ack
      • register

        public boolean register​(java.lang.String action,
                                ChannelAction listener)
        Register an action to be called by ChannelProvider
        Overrides:
        register in class ChannelBase
        Parameters:
        action - Name of the action to be invoked by the channel provider
        listener - Function representing the action to be taken on a client dispatch.
        Returns:
        if the action was registered successfully
      • disconnect

        public java.util.concurrent.CompletableFuture<Ack> disconnect()
        Disconnect from the channel.
        Returns:
        CompletableFuture with Ack object
        See Also:
        Ack
      • addChannelListener

        public boolean addChannelListener​(ChannelListener listener)
      • removeChannelListener

        public boolean removeChannelListener​(ChannelListener listener)