com.atlassian.user
Interface UserManager

All Superinterfaces:
EntityManager
All Known Implementing Classes:
CachingUserManager, DelegatingUserManager, HibernateUserManager, MemoryUserManager, MemoryUserManagerReadOnly, OSUUserManager, ReadOnlyUserManager

public interface UserManager
extends EntityManager


Method Summary
 void alterPassword(User user, java.lang.String plainTextPass)
          Encrypts the plain password, sets it on the user, and saves the user.
 User createUser(java.lang.String username)
          Creates a new user with the username provided.
 User getUser(java.lang.String username)
           
 Pager getUserNames()
           
 Pager getUsers()
           
 boolean isReadOnly(User user)
           
 void removeUser(User user)
          Removes the specified user from the repository.
 void saveUser(User user)
          Persists any changes made to the user to the storage system used by this user manager.
 
Methods inherited from interface com.atlassian.user.EntityManager
getIdentifier, getRepository, isCreative
 

Method Detail

getUsers

public Pager getUsers()
               throws EntityException
Returns:
a Pager holding all users being managed.
Throws:
EntityException

getUserNames

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

getUser

public User getUser(java.lang.String username)
             throws EntityException
Returns:
a null or a User if one could be found.
Throws:
EntityException

createUser

public User createUser(java.lang.String username)
                throws EntityException
Creates a new user with the username provided. Returns the newly created user.

Returns:
a User object representing the new user.
Throws:
DuplicateEntityException - if a user with the username already exists.
java.lang.UnsupportedOperationException - - if EntityManager.isCreative() returns false.
EntityException

alterPassword

public void alterPassword(User user,
                          java.lang.String plainTextPass)
                   throws EntityException
Encrypts the plain password, sets it on the user, and saves the user. Implementations supporting this will usually have an internal PasswordEncryptor.

Throws:
java.lang.UnsupportedOperationException - - if EntityManager.isCreative() returns false.
EntityException

saveUser

public void saveUser(User user)
              throws EntityException,
                     java.lang.IllegalArgumentException
Persists any changes made to the user to the storage system used by this user manager.

To ensure consistent behaviour across all repository types, clients must call this method after using User.setEmail(String), User.setFullName(String) or User.setPassword(String).

Throws:
java.lang.UnsupportedOperationException - - if EntityManager.isCreative() returns false
java.lang.IllegalArgumentException - if the user is null or not managed by this repository
EntityException

removeUser

public void removeUser(User user)
                throws EntityException,
                       java.lang.IllegalArgumentException
Removes the specified user from the repository.

Throws:
java.lang.UnsupportedOperationException - if isReadOnly(User) returns true.
java.lang.IllegalArgumentException - if the user is null or not managed by this repository
EntityException

isReadOnly

public boolean isReadOnly(User user)
                   throws EntityException
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


Copyright © 2005-2008 Atlassian Software Systems Pty Ltd. All Rights Reserved.