Package com.atlassian.bamboo.rest
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.
-
-
Field Summary
-
Fields inherited from interface com.atlassian.bamboo.rest.SessionManager
ANONYMOUS_USER
-
-
Constructor Summary
Constructors Constructor Description DefaultSessionManager(BambooUserManager bambooUserManager)
Default constructor that uses the default user timeoutDefaultSessionManager(BambooUserManager bambooUserManager, int sessionTimeout, TimeUnit timeUnit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getUserNameFromSession(String sessionId)
What is the username associated with this session?String
login(String username, String password)
Allow remote users to login to bamboo, providing them with a session id to pass into remote methods.void
logout(String sessionId)
Log users out of the session
-
-
-
Constructor Detail
-
DefaultSessionManager
public DefaultSessionManager(BambooUserManager bambooUserManager)
Default constructor that uses the default user timeout
-
DefaultSessionManager
public DefaultSessionManager(BambooUserManager bambooUserManager, int sessionTimeout, TimeUnit timeUnit)
-
-
Method Detail
-
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 interfaceSessionManager
- Parameters:
username
- The username we want to login underpassword
- 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 interfaceSessionManager
- 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 interfaceSessionManager
- Parameters:
sessionId
- The session identifier- Returns:
- The session's username
- Throws:
BambooRemoteException
- Unknown or timed out session,
-
-