Class SessionKernelWrapper<T extends SessionKernel>
- java.lang.Object
- 
- com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycle
- 
- com.inductiveautomation.perspective.gateway.session.SessionKernelWrapper<T>
 
 
- 
- Type Parameters:
- T- the type of- SessionKernelto be encapsulated by this wrapper
 - All Implemented Interfaces:
- AuditingContext,- LoggingContext,- PerspectiveElement,- PropertyTreeOwner,- Session,- InternalSession,- SessionKernel
 - Direct Known Subclasses:
- AbstractSession,- SecuredPerspectiveProjectSession
 
 public abstract class SessionKernelWrapper<T extends SessionKernel> extends AbstractLifecycle implements SessionKernel, InternalSession Base class for Perspective Sessions which wrap a session kernel. AllSessionKernelmethods in this class will proxy calls to the delegate session kernel.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface com.inductiveautomation.perspective.gateway.session.InternalSessionInternalSession.PageVisitor
 - 
Nested classes/interfaces inherited from interface com.inductiveautomation.perspective.gateway.api.SessionSession.WebAuthStatusChangeEvent
 
- 
 - 
Field Summary- 
Fields inherited from interface com.inductiveautomation.perspective.gateway.session.InternalSessionSESSION
 
- 
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidbroadcast(java.lang.String protocol, java.lang.String payload)Broadcast a message to all pages associated with this sessionjava.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 data)Create a new token associated with the given type and data for the this session kernel.AuditContext.BuildergetAuditSnapshot()com.google.common.eventbus.EventBusgetEventBus()EventManagergetEventManager()AnEventManagerfor events targeted to the running Perspective Project this session.com.inductiveautomation.ignition.common.gson.GsongetGson()longgetLastComm(java.util.concurrent.TimeUnit timeUnit)Return the time in the given time unit when the last communication was received from the clientlonggetLastMessageTime()LoggerExgetLogger()java.lang.StringgetLogoutMessage()java.lang.StringgetPageClosedMessage()java.lang.StringgetProjectName()The project that this session is running.java.lang.StringgetSessionClosedMessage()PerspectiveSessionCollectiongetSessionCollection()java.util.UUIDgetSessionId()PerspectiveSessionInfogetSessionInfo()SessionStatsgetSessionStats()longgetStartupTime()longgetUptime(java.util.concurrent.TimeUnit timeUnit)Return the amount of time elapsed in the given time unit since the session started up.voidonHello()Called every time the hello API is invoked on this session.protected voidonShutdown()protected voidonStartup()ExecutionQueuequeue()Queue upon which all work for components and their properties should occur onvoidtouch()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.api.AuditingContextaudit
 - 
Methods inherited from interface com.inductiveautomation.perspective.gateway.session.InternalSessionclose, closePage, closePage, destroySession, findPage, getBindingCount, getComponentCount, getLocale, getOrCreatePage, getPageCount, getPages, getPerspectiveContext, getProject, getTimeZone, getTimeZoneId, getViewCount, isRunning, logout, notifyConnected, notifyDisconnected, onKeepaliveReceived, onLoginResponse, onLogoutResponse, onSessionInit, receive, scope, shutdown, startup, updateSessionProps, visitPage
 - 
Methods inherited from interface com.inductiveautomation.perspective.gateway.api.LoggingContextmdc, mdcSetupTree, mdcTeardownTree, mdcWrap
 - 
Methods inherited from interface com.inductiveautomation.perspective.gateway.api.PerspectiveElementcreatePropertyReference, getAuditProfile, getQualifiedPath
 - 
Methods inherited from interface com.inductiveautomation.perspective.gateway.api.PropertyTreeOwnergetPropertyTreeOf
 - 
Methods inherited from interface com.inductiveautomation.perspective.gateway.api.SessioncreateViewModel, findViewConfig, getGatewayContext, getMdcParent, getName, getNamedQueryManager, getPage, getPageTimeout, getScriptManager, getSession, getTagHistoryManager, getTagManager, getView, getWebAuthStatus, mdcSetup, mdcTeardown, refreshBinding, sendErrorToDesigner
 - 
Methods inherited from interface com.inductiveautomation.perspective.gateway.session.SessionKernelshutdown, startup
 
- 
 
- 
- 
- 
Method Detail- 
getSessionCollectionpublic PerspectiveSessionCollection getSessionCollection() - Specified by:
- getSessionCollectionin interface- InternalSession
- Specified by:
- getSessionCollectionin interface- SessionKernel
- Returns:
- the PerspectiveSessionCollectionwhich contains the session
 
 - 
getProjectNamepublic java.lang.String getProjectName() Description copied from interface:SessionThe project that this session is running.- Specified by:
- getProjectNamein interface- Session
- Specified by:
- getProjectNamein interface- SessionKernel
- Returns:
- the name of the project associated with the session
 
 - 
getGsonpublic com.inductiveautomation.ignition.common.gson.Gson getGson() - Specified by:
- getGsonin interface- SessionKernel
- Returns:
- a Gsoninstance for json serialization / de-serialization
 
 - 
queuepublic ExecutionQueue queue() Description copied from interface:SessionQueue upon which all work for components and their properties should occur on- Specified by:
- queuein interface- Session
- Specified by:
- queuein interface- SessionKernel
- Returns:
- the ExecutionQueueused to run session tasks in serial
 
 - 
getLoggerpublic LoggerEx getLogger() - Specified by:
- getLoggerin interface- LoggingContext
- Specified by:
- getLoggerin interface- SessionKernel
- Returns:
- the LoggerExassociated with the session
 
 - 
getEventBuspublic com.google.common.eventbus.EventBus getEventBus() - Specified by:
- getEventBusin interface- Session
- Specified by:
- getEventBusin interface- SessionKernel
 
 - 
getEventManagerpublic EventManager getEventManager() Description copied from interface:SessionAnEventManagerfor events targeted to the running Perspective Project this session.- Specified by:
- getEventManagerin interface- Session
- Specified by:
- getEventManagerin interface- SessionKernel
- Returns:
- the EventManagerassociated with the session
 
 - 
getSessionIdpublic java.util.UUID getSessionId() - Specified by:
- getSessionIdin interface- Session
- 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- Session
- Specified by:
- getSessionStatsin interface- SessionKernel
- Returns:
- An object containing various statistics that pertain to this session. Also useful for registering metrics that will automatically get removed when this session is shut down.
 
 - 
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()
 
 - 
broadcastprotected abstract void broadcast(java.lang.String protocol, java.lang.String payload)Broadcast a message to all pages associated with this session- Parameters:
- protocol- the protocol of the message to broadcast
- payload- the payload of the message to broadcast
 
 - 
onStartupprotected void onStartup() - Specified by:
- onStartupin class- AbstractLifecycle
 
 - 
onShutdownprotected void onShutdown() - Specified by:
- onShutdownin class- AbstractLifecycle
 
 - 
onHellopublic void onHello() Description copied from interface:InternalSessionCalled every time the hello API is invoked on this session.- Specified by:
- onHelloin interface- InternalSession
 
 - 
getSessionInfopublic PerspectiveSessionInfo getSessionInfo() - Specified by:
- getSessionInfoin interface- InternalSession
- Returns:
- a report about this session
 
 - 
getUptimepublic long getUptime(java.util.concurrent.TimeUnit timeUnit) Description copied from interface:InternalSessionReturn the amount of time elapsed in the given time unit since the session started up.- Specified by:
- getUptimein interface- InternalSession
- Parameters:
- timeUnit- the- TimeUnitto which the internal startup time should be converted
- Returns:
- the up time in the given unit
 
 - 
getLastCommpublic long getLastComm(java.util.concurrent.TimeUnit timeUnit) Description copied from interface:InternalSessionReturn the time in the given time unit when the last communication was received from the client- Specified by:
- getLastCommin interface- InternalSession
- Parameters:
- timeUnit- the- TimeUnitto which the last communication time should be converted
- Returns:
- the last communication time in the given unit
 
 - 
getSessionClosedMessagepublic java.lang.String getSessionClosedMessage() - Specified by:
- getSessionClosedMessagein interface- InternalSession
- Returns:
- the default message sent to the client when the session is closed
 
 - 
getPageClosedMessagepublic java.lang.String getPageClosedMessage() - Specified by:
- getPageClosedMessagein interface- InternalSession
- Returns:
- the default message sent to the client then a page is closed
 
 - 
getLogoutMessagepublic java.lang.String getLogoutMessage() - Specified by:
- getLogoutMessagein interface- InternalSession
- Returns:
- the default message sent to the client when the user logs out
 
 - 
getAuditSnapshot@Nonnull public AuditContext.Builder getAuditSnapshot() - Specified by:
- getAuditSnapshotin interface- AuditingContext
- Returns:
- A new, or extended, AuditContext.Builder, with qualified information about the current scope.
 
 - 
createTokenpublic java.lang.String createToken(java.lang.String type, com.inductiveautomation.ignition.common.gson.JsonElement data)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- InternalSession
- 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- InternalSession
- 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
 
 
- 
 
-