Class ChannelProvider

java.lang.Object
com.openfin.desktop.channel.ChannelBase
com.openfin.desktop.channel.ChannelProvider

public class ChannelProvider
extends ChannelBase
  • Method Details

    • destroy

      public void destroy​(AckListener ackListener)
      Destroy the channel
      Parameters:
      ackListener - AckListener for the request
    • processConnection

      public void processConnection​(org.json.JSONObject connectionPayload, org.json.JSONObject ackToSenderPayload) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • publish

      public void publish​(java.lang.String action, org.json.JSONObject actionPayload, AckListener ackListener)
      Deprecated.
      Use publishAsync
      Publish an action and payload to every connected client.
      Parameters:
      action - Name of the action to be invoked by the channel client
      actionPayload - Payload to be sent along with the action.
      ackListener - AckListener for the request
    • publishAsync

      public java.util.List<java.util.concurrent.CompletableFuture<Ack>> publishAsync​(java.lang.String action, org.json.JSONObject actionPayload)
      Publish an action and payload to every connected client.
      Parameters:
      action - Name of the action to be invoked by the channel client
      actionPayload - Payload to be sent along with the action.
      Returns:
      A list of CompletableFuture with Ack object
      See Also:
      Ack
    • dispatchAsync

      public java.util.concurrent.CompletableFuture<Ack> dispatchAsync​(org.json.JSONObject destinationIdentity, java.lang.String action, org.json.JSONObject actionPayload)
      Dispatch an action to a specified client.
      Parameters:
      destinationIdentity - Identity of the target client.
      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
    • dispatch

      public void dispatch​(org.json.JSONObject destinationIdentity, java.lang.String action, org.json.JSONObject actionPayload, AckListener ackListener)
      Dispatch an action to a specified client.
      Parameters:
      destinationIdentity - Identity of the target client.
      action - Name of the action to be invoked by the client.
      actionPayload - Payload to be sent along with the action.
      ackListener - AckListener for the request
    • register

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

      protected void cleanup()
      Overrides:
      cleanup in class ChannelBase
    • addProviderListener

      public boolean addProviderListener​(ChannelProviderListener listener)
      Add a listener for channel provider events
      Parameters:
      listener - listener to add
      Returns:
    • removeProviderListener

      public boolean removeProviderListener​(ChannelProviderListener listener)
      Add a ChannelProviderListener
      Parameters:
      listener - listener to remove
      Returns:
    • fireClientConnectEvent

      protected void fireClientConnectEvent​(ChannelClientConnectEvent event) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • fireClientDisconnectEvent

      protected void fireClientDisconnectEvent​(ChannelClientConnectEvent event)