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 StringgetUserNameFromSession(String sessionId)What is the username associated with this session?Stringlogin(String username, String password)Allow remote users to login to bamboo, providing them with a session id to pass into remote methods.voidlogout(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:
loginin 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:
logoutin interfaceSessionManager- Parameters:
sessionId- The session identifier
-
getUserNameFromSession
public String getUserNameFromSession(String sessionId) throws BambooRemoteException
What is the username associated with this session?- Specified by:
getUserNameFromSessionin interfaceSessionManager- Parameters:
sessionId- The session identifier- Returns:
- The session's username
- Throws:
BambooRemoteException- Unknown or timed out session,
-
-