Package com.openfin.desktop.channel
Class ChannelClient
- java.lang.Object
-
- com.openfin.desktop.channel.ChannelBase
-
- com.openfin.desktop.channel.ChannelClient
-
public class ChannelClient extends ChannelBase
-
-
Field Summary
-
Fields inherited from class com.openfin.desktop.channel.ChannelBase
afterAction, beforeAction, channelActionMap, defaultAction, endpointIdentity, logger, onError
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddChannelListener(ChannelListener listener)protected voidcleanup()java.util.concurrent.CompletableFuture<Ack>disconnect()Disconnect from the channel.voiddispatch(java.lang.String action, org.json.JSONObject actionPayload, AckListener ackListener)Dispatch the given action to the channel provider.java.util.concurrent.CompletableFuture<Ack>dispatchAsync(java.lang.String action, java.lang.Object actionPayload)Dispatch an action to a specified client.booleanregister(java.lang.String action, ChannelAction listener)Register an action to be called by ChannelProviderbooleanremoveChannelListener(ChannelListener listener)-
Methods inherited from class com.openfin.desktop.channel.ChannelBase
dispatch, dispatchAsync, getChannelId, getChannelName, getEndpointId, getEndpointIdentity, getName, getUuid, hasRegisteredAction, remove, setAfterAction, setBeforeAction, setDefaultAction, setOnError
-
-
-
-
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:
registerin classChannelBase- Parameters:
action- Name of the action to be invoked by the channel providerlistener- 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)
-
cleanup
protected void cleanup()
- Overrides:
cleanupin classChannelBase
-
-