Package org.apache.archiva.redback.users
Interface UserManager
-
- All Known Implementing Classes:
AbstractUserManager,CachedUserManager,ConfigurableUserManager,JpaUserManager,LdapUserManager,MemoryUserManager
public interface UserManager
User Manager Interface- Author:
- Jason van Zyl, Joakim Erdfelt
-
-
Field Summary
Fields Modifier and Type Field Description static StringGUEST_USERNAME
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description UseraddUser(User user)Add a User.voidaddUserManagerListener(UserManagerListener listener)Add aUserManagerListenerto track major events in the UserManager.voidaddUserUnchecked(User user)Add a user to the database without checking for consistency or adjusting the password.UsercreateGuestUser()Factory method to create the guest user.UsercreateUser(String username, String fullName, String emailAddress)Factory method to create new User Objects based on provider specific implementation.UserQuerycreateUserQuery()Factory method to createUserQuerys based on provider specific implementations.voiddeleteUser(String username)Delete a user using the username.voideraseDatabase()UserfindUser(String username)Find a User using a User name.UserfindUser(String username, boolean useCache)Find a User using a User name.List<? extends User>findUsersByEmailKey(String emailKey, boolean orderAscending)List<? extends User>findUsersByFullNameKey(String fullNameKey, boolean orderAscending)List<? extends User>findUsersByQuery(UserQuery query)Find users matching properties, ordering and range as specified by theUserQuery.List<? extends User>findUsersByUsernameKey(String usernameKey, boolean orderAscending)StringgetDescriptionKey()UsergetGuestUser()Get the guest user.StringgetId()An Identifier for the UserManager.List<? extends User>getUsers()Get the List ofUserobjects.List<? extends User>getUsers(boolean orderAscending)voidinitialize()consumer of user manager can use it to reload various configuration with the configurable implementation is possible to change dynamically the real implementation used.booleanisFinalImplementation()booleanisReadOnly()Is the UserManager read only? if so then create and modify actions are to be disabledvoidremoveUserManagerListener(UserManagerListener listener)Remove aUserManagerListenerfrom the collection of listeners.UserupdateUser(User user)Update a User.UserupdateUser(User user, boolean passwordChangeRequired)booleanuserExists(String principal)true if the user exists, false if it doesn't
-
-
-
Field Detail
-
GUEST_USERNAME
static final String GUEST_USERNAME
- See Also:
- Constant Field Values
-
-
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
-
addUserManagerListener
void addUserManagerListener(UserManagerListener listener)
Add aUserManagerListenerto track major events in the UserManager.- Parameters:
listener- the listener to add.
-
removeUserManagerListener
void removeUserManagerListener(UserManagerListener listener)
Remove aUserManagerListenerfrom the collection of listeners.- Parameters:
listener- the listener to remove.
-
createUser
User createUser(String username, String fullName, String emailAddress) throws UserManagerException
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 toaddUser(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.
- Throws:
UserManagerException
-
createGuestUser
User createGuestUser() throws UserManagerException
Factory method to create the guest user.- Returns:
- The guest user
- Throws:
UserManagerException
-
createUserQuery
UserQuery createUserQuery()
Factory method to createUserQuerys based on provider specific implementations.- Returns:
- the provider implementation of UserQuery
-
getUsers
List<? extends User> getUsers() throws UserManagerException
Get the List ofUserobjects.- Returns:
- the List of
UserObjects. - Throws:
UserManagerException
-
getUsers
List<? extends User> getUsers(boolean orderAscending) throws UserManagerException
- Throws:
UserManagerException
-
addUser
User addUser(User user) throws UserManagerException
Add a User.- Parameters:
user- the user to add.- Returns:
- the user that was just added.
- Throws:
UserManagerException
-
updateUser
User updateUser(User user) throws UserNotFoundException, UserManagerException
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.UserManagerException
-
findUser
User findUser(String username) throws UserNotFoundException, UserManagerException
Find a User using a User name.- Parameters:
username- the username to find.- Returns:
- the user.
- Throws:
UserNotFoundException- if the user was not found.UserManagerException
-
findUser
User findUser(String username, boolean useCache) throws UserNotFoundException, UserManagerException
Find a User using a User name.- Parameters:
username- the username to find.useCache- to use or not caching- Returns:
- the user.
- Throws:
UserNotFoundException- if the user was not found.UserManagerException- Since:
- 2.2
-
getGuestUser
User getGuestUser() throws UserNotFoundException, UserManagerException
Get the guest user.- Returns:
- the guest user.
- Throws:
UserNotFoundExceptionUserManagerException
-
findUsersByUsernameKey
List<? extends User> findUsersByUsernameKey(String usernameKey, boolean orderAscending) throws UserManagerException
- Throws:
UserManagerException
-
findUsersByFullNameKey
List<? extends User> findUsersByFullNameKey(String fullNameKey, boolean orderAscending) throws UserManagerException
- Throws:
UserManagerException
-
findUsersByEmailKey
List<? extends User> findUsersByEmailKey(String emailKey, boolean orderAscending) throws UserManagerException
- Throws:
UserManagerException
-
findUsersByQuery
List<? extends User> findUsersByQuery(UserQuery query) throws UserManagerException
Find users matching properties, ordering and range as specified by theUserQuery.- Parameters:
query- the query.- Returns:
- a List of
Userobjects. - Throws:
UserManagerException
-
userExists
boolean userExists(String principal) throws UserManagerException
true if the user exists, false if it doesn't- Parameters:
principal-- Returns:
- true, if user exists
- Throws:
UserManagerException
-
deleteUser
void deleteUser(String username) throws UserNotFoundException, UserManagerException
Delete a user using the username.- Parameters:
username- the username to look for.- Throws:
UserNotFoundException- the user was not found.UserManagerException
-
addUserUnchecked
void addUserUnchecked(User user) throws UserManagerException
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- Throws:
UserManagerException
-
eraseDatabase
void eraseDatabase()
-
updateUser
User updateUser(User user, boolean passwordChangeRequired) throws UserNotFoundException, UserManagerException
-
initialize
void initialize()
consumer of user manager can use it to reload various configuration with the configurable implementation is possible to change dynamically the real implementation used.- Since:
- 2.1
-
isFinalImplementation
boolean isFinalImplementation()
- Returns:
- true if this implementation is a final one and not a wrapper (configurable, cached)
- Since:
- 2.1
-
getDescriptionKey
String getDescriptionKey()
- Returns:
- a key to be able to customize label in UI
- Since:
- 2.1
-
-