Interface SessionManagerLocal

  • All Superinterfaces:
    SessionManagerRemote

    public interface SessionManagerLocal
    extends SessionManagerRemote
    Local interface for a session manager class defining method signatures for necessary session handling functions.
    • Method Detail

      • requireSession

        org.apache.shiro.session.Session requireSession​(java.lang.String sessionId,
                                                        java.lang.String componentName,
                                                        boolean isSuperUser)
                                                 throws InvalidSessionException
        Checks if a session with a given ID exists on the server and returns the Session object.
        Parameters:
        sessionId - SessionID
        componentName - Component name (like class name)
        isSuperUser - true: needs a session object with superuser privileges
        Returns:
        session object associated with the current request
        Throws:
        InvalidSessionException
      • getSubjectOfSession

        org.apache.shiro.subject.Subject getSubjectOfSession​(org.apache.shiro.session.Session session)
        Gets the Shiro Subject for a session.

        Normally you should not handle shiro objects yourself.

        Parameters:
        session -
        Returns:
        subject (i.e. user object) associated with the current request
      • login

        org.apache.shiro.session.Session login​(java.lang.String login,
                                               java.lang.String password)
                                        throws InvalidSessionException
        Login a user by credentials and return the session.

        Missing or invalid credentials will lead to an InvalidSessionException.

        Parameters:
        login -
        password -
        Returns:
        session object associated with the current request
        Throws:
        InvalidSessionException
      • loginIfReady

        org.apache.shiro.session.Session loginIfReady​(java.lang.String login,
                                                      java.lang.String password)
                                               throws InvalidSessionException
        Login a user by credentials and checking PubServerPhase if Ready ,returns the session.

        Missing or invalid credentials will lead to an InvalidSessionException.

        Parameters:
        login -
        password -
        Returns:
        session object associated with the current request
        Throws:
        InvalidSessionException
      • logout

        void logout​(java.lang.String sessionID)
        End the session with the given ID.
        Parameters:
        sessionID -
      • registerSession

        void registerSession​(java.lang.String sessionId)
        Adds a session to the list of registered session.
        Parameters:
        sessionId -
      • unregisterSession

        void unregisterSession​(java.lang.String sessionId)
        Removes a session from the list of registered session.
        Parameters:
        sessionId -
      • createAnonymousSession

        java.lang.String createAnonymousSession​(java.lang.String name,
                                                long maxIdleTimeInMillis)
                                         throws SessionManagerException
        Create a new and anonymous session
        Parameters:
        name - Suffix to the automatically generated login name
        maxIdleTimeInMillis - new session will expiry after this time
        Returns:
        session id of anonymous session
        Throws:
        SessionManagerException
      • cloneSession

        java.lang.String cloneSession​(java.lang.String sessionId,
                                      long maxIdleTimeInMillis)
                               throws SessionManagerException
        Create a clone of the current session.
        Parameters:
        sessionId - id of session to be cloned
        maxIdleTimeInMillis - new session will expiry after this time
        Returns:
        session id of the session clone
        Throws:
        SessionManagerException
      • getShiroSubject

        org.apache.shiro.subject.Subject getShiroSubject​(java.lang.String sessionID)
                                                  throws InvalidSessionException
        Gets the Shiro Subject for a session by its ID.

        Normally you should not handle shiro objects yourself.

        Parameters:
        sessionId - id of session Returns shiro Subject
        Returns:
        session id of the session clone
        Throws:
        InvalidSessionException
      • prolongSession

        void prolongSession​(java.lang.String sessionID)
                     throws SessionManagerException
        Touch the session object to prolong the session with this ID.
        Parameters:
        sessionID - ID of the session which we want to prolong.
        Throws:
        SessionManagerException