Package com.openfin.desktop.channel
Class ChannelProvider
java.lang.Object
com.openfin.desktop.channel.ChannelBase
com.openfin.desktop.channel.ChannelProvider
public class ChannelProvider extends ChannelBase
-
Field Summary
Fields inherited from class com.openfin.desktop.channel.ChannelBase
afterAction, beforeAction, channelActionMap, defaultAction, endpointIdentity, onError
-
Method Summary
Modifier and Type Method Description boolean
addProviderListener(ChannelProviderListener listener)
Add a listener for channel provider eventsprotected void
cleanup()
void
destroy(AckListener ackListener)
Destroy the channelvoid
dispatch(org.json.JSONObject destinationIdentity, java.lang.String action, org.json.JSONObject actionPayload, AckListener ackListener)
Dispatch an action to a specified client.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.protected void
fireClientConnectEvent(ChannelClientConnectEvent event)
protected void
fireClientDisconnectEvent(ChannelClientConnectEvent event)
void
processConnection(org.json.JSONObject connectionPayload, org.json.JSONObject ackToSenderPayload)
void
publish(java.lang.String action, org.json.JSONObject actionPayload, AckListener ackListener)
Deprecated.Use publishAsyncjava.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.boolean
register(java.lang.String action, ChannelAction listener)
Register an action to be called by ChannelClientboolean
removeProviderListener(ChannelProviderListener listener)
Add a ChannelProviderListenerMethods inherited from class com.openfin.desktop.channel.ChannelBase
dispatch, dispatchAsync, getChannelId, getChannelName, getEndpointId, getEndpointIdentity, getName, getUuid, hasRegisteredAction, remove, setAfterAction, setBeforeAction, setDefaultAction, setOnError
-
Method Details
-
destroy
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 publishAsyncPublish an action and payload to every connected client.- Parameters:
action
- Name of the action to be invoked by the channel clientactionPayload
- 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 clientactionPayload
- 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
Register an action to be called by ChannelClient- Overrides:
register
in classChannelBase
- Parameters:
action
- Name of the action to be invoked by the channel clientlistener
- 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 classChannelBase
-
addProviderListener
Add a listener for channel provider events- Parameters:
listener
- listener to add- Returns:
-
removeProviderListener
Add a ChannelProviderListener- Parameters:
listener
- listener to remove- Returns:
-
fireClientConnectEvent
- Throws:
java.lang.Exception
-
fireClientDisconnectEvent
-