FileDocCategorySizeDatePackage
UsersRepository.javaAPI DocApache James 2.3.15259Fri Jan 12 12:56:26 GMT 2007org.apache.james.services

UsersRepository

public interface UsersRepository
Interface for a repository of users. A repository represents a logical grouping of users, typically by common purpose. E.g. the users served by an email server or the members of a mailing list.
version
$Revision: 494012 $

Fields Summary
String
ROLE
The component role used by components implementing this service
String
USER
Constructors Summary
Methods Summary
public booleanaddUser(User user)
Adds a user to the repository with the specified User object.

param
user the user to be added
return
true if succesful, false otherwise
since
James 1.2.2

public voidaddUser(java.lang.String name, java.lang.Object attributes)
Adds a user to the repository with the specified attributes. In current implementations, the Object attributes is generally a String password.

param
name the name of the user to be added
param
attributes see decription

public booleanaddUser(java.lang.String username, java.lang.String password)
Adds a user to the repository with the specified password

param
username the username of the user to be added
param
password the password of the user to add
return
true if succesful, false otherwise
since
James 2.3.0

public booleancontains(java.lang.String name)
Returns whether or not this user is in the repository

param
name the name to check in the repository
return
whether the user is in the repository

public booleancontainsCaseInsensitive(java.lang.String name)
Returns whether or not this user is in the repository. Names are matched on a case insensitive basis.

param
name the name to check in the repository
return
whether the user is in the repository

public intcountUsers()
Returns a count of the users in the repository.

return
the number of users in the repository

public java.lang.StringgetRealName(java.lang.String name)
Returns the user name of the user matching name on an equalsIgnoreCase basis. Returns null if no match.

param
name the name to case-correct
return
the case-correct name of the user, null if the user doesn't exist

public UsergetUserByName(java.lang.String name)
Get the user object with the specified user name. Return null if no such user.

param
name the name of the user to retrieve
return
the user being retrieved, null if the user doesn't exist
since
James 1.2.2

public UsergetUserByNameCaseInsensitive(java.lang.String name)
Get the user object with the specified user name. Match user naems on a case insensitive basis. Return null if no such user.

param
name the name of the user to retrieve
return
the user being retrieved, null if the user doesn't exist
since
James 1.2.2

public java.util.Iteratorlist()
List users in repository.

return
Iterator over a collection of Strings, each being one user in the repository.

public voidremoveUser(java.lang.String name)
Removes a user from the repository

param
name the user to remove from the repository

public booleantest(java.lang.String name, java.lang.String password)
Test if user with name 'name' has password 'password'.

param
name the name of the user to be tested
param
password the password to be tested
return
true if the test is successful, false if the user doesn't exist or if the password is incorrect
since
James 1.2.2

public booleanupdateUser(User user)
Update the repository with the specified user object. A user object with this username must already exist.

return
true if successful.