Class RuntimeConfiguration


  • public class RuntimeConfiguration
    extends org.json.JSONObject
    Configuration for launching OpenFin Runtime Created by wche on 3/26/2016.
    • Field Summary

      • Fields inherited from class org.json.JSONObject

        NULL
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addAppAsset​(org.json.JSONObject assetConfig)
      Add configuration of an app asset
      void addConfigurationItem​(java.lang.String key, java.lang.Object value)
      Add a configuration setting for launching Runtime.
      void addService​(java.lang.String name, java.lang.String manifestUrl)  
      java.lang.String generateRuntimeConfig()
      Generates JSON string that can be passed as --config to RVM and Insaller
      java.lang.String getAdditionalRvmArguments()
      Get additional arguments for RVM and Installer
      java.lang.String getLaunchRVMPath()
      return value of launchRVMPath
      java.lang.String getLicenseKey()
      Get license key for Runtime
      java.lang.String getLocalManifestFileName()
      Get name of local manifest file name
      java.lang.String getManifestLocation()
      Get location of app manifest.
      int getMaxMessageSize()
      Get max size of each message between Java adapter and Runtime
      java.lang.String getRuntimeFallbackVersion()
      Get fallback version number of Runtime to launch
      int getRuntimePort()
      Get port number of Runtime websocket server
      java.lang.String getRuntimeVersion()
      Get version number of Runtime
      java.lang.String getSecurityRealm()
      Get security realm
      boolean isDoNotLaunch()
      Get value of RVM option doNotLaunch setting
      boolean isNonPersistent()
      Get value of nonPersistent
      boolean isUseNamedPipePortDiscovery()  
      static org.json.JSONObject loadManifest​(java.lang.String manifestUrl)
      Utltity method to load a amnifest from an URL
      void setAdditionalRuntimeArguments​(java.lang.String additionalRuntimeArguments)
      Set additional arguments for Runtime
      void setAdditionalRvmArguments​(java.lang.String additionalRvmArguments)
      Set additional arguments for RVM and Installer
      void setDevToolsPort​(int port)
      Set port for accessing devtools on localhost
      void setDialogSettings​(org.json.JSONObject dialogSettings)
      set configuration to customize the appearance of the RVM progress dialog
      void setDoNotLaunch​(boolean doNotLaunch)
      RVM option, to perform all of the startup sequence steps but do not launch the app
      void setLaunchRVMPath​(java.lang.String path)
      By default, Java adapter launches Runtime with OpenFin installer.
      void setLicenseKey​(java.lang.String licenseKey)
      Set license key for Runtime
      void setLocalManifestFileName​(java.lang.String localManifestFileName)
      Set name of automatically generated local manifest file.
      void setManifestLocation​(java.lang.String manifestLocation)
      Set location of app manifest
      void setMaxMessageSize​(int maxMessageSize)
      Set max size of each message between Java adapter and Runtime
      void setNonPersistent​(java.lang.Boolean nonPersistent)
      Automatically disconnect the adapter from the runtime when the last application or persistent connection closes Defaults to false
      void setRuntimeFallbackVersion​(java.lang.String runtimeFallbackVersion)
      Set fallback version number of Runtime to launch
      void setRuntimePort​(int runtimePort)
      Set port number of Runtime websocket server
      void setRuntimeVersion​(java.lang.String version)
      Set version number of Runtime to launch
      void setRvmVersion​(java.lang.String rvmVersion)
      set Defines the minimum RVM version the app requires.
      void setSecurityRealm​(java.lang.String securityRealm)
      Set security realm of Runtime
      void setShortCut​(org.json.JSONObject shortCut)
      set configuration for shortcut
      void setSplashScreenImage​(java.lang.String splashScreenImage)
      Specify an image to display while the runtime is loading.
      void setStartupApp​(org.json.JSONObject startupApp)
      Set configuration of startup application.
      void setSupportInformation​(java.lang.String supportInformation)
      Specify customized error messages during launch
      void setUseNamedPipePortDiscovery​(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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • RuntimeConfiguration

        public RuntimeConfiguration()
        Constructor
    • Method Detail

      • 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 setting
        value - 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.Exception
        Utltity 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