Class AbstractSessionKernel
- java.lang.Object
- 
- com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycle
- 
- com.inductiveautomation.perspective.gateway.session.AbstractSessionKernel
 
 
- 
- All Implemented Interfaces:
- SessionKernel
 
 public abstract class AbstractSessionKernel extends AbstractLifecycle implements SessionKernel Base class forSessionKernelimplementations. Encapsulates the basic properties and lifecycle of a session kernel.
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.java.lang.StringcreateToken(java.lang.String type, com.inductiveautomation.ignition.common.gson.JsonElement jsonElement)Create a new token associated with the given type and data for the this session kernel.com.google.common.eventbus.EventBusgetEventBus()EventManagergetEventManager()longgetLastMessageTime()LoggerExgetLogger()java.lang.StringgetProjectName()PerspectiveSessionCollectiongetSessionCollection()java.util.UUIDgetSessionId()SessionStatsgetSessionStats()longgetStartupTime()protected voidonShutdown()protected voidonStartup()ExecutionQueuequeue()voidtouch()Updates the last message time to the current time in nanoseconds- 
Methods inherited from class com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycleisRunning, shutdown, startup
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface com.inductiveautomation.perspective.gateway.session.SessionKernelgetGson, shutdown, startup
 
- 
 
- 
- 
- 
Method Detail- 
getSessionCollectionpublic PerspectiveSessionCollection getSessionCollection() - Specified by:
- getSessionCollectionin interface- SessionKernel
- Returns:
- the PerspectiveSessionCollectionwhich contains the session
 
 - 
getProjectNamepublic java.lang.String getProjectName() - Specified by:
- getProjectNamein interface- SessionKernel
- Returns:
- the name of the project associated with the session
 
 - 
queuepublic ExecutionQueue queue() - Specified by:
- queuein interface- SessionKernel
- Returns:
- the ExecutionQueueused to run session tasks in serial
 
 - 
getLoggerpublic LoggerEx getLogger() - Specified by:
- getLoggerin interface- SessionKernel
- Returns:
- the LoggerExassociated with the session
 
 - 
getEventBuspublic com.google.common.eventbus.EventBus getEventBus() - Specified by:
- getEventBusin interface- SessionKernel
 
 - 
getEventManagerpublic EventManager getEventManager() - Specified by:
- getEventManagerin interface- SessionKernel
- Returns:
- the EventManagerassociated with the session
 
 - 
getSessionIdpublic java.util.UUID getSessionId() - Specified by:
- getSessionIdin interface- SessionKernel
- Returns:
- the session's unique identifier
 
 - 
getStartupTimepublic long getStartupTime() - Specified by:
- getStartupTimein interface- SessionKernel
- Returns:
- the time in nanoseconds when the session kernel started (or 0 if the session kernel has not yet been started)
 
 - 
getLastMessageTimepublic long getLastMessageTime() - Specified by:
- getLastMessageTimein interface- SessionKernel
- Returns:
- the time in nanoseconds when the last message was received by the session containing this kernel
 
 - 
getSessionStatspublic SessionStats getSessionStats() - Specified by:
- getSessionStatsin interface- SessionKernel
 
 - 
touchpublic void touch() Description copied from interface:SessionKernelUpdates the last message time to the current time in nanoseconds- Specified by:
- touchin interface- SessionKernel
- See Also:
- System.nanoTime()
 
 - 
onStartupprotected void onStartup() - Specified by:
- onStartupin class- AbstractLifecycle
 
 - 
onShutdownprotected void onShutdown() - Specified by:
- onShutdownin class- AbstractLifecycle
 
 - 
createTokenpublic java.lang.String createToken(java.lang.String type, com.inductiveautomation.ignition.common.gson.JsonElement jsonElement)Description copied from interface:SessionKernelCreate a new token associated with the given type and data for the this session kernel. The token expires in 30 seconds.- Specified by:
- createTokenin interface- SessionKernel
- Returns:
- the new short-lived token
 
 - 
claimTokenpublic java.util.Optional<com.inductiveautomation.ignition.common.gson.JsonElement> claimToken(java.lang.String type, java.lang.String token)Description copied from interface:SessionKernelClaim the given token associated with the given data type previously created by this session kernel.- Specified by:
- claimTokenin interface- SessionKernel
- token- the token to claim
- Returns:
- an Optionalcontaining theJsonElementdata associated with the given data type and token, or an empty Optional if no data exists for the given data type and token pair
 
 
- 
 
-