|
||||||||||
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()
HibernateDao
HibernateDao.load(long)
to
work correctly
getPersistentClass
in class HibernateDao
public InternalUser findByName(long directoryId, java.lang.String username) throws UserNotFoundException
UserDao
findByName
in interface UserDao
UserNotFoundException
- if the user could not be foundpublic PasswordCredential getCredential(long directoryId, java.lang.String username) throws UserNotFoundException
UserDao
getCredential
in interface UserDao
UserNotFoundException
- if the user could not be foundpublic java.util.List<PasswordCredential> getCredentialHistory(long directoryId, java.lang.String username) throws UserNotFoundException
UserDao
getCredentialHistory
in interface UserDao
UserNotFoundException
- if the user could not be foundpublic InternalUserWithAttributes findByNameWithAttributes(long directoryId, java.lang.String username) throws UserNotFoundException
UserDao
findByNameWithAttributes
in interface UserDao
UserNotFoundException
- 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 UserDao
user
- 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 UserDao
user
- 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 providedpublic void updateCredential(User user, PasswordCredential credential, int maxPasswordHistory) throws UserNotFoundException
UserDao
updateCredential
in interface UserDao
user
- the user whose password will be modified
UserNotFoundException
- if there is no user with the same name (case-insensitive) and directory as the user providedpublic InternalUser rename(User user, java.lang.String newUsername) throws UserNotFoundException
UserDao
rename
in interface UserDao
user
- the user to renamenewUsername
- the new name of the user
UserNotFoundException
- if the user cannot be foundpublic void remove(User user) throws UserNotFoundException
UserDao
remove
in interface UserDao
user
- 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 UserDao
user
- 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 UserDao
user
- the user whose attribute will be removedattributeName
- the name of the attribute to be removed
UserNotFoundException
- if the user cannot be foundpublic <T> java.util.List<T> search(long directoryID, EntityQuery<T> query)
UserDao
search
in interface UserDao
T
- the type of objects to return, which is normally either User
or String
directoryID
- the ID of the directory to searchquery
- the search query
public BatchResult<User> addAll(java.util.Set<UserTemplateWithCredentialAndAttributes> users)
UserDao
addAll
in interface UserDao
users
- to be added
public void removeAllUsers(long directoryId, java.util.Set<java.lang.String> userNames)
UserDao
removeAllUsers
in interface UserDao
directoryId
- 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 InternalUserDao
directoryID
- 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 |