Class PerspectiveDesignSession

java.lang.Object
com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycle
com.inductiveautomation.perspective.gateway.session.SessionKernelWrapper<T>
com.inductiveautomation.perspective.gateway.session.AbstractSession<com.inductiveautomation.perspective.gateway.session.PerspectiveDesignSession.SessionKernelImpl>
com.inductiveautomation.perspective.gateway.session.PerspectiveDesignSession
All Implemented Interfaces:
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.
  • Method Details

    • alter

      public void alter(PropertyConfigChange change)
    • newPage

      @Nonnull protected DesignerPageModel newPage(@Nonnull String pageId)
      Overrides:
      newPage in class AbstractSession<com.inductiveautomation.perspective.gateway.session.PerspectiveDesignSession.SessionKernelImpl>
    • createPermissionModel

      protected PropertyTreePermissionModel createPermissionModel(PropertyType scope, PropertyConfigCollection config)
      Overrides:
      createPermissionModel in class AbstractSession<com.inductiveautomation.perspective.gateway.session.PerspectiveDesignSession.SessionKernelImpl>
    • maybeScheduleReaper

      protected void maybeScheduleReaper()
      Description copied from class: AbstractSession
      Call 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:
      maybeScheduleReaper in class AbstractSession<com.inductiveautomation.perspective.gateway.session.PerspectiveDesignSession.SessionKernelImpl>
    • getWebAuthStatus

      @Nonnull public WebAuthStatus getWebAuthStatus()
      Returns:
      the WebAuthStatus for this Session
    • logout

      @Nonnull public Optional<String> logout(@Nullable String message)
      Always throws UnsupportedOperationException - 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:
      a logout token or hint for the IdP if one is available
    • onLoginResponse

      public void onLoginResponse(@Nonnull WebAuthResponseContext webAuthResponseContext)
      Always throws UnsupportedOperationException - it is a mistake if a code path reaches this method
      Parameters:
      webAuthResponseContext - the login response object
    • onLogoutResponse

      public void onLogoutResponse(@Nonnull WebAuthResponseContext webAuthResponseContext)
      Always throws UnsupportedOperationException - 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

      public CompletableFuture<Optional<ViewConfig>> findViewConfig(String viewResourcePath)
      Description copied from interface: Session
      Returns a CompletableFuture that completes to present an Optional<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

      public TagManager getTagManager()
    • getTagHistoryManager

      public TagHistoryManager getTagHistoryManager()
    • getScriptManager

      @Nonnull public ScriptManager getScriptManager()
    • getNamedQueryManager

      public NamedQueryManager getNamedQueryManager()
    • createPropertyReference

      @Nonnull public DesignerPropertyReference createPropertyReference(String referencePath, Consumer<PropertyTreeChangeEvent> subscriber, Set<Origin> acceptableOrigins)
      Description copied from interface: PerspectiveElement
      Create a PropertyReference with this PerspectiveElement as the target.
      Parameters:
      referencePath - the path to the property
      subscriber - the subscriber - a Consumer of PropertyTreeChangeEvents
      acceptableOrigins - the Set of Origins in which the subscriber is interested
      Returns:
      the PropertyReference
    • onDesignerNamedQueriesChange

      public void onDesignerNamedQueriesChange(Map<String,NamedQuery> namedQueryMap)
    • notifyScriptsModified

      public void notifyScriptsModified()
    • notifyDesignerSaved

      public void notifyDesignerSaved()
    • close

      public void close(@Nullable String message)
      Description copied from interface: Session
      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
    • closePage

      public void closePage(String pageId, @Nullable String message)
      Description copied from interface: InternalSession
      Shuts 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:
      closePage in interface InternalSession
      Overrides:
      closePage in class AbstractSession<com.inductiveautomation.perspective.gateway.session.PerspectiveDesignSession.SessionKernelImpl>
      Parameters:
      pageId - the page ID associated with the target page
      message - the message displayed to the client on the terminal state page
    • sendErrorToDesigner

      public void sendErrorToDesigner(String message, Throwable throwable)
      Description copied from interface: Session
      Pipes the error message down to the designer (or no-op if this is a client)
    • getAuditSnapshot

      @Nonnull public AuditContext.Builder getAuditSnapshot()
      Specified by:
      getAuditSnapshot in interface AuditingContext
      Overrides:
      getAuditSnapshot in class SessionKernelWrapper<com.inductiveautomation.perspective.gateway.session.PerspectiveDesignSession.SessionKernelImpl>
      Returns:
      A new, or extended, AuditContext.Builder, with qualified information about the current scope.