com.atlassian.user.impl.hibernate
Class HibernateUserManager

java.lang.Object
  extended by HibernateDaoSupport
      extended by com.atlassian.user.impl.hibernate.HibernateUserManager
All Implemented Interfaces:
EntityManager, UserManager
Direct Known Subclasses:
CachingHibernateUserManager

public class HibernateUserManager
extends HibernateDaoSupport
implements UserManager


Field Summary
static String USERNAME_FIELD
           
 
Constructor Summary
HibernateUserManager()
           
HibernateUserManager(HibernateRepository repository, PasswordEncryptor passwordEncryptor)
           
 
Method Summary
 void alterPassword(User user, String password)
          Encrypts the plain password, sets it on the user, and saves the user.
 User createUser(String username)
           
 PasswordEncryptor getPasswordEncryptor(User user)
           
 Repository getRepository()
           
 Repository getRepository(Entity entity)
           
 User getUser(String username)
           
 Pager getUserNames()
           
 Pager getUsers()
           
 void init(HashMap args)
          Used during configuration initialization.
 boolean isCreative()
          Used to detemine whether an entity can be added (eg, can call UserManager.createUser(String) or GroupManager.createGroup(String)
 boolean isReadOnly(User user)
           
 void removeUser(User user)
          Removes the specified group, if it is present.
 void saveUser(User user)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USERNAME_FIELD

public static final String USERNAME_FIELD
See Also:
Constant Field Values
Constructor Detail

HibernateUserManager

public HibernateUserManager()

HibernateUserManager

public HibernateUserManager(HibernateRepository repository,
                            PasswordEncryptor passwordEncryptor)
Method Detail

getUsers

public Pager getUsers()
               throws EntityException
Specified by:
getUsers in interface UserManager
Returns:
a Pager holding all users being managed.
Throws:
EntityException

getUserNames

public Pager getUserNames()
                   throws EntityException
Specified by:
getUserNames in interface UserManager
Returns:
a Pager holding the names of all users being managed.
Throws:
EntityException

getUser

public User getUser(String username)
             throws EntityException
Specified by:
getUser in interface UserManager
Parameters:
username -
Returns:
- an User if one could be found, otherwise null.conflue
Throws:
EntityException - - representing the exception which prohibited looking for or retrieving the user.

createUser

public User createUser(String username)
                throws EntityException
Specified by:
createUser in interface UserManager
Returns:
a User object.
Throws:
EntityException - - representing a system error

alterPassword

public void alterPassword(User user,
                          String password)
                   throws EntityException
Encrypts the plain password, sets it on the user, and saves the user.

Specified by:
alterPassword in interface UserManager
Parameters:
user -
password -
Throws:
EntityException - - representing a system error.

saveUser

public void saveUser(User user)
              throws EntityException
Specified by:
saveUser in interface UserManager
Parameters:
user -
Throws:
EntityException

removeUser

public void removeUser(User user)
                throws EntityException
Removes the specified group, if it is present.

Specified by:
removeUser in interface UserManager
Parameters:
user -
Throws:
EntityException - - representing the exception which prohibited removal

isReadOnly

public boolean isReadOnly(User user)
                   throws EntityException
Specified by:
isReadOnly in interface UserManager
Returns:
true indicates that information on the user object cannot be altered in the storage system (see Repository), false indicates that the storage system will save changes or that this UserManager does not know about the User.
Throws:
EntityException

getPasswordEncryptor

public PasswordEncryptor getPasswordEncryptor(User user)
                                       throws EntityException
Returns:
a PasswordEncryptor which handles the encrypytion of passwords for users managed by this object.
Throws:
UnsupportedOperationException - - for UserManager objects which do not create User objects.
EntityException

getRepository

public Repository getRepository()
Specified by:
getRepository in interface EntityManager
Returns:
the Repository which is managed by this instance.

getRepository

public Repository getRepository(Entity entity)
                         throws EntityException
Specified by:
getRepository in interface EntityManager
Returns:
the Repository in which the entity is stored, otherwise null.
Throws:
EntityException

isCreative

public boolean isCreative()
Used to detemine whether an entity can be added (eg, can call UserManager.createUser(String) or GroupManager.createGroup(String)

Specified by:
isCreative in interface EntityManager
Returns:
true if creative

init

public void init(HashMap args)
          throws ConfigurationException
Used during configuration initialization. Use a constructor for direct instantiation.

Specified by:
init in interface EntityManager
Parameters:
args -
Throws:
ConfigurationException


Atlassian User is developed by Atlassian Software Systems.