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 String
GUEST_USERNAME
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description User
addUser(User user)
Add a User.void
addUserManagerListener(UserManagerListener listener)
Add aUserManagerListener
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
createGuestUser()
Factory method to create the guest user.User
createUser(String username, String fullName, String emailAddress)
Factory method to create new User Objects based on provider specific implementation.UserQuery
createUserQuery()
Factory method to createUserQuery
s based on provider specific implementations.void
deleteUser(String username)
Delete a user using the username.void
eraseDatabase()
User
findUser(String username)
Find a User using a User name.User
findUser(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)
String
getDescriptionKey()
User
getGuestUser()
Get the guest user.String
getId()
An Identifier for the UserManager.List<? extends User>
getUsers()
Get the List ofUser
objects.List<? extends User>
getUsers(boolean orderAscending)
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.boolean
isFinalImplementation()
boolean
isReadOnly()
Is the UserManager read only? if so then create and modify actions are to be disabledvoid
removeUserManagerListener(UserManagerListener listener)
Remove aUserManagerListener
from the collection of listeners.User
updateUser(User user)
Update a User.User
updateUser(User user, boolean passwordChangeRequired)
boolean
userExists(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 aUserManagerListener
to track major events in the UserManager.- Parameters:
listener
- the listener to add.
-
removeUserManagerListener
void removeUserManagerListener(UserManagerListener listener)
Remove aUserManagerListener
from 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 createUserQuery
s based on provider specific implementations.- Returns:
- the provider implementation of UserQuery
-
getUsers
List<? extends User> getUsers() throws UserManagerException
Get the List ofUser
objects.- Returns:
- the List of
User
Objects. - 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:
UserNotFoundException
UserManagerException
-
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
User
objects. - 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
-
-