com.atlassian.user.impl.hibernate
Class HibernateUserManager
java.lang.Object
org.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate.support.HibernateDaoSupport
com.atlassian.user.impl.hibernate.HibernateUserManager
- All Implemented Interfaces:
- EntityManager, org.springframework.beans.factory.InitializingBean, UserManager
- public class HibernateUserManager
- extends org.springframework.orm.hibernate.support.HibernateDaoSupport
- implements UserManager
Field Summary |
static java.lang.String |
ENTITYID_FIELD
|
protected org.apache.log4j.Logger |
log
|
Fields inherited from class org.springframework.dao.support.DaoSupport |
logger |
Methods inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport |
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory |
Methods inherited from class org.springframework.dao.support.DaoSupport |
afterPropertiesSet, initDao |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ENTITYID_FIELD
public static final java.lang.String ENTITYID_FIELD
- See Also:
- Constant Field Values
log
protected final org.apache.log4j.Logger log
HibernateUserManager
public HibernateUserManager(RepositoryIdentifier identifier,
HibernateRepository repository,
PasswordEncryptor passwordEncryptor)
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(java.lang.String username)
throws EntityException
- Specified by:
getUser
in interface UserManager
- Returns:
- an
User
if one could be found, otherwise null.
- Throws:
EntityException
- representing the exception which prohibited looking for or retrieving the user.
createUser
public User createUser(java.lang.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,
java.lang.String password)
throws EntityException
- Encrypts the plain password, sets it on the user, and saves the user.
- Specified by:
alterPassword
in interface UserManager
- Throws:
EntityException
- - representing a system error.
saveUser
public void saveUser(User user)
throws EntityException
- Specified by:
saveUser
in interface UserManager
- Throws:
EntityException
- - representing a system error.
removeUser
public void removeUser(User user)
throws EntityException
- Removes the specified group, if it is present.
- Specified by:
removeUser
in interface UserManager
- Throws:
EntityException
- if an exception which prohibited removal
getGroupsForLocalUser
protected java.util.List getGroupsForLocalUser(User user)
throws RepositoryException
- Throws:
RepositoryException
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
RepositoryIdentifier
),
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:
java.lang.UnsupportedOperationException
- - for UserManager
objects which do not create User
objects.
EntityException
getIdentifier
public RepositoryIdentifier getIdentifier()
- Specified by:
getIdentifier
in interface EntityManager
- Returns:
- the
RepositoryIdentifier
which is managed by this instance.
getRepository
public RepositoryIdentifier getRepository(Entity entity)
throws EntityException
- Specified by:
getRepository
in interface EntityManager
- Returns:
- the
RepositoryIdentifier
of the repository in which the entity is stored, or null
if the entity cannot be found.
- Throws:
EntityException
- if the entity cannot be found, or trying to retrieve it results in an error
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 to indicate that
Entity
objects can be created by this manager, or false to indicate
not.
Copyright © 2005-2007 Atlassian Software Systems Pty Ltd. All Rights Reserved.