org.apache.james.services
Interface UsersRepository

All Known Implementing Classes:
AbstractUsersRepository, UsersFileRepository, AbstractJdbcUsersRepository, UsersLDAPRepository

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:
1.0.0, 24/04/1999
Author:
Federico Barbieri , Charles Benett Last changed by: $Author: donaldp $ on $Date: 2001/09/06 13:19:32 $ $Revision: 1.3 $

Field Summary
static java.lang.String ROLE
           
static java.lang.String USER
           
 
Method Summary
 void addUser(java.lang.String name, java.lang.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(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.
 java.lang.Object getAttributes(java.lang.String name)
          Deprecated. As of James 1.2.2 . Use the getUserByName method.
 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.
 User getUserByNameCaseInsensitive(java.lang.String name)
          Get the user object with the specified user name.
 java.util.Iterator list()
          List users in repository.
 void removeUser(java.lang.String name)
          Removes a user from the repository
 boolean test(java.lang.String name, java.lang.Object attributes)
          Deprecated. As of James 1.2.2, use test(String name, String password)
 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.
 

Field Detail

ROLE

public static final java.lang.String ROLE

USER

public static final java.lang.String USER
Method Detail

addUser

public boolean addUser(User user)
Adds a user to the repository with the specified User object.
Since:
James 1.2.2

addUser

public void addUser(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.

getAttributes

public java.lang.Object getAttributes(java.lang.String name)
Deprecated. As of James 1.2.2 . Use the getUserByName method.

Gets the attribute for a user. Not clear on behavior.

getUserByName

public User getUserByName(java.lang.String name)
Get the user object with the specified user name. Return null if no such user.
Since:
James 1.2.2

getUserByNameCaseInsensitive

public User getUserByNameCaseInsensitive(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.
Since:
James 1.2.2

getRealName

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

updateUser

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

removeUser

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

contains

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

containsCaseInsensitive

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

test

public boolean test(java.lang.String name,
                    java.lang.Object attributes)
Deprecated. As of James 1.2.2, use test(String name, String password)

Tests a user with the appropriate attributes. In current implementations, this typically means "check the password" where a String password is passed as the Object attributes.

test

public boolean test(java.lang.String name,
                    java.lang.String password)
Test if user with name 'name' has password 'password'.
Since:
James 1.2.2

countUsers

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

list

public java.util.Iterator list()
List users in repository.


"Copyright © 2001 Apache Jakarta Project. All Rights Reserved."