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
 
 public class PerspectiveProjectSession extends AbstractSession<SecuredPerspectiveProjectSession> 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.InternalSessionInternalSession.PageVisitor
 - 
Nested classes/interfaces inherited from interface com.inductiveautomation.perspective.gateway.api.SessionSession.WebAuthStatusChangeEvent
 
- 
 - 
Field Summary- 
Fields inherited from class com.inductiveautomation.perspective.gateway.session.AbstractSessionbindings, changeScripts, handlers, pages, props
 - 
Fields inherited from interface com.inductiveautomation.perspective.gateway.session.InternalSessionSESSION
 
- 
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose(java.lang.String message)Destroys this session and moves clients to a terminal state of closedvoidclosePage(java.lang.String pageId)Shuts down and removes the page associated with the given page ID which will disconnect the associated message channel (if one is connected).PropertyReferencecreatePropertyReference(java.lang.String referencePath, java.util.function.Consumer<PropertyTreeChangeEvent> subscriber, java.util.Set<Origin> acceptableOrigins)Create aPropertyReferencewith thisPerspectiveElementas the target.ViewModelcreateViewModel(PageModel group, ViewInstanceId id, ViewConfig config, com.inductiveautomation.ignition.common.gson.JsonObject params)voiddestroySession()Destroys the session by removing it from its containing session collection and shutting it down (which should close any connected message channels).java.util.concurrent.CompletableFuture<java.util.Optional<ViewConfig>>findViewConfig(java.lang.String viewPath)Returns aCompletableFuturethat completes to present anOptional<ViewConfig> for the specified path.longgetLastActiveTime()NamedQueryManagergetNamedQueryManager()longgetPageTimeout()PerspectiveProjectgetProject()Fetch the project associated with this session.ScriptManagergetScriptManager()TagHistoryManagergetTagHistoryManager()TagManagergetTagManager()WebAuthStatusgetWebAuthStatus()java.util.Optional<java.lang.String>logout(java.lang.String message)Logout of this session.protected voidmaybeScheduleReaper()Call this when it's possible the last page has been closed.protected PageModelnewPage(java.lang.String pageId)voidonLoginResponse(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 when handling the session-init message.protected voidonShutdown()protected voidonStartup()protected voidsendGatewayTime()- 
Methods inherited from class com.inductiveautomation.perspective.gateway.session.AbstractSessionbroadcast, closePage, createPermissionModel, findPage, findPropConfig, getBindingCount, getComponentCount, getLocale, getOrCreatePage, getPageCount, getPageReport, getPages, getPropertyTreeOf, getTimeZoneId, getViewCount, initProperties, notifyConnected, notifyDisconnected, onKeepaliveReceived, receive, refreshBinding, sendSessionKeepalive, updateSessionProps, visitPage
 - 
Methods inherited from class com.inductiveautomation.perspective.gateway.session.SessionKernelWrapperclaimToken, createToken, getAuditSnapshot, getEventBus, getEventManager, getGson, getLastComm, getLastMessageTime, getLogger, getLogoutMessage, getPageClosedMessage, getProjectName, getSessionClosedMessage, getSessionCollection, getSessionId, getSessionInfo, getSessionStats, getStartupTime, getUptime, onHello, queue, touch
 - 
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.InternalSessiongetPerspectiveContext, getTimeZone, isRunning, scope, shutdown, startup
 - 
Methods inherited from interface com.inductiveautomation.perspective.gateway.api.LoggingContextmdc, mdcSetupTree, mdcTeardownTree, mdcWrap
 - 
Methods inherited from interface com.inductiveautomation.perspective.gateway.api.PerspectiveElementgetAuditProfile, getQualifiedPath
 - 
Methods inherited from interface com.inductiveautomation.perspective.gateway.api.SessiongetGatewayContext, getMdcParent, getName, getPage, getSession, getView, mdcSetup, mdcTeardown, sendErrorToDesigner
 - 
Methods inherited from interface com.inductiveautomation.perspective.gateway.session.SessionKernelshutdown, startup
 
- 
 
- 
- 
- 
Method Detail- 
findViewConfigpublic java.util.concurrent.CompletableFuture<java.util.Optional<ViewConfig>> findViewConfig(java.lang.String viewPath) 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@Nonnull public PerspectiveProject getProject() Description copied from interface:InternalSessionFetch the project associated with this session.- Returns:
- the PerspectiveProjectassociated with this session
 
 - 
createViewModelpublic ViewModel createViewModel(PageModel group, ViewInstanceId id, ViewConfig config, com.inductiveautomation.ignition.common.gson.JsonObject params) 
 - 
getTagManagerpublic TagManager getTagManager() 
 - 
getTagHistoryManagerpublic TagHistoryManager getTagHistoryManager() 
 - 
getScriptManagerpublic ScriptManager getScriptManager() 
 - 
getNamedQueryManagerpublic NamedQueryManager getNamedQueryManager() 
 - 
getPageTimeoutpublic long getPageTimeout() 
 - 
getWebAuthStatus@Nonnull public WebAuthStatus getWebAuthStatus() - Returns:
- the WebAuthStatusfor thisSession
 
 - 
maybeScheduleReaperprotected 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 class- AbstractSession<SecuredPerspectiveProjectSession>
 
 - 
onStartupprotected void onStartup() - Overrides:
- onStartupin class- SessionKernelWrapper<SecuredPerspectiveProjectSession>
 
 - 
onShutdownprotected void onShutdown() - Overrides:
- onShutdownin class- SessionKernelWrapper<SecuredPerspectiveProjectSession>
 
 - 
onSessionInitpublic void onSessionInit(com.inductiveautomation.ignition.common.gson.JsonObject sessionInitResponse) Description copied from class:AbstractSessionCalled when when handling the session-init message. Gives the project session a chance to add things to the response- Specified by:
- onSessionInitin interface- InternalSession
- Overrides:
- onSessionInitin class- AbstractSession<SecuredPerspectiveProjectSession>
- Parameters:
- sessionInitResponse- the response JSON object to be passed back to the client in response to the session-init call
 
 - 
sendGatewayTimeprotected void sendGatewayTime() 
 - 
logoutpublic java.util.Optional<java.lang.String> logout(@Nullable java.lang.String message)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
 
 - 
onLoginResponsepublic void onLoginResponse(WebAuthResponseContext webAuthResponseContext) Description copied from interface:InternalSessionCalled when the session receives a login response from the IdP- Parameters:
- webAuthResponseContext- the login response object
 
 - 
onLogoutResponsepublic void onLogoutResponse(WebAuthResponseContext webAuthResponseContext) 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(java.lang.String referencePath, java.util.function.Consumer<PropertyTreeChangeEvent> subscriber, java.util.Set<Origin> acceptableOrigins) Description copied from interface:PerspectiveElementCreate aPropertyReferencewith thisPerspectiveElementas the target.- Parameters:
- referencePath- the path to the property
- subscriber- the subscriber - a- Consumerof- PropertyTreeChangeEvents
- acceptableOrigins- the- Setof- Origins in which the subscriber is interested
- Returns:
- the PropertyReference
 
 - 
getLastActiveTimepublic long getLastActiveTime() 
 - 
closePagepublic void closePage(java.lang.String pageId) 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 interface- InternalSession
- Overrides:
- closePagein class- AbstractSession<SecuredPerspectiveProjectSession>
- Parameters:
- pageId- the page ID associated with the target page
 
 - 
newPage@Nonnull protected PageModel newPage(@Nonnull java.lang.String pageId) - Overrides:
- newPagein class- AbstractSession<SecuredPerspectiveProjectSession>
 
 - 
destroySessionpublic 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).
 - 
closepublic void close(@Nullable java.lang.String message)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
 
 
- 
 
-