Class DefaultSessionManager

java.lang.Object
com.atlassian.bamboo.rest.DefaultSessionManager
All Implemented Interfaces:
SessionManager

public class DefaultSessionManager extends Object implements SessionManager
This class manages user rest api sessions.
  • Constructor Details

    • DefaultSessionManager

      public DefaultSessionManager(BambooUserManager bambooUserManager)
      Default constructor that uses the default user timeout
    • DefaultSessionManager

      public DefaultSessionManager(BambooUserManager bambooUserManager, int sessionTimeout, TimeUnit timeUnit)
  • Method Details

    • login

      public String login(String username, String password) throws BambooRemoteException
      Allow remote users to login to bamboo, providing them with a session id to pass into remote methods.
      Specified by:
      login in interface SessionManager
      Parameters:
      username - The username we want to login under
      password - The password associatedd with the username
      Returns:
      The session id for this user
      Throws:
      BambooRemoteException - Failed to login
    • logout

      public void logout(String sessionId)
      Log users out of the session
      Specified by:
      logout in interface SessionManager
      Parameters:
      sessionId - The session identifier
    • getUserNameFromSession

      public String getUserNameFromSession(String sessionId) throws BambooRemoteException
      What is the username associated with this session?
      Specified by:
      getUserNameFromSession in interface SessionManager
      Parameters:
      sessionId - The session identifier
      Returns:
      The session's username
      Throws:
      BambooRemoteException - Unknown or timed out session,