|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate3.support.HibernateDaoSupport
com.atlassian.crowd.util.persistence.hibernate.HibernateDao
com.atlassian.crowd.dao.user.UserDAOHibernate
public class UserDAOHibernate
| Field Summary |
|---|
| Fields inherited from class com.atlassian.crowd.util.persistence.hibernate.HibernateDao |
|---|
batchFinder, batchProcessor, logger |
| Constructor Summary | |
|---|---|
UserDAOHibernate()
|
|
| Method Summary | ||
|---|---|---|
InternalUser |
add(User user,
PasswordCredential credential)
Creates a new user with the given details and credentials. |
|
BatchResultWithIdReferences<User> |
addAll(java.util.Collection<UserTemplateWithCredentialAndAttributes> users)
|
|
BatchResult<User> |
addAll(java.util.Set<UserTemplateWithCredentialAndAttributes> users)
Bulk add of users using JDBC batch support. |
|
InternalUser |
findByName(long directoryId,
java.lang.String username)
Finds and returns the user with the given name and directory ID. |
|
java.util.Collection<InternalUser> |
findByNames(long directoryID,
java.util.Collection<java.lang.String> usernames)
Bulk find of users using SQL disjunction. |
|
InternalUserWithAttributes |
findByNameWithAttributes(long directoryId,
java.lang.String username)
Finds and returns the user with attributes with the given name and directory ID. |
|
java.util.Set<InternalUserAttribute> |
findUserAttributes(long userID)
|
|
PasswordCredential |
getCredential(long directoryId,
java.lang.String username)
Returns the credential for the given user. |
|
java.util.List<PasswordCredential> |
getCredentialHistory(long directoryId,
java.lang.String username)
Returns the previous credentials for the given user, starting with the oldest. |
|
java.lang.Class |
getPersistentClass()
All subclasses of HibernateDAO must implement this method for HibernateDao.load(long) to
work correctly |
|
void |
remove(User user)
Removes the user. |
|
void |
removeAll(long directoryId)
|
|
void |
removeAllUsers(long directoryId,
java.util.Set<java.lang.String> userNames)
Remove all the given users from directory. |
|
void |
removeAttribute(User user,
java.lang.String attributeName)
Removes the attributes for the user with the given name. |
|
InternalUser |
rename(User user,
java.lang.String newUsername)
Changes the user's name to the provided new name. |
|
|
search(long directoryID,
EntityQuery<T> query)
Returns users matching the search query in the given directory, ordered by name. |
|
void |
setDirectoryDAO(DirectoryDAOHibernate directoryDAO)
|
|
void |
setHqlQueryTranslater(HQLQueryTranslater hqlQueryTranslater)
|
|
void |
setInternalAttributesHelper(InternalAttributesHelper internalAttributesHelper)
|
|
void |
setMembershipDAO(InternalMembershipDao internalMembershipDao)
|
|
void |
storeAttributes(User user,
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> attributes)
Adds or updates a user's attributes with the new Map of attribute values. |
|
InternalUser |
update(User user)
Updates all the user properties of the user with the same directory and case-insensitive name. |
|
void |
updateCredential(User user,
PasswordCredential credential,
int maxPasswordHistory)
Updates the credential (password) of the user with the same directory and case-insensitive name. |
|
| Methods inherited from class com.atlassian.crowd.util.persistence.hibernate.HibernateDao |
|---|
load, loadReference, remove, save, saveOrUpdate, setBatchFinder, setBatchProcessor, update |
| Methods inherited from class org.springframework.orm.hibernate3.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 |
| Constructor Detail |
|---|
public UserDAOHibernate()
| Method Detail |
|---|
public java.lang.Class getPersistentClass()
HibernateDaoHibernateDao.load(long) to
work correctly
getPersistentClass in class HibernateDao
public InternalUser findByName(long directoryId,
java.lang.String username)
throws UserNotFoundException
UserDao
findByName in interface UserDaoUserNotFoundException - if the user could not be found
public PasswordCredential getCredential(long directoryId,
java.lang.String username)
throws UserNotFoundException
UserDao
getCredential in interface UserDaoUserNotFoundException - if the user could not be found
public java.util.List<PasswordCredential> getCredentialHistory(long directoryId,
java.lang.String username)
throws UserNotFoundException
UserDao
getCredentialHistory in interface UserDaoUserNotFoundException - if the user could not be found
public InternalUserWithAttributes findByNameWithAttributes(long directoryId,
java.lang.String username)
throws UserNotFoundException
UserDao
findByNameWithAttributes in interface UserDaoUserNotFoundException - if the user could not be foundpublic java.util.Set<InternalUserAttribute> findUserAttributes(long userID)
public InternalUser add(User user,
PasswordCredential credential)
throws DirectoryNotFoundException,
UserAlreadyExistsException
UserDao
add in interface UserDaouser - the user to createcredential - the encrypted password for the user, which may be null if the user's password is not yet available
UserAlreadyExistsException - if a user with the same directory and name (case-insensitive) already exists
DirectoryNotFoundException
public InternalUser update(User user)
throws UserNotFoundException
UserDao
update in interface UserDaouser - the user details, which should have the same name as the user to modify
UserNotFoundException - if there is no user with the same name (case-insensitive) and directory as the user provided
public void updateCredential(User user,
PasswordCredential credential,
int maxPasswordHistory)
throws UserNotFoundException
UserDao
updateCredential in interface UserDaouser - the user whose password will be modified
UserNotFoundException - if there is no user with the same name (case-insensitive) and directory as the user provided
public InternalUser rename(User user,
java.lang.String newUsername)
throws UserNotFoundException
UserDao
rename in interface UserDaouser - the user to renamenewUsername - the new name of the user
UserNotFoundException - if the user cannot be found
public void remove(User user)
throws UserNotFoundException
UserDao
remove in interface UserDaouser - the user to remove
UserNotFoundException - if the user does not existpublic void removeAll(long directoryId)
removeAll in interface InternalUserDao
public void storeAttributes(User user,
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> attributes)
throws UserNotFoundException
UserDao
storeAttributes in interface UserDaouser - the user to store attributes forattributes - new or updated attributes (attributes that don't need changing should not appear in this Map).
UserNotFoundException - user with supplied username does not exist.
public void removeAttribute(User user,
java.lang.String attributeName)
throws UserNotFoundException
UserDao
removeAttribute in interface UserDaouser - the user whose attribute will be removedattributeName - the name of the attribute to be removed
UserNotFoundException - if the user cannot be found
public <T> java.util.List<T> search(long directoryID,
EntityQuery<T> query)
UserDao
search in interface UserDaoT - the type of objects to return, which is normally either User or StringdirectoryID - the ID of the directory to searchquery - the search query
public BatchResult<User> addAll(java.util.Set<UserTemplateWithCredentialAndAttributes> users)
UserDao
addAll in interface UserDaousers - to be added
public void removeAllUsers(long directoryId,
java.util.Set<java.lang.String> userNames)
UserDao
removeAllUsers in interface UserDaodirectoryId - the ID of the directory to remove users fromuserNames - set of users to be removedpublic BatchResultWithIdReferences<User> addAll(java.util.Collection<UserTemplateWithCredentialAndAttributes> users)
addAll in interface InternalUserDao
public java.util.Collection<InternalUser> findByNames(long directoryID,
java.util.Collection<java.lang.String> usernames)
InternalUserDao
findByNames in interface InternalUserDaodirectoryID - the directory to search for the users.usernames - names of users to find
public void setDirectoryDAO(DirectoryDAOHibernate directoryDAO)
public void setMembershipDAO(InternalMembershipDao internalMembershipDao)
public void setHqlQueryTranslater(HQLQueryTranslater hqlQueryTranslater)
public void setInternalAttributesHelper(InternalAttributesHelper internalAttributesHelper)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||