com.atlassian.bamboo.rest
Class DefaultSessionManager

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

public class DefaultSessionManager
extends java.lang.Object
implements SessionManager

This class manages user rest api sessions.


Field Summary
static long DEFAULT_TIMEOUT
           
 
Fields inherited from interface com.atlassian.bamboo.rest.SessionManager
ANONYMOUS_USER
 
Constructor Summary
DefaultSessionManager(BambooUserManager bambooUserManager)
          Default constructor that uses the default user timeout
DefaultSessionManager(long sessionTimeout, BambooUserManager bambooUserManager)
          Custom constructor to control the length of the timeout
 
Method Summary
 java.lang.String getUserNameFromSession(java.lang.String sessionId)
          What is the username associated with this session?
 java.lang.String login(java.lang.String username, java.lang.String password)
          Allow remote users to login to bamboo, providing them with a session id to pass into remote methods.
 void logout(java.lang.String sessionId)
          Log users out of the session
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TIMEOUT

public static long DEFAULT_TIMEOUT
Constructor Detail

DefaultSessionManager

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


DefaultSessionManager

public DefaultSessionManager(long sessionTimeout,
                             BambooUserManager bambooUserManager)
Custom constructor to control the length of the timeout

Parameters:
sessionTimeout - How much inactive use before the user's session timesout?
Method Detail

login

public java.lang.String login(java.lang.String username,
                              java.lang.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(java.lang.String sessionId)
Log users out of the session

Specified by:
logout in interface SessionManager
Parameters:
sessionId - The session identifer

getUserNameFromSession

public java.lang.String getUserNameFromSession(java.lang.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,


Copyright © 2010 Atlassian. All Rights Reserved.