Interface SessionKernel

    • Method Detail

      • getProjectName

        java.lang.String getProjectName()
        Returns:
        the name of the project associated with the session
      • getGson

        default com.inductiveautomation.ignition.common.gson.Gson getGson()
        Returns:
        a Gson instance for json serialization / de-serialization
      • getLogger

        LoggerEx getLogger()
        Returns:
        the LoggerEx associated with the session
      • getEventBus

        @Deprecated
        com.google.common.eventbus.EventBus getEventBus()
        Deprecated.
        Replaced by getEventManager. To be removed in 8.2.0
      • getSessionId

        java.util.UUID getSessionId()
        Returns:
        the session's unique identifier
      • startup

        void startup()
        Starts up the session kernel
        Throws:
        java.lang.IllegalStateException - if the session kernel has already been started or shutdown
      • shutdown

        void shutdown()
        Shuts down the session kernel
        Throws:
        java.lang.IllegalStateException - if the session has not been started or if it has already been shut down
      • getStartupTime

        long getStartupTime()
        Returns:
        the time in nanoseconds when the session kernel started (or 0 if the session kernel has not yet been started)
      • getLastMessageTime

        long getLastMessageTime()
        Returns:
        the time in nanoseconds when the last message was received by the session containing this kernel
      • touch

        void touch()
        Updates the last message time to the current time in nanoseconds
        See Also:
        System.nanoTime()
      • createToken

        java.lang.String createToken​(java.lang.String type,
                                     com.inductiveautomation.ignition.common.gson.JsonElement data)
        Create a new token associated with the given type and data for the this session kernel. The token expires in 30 seconds.
        Returns:
        the new short-lived token
      • claimToken

        java.util.Optional<com.inductiveautomation.ignition.common.gson.JsonElement> claimToken​(java.lang.String type,
                                                                                                java.lang.String token)
        Claim the given token associated with the given data type previously created by this session kernel.
        Parameters:
        token - the token to claim
        Returns:
        an Optional containing the JsonElement data associated with the given data type and token, or an empty Optional if no data exists for the given data type and token pair