Class MemoryUserManager
- java.lang.Object
-
- org.apache.archiva.redback.users.AbstractUserManager
-
- org.apache.archiva.redback.users.memory.MemoryUserManager
-
- All Implemented Interfaces:
UserManager
@Service("userManager#memory") public class MemoryUserManager extends AbstractUserManager implements UserManager
-
-
Field Summary
-
Fields inherited from class org.apache.archiva.redback.users.AbstractUserManager
log
-
Fields inherited from interface org.apache.archiva.redback.users.UserManager
GUEST_USERNAME
-
-
Constructor Summary
Constructors Constructor Description MemoryUserManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UseraddUser(User user)Add a User.voidaddUserUnchecked(User user)Add a user to the database without checking for consistency or adjusting the password.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<User>findUsersByEmailKey(String emailKey, boolean orderAscending)List<User>findUsersByFullNameKey(String fullNameKey, boolean orderAscending)List<User>findUsersByQuery(UserQuery query)Find users matching properties, ordering and range as specified by theUserQuery.List<User>findUsersByUsernameKey(String usernameKey, boolean orderAscending)StringgetDescriptionKey()StringgetId()An Identifier for the UserManager.List<User>getUsers()Get the List ofUserobjects.List<User>getUsers(boolean ascendingUsername)booleanisReadOnly()Is the UserManager read only? if so then create and modify actions are to be disabledvoidtriggerInit()UserupdateUser(User user)Update a User.UserupdateUser(User user, boolean passwordChangeRequired)booleanuserExists(String principal)true if the user exists, false if it doesn't-
Methods inherited from class org.apache.archiva.redback.users.AbstractUserManager
addUserManagerListener, createGuestUser, fireUserManagerInit, fireUserManagerUserAdded, fireUserManagerUserRemoved, fireUserManagerUserUpdated, getGuestUser, getListeners, initialize, isFinalImplementation, removeUserManagerListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.archiva.redback.users.UserManager
addUserManagerListener, createGuestUser, getGuestUser, initialize, isFinalImplementation, removeUserManagerListener
-
-
-
-
Constructor Detail
-
MemoryUserManager
public MemoryUserManager()
-
-
Method Detail
-
getId
public String getId()
Description copied from interface:UserManagerAn Identifier for the UserManager.- Specified by:
getIdin interfaceUserManager- Returns:
- the user manager identifier.
-
isReadOnly
public boolean isReadOnly()
Description copied from interface:UserManagerIs the UserManager read only? if so then create and modify actions are to be disabled- Specified by:
isReadOnlyin interfaceUserManager- Returns:
- boolean true if user manager is disabled
-
createUserQuery
public UserQuery createUserQuery()
Description copied from interface:UserManagerFactory method to createUserQuerys based on provider specific implementations.- Specified by:
createUserQueryin interfaceUserManager- Returns:
- the provider implementation of UserQuery
-
findUsersByQuery
public List<User> findUsersByQuery(UserQuery query)
Description copied from interface:UserManagerFind users matching properties, ordering and range as specified by theUserQuery.- Specified by:
findUsersByQueryin interfaceUserManager- Parameters:
query- the query.- Returns:
- a List of
Userobjects.
-
addUser
public User addUser(User user) throws UserManagerException
Description copied from interface:UserManagerAdd a User.- Specified by:
addUserin interfaceUserManager- Parameters:
user- the user to add.- Returns:
- the user that was just added.
- Throws:
UserManagerException
-
updateUser
public User updateUser(User user)
Description copied from interface:UserManagerUpdate a User.- Specified by:
updateUserin interfaceUserManager- Parameters:
user- the user to update.- Returns:
- the user that was just updated.
-
updateUser
public User updateUser(User user, boolean passwordChangeRequired)
- Specified by:
updateUserin interfaceUserManager
-
userExists
public boolean userExists(String principal)
Description copied from interface:UserManagertrue if the user exists, false if it doesn't- Specified by:
userExistsin interfaceUserManager- Returns:
- true, if user exists
-
createUser
public User createUser(String username, String fullName, String emailAddress)
Description copied from interface:UserManagerFactory 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 toUserManager.addUser(User)is made.- Specified by:
createUserin interfaceUserManager- 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.
-
deleteUser
public void deleteUser(String username) throws UserNotFoundException, UserManagerException
Description copied from interface:UserManagerDelete a user using the username.- Specified by:
deleteUserin interfaceUserManager- Parameters:
username- the username to look for.- Throws:
UserNotFoundException- the user was not found.UserManagerException
-
addUserUnchecked
public void addUserUnchecked(User user)
Description copied from interface:UserManagerAdd a user to the database without checking for consistency or adjusting the password. Should only be used for re-importing known-good data.- Specified by:
addUserUncheckedin interfaceUserManager- Parameters:
user- the user to add
-
eraseDatabase
public void eraseDatabase()
- Specified by:
eraseDatabasein interfaceUserManager
-
findUser
public User findUser(String username) throws UserNotFoundException
Description copied from interface:UserManagerFind a User using a User name.- Specified by:
findUserin interfaceUserManager- Parameters:
username- the username to find.- Returns:
- the user.
- Throws:
UserNotFoundException- if the user was not found.
-
findUser
public User findUser(String username, boolean useCache) throws UserNotFoundException, UserManagerException
Description copied from interface:UserManagerFind a User using a User name.- Specified by:
findUserin interfaceUserManager- Parameters:
username- the username to find.useCache- to use or not caching- Returns:
- the user.
- Throws:
UserNotFoundException- if the user was not found.UserManagerException
-
findUsersByUsernameKey
public List<User> findUsersByUsernameKey(String usernameKey, boolean orderAscending)
- Specified by:
findUsersByUsernameKeyin interfaceUserManager
-
findUsersByFullNameKey
public List<User> findUsersByFullNameKey(String fullNameKey, boolean orderAscending)
- Specified by:
findUsersByFullNameKeyin interfaceUserManager
-
findUsersByEmailKey
public List<User> findUsersByEmailKey(String emailKey, boolean orderAscending)
- Specified by:
findUsersByEmailKeyin interfaceUserManager
-
getUsers
public List<User> getUsers()
Description copied from interface:UserManagerGet the List ofUserobjects.- Specified by:
getUsersin interfaceUserManager- Returns:
- the List of
UserObjects.
-
getUsers
public List<User> getUsers(boolean ascendingUsername)
- Specified by:
getUsersin interfaceUserManager
-
triggerInit
public void triggerInit()
-
getDescriptionKey
public String getDescriptionKey()
- Specified by:
getDescriptionKeyin interfaceUserManager- Returns:
- a key to be able to customize label in UI
-
-