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 Details

    • requireSession

      org.apache.shiro.session.Session requireSession(String sessionId, 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(String login, 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(String login, 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(String sessionID)
      End the session with the given ID.
      Parameters:
      sessionID -
    • registerSession

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

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

      String createAnonymousSession(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

      String cloneSession(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(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(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