com.atlassian.crowd.model.principal
Interface UserDAO

All Superinterfaces:
ObjectDao
All Known Implementing Classes:
UserDAOHibernate

public interface UserDAO
extends ObjectDao


Method Summary
 InternalUser add(User user, PasswordCredential credential)
           
 BatchResult<User> addAll(long directoryId, java.util.Set<UserTemplateWithCredentialAndAttributes> users)
          Bulk add of users using JDBC batch support.
 InternalUser findByName(long directoryID, java.lang.String username)
           
 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)
           
 void remove(User user)
           
 void removeAll(long directoryId)
           
 void removeAttribute(User user, java.lang.String attributeName)
           
 InternalUser rename(User user, java.lang.String newUsername)
           
 java.util.List search(long directoryID, EntityQuery query)
           
 void storeAttributes(User user, java.util.Map<java.lang.String,java.util.List<java.lang.String>> attributes)
           
 InternalUser update(User user)
           
 InternalUser updateCredential(User user, PasswordCredential credential, int maxPasswordHistory)
           
 
Methods inherited from interface com.atlassian.crowd.util.persistence.hibernate.ObjectDao
getPersistentClass, load, remove, save, update
 

Method Detail

findByName

InternalUser findByName(long directoryID,
                        java.lang.String username)
                        throws ObjectNotFoundException
Throws:
ObjectNotFoundException

findByNameWithAttributes

InternalUserWithAttributes findByNameWithAttributes(long directoryID,
                                                    java.lang.String username)
                                                    throws ObjectNotFoundException
Throws:
ObjectNotFoundException

add

InternalUser add(User user,
                 PasswordCredential credential)
                 throws ObjectNotFoundException
Throws:
ObjectNotFoundException

update

InternalUser update(User user)
                    throws ObjectNotFoundException
Throws:
ObjectNotFoundException

updateCredential

InternalUser updateCredential(User user,
                              PasswordCredential credential,
                              int maxPasswordHistory)
                              throws ObjectNotFoundException
Throws:
ObjectNotFoundException

rename

InternalUser rename(User user,
                    java.lang.String newUsername)
                    throws ObjectNotFoundException
Throws:
ObjectNotFoundException

storeAttributes

void storeAttributes(User user,
                     java.util.Map<java.lang.String,java.util.List<java.lang.String>> attributes)
                     throws ObjectNotFoundException
Throws:
ObjectNotFoundException

removeAttribute

void removeAttribute(User user,
                     java.lang.String attributeName)
                     throws ObjectNotFoundException
Throws:
ObjectNotFoundException

remove

void remove(User user)
            throws ObjectNotFoundException
Throws:
ObjectNotFoundException

removeAll

void removeAll(long directoryId)

search

java.util.List search(long directoryID,
                      EntityQuery query)
Parameters:
directoryID - ID of the directory to condunct the search.
query - the user query
Returns:
a List of users, or an empty list.
Throws:
org.springframework.dao.DataAccessException - underlying problem communicating with the database.
java.lang.IllegalArgumentException - query contains illegal arguments.

addAll

BatchResult<User> addAll(long directoryId,
                         java.util.Set<UserTemplateWithCredentialAndAttributes> users)
                         throws ObjectNotFoundException
Bulk add of users using JDBC batch support.

Parameters:
directoryId - the directory to add the users to
users - to be added
Returns:
a list of Users that failed to be added
Throws:
ObjectNotFoundException - if the directory cannot be found

findByNames

java.util.Collection<InternalUser> findByNames(long directoryID,
                                               java.util.Collection<java.lang.String> usernames)
Bulk find of users using SQL disjunction.

Parameters:
directoryID - the directory to search for the users.
usernames - names of users to find
Returns:
collection of found users.


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.