Interface Session
-
- All Superinterfaces:
AuditingContext
,LoggingContext
,PerspectiveElement
,PropertyTreeOwner
- All Known Subinterfaces:
InternalSession
- All Known Implementing Classes:
AbstractSession
,PerspectiveDesignSession
,PerspectiveProjectSession
,SecuredPerspectiveProjectSession
,SessionKernelWrapper
public interface Session extends PerspectiveElement
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
Session.WebAuthStatusChangeEvent
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
close(java.lang.String message)
Destroys this session and moves clients to a terminal state of closedViewModel
createViewModel(PageModel group, ViewInstanceId id, ViewConfig config, com.inductiveautomation.ignition.common.gson.JsonObject params)
java.util.Optional<? extends Page>
findPage(java.lang.String pageId)
Find thePage
associated with the given page IDjava.util.concurrent.CompletableFuture<java.util.Optional<ViewConfig>>
findViewConfig(java.lang.String viewPath)
Returns aCompletableFuture
that completes to present anOptional
<ViewConfig
> for the specified path.com.google.common.eventbus.EventBus
getEventBus()
AnEventBus
for events targeted to the running Perspective Project this session.default GatewayContext
getGatewayContext()
default LoggingContext
getMdcParent()
default java.lang.String
getName()
NamedQueryManager
getNamedQueryManager()
default Page
getPage()
java.util.List<? extends Page>
getPages()
default long
getPageTimeout()
PerspectiveContext
getPerspectiveContext()
java.lang.String
getProjectName()
The project that this session is running.ScriptManager
getScriptManager()
default Session
getSession()
java.util.UUID
getSessionId()
TagHistoryManager
getTagHistoryManager()
TagManager
getTagManager()
default View
getView()
WebAuthStatus
getWebAuthStatus()
default void
mdcSetup()
Set up the MDC keys for this contextdefault void
mdcTeardown()
Tear down the MDC keys that are added in #mdcSetupExecutionQueue
queue()
Queue upon which all work for components and their properties should occur onvoid
refreshBinding(PropertyKey property)
Refresh the binding for the given propertySessionScope
scope()
The scope in which this context represents -- Client or Designerdefault void
sendErrorToDesigner(java.lang.String message, java.lang.Throwable throwable)
Pipes the error message down to the designer (or no-op if this is a client)-
Methods inherited from interface com.inductiveautomation.perspective.gateway.api.AuditingContext
audit, getAuditSnapshot
-
Methods inherited from interface com.inductiveautomation.perspective.gateway.api.LoggingContext
getLogger, mdc, mdcSetupTree, mdcTeardownTree, mdcWrap
-
Methods inherited from interface com.inductiveautomation.perspective.gateway.api.PerspectiveElement
createPropertyReference, getAuditProfile, getQualifiedPath
-
Methods inherited from interface com.inductiveautomation.perspective.gateway.api.PropertyTreeOwner
getPropertyTreeOf
-
-
-
-
Method Detail
-
queue
ExecutionQueue queue()
Queue upon which all work for components and their properties should occur on
-
scope
SessionScope scope()
The scope in which this context represents -- Client or Designer
-
getProjectName
java.lang.String getProjectName()
The project that this session is running.
-
findPage
java.util.Optional<? extends Page> findPage(java.lang.String pageId)
Find thePage
associated with the given page ID- Parameters:
pageId
- the page ID associated with the target page- Returns:
- the page associated with the given page ID if it exists
-
getPages
java.util.List<? extends Page> getPages()
- Returns:
- A list of all open pages for this session
-
findViewConfig
java.util.concurrent.CompletableFuture<java.util.Optional<ViewConfig>> findViewConfig(java.lang.String viewPath)
Returns aCompletableFuture
that 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.
-
createViewModel
ViewModel createViewModel(PageModel group, ViewInstanceId id, ViewConfig config, com.inductiveautomation.ignition.common.gson.JsonObject params)
-
getTagManager
TagManager getTagManager()
-
getTagHistoryManager
TagHistoryManager getTagHistoryManager()
-
getScriptManager
ScriptManager getScriptManager()
-
getNamedQueryManager
NamedQueryManager getNamedQueryManager()
-
getEventBus
com.google.common.eventbus.EventBus getEventBus()
AnEventBus
for events targeted to the running Perspective Project this session.- Returns:
- The EventBus
-
getSessionId
java.util.UUID getSessionId()
- Returns:
- A unique identifier for this session instance.
-
getPerspectiveContext
PerspectiveContext getPerspectiveContext()
-
getGatewayContext
default GatewayContext getGatewayContext()
-
getPageTimeout
default long getPageTimeout()
-
getWebAuthStatus
@Nonnull WebAuthStatus getWebAuthStatus()
- Returns:
- the
WebAuthStatus
for thisSession
-
refreshBinding
void refreshBinding(PropertyKey property)
Refresh the binding for the given property- Parameters:
property
- the property which has the binding to refresh
-
getName
default java.lang.String getName()
- Specified by:
getName
in interfacePerspectiveElement
- Returns:
- The name of the element. If this is a component, it will be the name of the component. If this is a View, the name will be "view". If this is a Page, the name will be "page". If this is the session, the name will be "session".
-
getSession
@Nonnull default Session getSession()
- Specified by:
getSession
in interfacePerspectiveElement
- Returns:
- The session that this element is a part of.
-
getPage
@Nullable default Page getPage()
- Specified by:
getPage
in interfacePerspectiveElement
- Returns:
- The Page that this element is part of. Will return null if this is the Session
-
getView
@Nullable default View getView()
- Specified by:
getView
in interfacePerspectiveElement
- Returns:
- The view within which this element exists, or null if this is a Page or Session
-
getMdcParent
@Nullable default LoggingContext getMdcParent()
- Specified by:
getMdcParent
in interfaceLoggingContext
-
mdcSetup
default void mdcSetup()
Description copied from interface:LoggingContext
Set up the MDC keys for this context- Specified by:
mdcSetup
in interfaceLoggingContext
-
mdcTeardown
default void mdcTeardown()
Description copied from interface:LoggingContext
Tear down the MDC keys that are added in #mdcSetup- Specified by:
mdcTeardown
in interfaceLoggingContext
-
close
void close(@Nullable java.lang.String message)
Destroys this session and moves clients to a terminal state of closed- Parameters:
message
- the message displayed to the client on the terminal state page
-
sendErrorToDesigner
default void sendErrorToDesigner(java.lang.String message, java.lang.Throwable throwable)
Pipes the error message down to the designer (or no-op if this is a client)
-
-