Class PerspectiveProjectSession
- All Implemented Interfaces:
Lifecycle, AuditingContext, LoggingContext, PerspectiveElement, PropertyTreeOwner, Session, InternalSession, SessionKernel
-
Nested Class Summary
Nested classes/interfaces inherited from interface InternalSession
InternalSession.PageVisitorNested classes/interfaces inherited from interface Session
Session.WebAuthStatusChangeEvent -
Field Summary
Fields inherited from class AbstractSession
bindings, changeScripts, handlers, pages, propsFields inherited from interface 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).@NonNull PropertyReferencecreatePropertyReference(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.longlong@NonNull PerspectiveProjectFetch the project associated with this session.@NonNull WebAuthStatuscom.inductiveautomation.ignition.gateway.auth.idp.WebAuthSessionContextLogout this session.protected voidCall this when it's possible the last page has been closed.protected @NonNull PageModelvoidonLoginResponse(com.inductiveautomation.ignition.gateway.auth.web.response.WebAuthResponseContext webAuthResponseContext) Called when the session receives a login response from the IdP.voidonLogoutResponse(com.inductiveautomation.ignition.gateway.auth.web.response.WebAuthResponseContext webAuthResponseContext) Called when this session received a logout response from the IdP.voidonSessionInit(com.inductiveautomation.ignition.common.gson.JsonObject sessionInitResponse) Called when handling the session-init message.protected voidprotected voidprotected voidMethods inherited from class AbstractSession
broadcast, closePage, createPermissionModel, findPage, findPropConfig, getBindingCount, getComponentCount, getKeepAliveIntervalSecs, getLatencyMs, getLocale, getOrCreatePage, getPageCount, getPageReport, getPages, getPropertyTreeOf, getTimeZoneId, getViewCount, initProperties, makeInitialSessionPropValues, notifyConnected, notifyDisconnected, onKeepaliveReceived, receive, refreshBinding, sendSessionKeepalive, updateSessionProps, visitPageMethods inherited from class 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 AbstractLifecycle
isRunning, shutdown, startupMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AuditingContext
auditMethods inherited from interface InternalSession
getPerspectiveContext, getTimeZone, isRunning, scope, shutdown, startupMethods inherited from interface LoggingContext
mdc, mdcSetupTree, mdcTeardownTree, mdcWrapMethods inherited from interface PerspectiveElement
getAuditProfile, getQualifiedPathMethods inherited from interface Session
getGatewayContext, getMdcParent, getName, getPage, getSession, getView, mdcSetup, mdcTeardown, sendErrorToDesignerMethods inherited from interface 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
public com.inductiveautomation.ignition.gateway.auth.idp.WebAuthSessionContext logout(@Nullable String message) Description copied from interface:InternalSessionLogout this session. The user will no longer be authenticated against the session's IdP.Read the IdP to send the logout to from the returned context, not from
Session.getWebAuthStatus()before calling this: a logout waits for any sign-in in progress, so the user it signs out may have just signed in through a different IdP.- Parameters:
message- the message to display to the user after they are logged out of this session- Returns:
- the context this logout replaced, naming the IdP the user was signed in through and carrying that IdP's logout hint, if any. never null.
-
onLoginResponse
public void onLoginResponse(com.inductiveautomation.ignition.gateway.auth.web.response.WebAuthResponseContext webAuthResponseContext) throws com.inductiveautomation.ignition.gateway.auth.idp.IdentityProviderException Description copied from interface:InternalSessionCalled when the session receives a login response from the IdP.The response is not always applied - the responding IdP may not be one this session permits, the user may have cancelled, or the IdP may no longer exist or its response may not parse. The reason is thrown rather than logged and dropped so the caller can audit the outcome it actually got instead of assuming success.
- Parameters:
webAuthResponseContext- the login response object- Throws:
com.inductiveautomation.ignition.gateway.auth.idp.IdentityProviderException- if the response was not applied for any other reason
-
onLogoutResponse
public void onLogoutResponse(com.inductiveautomation.ignition.gateway.auth.web.response.WebAuthResponseContext webAuthResponseContext) throws com.inductiveautomation.ignition.gateway.auth.idp.IdentityProviderException Description copied from interface:InternalSessionCalled when this session received a logout response from the IdP.The session was already signed out when the logout request leg ran, before the redirect to the IdP, so a throw from here means only that the IdP's confirmation could not be validated. The sign-out itself stands either way; the reason is thrown so the caller can audit what actually happened instead of assuming the round trip completed cleanly.
- Parameters:
webAuthResponseContext- the logout response object- Throws:
com.inductiveautomation.ignition.gateway.auth.idp.IdentityProviderException- if the response could not be validated for any other reason
-
createPropertyReference
public @NonNull 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
-