org.codehaus.plexus.redback.users
Interface UserManager

All Known Implementing Classes:
AbstractUserManager

public interface UserManager

User Manager Interface

Author:
Jason van Zyl, Joakim Erdfelt

Field Summary
static java.lang.String ROLE
           
 
Method Summary
 User addUser(User user)
          Add a User.
 void addUserManagerListener(UserManagerListener listener)
          Add a UserManagerListener to track major events in the UserManager.
 void addUserUnchecked(User user)
          Add a user to the database without checking for consistency or adjusting the password.
 User createUser(java.lang.String username, java.lang.String fullName, java.lang.String emailAddress)
          Factory method to create new User Objects based on provider specific implementation.
 UserQuery createUserQuery()
          Factory method to create UserQuerys based on provider specific implementations.
 void deleteUser(java.lang.Object principal)
          Delete a user using the principal.
 void deleteUser(java.lang.String username)
          Delete a user using the username.
 void eraseDatabase()
           
 User findUser(java.lang.Object principal)
          Find a User using the principal.
 User findUser(java.lang.String username)
          Find a User using a User name.
 java.util.List findUsersByEmailKey(java.lang.String emailKey, boolean orderAscending)
           
 java.util.List findUsersByFullNameKey(java.lang.String fullNameKey, boolean orderAscending)
           
 java.util.List findUsersByQuery(UserQuery query)
          Find users matching properties, ordering and range as specified by the UserQuery.
 java.util.List findUsersByUsernameKey(java.lang.String usernameKey, boolean orderAscending)
           
 java.lang.String getId()
          And Identifier for the UserManager.
 java.util.List getUsers()
          Get the List of User objects.
 java.util.List getUsers(boolean orderAscending)
           
 boolean isReadOnly()
          Is the UserManager read only? if so then create and modify actions are to be disabled
 void removeUserManagerListener(UserManagerListener listener)
          Remove a UserManagerListener from the collection of listeners.
 User updateUser(User user)
          Update a User.
 boolean userExists(java.lang.Object principal)
          true if the user exists, false if it doesn't
 

Field Detail

ROLE

static final java.lang.String ROLE
Method Detail

isReadOnly

boolean isReadOnly()
Is the UserManager read only? if so then create and modify actions are to be disabled

Returns:
boolean true if user manager is disabled

getId

java.lang.String getId()
And Identifier for the UserManager.

Returns:
the user manager identifier.

addUserManagerListener

void addUserManagerListener(UserManagerListener listener)
Add a UserManagerListener to track major events in the UserManager.

Parameters:
listener - the listener to add.

removeUserManagerListener

void removeUserManagerListener(UserManagerListener listener)
Remove a UserManagerListener from the collection of listeners.

Parameters:
listener - the listener to remove.

createUser

User createUser(java.lang.String username,
                java.lang.String fullName,
                java.lang.String emailAddress)
Factory method to create new User Objects based on provider specific implementation.

User objects created this way do not exist in the provider's underlying data store until a call to addUser(User) is made.

Parameters:
username - the username for this user.
fullName - the full name for this user.
emailAddress - the email address for this user.
Returns:
the new user object ready to use.

createUserQuery

UserQuery createUserQuery()
Factory method to create UserQuerys based on provider specific implementations.

Returns:
the provider implementation of UserQuery

getUsers

java.util.List getUsers()
Get the List of User objects.

Returns:
the List of User Objects.

getUsers

java.util.List getUsers(boolean orderAscending)

addUser

User addUser(User user)
Add a User.

Parameters:
user - the user to add.
Returns:
the user that was just added.

updateUser

User updateUser(User user)
                throws UserNotFoundException
Update a User.

Parameters:
user - the user to update.
Returns:
the user that was just updated.
Throws:
UserNotFoundException - if the user was not found to update.

findUser

User findUser(java.lang.String username)
              throws UserNotFoundException
Find a User using a User name.

Parameters:
username - the username to find.
Returns:
the user.
Throws:
UserNotFoundException - if the user was not found.

findUsersByUsernameKey

java.util.List findUsersByUsernameKey(java.lang.String usernameKey,
                                      boolean orderAscending)

findUsersByFullNameKey

java.util.List findUsersByFullNameKey(java.lang.String fullNameKey,
                                      boolean orderAscending)

findUsersByEmailKey

java.util.List findUsersByEmailKey(java.lang.String emailKey,
                                   boolean orderAscending)

findUsersByQuery

java.util.List findUsersByQuery(UserQuery query)
Find users matching properties, ordering and range as specified by the UserQuery.

Parameters:
query - the query.
Returns:
a List of User objects.

findUser

User findUser(java.lang.Object principal)
              throws UserNotFoundException
Find a User using the principal.

Parameters:
principal - the principal to look for.
Returns:
the user.
Throws:
UserNotFoundException - if the user was not found.

userExists

boolean userExists(java.lang.Object principal)
true if the user exists, false if it doesn't

Parameters:
principal -
Returns:
true, if user exists

deleteUser

void deleteUser(java.lang.Object principal)
                throws UserNotFoundException
Delete a user using the principal.

Parameters:
principal - the principal to look for.
Throws:
UserNotFoundException - the user was not found.

deleteUser

void deleteUser(java.lang.String username)
                throws UserNotFoundException
Delete a user using the username.

Parameters:
username - the username to look for.
Throws:
UserNotFoundException - the user was not found.

addUserUnchecked

void addUserUnchecked(User user)
Add a user to the database without checking for consistency or adjusting the password. Should only be used for re-importing known-good data.

Parameters:
user - the user to add

eraseDatabase

void eraseDatabase()


Copyright © 2006-2008 Codehaus. All Rights Reserved.