Class LaunchContextImpl

java.lang.Object
com.inductiveautomation.ignition.client.launch.LaunchContextImpl
All Implemented Interfaces:
LaunchContext

public class LaunchContextImpl extends Object implements LaunchContext
  • Constructor Details

  • Method Details

    • getScopeCode

      public String getScopeCode()
      Specified by:
      getScopeCode in interface LaunchContext
      Returns:
      "C" for client, "D" for designer
    • getBundle

      public ResourceBundle getBundle()
    • getCacheDir

      public File getCacheDir()
      Description copied from interface: LaunchContext
      The base of the cache dirs: %USER_HOME%/.ignition/cache/
      Specified by:
      getCacheDir in interface LaunchContext
    • getResourceDir

      public File getResourceDir()
      Description copied from interface: LaunchContext
      The base of the cached resources: %USER_HOME%/.ignition/cache/resources/
      Specified by:
      getResourceDir in interface LaunchContext
    • log

      public void log(String message, Object... args)
      Description copied from interface: LaunchContext
      A shortcut for:

       getLog().printf(message, args);
       getLog().println();
       
      Specified by:
      log in interface LaunchContext
    • getLog

      public PrintWriter getLog()
      Description copied from interface: LaunchContext
      A PrintWriter that steps can use to log their progress. Under normal conditions, this log is echoed to System.out. However, if an error ever occurs during the launch procedure, the entire contents of the log will be written to a launch crash file under the user's cache dir.
      Specified by:
      getLog in interface LaunchContext
    • getLogContents

      public String getLogContents()
    • getTranslationDBLocation

      public File getTranslationDBLocation()
      Description copied from interface: LaunchContext
      Returns the location of the cached translation term db file. The file will be in the form of "XXX_e{d}_v{d}.dat". The "e{d}" is the edit version, the "v{d}" is the serialization version.
      Specified by:
      getTranslationDBLocation in interface LaunchContext
    • setTranDBLocation

      public void setTranDBLocation(File tranDBLocation)
    • getLaunchManifest

      public LaunchManifest getLaunchManifest()
      Description copied from interface: LaunchContext
      This LaunchManifest is downloaded from the gateway during ConnectStep. It describes all JAR files that will we'll need to start up the app of this context, including their CRC32 checksums. Will only be set after ConnectStep finishes.
      Specified by:
      getLaunchManifest in interface LaunchContext
    • setLaunchManifest

      public void setLaunchManifest(LaunchManifest launchManifest)
    • getDownloadRequiredManifest

      public LaunchManifest getDownloadRequiredManifest()
    • setDownloadRequiredManifest

      public void setDownloadRequiredManifest(LaunchManifest downloadRequiredManifest)
    • getGwCacheDir

      public File getGwCacheDir()
      Description copied from interface: LaunchContext
      The actual cache directory for the specific gateway that we ended up connecting to. Only set after CacheStep runs. %USER_HOME%/.ignition/cache/gwHOST_HTTP_HTTPS_CONTEXT/Cx where "x" is the client ID that this JVM has claimed. Each JVM gets its own cache dir so that the they don't step on each other's toes when downloading/modifying jar files.
      Specified by:
      getGwCacheDir in interface LaunchContext
    • setGwCacheDir

      public void setGwCacheDir(File gwCacheDir)
    • getMainClass

      public String getMainClass()
      Description copied from interface: LaunchContext
      The name of the class that should be started during StartupStep
      Specified by:
      getMainClass in interface LaunchContext
    • getGatewayAddresses

      public List<GatewayAddress> getGatewayAddresses()
      Specified by:
      getGatewayAddresses in interface LaunchContext
    • setGatewayAddresses

      public void setGatewayAddresses(List<GatewayAddress> gatewayAddresses)
    • updateGatewayAddressListCache

      public void updateGatewayAddressListCache(List<GatewayAddress> addrs)
      Description copied from interface: LaunchContext
      Updates the cache with a list of gateway addresses that will be available for use next time this project is loaded. Should be update when the client receives notification that new cluster gateways have been added
      Specified by:
      updateGatewayAddressListCache in interface LaunchContext
    • getGatewayAddress

      public GatewayAddress getGatewayAddress()
      Specified by:
      getGatewayAddress in interface LaunchContext
    • setGatewayAddress

      public void setGatewayAddress(GatewayAddress gatewayAddress)
    • getProjectName

      public String getProjectName()
      Description copied from interface: LaunchContext
      The name of the project. May not be used in all scopes
      Specified by:
      getProjectName in interface LaunchContext
    • getPlatformEdition

      public String getPlatformEdition()
      Description copied from interface: LaunchContext
      The platform edition. Standard edition = "", Edge edition = "edge"
      Specified by:
      getPlatformEdition in interface LaunchContext
    • getEdgeFlags

      public List<String> getEdgeFlags()
      Description copied from interface: LaunchContext
      Currently should return an empty list if edition is not edge.
      Specified by:
      getEdgeFlags in interface LaunchContext
    • getProjectCacheFile

      public File getProjectCacheFile()
      Specified by:
      getProjectCacheFile in interface LaunchContext
    • getProjectCacheChkFile

      public File getProjectCacheChkFile()
      Specified by:
      getProjectCacheChkFile in interface LaunchContext
    • getProjectCacheSignatureFile

      public File getProjectCacheSignatureFile()
      This is the project snapshot that we can send to the gw to get changes.
    • updateProjectCache

      public void updateProjectCache(LaunchContext.WritableProject project) throws IOException
      Description copied from interface: LaunchContext
      This overload of updateProjectCache takes a WriteableProject, which lets the project be streamed. We cannot remove the old byte[] version, because of re-targeting compatibility.
      Specified by:
      updateProjectCache in interface LaunchContext
      Throws:
      IOException
    • getParent

      public LaunchParent getParent()
      Specified by:
      getParent in interface LaunchContext
    • getUserObject

      public byte[] getUserObject()
      Description copied from interface: LaunchContext
      Returns a serialized user object (if any) that was passed as part of a restart
      Specified by:
      getUserObject in interface LaunchContext
    • getAttribute

      public <T> T getAttribute(String key)
      Description copied from interface: LaunchContext
      A free-for-all map of objects that clients can use to communicate between launches. Beware that one should only store types is this map that are loaded by the system classloader - not custom objects. Any custom objects should be serialized to a byte[] first.
      Specified by:
      getAttribute in interface LaunchContext
    • getAttribute

      public <T> T getAttribute(String key, T defaultValue)
      Specified by:
      getAttribute in interface LaunchContext
    • setAttribute

      public void setAttribute(String key, Object value)
      Specified by:
      setAttribute in interface LaunchContext
    • getAttributes

      public Map<String,Object> getAttributes()
      Description copied from interface: LaunchContext
      Retrieves the raw attribute map
      Specified by:
      getAttributes in interface LaunchContext