Class PerspectiveSessionMonitor

java.lang.Object
com.inductiveautomation.perspective.gateway.session.PerspectiveSessionMonitor

public class PerspectiveSessionMonitor extends Object
Simple class which holds a set of auth sessions that are currently live. These sessions are added by the perspective auth session itself when it gets an http binding event. It calls remove when the unbinding event is fired.
  • Constructor Details

    • PerspectiveSessionMonitor

      public PerspectiveSessionMonitor(PerspectiveContext context)
  • Method Details

    • onSessionStarted

      public void onSessionStarted(SessionStartupEvent event)
    • onSessionShutdown

      public void onSessionShutdown(SessionShutdownEvent event)
    • getSessionInfos

      @Nonnull public List<PerspectiveSessionInfo> getSessionInfos()
      Returns a readonly list of all current PerspectiveAuth sessions.
    • getSessionCount

      public long getSessionCount(Predicate<InternalSession> predicate)
      Count of running client sessions.
      Parameters:
      predicate - Only running client sessions that match this predicate will be counted
    • getPageCount

      public int getPageCount()
    • getViewCount

      public int getViewCount()
    • getComponentCount

      public int getComponentCount()
    • getBindingCount

      public int getBindingCount()
    • getProjectSessionInfo

      public Optional<PerspectiveSessionInfo> getProjectSessionInfo(String authId, String projectName)
      Get read only info on a particular client/designer session. A convenience method to return only a single session info if that session exists.
      Parameters:
      authId - The parent session id.
      projectName - The requested project name.
      Returns:
      {PerspectiveSessionInfo} The session details or null if not found.
    • getClientSessionsForProject

      public List<InternalSession> getClientSessionsForProject(String projectName)
    • findSession

      public Optional<InternalSession> findSession(UUID sessionId)