|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.james.userrepository.AbstractUsersRepository
public abstract class AbstractUsersRepository
A partial implementation of a Repository to store users.
This implements common functionality found in different UsersRespository implementations, and makes it easier to create new User repositories.
Field Summary |
---|
Fields inherited from interface org.apache.james.services.UsersRepository |
---|
ROLE, USER |
Constructor Summary | |
---|---|
AbstractUsersRepository()
|
Method Summary | |
---|---|
void |
addUser(java.lang.String name,
java.lang.Object attributes)
Adds a user to the repository with the specified attributes. |
boolean |
addUser(java.lang.String username,
java.lang.String password)
Adds a user to the repository with the specified password |
boolean |
addUser(User user)
Adds a user to the repository with the specified User object. |
boolean |
contains(java.lang.String name)
Returns whether or not this user is in the repository |
boolean |
containsCaseInsensitive(java.lang.String name)
Returns whether or not this user is in the repository. |
int |
countUsers()
Returns a count of the users in the repository. |
protected abstract void |
doAddUser(User user)
Adds a user to the underlying Repository. |
protected abstract void |
doRemoveUser(User user)
Removes a user from the underlying repository. |
protected abstract void |
doUpdateUser(User user)
Updates a user record to match the supplied User. |
java.lang.String |
getRealName(java.lang.String name)
Returns the user name of the user matching name on an equalsIgnoreCase basis. |
User |
getUserByName(java.lang.String name)
Get the user object with the specified user name. |
protected User |
getUserByName(java.lang.String name,
boolean ignoreCase)
Gets a user by name, ignoring case if specified. |
User |
getUserByNameCaseInsensitive(java.lang.String name)
Get the user object with the specified user name. |
java.util.Iterator |
list()
List users in repository. |
protected abstract java.util.Iterator |
listAllUsers()
Returns a list populated with all of the Users in the repository. |
protected java.util.List |
listUserNames()
Produces the complete list of User names, with correct case. |
void |
removeUser(java.lang.String name)
Removes a user from the repository |
boolean |
test(java.lang.String name,
java.lang.String password)
Test if user with name 'name' has password 'password'. |
boolean |
updateUser(User user)
Update the repository with the specified user object. |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractUsersRepository()
Method Detail |
---|
protected abstract java.util.Iterator listAllUsers()
Iterator
of User
s.protected abstract void doAddUser(User user)
protected abstract void doRemoveUser(User user)
protected abstract void doUpdateUser(User user)
protected java.util.List listUserNames()
List
of String
s representing
user names.protected User getUserByName(java.lang.String name, boolean ignoreCase)
name
.
name
- the name of the user being retrievedignoreCase
- whether the name is regarded as case-insensitive
public boolean addUser(User user)
addUser
in interface UsersRepository
user
- the user to be added
public void addUser(java.lang.String name, java.lang.Object attributes)
addUser
in interface UsersRepository
name
- the name of the user to be addedattributes
- the password value as a Stringpublic boolean addUser(java.lang.String username, java.lang.String password)
UsersRepository
addUser
in interface UsersRepository
username
- the username of the user to be addedpassword
- the password of the user to add
UsersRepository.addUser(java.lang.String, java.lang.String)
public boolean updateUser(User user)
updateUser
in interface UsersRepository
user
- the user to be updated
public void removeUser(java.lang.String name)
removeUser
in interface UsersRepository
user
- the user to be removedpublic User getUserByName(java.lang.String name)
getUserByName
in interface UsersRepository
name
- the name of the user to retrieve
public User getUserByNameCaseInsensitive(java.lang.String name)
getUserByNameCaseInsensitive
in interface UsersRepository
name
- the name of the user to retrieve
public java.lang.String getRealName(java.lang.String name)
getRealName
in interface UsersRepository
name
- the name of the user to retrieve
public boolean contains(java.lang.String name)
contains
in interface UsersRepository
name
- the name to check in the repository
public boolean containsCaseInsensitive(java.lang.String name)
containsCaseInsensitive
in interface UsersRepository
name
- the name to check in the repository
public boolean test(java.lang.String name, java.lang.String password)
test
in interface UsersRepository
name
- the name of the user to be testedpassword
- the password to be tested
public int countUsers()
countUsers
in interface UsersRepository
public java.util.Iterator list()
list
in interface UsersRepository
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |