Class SecuredPerspectiveProjectSession

    • Method Detail

      • broadcast

        protected void broadcast​(java.lang.String protocol,
                                 java.lang.String payload)
        Description copied from class: SessionKernelWrapper
        Broadcast a message to all pages associated with this session
        Specified by:
        broadcast in class SessionKernelWrapper<com.inductiveautomation.perspective.gateway.session.SecuredPerspectiveProjectSession.SessionKernelImpl>
        Parameters:
        protocol - the protocol of the message to broadcast
        payload - the payload of the message to broadcast
      • notifyConnected

        public void notifyConnected​(MessageChannel channel)
        Description copied from interface: InternalSession
        Let the session know that the page has connected
        Parameters:
        channel - the MessageChannel used for communications between the client page and the gateway page
      • notifyDisconnected

        public void notifyDisconnected​(MessageChannel channel)
        Description copied from interface: InternalSession
        Let the session know that the page has disconnected
        Parameters:
        channel - the MessageChannel used for communications between the client page and the gateway page
      • receive

        public void receive​(MessageChannel channel,
                            java.lang.String protocol,
                            java.io.Reader payload)
        Description copied from interface: InternalSession
        Called when this session has received a message from the message channel.
        Parameters:
        channel - the MessageChannel from which the message was received
        protocol - the protocol of the message
        payload - the payload of the message
      • getOrCreatePage

        public PageModel getOrCreatePage​(java.lang.String pageId)
        Description copied from interface: InternalSession
        Fetch the PageModel associated with the given page ID. If the page does not exist, it is created, associated with the given page ID, and returned.
        Parameters:
        pageId - the page ID associated with the target page
        Returns:
        the page associated with the given page ID or a new page if it does not exist
      • findPage

        public java.util.Optional<PageModel> findPage​(java.lang.String pageId)
        Description copied from interface: Session
        Find the Page 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

        public java.util.List<PageModel> getPages()
        Returns:
        A list of all open pages for this session
      • closePage

        public void closePage​(java.lang.String pageId)
        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).
        Parameters:
        pageId - the page ID associated with the target page
      • closePage

        public void closePage​(java.lang.String pageId,
                              @Nullable
                              java.lang.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.
        Parameters:
        pageId - the page ID associated with the target page
        message - the message displayed to the client on the terminal state page
      • onSessionInit

        public void onSessionInit​(com.inductiveautomation.ignition.common.gson.JsonObject sessionInitResponse)
        Description copied from interface: InternalSession
        Called during the session-init lifecycle of the client. Implementations may modify the given response JSON object to pass back to the client.
        Parameters:
        sessionInitResponse - the response JSON object to be passed back to the client in response to the session-init call
      • logout

        @Nonnull
        public java.util.Optional<java.lang.String> logout()
        Description copied from interface: InternalSession
        Logout of this session. The user will no longer be authenticated.
        Returns:
        a logout token or hint for the IdP if one is available
      • onLoginResponse

        public void onLoginResponse​(@Nonnull
                                    WebAuthResponseContext webAuthResponseContext)
        Description copied from interface: InternalSession
        Called when the session receives a login response from the IdP
        Parameters:
        webAuthResponseContext - the login response object
      • onLogoutResponse

        public void onLogoutResponse​(@Nonnull
                                     WebAuthResponseContext webAuthResponseContext)
        Description copied from interface: InternalSession
        Called when this session received a logout response from the IdP
        Parameters:
        webAuthResponseContext - the logout response object
      • onKeepaliveReceived

        public void onKeepaliveReceived​(java.lang.String pageId,
                                        long timestamp)
        Description copied from interface: InternalSession
        Called by the client to keep the session alive.
        Parameters:
        pageId - the page ID of the page which triggered the keep alive request
        timestamp - the timestamp associated with the keep alive request
      • updateSessionProps

        public void updateSessionProps​(SessionPropsConfig config)
        Description copied from interface: InternalSession
        Update the props and bindings associated with this session
        Parameters:
        config - the session props config to apply
      • findViewConfig

        public java.util.concurrent.CompletableFuture<java.util.Optional<ViewConfig>> findViewConfig​(java.lang.String viewPath)
        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:
        viewPath - path to the view's project resource within the project being run.
      • getTagManager

        public TagManager getTagManager()
      • getLocale

        public java.util.Locale getLocale()
        Description copied from interface: InternalSession
        The current locale for this session, or a safe default Locale.getDefault() if not available.
      • getTimeZoneId

        public java.lang.String getTimeZoneId()
        Description copied from interface: InternalSession
        The current timezone id for this session, or a safe default if not available.
      • refreshBinding

        public void refreshBinding​(PropertyKey property)
        Description copied from interface: Session
        Refresh the binding for the given property
        Parameters:
        property - the property which has the binding to refresh
      • getPropertyTreeOf

        @Nullable
        public PropertyTree getPropertyTreeOf​(@Nullable
                                              PropertyType propertyType)
        Description copied from interface: PropertyTreeOwner
        Fetch the PropertyTree associated with the given PropertyType
        Parameters:
        propertyType - The PropertyType of the PropertyTree we want to fetch
        Returns:
        The PropertyTree or null if this PropertyTreeOwner does not manage a PropertyTree for the given PropertyType or if a null PropertyType is given