Class SecuredPerspectiveProjectSession
- java.lang.Object
- 
- com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycle
- 
- com.inductiveautomation.perspective.gateway.session.SessionKernelWrapper<com.inductiveautomation.perspective.gateway.session.SecuredPerspectiveProjectSession.SessionKernelImpl>
- 
- com.inductiveautomation.perspective.gateway.session.SecuredPerspectiveProjectSession
 
 
 
- 
- All Implemented Interfaces:
- com.inductiveautomation.ignition.gateway.clientcomm.scriptmsg.event.SessionMessageDispatchHandler,- AuditingContext,- LoggingContext,- PerspectiveElement,- PropertyTreeOwner,- Session,- InternalSession,- SessionKernel
 
 public class SecuredPerspectiveProjectSession extends SessionKernelWrapper<com.inductiveautomation.perspective.gateway.session.SecuredPerspectiveProjectSession.SessionKernelImpl> implements com.inductiveautomation.ignition.gateway.clientcomm.scriptmsg.event.SessionMessageDispatchHandler A client session secured by the security levels set in the project's permissions. This class is a proxy to aPerspectiveProjectSessionwhich is only created and run when the user is authorized to do so.
- 
- 
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 Concrete Methods Modifier and Type Method Description protected voidbroadcast(java.lang.String protocol, java.lang.String payload)Broadcast a message to all pages associated with this sessionvoidclosePage(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).voidclosePage(java.lang.String pageId, java.lang.String message)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)java.util.Optional<PageModel>findPage(java.lang.String pageId)Find thePageassociated with the given page IDjava.util.concurrent.CompletableFuture<java.util.Optional<ViewConfig>>findViewConfig(java.lang.String viewPath)Returns aCompletableFuturethat completes to present anOptional<ViewConfig> for the specified path.intgetBindingCount()intgetComponentCount()java.util.LocalegetLocale()The current locale for this session, or a safe defaultLocale.getDefault()if not available.NamedQueryManagergetNamedQueryManager()PageModelgetOrCreatePage(java.lang.String pageId)Fetch thePageModelassociated with the given page ID.intgetPageCount()java.util.List<PageModel>getPages()PerspectiveProjectgetProject()Fetch the project associated with this session.PropertyTreegetPropertyTreeOf(PropertyType propertyType)Fetch thePropertyTreeassociated with the givenPropertyTypeScriptManagergetScriptManager()TagHistoryManagergetTagHistoryManager()TagManagergetTagManager()java.lang.StringgetTimeZoneId()The current timezone id for this session, or a safe default if not available.intgetViewCount()WebAuthStatusgetWebAuthStatus()java.util.List<java.lang.String>handleMessage(com.inductiveautomation.ignition.gateway.clientcomm.scriptmsg.event.SessionMessageDispatchEvent event)java.util.Optional<java.lang.String>logout(java.lang.String message)Logout of this session.voidnotifyConnected(MessageChannel channel)Let the session know that the page has connectedvoidnotifyDisconnected(MessageChannel channel)Let the session know that the page has disconnectedvoidonKeepaliveReceived(java.lang.String pageId, long timestamp)Called by the client to keep the session alive.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 during the session-init lifecycle of the client.voidreceive(MessageChannel channel, java.lang.String protocol, java.io.Reader payload)Called when this session has received a message from the message channel.voidrefreshBinding(PropertyKey property)Refresh the binding for the given propertyvoidupdateSessionProps(SessionPropsConfig config)Update the props and bindings associated with this sessionvoidvisitPage(java.lang.String pageId, InternalSession.PageVisitor visitor)Visit the page associated with the given ID.- 
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, onShutdown, onStartup, 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.InternalSessionclose, destroySession, getPerspectiveContext, 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, getPageTimeout, getSession, getView, mdcSetup, mdcTeardown, sendErrorToDesigner
 - 
Methods inherited from interface com.inductiveautomation.perspective.gateway.session.SessionKernelshutdown, startup
 
- 
 
- 
- 
- 
Method Detail- 
handleMessagepublic java.util.List<java.lang.String> handleMessage(com.inductiveautomation.ignition.gateway.clientcomm.scriptmsg.event.SessionMessageDispatchEvent event) - Specified by:
- handleMessagein interface- com.inductiveautomation.ignition.gateway.clientcomm.scriptmsg.event.SessionMessageDispatchHandler
 
 - 
broadcastprotected void broadcast(java.lang.String protocol, java.lang.String payload)Description copied from class:SessionKernelWrapperBroadcast a message to all pages associated with this session- Specified by:
- broadcastin class- SessionKernelWrapper<com.inductiveautomation.perspective.gateway.session.SecuredPerspectiveProjectSession.SessionKernelImpl>
- Parameters:
- protocol- the protocol of the message to broadcast
- payload- the payload of the message to broadcast
 
 - 
getProject@Nonnull public PerspectiveProject getProject() Description copied from interface:InternalSessionFetch the project associated with this session.- Specified by:
- getProjectin interface- InternalSession
- Returns:
- the PerspectiveProjectassociated with this session
 
 - 
notifyConnectedpublic void notifyConnected(MessageChannel channel) Description copied from interface:InternalSessionLet the session know that the page has connected- Specified by:
- notifyConnectedin interface- InternalSession
- Parameters:
- channel- the- MessageChannelused for communications between the client page and the gateway page
 
 - 
notifyDisconnectedpublic void notifyDisconnected(MessageChannel channel) Description copied from interface:InternalSessionLet the session know that the page has disconnected- Specified by:
- notifyDisconnectedin interface- InternalSession
- Parameters:
- channel- the- MessageChannelused for communications between the client page and the gateway page
 
 - 
receivepublic void receive(MessageChannel channel, java.lang.String protocol, java.io.Reader payload) Description copied from interface:InternalSessionCalled when this session has received a message from the message channel.- Specified by:
- receivein interface- InternalSession
- Parameters:
- channel- the- MessageChannelfrom which the message was received
- protocol- the protocol of the message
- payload- the payload of the message
 
 - 
getOrCreatePagepublic PageModel getOrCreatePage(java.lang.String pageId) Description copied from interface:InternalSessionFetch thePageModelassociated with the given page ID. If the page does not exist, it is created, associated with the given page ID, and returned.- Specified by:
- getOrCreatePagein interface- InternalSession
- Parameters:
- pageId- the page ID associated with the target page
- Returns:
- the page associated with the given page ID or a new page if it does not exist
 
 - 
findPagepublic java.util.Optional<PageModel> findPage(java.lang.String pageId) Description copied from interface:SessionFind thePageassociated with the given page ID- Specified by:
- findPagein interface- InternalSession
- Specified by:
- findPagein interface- Session
- Parameters:
- pageId- the page ID associated with the target page
- Returns:
- the page associated with the given page ID if it exists
 
 - 
getPagespublic java.util.List<PageModel> getPages() - Specified by:
- getPagesin interface- InternalSession
- Specified by:
- getPagesin interface- Session
- Returns:
- A list of all open pages for this session
 
 - 
getPageCountpublic int getPageCount() - Specified by:
- getPageCountin interface- InternalSession
 
 - 
getViewCountpublic int getViewCount() - Specified by:
- getViewCountin interface- InternalSession
 
 - 
getComponentCountpublic int getComponentCount() - Specified by:
- getComponentCountin interface- InternalSession
 
 - 
getBindingCountpublic int getBindingCount() - Specified by:
- getBindingCountin interface- InternalSession
 
 - 
visitPagepublic void visitPage(java.lang.String pageId, InternalSession.PageVisitor visitor)Description copied from interface:InternalSessionVisit the page associated with the given ID. If the page is found,InternalSession.PageVisitor.onPageFound(PageModel)is invoked with the target page. If the page is not found,InternalSession.PageVisitor.onPageMissing()is invoked. If the page is closed,InternalSession.PageVisitor.onPageClosed(String)is invoked with the closed message.- Specified by:
- visitPagein interface- InternalSession
- Parameters:
- pageId- the target page ID
- visitor- the page visitor
 
 - 
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
- Parameters:
- pageId- the page ID associated with the target page
 
 - 
closePagepublic void closePage(java.lang.String pageId, @Nullable java.lang.String message)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). Moves the client to a terminal state page of closed with the given message.- Specified by:
- closePagein interface- InternalSession
- Parameters:
- pageId- the page ID associated with the target page
- message- the message displayed to the client on the terminal state page
 
 - 
onSessionInitpublic void onSessionInit(com.inductiveautomation.ignition.common.gson.JsonObject sessionInitResponse) Description copied from interface:InternalSessionCalled during the session-init lifecycle of the client. Implementations may modify the given response JSON object to pass back to the client.- Specified by:
- onSessionInitin interface- InternalSession
- Parameters:
- sessionInitResponse- the response JSON object to be passed back to the client in response to the session-init call
 
 - 
logout@Nonnull public 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.- Specified by:
- logoutin interface- InternalSession
- 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(@Nonnull WebAuthResponseContext webAuthResponseContext)Description copied from interface:InternalSessionCalled when the session receives a login response from the IdP- Specified by:
- onLoginResponsein interface- InternalSession
- Parameters:
- webAuthResponseContext- the login response object
 
 - 
onLogoutResponsepublic void onLogoutResponse(@Nonnull WebAuthResponseContext webAuthResponseContext)Description copied from interface:InternalSessionCalled when this session received a logout response from the IdP- Specified by:
- onLogoutResponsein interface- InternalSession
- Parameters:
- webAuthResponseContext- the logout response object
 
 - 
onKeepaliveReceivedpublic void onKeepaliveReceived(java.lang.String pageId, long timestamp)Description copied from interface:InternalSessionCalled by the client to keep the session alive.- Specified by:
- onKeepaliveReceivedin interface- InternalSession
- Parameters:
- pageId- the page ID of the page which triggered the keep alive request
- timestamp- the timestamp associated with the keep alive request
 
 - 
updateSessionPropspublic void updateSessionProps(SessionPropsConfig config) Description copied from interface:InternalSessionUpdate the props and bindings associated with this session- Specified by:
- updateSessionPropsin interface- InternalSession
- Parameters:
- config- the session props config to apply
 
 - 
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.- Specified by:
- findViewConfigin interface- Session
- Parameters:
- viewPath- path to the view's project resource within the project being run.
 
 - 
createViewModelpublic ViewModel createViewModel(PageModel group, ViewInstanceId id, ViewConfig config, com.inductiveautomation.ignition.common.gson.JsonObject params) - Specified by:
- createViewModelin interface- Session
 
 - 
getTagManagerpublic TagManager getTagManager() - Specified by:
- getTagManagerin interface- Session
 
 - 
getTagHistoryManagerpublic TagHistoryManager getTagHistoryManager() - Specified by:
- getTagHistoryManagerin interface- Session
 
 - 
getScriptManagerpublic ScriptManager getScriptManager() - Specified by:
- getScriptManagerin interface- Session
 
 - 
getNamedQueryManagerpublic NamedQueryManager getNamedQueryManager() - Specified by:
- getNamedQueryManagerin interface- Session
 
 - 
getWebAuthStatus@Nonnull public WebAuthStatus getWebAuthStatus() - Specified by:
- getWebAuthStatusin interface- Session
- Returns:
- the WebAuthStatusfor thisSession
 
 - 
getLocalepublic java.util.Locale getLocale() Description copied from interface:InternalSessionThe current locale for this session, or a safe defaultLocale.getDefault()if not available.- Specified by:
- getLocalein interface- InternalSession
 
 - 
getTimeZoneIdpublic java.lang.String getTimeZoneId() Description copied from interface:InternalSessionThe current timezone id for this session, or a safe default if not available.- Specified by:
- getTimeZoneIdin interface- InternalSession
 
 - 
refreshBindingpublic void refreshBinding(PropertyKey property) Description copied from interface:SessionRefresh the binding for the given property- Specified by:
- refreshBindingin interface- Session
- Parameters:
- property- the property which has the binding to refresh
 
 - 
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.- Specified by:
- createPropertyReferencein interface- PerspectiveElement
- 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
 
 - 
getPropertyTreeOf@Nullable public PropertyTree getPropertyTreeOf(@Nullable PropertyType propertyType) Description copied from interface:PropertyTreeOwnerFetch thePropertyTreeassociated with the givenPropertyType- Specified by:
- getPropertyTreeOfin interface- PropertyTreeOwner
- Parameters:
- propertyType- The- PropertyTypeof the- PropertyTreewe want to fetch
- Returns:
- The PropertyTree or null if this PropertyTreeOwner does not manage a PropertyTree for the given PropertyType or if a null PropertyType is given
 
 
- 
 
-