Class RuntimeConfiguration


  • public class RuntimeConfiguration
    extends org.json.JSONObject
    Configuration for launching OpenFin Runtime Created by wche on 3/26/2016.
    • 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​(String version)
        Set version number of Runtime to launch
        Parameters:
        version - version number
      • getRuntimeVersion

        public String getRuntimeVersion()
        Get version number of Runtime
        Returns:
        version of Runtime
      • getRuntimeFallbackVersion

        public String getRuntimeFallbackVersion()
        Get fallback version number of Runtime to launch
        Returns:
        fallback version
      • setRuntimeFallbackVersion

        public void setRuntimeFallbackVersion​(String runtimeFallbackVersion)
        Set fallback version number of Runtime to launch
        Parameters:
        runtimeFallbackVersion - fallback version of Runtime
      • setSecurityRealm

        public void setSecurityRealm​(String securityRealm)
        Set security realm of Runtime
        Parameters:
        securityRealm - name of security realm
      • getSecurityRealm

        public String getSecurityRealm()
        Get security realm
        Returns:
        security realm
      • setAdditionalRuntimeArguments

        public void setAdditionalRuntimeArguments​(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 String getAdditionalRvmArguments()
        Get additional arguments for RVM and Installer
        Returns:
        additional arguments
      • setRvmVersion

        public void setRvmVersion​(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​(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​(String supportInformation)
        Specify customized error messages during launch
        Parameters:
        supportInformation - config for support info
      • setAdditionalRvmArguments

        public void setAdditionalRvmArguments​(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 String getLicenseKey()
        Get license key for Runtime
        Returns:
        license key
      • setLicenseKey

        public void setLicenseKey​(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​(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​(String key,
                                         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​(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 String getLaunchRVMPath()
        return value of launchRVMPath
        Returns:
        path
      • getManifestLocation

        public 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 String getLocalManifestFileName()
        Get name of local manifest file name
        Returns:
        file name
      • setLocalManifestFileName

        public void setLocalManifestFileName​(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​(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​(String name,
                               String manifestUrl)
      • generateRuntimeConfig

        public 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​(String manifestUrl)
                                                throws Exception
        Utltity method to load a amnifest from an URL
        Parameters:
        manifestUrl - url of the manifest
        Returns:
        manifest as a JSONObject
        Throws:
        Exception - if the rewquest fails