public class Channel extends Object
| Constructor and Description |
|---|
Channel(String name,
DesktopConnection desktopConnection) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addChannelListener(ChannelListener listener) |
protected void |
addEventListener(org.json.JSONObject subscriptionObject,
EventListener listener,
AckListener callback)
Registers an event listener on the specified event
|
void |
addEventListener(String type,
EventListener listener,
AckListener callback)
Registers an event listener on the specified event
|
void |
connect(AsyncCallback<ChannelClient> callback)
Connect to the channel.
|
CompletionStage<ChannelClient> |
connectAsync() |
CompletionStage<ChannelClient> |
connectAsync(Boolean noWait) |
void |
create(AsyncCallback<ChannelProvider> callback)
Create a new channel.
|
CompletionStage<ChannelProvider> |
createAsync() |
protected void |
fireChannelConnectEvent(ConnectionEvent event) |
protected void |
fireChannelDisconnectEvent(ConnectionEvent event) |
DesktopConnection |
getDesktopConnection() |
String |
getName()
Get the name of the channel
|
boolean |
hasClient()
Check if the channel has client connected
|
boolean |
hasProvider()
Check if the channel has provider created
|
Object |
invokeAction(EndpointIdentity targetIdentity,
String action,
org.json.JSONObject actionPayload,
org.json.JSONObject senderIdentity) |
void |
processConnection(org.json.JSONObject payload) |
boolean |
removeChannelListener(ChannelListener listener) |
void |
removeEventListener(String type,
EventListener listener,
AckListener callback)
Removes a previously registered event listener from the specified event
|
public Channel(String name, DesktopConnection desktopConnection)
public String getName()
public DesktopConnection getDesktopConnection()
public CompletionStage<ChannelProvider> createAsync()
public void create(AsyncCallback<ChannelProvider> callback)
callback - The callback that receives the wrapped ChannelProvider objectpublic CompletionStage<ChannelClient> connectAsync()
public CompletionStage<ChannelClient> connectAsync(Boolean noWait)
public void connect(AsyncCallback<ChannelClient> callback)
callback - The callback that receives the wrapped ChannelClient objectpublic boolean hasProvider()
public boolean hasClient()
public Object invokeAction(EndpointIdentity targetIdentity, String action, org.json.JSONObject actionPayload, org.json.JSONObject senderIdentity)
public boolean addChannelListener(ChannelListener listener)
public boolean removeChannelListener(ChannelListener listener)
protected void fireChannelConnectEvent(ConnectionEvent event)
protected void fireChannelDisconnectEvent(ConnectionEvent event)
public void processConnection(org.json.JSONObject payload)
protected void addEventListener(org.json.JSONObject subscriptionObject,
EventListener listener,
AckListener callback)
throws DesktopException
Supported system event types are:
subscriptionObject - A JSON object containing subscription information such as the topic and typelistener - EventListener for the eventcallback - AckListener for the requestDesktopException - if this method fails to add event listener specifiedEventListener,
AckListenerpublic void addEventListener(String type, EventListener listener, AckListener callback) throws DesktopException
Supported system event types are:
type - Type of the eventlistener - EventListener for the eventcallback - AckListener for the requestDesktopException - if this method fails to add event listener specifiedEventListener,
AckListenerpublic void removeEventListener(String type, EventListener listener, AckListener callback) throws DesktopException
type - Type of the eventlistener - EventListener for the eventcallback - AckListener for the requestDesktopException - if this method fails to remove event listener specifiedDesktopException,
EventListener,
AckListenerCopyright © 2021. All rights reserved.