Class PerspectiveDesignSession
java.lang.Object
com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycle
com.inductiveautomation.perspective.gateway.session.SessionKernelWrapper<com.inductiveautomation.perspective.gateway.session.PerspectiveDesignSession.SessionKernelImpl>
com.inductiveautomation.perspective.gateway.session.AbstractSession<com.inductiveautomation.perspective.gateway.session.PerspectiveDesignSession.SessionKernelImpl>
com.inductiveautomation.perspective.gateway.session.PerspectiveDesignSession
- All Implemented Interfaces:
Lifecycle, AuditingContext, LoggingContext, PerspectiveElement, PropertyTreeOwner, Session, InternalSession, SessionKernel
public class PerspectiveDesignSession
extends AbstractSession<com.inductiveautomation.perspective.gateway.session.PerspectiveDesignSession.SessionKernelImpl>
Implementation of
AbstractSession which is used when the Ignition Designer is creating,
running, and previewing Perspective Views. Created by pjones on 4/17/17.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassListens to the gateway-wide EventBus for mutability changes to this design session, and then delegates the change to this session's EventManager for more efficient notification for bindings.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 TypeMethodDescriptionvoidalter(PropertyConfigChange change) voidDestroys 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).protected PropertyTreePermissionModelcreatePermissionModel(PropertyType scope, PropertyConfigCollection config) @NonNull DesignerPropertyReferencecreatePropertyReference(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) findViewConfig(String viewResourcePath) Returns aCompletableFuturethat completes to present anOptional<ViewConfig> for the specified path.@NonNull AuditContext.Builder@NonNull ScriptManager@NonNull WebAuthStatus@NonNull com.inductiveautomation.ignition.gateway.auth.idp.WebAuthSessionContextAlways throwsUnsupportedOperationException- it is a mistake if a code path reaches this methodprotected voidCall this when it's possible the last page has been closed.protected @NonNull DesignerPageModelvoidvoidvoidonDesignerNamedQueriesChange(Map<String, NamedQuery> namedQueryMap) voidonLoginResponse(@NonNull com.inductiveautomation.ignition.gateway.auth.web.response.WebAuthResponseContext webAuthResponseContext) Always throwsUnsupportedOperationException- it is a mistake if a code path reaches this methodvoidonLogoutResponse(@NonNull com.inductiveautomation.ignition.gateway.auth.web.response.WebAuthResponseContext webAuthResponseContext) Always throwsUnsupportedOperationException- it is a mistake if a code path reaches this methodvoidsendErrorToDesigner(String message, Throwable throwable) Pipes the error message down to the designer (or no-op if this is a client)Methods inherited from class AbstractSession
broadcast, closePage, findPage, findPropConfig, getBindingCount, getComponentCount, getKeepAliveIntervalSecs, getLatencyMs, getLocale, getOrCreatePage, getPageCount, getPageReport, getPages, getPropertyTreeOf, getTimeZoneId, getViewCount, initProperties, makeInitialSessionPropValues, notifyConnected, notifyDisconnected, onKeepaliveReceived, onSessionInit, receive, refreshBinding, sendSessionKeepalive, updateSessionProps, visitPageMethods inherited from class SessionKernelWrapper
claimToken, createToken, getEventBus, getEventManager, getGson, getLastComm, getLastMessageTime, getLogger, getLogoutMessage, getPageClosedMessage, getProjectName, getSessionClosedMessage, getSessionCollection, getSessionId, getSessionInfo, getSessionStats, getStartupTime, getUptime, onHello, onShutdown, onStartup, 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
destroySession, getPerspectiveContext, getProject, 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, getPageTimeout, getSession, getView, mdcSetup, mdcTeardownMethods inherited from interface SessionKernel
shutdown, startup
-
Method Details
-
alter
-
newPage
- Overrides:
newPagein classAbstractSession<com.inductiveautomation.perspective.gateway.session.PerspectiveDesignSession.SessionKernelImpl>
-
createPermissionModel
protected PropertyTreePermissionModel createPermissionModel(PropertyType scope, PropertyConfigCollection config) - Overrides:
createPermissionModelin classAbstractSession<com.inductiveautomation.perspective.gateway.session.PerspectiveDesignSession.SessionKernelImpl>
-
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<com.inductiveautomation.perspective.gateway.session.PerspectiveDesignSession.SessionKernelImpl>
-
getWebAuthStatus
- Returns:
- the
WebAuthStatusfor thisSession
-
logout
public @NonNull com.inductiveautomation.ignition.gateway.auth.idp.WebAuthSessionContext logout(@Nullable String message) Always throwsUnsupportedOperationException- it is a mistake if a code path reaches this method- 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(@NonNull com.inductiveautomation.ignition.gateway.auth.web.response.WebAuthResponseContext webAuthResponseContext) Always throwsUnsupportedOperationException- it is a mistake if a code path reaches this method- Parameters:
webAuthResponseContext- the login response object
-
onLogoutResponse
public void onLogoutResponse(@NonNull com.inductiveautomation.ignition.gateway.auth.web.response.WebAuthResponseContext webAuthResponseContext) Always throwsUnsupportedOperationException- it is a mistake if a code path reaches this method- Parameters:
webAuthResponseContext- the logout response object
-
createViewModel
public ViewModel createViewModel(PageModel group, ViewInstanceId id, ViewConfig config, com.inductiveautomation.ignition.common.gson.JsonObject params) -
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:
viewResourcePath- path to the view's project resource within the project being run.
-
getTagManager
-
getTagHistoryManager
-
getScriptManager
-
getNamedQueryManager
-
createPropertyReference
public @NonNull DesignerPropertyReference 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
-
onDesignerNamedQueriesChange
-
notifyScriptsModified
public void notifyScriptsModified() -
notifyDesignerSaved
public void notifyDesignerSaved() -
close
-
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). Moves the client to a terminal state page of closed with the given message.- Specified by:
closePagein interfaceInternalSession- Overrides:
closePagein classAbstractSession<com.inductiveautomation.perspective.gateway.session.PerspectiveDesignSession.SessionKernelImpl>- Parameters:
pageId- the page ID associated with the target pagemessage- the message displayed to the client on the terminal state page
-
sendErrorToDesigner
-
getAuditSnapshot
- Specified by:
getAuditSnapshotin interfaceAuditingContext- Overrides:
getAuditSnapshotin classSessionKernelWrapper<com.inductiveautomation.perspective.gateway.session.PerspectiveDesignSession.SessionKernelImpl>- Returns:
- A new, or extended,
AuditContext.Builder, with qualified information about the current scope.
-