Modifier and Type | Field and Description |
---|---|
protected org.json.JSONObject |
configPayload |
protected DesktopConnection |
connection |
protected org.json.JSONObject |
eventListenerPayload |
Constructor and Description |
---|
OpenFinRuntime(DesktopConnection connection)
Constructor
|
Modifier and Type | Method and Description |
---|---|
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 |
clearCache(boolean cache,
boolean cookies,
boolean localStorage,
boolean appcache,
boolean userData)
Clears cached data containing window state/positions,
application resource files (images, HTML, JavaScript files)
cookies, and items stored in the Local Storage.
|
void |
clearCache(boolean cache,
boolean cookies,
boolean localStorage,
boolean appcache,
boolean userData,
AckListener listener)
Clears cached data containing window state/positions,
application resource files (images, HTML, JavaScript files)
cookies, and items stored in the Local Storage.
|
void |
deleteCacheOnRestart()
Clears all cached data when Runtime is restarted
|
void |
deleteCacheOnRestart(AckListener listener)
Clears all cached data when App Desktop is restarted
|
void |
exit()
Exit Runtime
|
static String |
getAdapterBuildTime()
Get build time of java adapter
|
static String |
getAdapterVersion()
Get version info of java adapter
|
void |
getAllApplications(AckListener listener)
Retrieves an array of data (uuid, running/active state) for all application windows
|
void |
getAllWindows(AckListener listener)
The object passed to callback takes the form:
|
void |
getCommandLineArguments(AckListener listener)
Retrieves the command line argument string that started App Desktop
|
void |
getConfig(String section,
AckListener callback)
Retrieves the Runtime's configuration
|
void |
getEntityInfo(String uuid,
String name,
AckListener listener)
Returns a frame info object relating to the entity specified by the uuid and name passed in.
|
void |
getEnvironmentVariable(String name,
AckListener callback)
Retrieve name of a environment variable
|
void |
getEnvironmentVariables(String[] names,
AckListener callback)
Retrieve name of environment variables
|
void |
getHostSpecs(AckListener listener)
Get system information
|
static org.json.JSONObject |
getInstallInfo()
Retrieve info about RVM and Runtime already installed on desktop.
|
void |
getLog(String logName,
AckListener listener)
Retrieves the contents of the log with the specified filename
|
void |
getLogList(AckListener listener)
Retrieves an array of data objects for all available logs
Each object in the returned array takes the form:
{
name: (string) the filename of the log,
size: (integer) the size of the log in bytes,
date: (integer) the unix time at which the log was created
}
|
void |
getMachineId(AckListener listener)
Gets Machine ID
|
void |
getMonitorInfo(AckListener listener)
Retrieves an object that contains data about the about the
|
CompletableFuture<MonitorInfo> |
getMonitorInfoAsync() |
void |
getMousePosition(AckListener listener)
Returns the mouse in virtual screen coordinates (left, top)
|
void |
getProcessList(AckListener listener)
Retrieves an array of all App Desktop processes that are currently running
Each element in the array is an object containing the uuid
and the name of the application to which the process belongs.
|
void |
getProxySettings(AckListener listener)
Retrieves the proxy settings object
|
void |
getRuntimeInfo(AckListener callback)
Returns the version of the runtime
|
void |
getRvmInfo(AckListener callback)
Returns information about the running RVM
|
void |
getVersion(AckListener listener)
Gets AppDesktop version number
|
void |
launchExternalProcess(org.json.JSONObject launchConfig,
AsyncCallback<LaunchExternalProcessResult> callback,
AckListener listener)
Runs an executable or batch file.
|
void |
launchExternalProcess(String path,
String commandLine,
AsyncCallback<LaunchExternalProcessResult> callback,
AckListener listener)
Runs an executable or batch file.
|
void |
launchManifest(String manifestUrl,
org.json.JSONObject rvmLaunchOptions,
AckListener listener)
Request Runtime to launch app from a manifest
Shape of rvmLaunchOptions
{
noUi: boolean;
userAppConfigArgs: JSONObject;
}
|
void |
log(String level,
String message)
Writes a message to the log
|
void |
log(String level,
String message,
AckListener listener)
Writes a message to the log
|
void |
openUrlWithBrowser()
Opens the passed URL
|
void |
openUrlWithBrowser(AckListener listener)
Opens the passed URL
|
void |
releaseExternalProcess(String processUuid,
AckListener callback)
Removes the process entry for the passed UUID obtained
from a previous call to DesktopSystem.launchExternalProcess().
|
void |
removeEventListener(String type,
EventListener listener,
AckListener callback)
Removes a previously registered event listener from the specified event
|
void |
resolveProxy(String url,
AckListener listener)
Resolve proxy information for a given url
|
void |
setClipboard(String text,
AckListener callback)
Copies text to the clipboard
|
void |
setCookie(String url,
String name,
String value,
long ttl,
boolean secure,
boolean httpOnly,
AckListener callback)
Stores a cookie in the runtime
|
void |
setCookie(String url,
String name,
String value,
String domain,
String path,
long ttl,
boolean secure,
boolean httpOnly,
AckListener callback)
Stores a cookie in the runtime
|
void |
showDeveloperTools(String applicationUUID,
String windowName,
AckListener callback)
Shows Developer tool
|
void |
terminateExternalProcess(String processUuid,
int timeout,
boolean killTree,
AsyncCallback<TerminateExternalProcessResult> callback,
AckListener listener)
Attempts to cleanly close an external process and terminates it
if the close has not occured after the elapsed timeout in milliseconds.
|
void |
updateProxySettings(String type,
String proxyAddress,
int proxyPort,
AckListener listener)
Updates the proxy settings
The passed type can be either "system" or "named".
|
protected DesktopConnection connection
protected org.json.JSONObject eventListenerPayload
protected org.json.JSONObject configPayload
public OpenFinRuntime(DesktopConnection connection)
connection
- Connection object to the AppDesktopDesktopConnection
public void getMachineId(AckListener listener)
listener
- AckListener for machine IDAckListener
public void getEntityInfo(String uuid, String name, AckListener listener)
uuid
- entity uuidname
- entity namelistener
- AckListener for entity infoAckListener
public void getVersion(AckListener listener)
listener
- AckListener for version numberAckListener
public void getCommandLineArguments(AckListener listener)
listener
- AckListener for command line argumentAckListener
public void getProcessList(AckListener listener)
listener
- AckListener for process listAckListener
public void getLog(String logName, AckListener listener)
logName
- The filename of the loglistener
- AckListener for log contentsAckListener
public void getLogList(AckListener listener)
listener
- AckListener for log listAckListener
public void log(String level, String message) throws DesktopException
level
- The log level for the entry. Can be either "info", "warning" or "error"message
- The log message textDesktopException
- if this method fails to send the request to RuntimeDesktopException
public void log(String level, String message, AckListener listener) throws DesktopException
level
- The log level for the entry. Can be either "info", "warning" or "error"message
- The log message textlistener
- AckListener for the resultDesktopException
- if this method fails to send the request to RuntimeDesktopException
,
AckListener
public void getProxySettings(AckListener listener)
The proxy object the callback receives takes the following form: { type: (string) "system" or "named", proxyAddress: (string) the address of the proxy server, proxyPort: (integer) the port of proxy server }
listener
- AckListener for the requestAckListener
public void resolveProxy(String url, AckListener listener)
Proxy setting for the url the callback receives takes the following form: DIRECT or PROXY host:port which can be retrieved with listener.getData()
url
- url to resolvelistener
- AckListener for the requestAckListener
public void updateProxySettings(String type, String proxyAddress, int proxyPort, AckListener listener) throws DesktopException
type
- Type of the proxyproxyAddress
- Address of the proxyproxyPort
- Port of the proxylistener
- AckListener for the requestDesktopException
- if this method fails to send the request to RuntimeDesktopException
,
AckListener
public void clearCache(boolean cache, boolean cookies, boolean localStorage, boolean appcache, boolean userData) throws DesktopException
cache
- If true, clears chrome cachescookies
- If true, deletes all cookieslocalStorage
- If true, clear application cachesappcache
- If true, clears local storageuserData
- If true, clears user dataDesktopException
- if this method fails to send the request to RuntimeDesktopException
public void clearCache(boolean cache, boolean cookies, boolean localStorage, boolean appcache, boolean userData, AckListener listener) throws DesktopException
cache
- If true, clears chrome cachescookies
- If true, deletes all cookieslocalStorage
- If true, clear application cachesappcache
- If true, clears local storageuserData
- If true, clears user datalistener
- AckListener for the requestDesktopException
- if this method fails to send the request to RuntimeDesktopException
,
AckListener
public void deleteCacheOnRestart() throws DesktopException
DesktopException
- if this method fails to send the request to RuntimeDesktopException
public void deleteCacheOnRestart(AckListener listener)
listener
- AckListener for the requestAckListener
public void openUrlWithBrowser(AckListener listener)
listener
- AckListener for the requestAckListener
public void getMonitorInfo(AckListener listener)
monitor setup of the computer that App Desktop is running on. The returned object takes the form: { nonPrimaryMonitors: [{ availableRect: { bottom: (integer) bottom-most available monitor coordinate, left: (integer) left-most available monitor coordinate, right: (integer) right-most available monitor coordinate, top: (integer) top-most available monitor coordinate }, deviceId: (string) device id of the display, displayDeviceActive: (boolean) true if the display is active, monitorRect: { bottom: (integer) bottom-most monitor coordinate, left: (integer) left-most monitor coordinate, right: (integer) right-most monitor coordinate, top: (integer) top-most monitor coordinate }, name: (string) name of the display }, ... ], primaryMonitor: { availableRect: { bottom: (integer) bottom-most available monitor coordinate, left: (integer) left-most available monitor coordinate, right: (integer) right-most available monitor coordinate, top: (integer) top-most available monitor coordinate }, deviceId: (string) device id of the display, displayDeviceActive: (boolean) true if the display is active, monitorRect: { bottom: (integer) bottom-most monitor coordinate, left: (integer) left-most monitor coordinate, right: (integer) right-most monitor coordinate, top: (integer) top-most monitor coordinate }, name: (string) name of the display }, reason: (string) always "api-query", taskbar: { edge: {string} which edge of a monitor the taskbar is on, rect: { bottom: ({integer} bottom-most coordinate of the taskbar), left: ({integer} left-most coordinate of the taskbar), right: ({integer} right-most coordinate of the taskbar), top: ({integer} top-most coordinate of the taskbar) } }, virtualScreen: { bottom: (integer) bottom-most coordinate of the virtual screen, left: (integer) left-most coordinate of the virtual screen, right: (integer) right-most coordinate of the virtual screen, top: (integer) top-most coordinate of the virtual screen } }
listener
- AckListener for the requestAckListener
public CompletableFuture<MonitorInfo> getMonitorInfoAsync()
public void getAllWindows(AckListener listener)
[ { uuid: (string) uuid of the application, mainWindow: { name: (string) name of the main window, top: (integer) top-most coordinate of the main window, right: (integer) right-most coordinate of the main window, bottom: (integer) bottom-most coordinate of the main window, left: (integer) left-most coordinate of the main window }, childWindows: [{ name: (string) name of the child window, top: (integer) top-most coordinate of the child window, right: (integer) right-most coordinate of the child window, bottom: (integer) bottom-most coordinate of the child window, left: (integer) left-most coordinate of the child window }, ... ] }, ... ]
listener
- AckListener for the requestAckListener
public void getAllApplications(AckListener listener)
The object passed to callback takes the form: [ { uuid: (string) uuid of the application, isRunning: (bool) true when the application is running/active }, ... ]
listener
- AckListener for the requestpublic void exit() throws DesktopException
DesktopException
- if this method fails to send the request to RuntimeDesktopException
public void getMousePosition(AckListener listener)
The returned object takes the form: { top: (integer) the top position of the mouse in virtual screen coordinates, left: (integer) the left position of the mouse in virtual screen coordinates }
listener
- AckListener for the requestAckListener
public void openUrlWithBrowser() throws DesktopException
DesktopException
- if this method fails to send the request to RuntimeDesktopException
public void getConfig(String section, AckListener callback) throws DesktopException
section
- Which section to return from the configuration. Pass null to get all sectionscallback
- AckListener for the requestDesktopException
- if this method fails to get Runtime configurationDesktopException
,
AckListener
public void showDeveloperTools(String applicationUUID, String windowName, AckListener callback) throws DesktopException
applicationUUID
- The application IDwindowName
- The name of dev tool windowcallback
- AckListener for the requestDesktopException
- if this method fails to show devtoolsDesktopException
,
AckListener
protected void addEventListener(org.json.JSONObject subscriptionObject, EventListener listener, AckListener callback) throws DesktopException
Supported system event types are: desktop-icon-clicked idle-state-changed monitor-info-changed session-changed
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
,
AckListener
public void addEventListener(String type, EventListener listener, AckListener callback) throws DesktopException
Supported system event types are: desktop-icon-clicked idle-state-changed monitor-info-changed session-changed
type
- Type of the eventlistener
- EventListener for the eventcallback
- AckListener for the requestDesktopException
- if this method fails to add event listener specifiedEventListener
,
AckListener
public 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
,
AckListener
public void launchExternalProcess(String path, String commandLine, AsyncCallback<LaunchExternalProcessResult> callback, AckListener listener) throws DesktopException
path
- The path of the file to launch via the command linecommandLine
- The command line arguments to passcallback
- A function that is called if the method succeedslistener
- A function that is called if the method failsDesktopException
- if this method fails to send the request to RuntimeDesktopException
,
AsyncCallback
,
LaunchExternalProcessResult
,
AckListener
public void launchExternalProcess(org.json.JSONObject launchConfig, AsyncCallback<LaunchExternalProcessResult> callback, AckListener listener) throws DesktopException
launchConfig
- configuration for launching external processcallback
- A function that is called if the method succeedslistener
- A function that is called if the method failsDesktopException
- if this method fails to send the request to RuntimeDesktopException
,
AsyncCallback
,
LaunchExternalProcessResult
,
AckListener
public void terminateExternalProcess(String processUuid, int timeout, boolean killTree, AsyncCallback<TerminateExternalProcessResult> callback, AckListener listener) throws DesktopException
processUuid
- The UUID for a process launched by DesktopSystem.launchExternalProcess()timeout
- The time in milliseconds to wait for a close to occur before terminatingkillTree
- true if child processes are includedcallback
- A function that is called if the method succeed with result code being passedlistener
- A function that is called if the method failsDesktopException
- if this method fails to send the request to RuntimeDesktopException
,
terminateExternalProcess
,
TerminateExternalProcessResult
,
AckListener
public void releaseExternalProcess(String processUuid, AckListener callback) throws DesktopException
processUuid
- The UUID for a process launched by DesktopSystem.launchExternalProcess()callback
- AckListener for the requestDesktopException
- if this method fails to send the request to RuntimeDesktopException
,
AckListener
public void setClipboard(String text, AckListener callback) throws DesktopException
text
- The text to copycallback
- AckListener for the requestDesktopException
- if this method fails to send the request to RuntimeDesktopException
,
AckListener
public void setCookie(String url, String name, String value, long ttl, boolean secure, boolean httpOnly, AckListener callback) throws DesktopException
url
- The URL that the cookie is forname
- The key used to lookup the valuevalue
- The value paired with the key (name)ttl
- The time to till the cookie expires in milliseconds. Never expires when set to 0. Defaults to 0.secure
- Accessible only on a secured connection (SSL)httpOnly
- Accessible only on HTTP/HTTPS.callback
- AckListener for the requestDesktopException
- if this method fails to send the request to RuntimeDesktopException
,
AckListener
public void setCookie(String url, String name, String value, String domain, String path, long ttl, boolean secure, boolean httpOnly, AckListener callback) throws DesktopException
url
- The URL that the cookie is forname
- The key used to lookup the valuevalue
- The value paired with the key (name)domain
- domain of the cookiepath
- path of the cookiettl
- The time to till the cookie expires in milliseconds. Never expires when set to 0. Defaults to 0.secure
- Accessible only on a secured connection (SSL)httpOnly
- Accessible only on HTTP/HTTPS.callback
- AckListener for the requestDesktopException
- if this method fails to send the request to RuntimeDesktopException
,
AckListener
public void getRvmInfo(AckListener callback) throws DesktopException
callback
- AckListener for the requestDesktopException
- if this method fails to send the request to RuntimeDesktopException
,
AckListener
public void getRuntimeInfo(AckListener callback) throws DesktopException
callback
- AckListener for the requestDesktopException
- if this method fails to send the request to RuntimeDesktopException
,
AckListener
public void getEnvironmentVariable(String name, AckListener callback) throws DesktopException
name
- name of the environment variablecallback
- AckListener for the requestDesktopException
- if this method fails to send the request to RuntimeAckListener
,
DesktopException
public void getEnvironmentVariables(String[] names, AckListener callback) throws DesktopException
names
- names of the environment variablecallback
- AckListener for the requestDesktopException
- if this method fails to send the request to RuntimeDesktopException
,
AckListener
public void getHostSpecs(AckListener listener) throws DesktopException
listener
- AckListener for the requestDesktopException
- if this method fails to send the request to RuntimeDesktopException
,
AckListener
public void launchManifest(String manifestUrl, org.json.JSONObject rvmLaunchOptions, AckListener listener) throws DesktopException
manifestUrl
- URL of a manifestrvmLaunchOptions
- launch options used by RVMlistener
- AckListner for the requestDesktopException
- if the request failspublic static String getAdapterVersion()
public static String getAdapterBuildTime()
public static org.json.JSONObject getInstallInfo()
Copyright © 2022. All rights reserved.