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.
 All 
SessionKernel methods in this class will proxy calls to the delegate session kernel.- 
Nested Class SummaryNested classes/interfaces inherited from interface com.inductiveautomation.perspective.gateway.session.InternalSessionInternalSession.PageVisitorNested classes/interfaces inherited from interface com.inductiveautomation.perspective.gateway.api.SessionSession.WebAuthStatusChangeEvent
- 
Field SummaryFields inherited from interface com.inductiveautomation.perspective.gateway.session.InternalSessionSESSION
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract voidBroadcast a message to all pages associated with this sessionOptional<com.inductiveautomation.ignition.common.gson.JsonElement>claimToken(String type, String token) Claim the given token associated with the given data type previously created by this session kernel.createToken(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.com.google.common.eventbus.EventBusAnEventManagerfor events targeted to the running Perspective Project this session.com.inductiveautomation.ignition.common.gson.GsongetGson()longgetLastComm(TimeUnit timeUnit) Return the time in the given time unit when the last communication was received from the clientlongThe project that this session is running.longlongReturn 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 voidprotected voidqueue()Queue upon which all work for components and their properties should occur onvoidtouch()Updates the last message time to the current time in nanosecondsMethods inherited from class com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycleisRunning, shutdown, startupMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.inductiveautomation.perspective.gateway.api.AuditingContextauditMethods 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, visitPageMethods inherited from interface com.inductiveautomation.perspective.gateway.api.LoggingContextmdc, mdcSetupTree, mdcTeardownTree, mdcWrapMethods inherited from interface com.inductiveautomation.perspective.gateway.api.PerspectiveElementcreatePropertyReference, getAuditProfile, getQualifiedPathMethods inherited from interface com.inductiveautomation.perspective.gateway.api.PropertyTreeOwnergetPropertyTreeOfMethods 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, sendErrorToDesignerMethods inherited from interface com.inductiveautomation.perspective.gateway.session.SessionKernelshutdown, startup
- 
Method Details- 
getSessionCollection- Specified by:
- getSessionCollectionin interface- InternalSession
- Specified by:
- getSessionCollectionin interface- SessionKernel
- Returns:
- the PerspectiveSessionCollectionwhich contains the session
 
- 
getProjectNameDescription 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
 
- 
queueDescription 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
 
- 
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
 
- 
getEventManagerDescription 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
 
- 
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
 
- 
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:
 
- 
broadcastBroadcast 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
 
- 
getSessionInfo- Specified by:
- getSessionInfoin interface- InternalSession
- Returns:
- a report about this session
 
- 
getUptimeDescription 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
 
- 
getLastCommDescription 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
 
- 
getSessionClosedMessage- Specified by:
- getSessionClosedMessagein interface- InternalSession
- Returns:
- the default message sent to the client when the session is closed
 
- 
getPageClosedMessage- Specified by:
- getPageClosedMessagein interface- InternalSession
- Returns:
- the default message sent to the client then a page is closed
 
- 
getLogoutMessage- Specified by:
- getLogoutMessagein interface- InternalSession
- Returns:
- the default message sent to the client when the user logs out
 
- 
getAuditSnapshot- Specified by:
- getAuditSnapshotin interface- AuditingContext
- Returns:
- A new, or extended, AuditContext.Builder, with qualified information about the current scope.
 
- 
createTokenpublic String createToken(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 Optional<com.inductiveautomation.ignition.common.gson.JsonElement> claimToken(String type, 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
 
 
-