Class PerspectiveProjectSession
java.lang.Object
com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycle
com.inductiveautomation.perspective.gateway.session.SessionKernelWrapper<T>
com.inductiveautomation.perspective.gateway.session.AbstractSession<SecuredPerspectiveProjectSession>
com.inductiveautomation.perspective.gateway.session.PerspectiveProjectSession
- All Implemented Interfaces:
AuditingContext,LoggingContext,PerspectiveElement,PropertyTreeOwner,Session,InternalSession,SessionKernel
Contains a running Perspective project for a session. Includes the pages, bindings, property trees, and property
change scripts. Runs the configured session startup script on startup and the shutdown script on shutdown.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.inductiveautomation.perspective.gateway.session.InternalSession
InternalSession.PageVisitorNested classes/interfaces inherited from interface com.inductiveautomation.perspective.gateway.api.Session
Session.WebAuthStatusChangeEvent -
Field Summary
Fields inherited from class com.inductiveautomation.perspective.gateway.session.AbstractSession
bindings, changeScripts, handlers, pages, propsFields inherited from interface com.inductiveautomation.perspective.gateway.session.InternalSession
SESSION -
Method Summary
Modifier and TypeMethodDescriptionvoidDestroys this session and moves clients to a terminal state of closedvoidShuts down and removes the page associated with the given page ID which will disconnect the associated message channel (if one is connected).createPropertyReference(String referencePath, Consumer<PropertyTreeChangeEvent> subscriber, Set<Origin> acceptableOrigins) Create aPropertyReferencewith thisPerspectiveElementas the target.createViewModel(PageModel group, ViewInstanceId id, ViewConfig config, com.inductiveautomation.ignition.common.gson.JsonObject params) voidDestroys the session by removing it from its containing session collection and shutting it down (which should close any connected message channels).findViewConfig(String viewPath) Returns aCompletableFuturethat completes to present anOptional<ViewConfig> for the specified path.longlongFetch the project associated with this session.Logout of this session.protected voidCall this when it's possible the last page has been closed.protected PageModelvoidonLoginResponse(WebAuthResponseContext webAuthResponseContext) Called when the session receives a login response from the IdPvoidonLogoutResponse(WebAuthResponseContext webAuthResponseContext) Called when this session received a logout response from the IdPvoidonSessionInit(com.inductiveautomation.ignition.common.gson.JsonObject sessionInitResponse) Called when handling the session-init message.protected voidprotected voidprotected voidMethods inherited from class com.inductiveautomation.perspective.gateway.session.AbstractSession
broadcast, closePage, createPermissionModel, findPage, findPropConfig, getBindingCount, getComponentCount, getKeepAliveIntervalSecs, getLocale, getOrCreatePage, getPageCount, getPageReport, getPages, getPropertyTreeOf, getTimeZoneId, getViewCount, initProperties, notifyConnected, notifyDisconnected, onKeepaliveReceived, receive, refreshBinding, sendSessionKeepalive, updateSessionProps, visitPageMethods inherited from class com.inductiveautomation.perspective.gateway.session.SessionKernelWrapper
claimToken, createToken, getAuditSnapshot, getEventBus, getEventManager, getGson, getLastComm, getLastMessageTime, getLogger, getLogoutMessage, getPageClosedMessage, getProjectName, getSessionClosedMessage, getSessionCollection, getSessionId, getSessionInfo, getSessionStats, getStartupTime, getUptime, onHello, queue, touchMethods inherited from class com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycle
isRunning, shutdown, startupMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.inductiveautomation.perspective.gateway.api.AuditingContext
auditMethods inherited from interface com.inductiveautomation.perspective.gateway.session.InternalSession
getPerspectiveContext, getTimeZone, isRunning, scope, shutdown, startupMethods inherited from interface com.inductiveautomation.perspective.gateway.api.LoggingContext
mdc, mdcSetupTree, mdcTeardownTree, mdcWrapMethods inherited from interface com.inductiveautomation.perspective.gateway.api.PerspectiveElement
getAuditProfile, getQualifiedPathMethods inherited from interface com.inductiveautomation.perspective.gateway.api.Session
getGatewayContext, getMdcParent, getName, getPage, getSession, getView, mdcSetup, mdcTeardown, sendErrorToDesignerMethods inherited from interface com.inductiveautomation.perspective.gateway.session.SessionKernel
shutdown, startup
-
Method Details
-
findViewConfig
Description copied from interface:SessionReturns aCompletableFuturethat completes to present anOptional<ViewConfig> for the specified path. The use of the future is to allow for the asynch collection of configs for views which are retrieved via asynchronous processes, as is the case when a view is being edited/altered in the designer.- Parameters:
viewPath- path to the view's project resource within the project being run.
-
getProject
Description copied from interface:InternalSessionFetch the project associated with this session.- Returns:
- the
PerspectiveProjectassociated with this session
-
createViewModel
public ViewModel createViewModel(PageModel group, ViewInstanceId id, ViewConfig config, com.inductiveautomation.ignition.common.gson.JsonObject params) -
getTagManager
-
getTagHistoryManager
-
getScriptManager
-
getNamedQueryManager
-
getPageTimeout
public long getPageTimeout() -
getWebAuthStatus
- Returns:
- the
WebAuthStatusfor thisSession
-
maybeScheduleReaper
protected void maybeScheduleReaper()Description copied from class:AbstractSessionCall this when it's possible the last page has been closed. The session will then schedule the reaper to close the session itself (runtime sessions only, designer sessions don't reap in this way)- Specified by:
maybeScheduleReaperin classAbstractSession<SecuredPerspectiveProjectSession>
-
onStartup
protected void onStartup()- Overrides:
onStartupin classSessionKernelWrapper<SecuredPerspectiveProjectSession>
-
onShutdown
protected void onShutdown()- Overrides:
onShutdownin classSessionKernelWrapper<SecuredPerspectiveProjectSession>
-
onSessionInit
public void onSessionInit(com.inductiveautomation.ignition.common.gson.JsonObject sessionInitResponse) Description copied from class:AbstractSessionCalled when handling the session-init message. Gives the project session a chance to add things to the response- Specified by:
onSessionInitin interfaceInternalSession- Overrides:
onSessionInitin classAbstractSession<SecuredPerspectiveProjectSession>- Parameters:
sessionInitResponse- the response JSON object to be passed back to the client in response to the session-init call
-
sendGatewayTime
protected void sendGatewayTime() -
logout
Description copied from interface:InternalSessionLogout of this session. The user will no longer be authenticated.- Parameters:
message- the message to display to the user after they are logged out of this session- Returns:
- a logout token or hint for the IdP if one is available
-
onLoginResponse
Description copied from interface:InternalSessionCalled when the session receives a login response from the IdP- Parameters:
webAuthResponseContext- the login response object
-
onLogoutResponse
Description copied from interface:InternalSessionCalled when this session received a logout response from the IdP- Parameters:
webAuthResponseContext- the logout response object
-
createPropertyReference
@Nonnull public PropertyReference createPropertyReference(String referencePath, Consumer<PropertyTreeChangeEvent> subscriber, Set<Origin> acceptableOrigins) Description copied from interface:PerspectiveElementCreate aPropertyReferencewith thisPerspectiveElementas the target.- Parameters:
referencePath- the path to the propertysubscriber- the subscriber - aConsumerofPropertyTreeChangeEventsacceptableOrigins- theSetofOrigins in which the subscriber is interested- Returns:
- the
PropertyReference
-
getLastActiveTime
public long getLastActiveTime() -
closePage
Description copied from interface:InternalSessionShuts down and removes the page associated with the given page ID which will disconnect the associated message channel (if one is connected).- Specified by:
closePagein interfaceInternalSession- Overrides:
closePagein classAbstractSession<SecuredPerspectiveProjectSession>- Parameters:
pageId- the page ID associated with the target page
-
newPage
- Overrides:
newPagein classAbstractSession<SecuredPerspectiveProjectSession>
-
destroySession
public void destroySession()Description copied from interface:InternalSessionDestroys the session by removing it from its containing session collection and shutting it down (which should close any connected message channels). -
close
Description copied from interface:SessionDestroys this session and moves clients to a terminal state of closed- Parameters:
message- the message displayed to the client on the terminal state page
-