Package com.openfin.desktop
Class RuntimeConfiguration
java.lang.Object
org.json.JSONObject
com.openfin.desktop.RuntimeConfiguration
public class RuntimeConfiguration
extends org.json.JSONObject
Configuration for launching OpenFin Runtime
Created by wche on 3/26/2016.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description RuntimeConfiguration()Constructor -
Method Summary
Modifier and Type Method Description voidaddAppAsset(org.json.JSONObject assetConfig)Add configuration of an app assetvoidaddConfigurationItem(java.lang.String key, java.lang.Object value)Add a configuration setting for launching Runtime.voidaddService(java.lang.String name, java.lang.String manifestUrl)java.lang.StringgenerateRuntimeConfig()Generates JSON string that can be passed as --config to RVM and Insallerjava.lang.StringgetAdditionalRvmArguments()Get additional arguments for RVM and Installerjava.lang.StringgetLaunchRVMPath()return value of launchRVMPathjava.lang.StringgetLicenseKey()Get license key for Runtimejava.lang.StringgetLocalManifestFileName()Get name of local manifest file namejava.lang.StringgetManifestLocation()Get location of app manifest.intgetMaxMessageSize()Get max size of each message between Java adapter and Runtimejava.lang.StringgetRuntimeFallbackVersion()Get fallback version number of Runtime to launchintgetRuntimePort()Get port number of Runtime websocket serverjava.lang.StringgetRuntimeVersion()Get version number of Runtimejava.lang.StringgetSecurityRealm()Get security realmbooleanisDoNotLaunch()Get value of RVM option doNotLaunch settingbooleanisNonPersistent()Get value of nonPersistentbooleanisUseNamedPipePortDiscovery()static org.json.JSONObjectloadManifest(java.lang.String manifestUrl)Utltity method to load a amnifest from an URLvoidsetAdditionalRuntimeArguments(java.lang.String additionalRuntimeArguments)Set additional arguments for RuntimevoidsetAdditionalRvmArguments(java.lang.String additionalRvmArguments)Set additional arguments for RVM and InstallervoidsetDevToolsPort(int port)Set port for accessing devtools on localhostvoidsetDialogSettings(org.json.JSONObject dialogSettings)set configuration to customize the appearance of the RVM progress dialogvoidsetDoNotLaunch(boolean doNotLaunch)RVM option, to perform all of the startup sequence steps but do not launch the appvoidsetLaunchRVMPath(java.lang.String path)By default, Java adapter launches Runtime with OpenFin installer.voidsetLicenseKey(java.lang.String licenseKey)Set license key for RuntimevoidsetLocalManifestFileName(java.lang.String localManifestFileName)Set name of automatically generated local manifest file.voidsetManifestLocation(java.lang.String manifestLocation)Set location of app manifestvoidsetMaxMessageSize(int maxMessageSize)Set max size of each message between Java adapter and RuntimevoidsetNonPersistent(java.lang.Boolean nonPersistent)Automatically disconnect the adapter from the runtime when the last application or persistent connection closes Defaults to falsevoidsetRuntimeFallbackVersion(java.lang.String runtimeFallbackVersion)Set fallback version number of Runtime to launchvoidsetRuntimePort(int runtimePort)Set port number of Runtime websocket servervoidsetRuntimeVersion(java.lang.String version)Set version number of Runtime to launchvoidsetRvmVersion(java.lang.String rvmVersion)set Defines the minimum RVM version the app requires.voidsetSecurityRealm(java.lang.String securityRealm)Set security realm of RuntimevoidsetShortCut(org.json.JSONObject shortCut)set configuration for shortcutvoidsetSplashScreenImage(java.lang.String splashScreenImage)Specify an image to display while the runtime is loading.voidsetStartupApp(org.json.JSONObject startupApp)Set configuration of startup application.voidsetSupportInformation(java.lang.String supportInformation)Specify customized error messages during launchvoidsetUseNamedPipePortDiscovery(boolean useNamedPipePortDiscovery)Methods inherited from class org.json.JSONObject
accumulate, append, clear, doubleToString, entrySet, get, getBigDecimal, getBigInteger, getBoolean, getDouble, getEnum, getFloat, getInt, getJSONArray, getJSONObject, getLong, getNames, getNames, getNumber, getString, has, increment, isDecimalNotation, isEmpty, isNull, keys, keySet, length, names, numberToString, opt, optBigDecimal, optBigInteger, optBoolean, optBoolean, optDouble, optDouble, optEnum, optEnum, optFloat, optFloat, optInt, optInt, optJSONArray, optJSONObject, optLong, optLong, optNumber, optNumber, optQuery, optQuery, optString, optString, put, put, put, put, put, put, put, put, putOnce, putOpt, query, query, quote, quote, remove, similar, stringToNumber, stringToValue, testValidity, toJSONArray, toMap, toString, toString, valueToString, wrap, write, write
-
Constructor Details
-
RuntimeConfiguration
public RuntimeConfiguration()Constructor
-
-
Method Details
-
setDevToolsPort
public void setDevToolsPort(int port)Set port for accessing devtools on localhost- Parameters:
port- port number
-
setRuntimeVersion
public void setRuntimeVersion(java.lang.String version)Set version number of Runtime to launch- Parameters:
version- version number
-
getRuntimeVersion
public java.lang.String getRuntimeVersion()Get version number of Runtime- Returns:
- version of Runtime
-
getRuntimeFallbackVersion
public java.lang.String getRuntimeFallbackVersion()Get fallback version number of Runtime to launch- Returns:
- fallback version
-
setRuntimeFallbackVersion
public void setRuntimeFallbackVersion(java.lang.String runtimeFallbackVersion)Set fallback version number of Runtime to launch- Parameters:
runtimeFallbackVersion- fallback version of Runtime
-
setSecurityRealm
public void setSecurityRealm(java.lang.String securityRealm)Set security realm of Runtime- Parameters:
securityRealm- name of security realm
-
getSecurityRealm
public java.lang.String getSecurityRealm()Get security realm- Returns:
- security realm
-
setAdditionalRuntimeArguments
public void setAdditionalRuntimeArguments(java.lang.String additionalRuntimeArguments)Set additional arguments for Runtime- Parameters:
additionalRuntimeArguments- additional arguments
-
addAppAsset
public void addAppAsset(org.json.JSONObject assetConfig)Add configuration of an app asset- Parameters:
assetConfig- configuration in JSON format
-
getAdditionalRvmArguments
public java.lang.String getAdditionalRvmArguments()Get additional arguments for RVM and Installer- Returns:
- additional arguments
-
setRvmVersion
public void setRvmVersion(java.lang.String rvmVersion)set Defines the minimum RVM version the app requires. This option is available in RVM 2.3 or greater- Parameters:
rvmVersion- version of RVM required
-
setShortCut
public void setShortCut(org.json.JSONObject shortCut)set configuration for shortcut- Parameters:
shortCut- config for shortcut
-
setDialogSettings
public void setDialogSettings(org.json.JSONObject dialogSettings)set configuration to customize the appearance of the RVM progress dialog- Parameters:
dialogSettings- config for dialog
-
setSplashScreenImage
public void setSplashScreenImage(java.lang.String splashScreenImage)Specify an image to display while the runtime is loading. It takes any image file (including semi-transparent PNGs)- Parameters:
splashScreenImage- URL of the image
-
setSupportInformation
public void setSupportInformation(java.lang.String supportInformation)Specify customized error messages during launch- Parameters:
supportInformation- config for support info
-
setAdditionalRvmArguments
public void setAdditionalRvmArguments(java.lang.String additionalRvmArguments)Set additional arguments for RVM and Installer- Parameters:
additionalRvmArguments- set additional arguments
-
setStartupApp
public void setStartupApp(org.json.JSONObject startupApp)Set configuration of startup application.- Parameters:
startupApp- configuration in JSON format
-
getLicenseKey
public java.lang.String getLicenseKey()Get license key for Runtime- Returns:
- license key
-
setLicenseKey
public void setLicenseKey(java.lang.String licenseKey)Set license key for Runtime- Parameters:
licenseKey- license key
-
isNonPersistent
public boolean isNonPersistent()Get value of nonPersistent- Returns:
- value of nonPersistent
-
setNonPersistent
public void setNonPersistent(java.lang.Boolean nonPersistent)Automatically disconnect the adapter from the runtime when the last application or persistent connection closes Defaults to false- Parameters:
nonPersistent- true for non persistent connection
-
setDoNotLaunch
public void setDoNotLaunch(boolean doNotLaunch)RVM option, to perform all of the startup sequence steps but do not launch the app- Parameters:
doNotLaunch- true to add --do-not-launch options for RVM
-
isDoNotLaunch
public boolean isDoNotLaunch()Get value of RVM option doNotLaunch setting- Returns:
- value of doNotLaunch
-
isUseNamedPipePortDiscovery
public boolean isUseNamedPipePortDiscovery() -
setUseNamedPipePortDiscovery
public void setUseNamedPipePortDiscovery(boolean useNamedPipePortDiscovery) -
addConfigurationItem
public void addConfigurationItem(java.lang.String key, java.lang.Object value)Add a configuration setting for launching Runtime. value can be type of Integer, Long, Double, String or JSONObject- Parameters:
key- key value of the settingvalue- value of the setting
-
setLaunchRVMPath
public void setLaunchRVMPath(java.lang.String path)By default, Java adapter launches Runtime with OpenFin installer. If RVM path is set, installer is skipped and RVM is started instead.- Parameters:
path- path for RVM
-
getLaunchRVMPath
public java.lang.String getLaunchRVMPath()return value of launchRVMPath- Returns:
- path
-
getManifestLocation
public java.lang.String getManifestLocation()Get location of app manifest. If manifest is set, some fields, such as runtimeVersion, will be copied from the manifest- Returns:
- location of app manifest
-
getLocalManifestFileName
public java.lang.String getLocalManifestFileName()Get name of local manifest file name- Returns:
- file name
-
setLocalManifestFileName
public void setLocalManifestFileName(java.lang.String localManifestFileName)Set name of automatically generated local manifest file. Only name of the file, not path, should be specified. An extension of ".json" is appended.- Parameters:
localManifestFileName- file name
-
setManifestLocation
public void setManifestLocation(java.lang.String manifestLocation)Set location of app manifest- Parameters:
manifestLocation- location of app manifest
-
getMaxMessageSize
public int getMaxMessageSize()Get max size of each message between Java adapter and Runtime- Returns:
- max size
-
setMaxMessageSize
public void setMaxMessageSize(int maxMessageSize)Set max size of each message between Java adapter and Runtime- Parameters:
maxMessageSize- max size
-
getRuntimePort
public int getRuntimePort()Get port number of Runtime websocket server- Returns:
- port number
-
setRuntimePort
public void setRuntimePort(int runtimePort)Set port number of Runtime websocket server- Parameters:
runtimePort- port number
-
addService
public void addService(java.lang.String name, java.lang.String manifestUrl) -
generateRuntimeConfig
public java.lang.String generateRuntimeConfig()Generates JSON string that can be passed as --config to RVM and Insaller- Returns:
- JSON string
-
loadManifest
public static org.json.JSONObject loadManifest(java.lang.String manifestUrl) throws java.lang.ExceptionUtltity method to load a amnifest from an URL- Parameters:
manifestUrl- url of the manifest- Returns:
- manifest as a JSONObject
- Throws:
java.lang.Exception- if the rewquest fails
-