|
|||||||||||
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
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(String name,
Object attributes)
Adds a user to the repository with the specified attributes. |
boolean |
addUser(User user)
Adds a user to the repository with the specified User object. |
boolean |
contains(String name)
Returns whether or not this user is in the repository |
boolean |
containsCaseInsensitive(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. |
Object |
getAttributes(String name)
Deprecated. As of James 1.2.2 . Use the getUserByName method. |
String |
getRealName(String name)
Returns the user name of the user matching name on an equalsIgnoreCase basis. |
User |
getUserByName(String name)
Get the user object with the specified user name. |
protected User |
getUserByName(String name,
boolean ignoreCase)
Gets a user by name, ignoring case if specified. |
User |
getUserByNameCaseInsensitive(String name)
Get the user object with the specified user name. |
Iterator |
list()
List users in repository. |
protected abstract Iterator |
listAllUsers()
Returns a list populated with all of the Users in the repository. |
protected List |
listUserNames()
Produces the complete list of User names, with correct case. |
void |
removeUser(String name)
Removes a user from the repository |
boolean |
test(String name,
Object attributes)
Deprecated. As of James 1.2.2, use test(String name, String password) |
boolean |
test(String name,
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 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 List listUserNames()
List
of String
s representing
user names.protected User getUserByName(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(String name, Object attributes)
addUser
in interface UsersRepository
name
- the name of the user to be addedattributes
- the password value as a Stringpublic boolean updateUser(User user)
updateUser
in interface UsersRepository
user
- the user to be updated
public void removeUser(String name)
removeUser
in interface UsersRepository
name
- the user to remove from the repositorypublic Object getAttributes(String name)
getUserByName
method.
getAttributes
in interface UsersRepository
public User getUserByName(String name)
getUserByName
in interface UsersRepository
name
- the name of the user to retrieve
public User getUserByNameCaseInsensitive(String name)
getUserByNameCaseInsensitive
in interface UsersRepository
name
- the name of the user to retrieve
public String getRealName(String name)
getRealName
in interface UsersRepository
name
- the name of the user to retrieve
public boolean contains(String name)
contains
in interface UsersRepository
name
- the name to check in the repository
public boolean containsCaseInsensitive(String name)
containsCaseInsensitive
in interface UsersRepository
name
- the name to check in the repository
public boolean test(String name, Object attributes)
test(String name, String password)
test
in interface UsersRepository
name
- the name of the user to be testedattributes
- the password to be tested
UnsupportedOperationException
- always, as this method should not be usedpublic boolean test(String name, 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 Iterator list()
list
in interface UsersRepository
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |