|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.openfin.desktop.DesktopConnection
public class DesktopConnection
A object for launching, connecting to, and controlling AppDesktop.
| Constructor Summary | |
|---|---|
DesktopConnection(String uuid)
Creates a new connection to AppDesktop |
|
DesktopConnection(String uuid,
String host,
Integer port)
Creates a new connection to AppDesktop |
|
| Method Summary | |
|---|---|
void |
addEventCallback(org.json.JSONObject subscriptionObject,
EventListener listener,
AckListener callback,
Object source)
Registers an event listener on the specified event |
void |
addExternalMessageHandler(ExternalMessageListener listener,
Object source)
Registers a listener to handle messages for this connection's UUID originating via HTTPS/HTTP |
void |
connect(DesktopStateListener listener)
Connects to an AppDesktop process |
void |
connectToVersion(String desktopVersion,
DesktopStateListener listener,
int timeout)
Connect to specified version of Desktop. |
void |
disconnect()
Disconnects from AppDesktop |
void |
exit()
Notify AppDesktop to exit |
InterApplicationBus |
getInterApplicationBus()
Gets the Inter-Application message dispatcher associated with this DesktopConnection |
boolean |
isConnected()
InterApplicationBus |
void |
launchAndConnect(String commandLineArguments,
DesktopStateListener listener,
int timeout)
Launches AppDesktop and notifies the listener when connected. |
void |
launchAndConnect(String desktopPath,
String commandLineArguments,
DesktopStateListener listener,
int timeout)
Launches AppDesktop and notifies the listener when connected. |
protected void |
log(String text)
Logging info |
Integer |
registerNotificationListener(NotificationListener listener,
Object source)
Registers listener for a new notification |
void |
removeEventCallback(org.json.JSONObject subscriptionObject,
EventListener listener,
AckListener callback,
Object source)
Removes a previously registered event listener from the specified event |
protected void |
respondToPing(long pingId)
|
void |
sendAction(String action,
org.json.JSONObject payload)
Sends a message to AppDesktop |
void |
sendAction(String action,
org.json.JSONObject payload,
AckListener listener,
Object source)
Sends a message to AppDesktop |
void |
sendActionToNotificationsCenter(String action,
org.json.JSONObject payload,
AckListener callback,
Object source)
|
void |
setLogLevel(boolean enabled)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DesktopConnection(String uuid)
throws DesktopException
uuid - unique ID for AppDesktop to refer to this DesktopConnection
DesktopException
public DesktopConnection(String uuid,
String host,
Integer port)
throws DesktopException
uuid - unique ID for AppDesktop to refer to this DesktopConnectionhost - The host that AppDesktop is running onport - The port that AppDesktop is listening on for connections. -null if unknown
DesktopException| Method Detail |
|---|
public void launchAndConnect(String commandLineArguments,
DesktopStateListener listener,
int timeout)
throws URISyntaxException,
DesktopIOException
commandLineArguments - Command line arguments to start the AppDesktop withlistener - Receives updates on startup and connection statetimeout - For connecting to Desktop after launch. If the connection to AppDesktop is not established by the timeout the listener will get an onError() call
URISyntaxException
DesktopIOException
public void launchAndConnect(String desktopPath,
String commandLineArguments,
DesktopStateListener listener,
int timeout)
throws URISyntaxException,
DesktopIOException
desktopPath - Absolute path to the AppDesktop executablecommandLineArguments - Command line arguments to start the AppDesktop withlistener - Receives updates on startup and connection statetimeout - For connecting to Desktop after launch. If the connection to AppDesktop is not established by the timeout the listener will get an onError() call
URISyntaxException
DesktopIOException
public void connectToVersion(String desktopVersion,
DesktopStateListener listener,
int timeout)
throws URISyntaxException,
DesktopIOException,
IOException
desktopVersion - version of Desktop requiredlistener - Receives updates on startup and connection statetimeout - For connecting to Desktop after launch. If the connection to AppDesktop is not established by the timeout the listener will get an onError() call
URISyntaxException
DesktopIOException
IOExceptionpublic void disconnect()
public boolean isConnected()
public void exit()
public InterApplicationBus getInterApplicationBus()
public void sendAction(String action,
org.json.JSONObject payload)
throws DesktopException,
DesktopIOException
action - The action of the messagepayload - The message object to send
DesktopException
DesktopIOException
public void sendAction(String action,
org.json.JSONObject payload,
AckListener listener,
Object source)
action - The action of the messagepayload - The message object to sendlistener - AckListener for the messagesource - Message sourceAckListener
public void connect(DesktopStateListener listener)
throws URISyntaxException,
DesktopIOException
listener - Receives updates on startup and connection state
URISyntaxException
DesktopIOExceptionDesktopStateListener
public Integer registerNotificationListener(NotificationListener listener,
Object source)
listener - NotificationListener for the notificationsource - Source of the request
NotificationListener
public void sendActionToNotificationsCenter(String action,
org.json.JSONObject payload,
AckListener callback,
Object source)
public void addEventCallback(org.json.JSONObject subscriptionObject,
EventListener listener,
AckListener callback,
Object source)
subscriptionObject - JSON object containing subscription information such as the topic and typelistener - EventListener for the eventcallback - AckListener for this requestsource - Source of this requestEventListener,
AckListener
public void removeEventCallback(org.json.JSONObject subscriptionObject,
EventListener listener,
AckListener callback,
Object source)
subscriptionObject - JSON object containing subscription information such as the topic and typelistener - EventListener that was registered beforecallback - AckListener for this requestsource - source of this requestprotected void respondToPing(long pingId)
public void addExternalMessageHandler(ExternalMessageListener listener,
Object source)
listener - process a received HTTPS/HTTP message for this connectionsource - The object that originally registered the listenerpublic void setLogLevel(boolean enabled)
protected void log(String text)
text - The text to be logged
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||