org.apache.james.userrepository
Class UsersLDAPRepository

java.lang.Object
  |
  +--org.apache.james.userrepository.UsersLDAPRepository
All Implemented Interfaces:
org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.logger.Loggable, UsersRepository

public class UsersLDAPRepository
extends java.lang.Object
implements UsersRepository, org.apache.avalon.framework.logger.Loggable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.activity.Initializable

Implementation of a Repository to store users. This clas is a dummy for the proposal!

Version:
1.0.0, 24/04/1999
Author:
Charles Bennett

Fields inherited from interface org.apache.james.services.UsersRepository
ROLE, USER
 
Constructor Summary
UsersLDAPRepository()
           
 
Method Summary
 void addUser(java.lang.String userName, java.lang.Object attributes)
          Adds userName to the MemberAttribute (specified in conf.xml) of this node.
 boolean addUser(User user)
          Adds a user to the repository with the specified User object.
 void compose(org.apache.avalon.framework.component.ComponentManager compMgr)
           
 void configure(org.apache.avalon.framework.configuration.Configuration conf)
           
 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.
 void contextualize(org.apache.avalon.framework.context.Context context)
           
 int countUsers()
          Returns a count of the users in the repository.
 void dispose()
          Disposes of all open directory contexts.
 java.lang.Object getAttributes(java.lang.String name)
          Gets the attribute for a user.
 java.lang.String getChildDestination(java.lang.String childName)
           
 java.lang.String getDomains()
           
 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.
 void initialize()
           
 java.util.Iterator list()
          List users in repository.
 void removeGroupFromUser(java.lang.String userName)
           
 void removeUser(java.lang.String userName)
          Removes a user from the repository
 void setBase(java.lang.String base)
           
 void setLogger(org.apache.log.Logger a_Logger)
           
 void setServerRoot()
           
 boolean test(java.lang.String name, java.lang.Object attributes)
          Tests a user with the appropriate attributes.
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UsersLDAPRepository

public UsersLDAPRepository()
Method Detail

setLogger

public void setLogger(org.apache.log.Logger a_Logger)
Specified by:
setLogger in interface org.apache.avalon.framework.logger.Loggable

configure

public void configure(org.apache.avalon.framework.configuration.Configuration conf)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable

compose

public void compose(org.apache.avalon.framework.component.ComponentManager compMgr)

contextualize

public void contextualize(org.apache.avalon.framework.context.Context context)
                   throws org.apache.avalon.framework.context.ContextException
Specified by:
contextualize in interface org.apache.avalon.framework.context.Contextualizable

setServerRoot

public void setServerRoot()

setBase

public void setBase(java.lang.String base)

initialize

public void initialize()
                throws java.lang.Exception
Specified by:
initialize in interface org.apache.avalon.framework.activity.Initializable

getChildDestination

public java.lang.String getChildDestination(java.lang.String childName)

list

public java.util.Iterator list()
Description copied from interface: UsersRepository
List users in repository.
Specified by:
list in interface UsersRepository

addUser

public boolean addUser(User user)
Description copied from interface: UsersRepository
Adds a user to the repository with the specified User object.
Specified by:
addUser in interface UsersRepository

getUserByName

public User getUserByName(java.lang.String name)
Description copied from interface: UsersRepository
Get the user object with the specified user name. Return null if no such user.
Specified by:
getUserByName in interface UsersRepository

getUserByNameCaseInsensitive

public User getUserByNameCaseInsensitive(java.lang.String name)
Description copied from interface: UsersRepository
Get the user object with the specified user name. Match user naems on a case insensitive basis. Return null if no such user.
Specified by:
getUserByNameCaseInsensitive in interface UsersRepository

containsCaseInsensitive

public boolean containsCaseInsensitive(java.lang.String name)
Description copied from interface: UsersRepository
Returns whether or not this user is in the repository. Names are matched on a case insensitive basis.
Specified by:
containsCaseInsensitive in interface UsersRepository

getRealName

public java.lang.String getRealName(java.lang.String name)
Description copied from interface: UsersRepository
Returns the user name of the user matching name on an equalsIgnoreCase basis. Returns null if no match.
Specified by:
getRealName in interface UsersRepository

updateUser

public boolean updateUser(User user)
Description copied from interface: UsersRepository
Update the repository with the specified user object. A user object with this username must already exist.
Specified by:
updateUser in interface UsersRepository

test

public boolean test(java.lang.String name,
                    java.lang.String password)
Description copied from interface: UsersRepository
Test if user with name 'name' has password 'password'.
Specified by:
test in interface UsersRepository

addUser

public void addUser(java.lang.String userName,
                    java.lang.Object attributes)
Adds userName to the MemberAttribute (specified in conf.xml) of this node. If ManageGroupAttribute (conf.xml) is TRUE then calls addGroupToUser.
Specified by:
addUser in interface UsersRepository

getAttributes

public java.lang.Object getAttributes(java.lang.String name)
Description copied from interface: UsersRepository
Gets the attribute for a user. Not clear on behavior.
Specified by:
getAttributes in interface UsersRepository

removeUser

public void removeUser(java.lang.String userName)
Description copied from interface: UsersRepository
Removes a user from the repository
Specified by:
removeUser in interface UsersRepository

removeGroupFromUser

public void removeGroupFromUser(java.lang.String userName)

contains

public boolean contains(java.lang.String name)
Description copied from interface: UsersRepository
Returns whether or not this user is in the repository
Specified by:
contains in interface UsersRepository

test

public boolean test(java.lang.String name,
                    java.lang.Object attributes)
Description copied from interface: UsersRepository
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.
Specified by:
test in interface UsersRepository

countUsers

public int countUsers()
Description copied from interface: UsersRepository
Returns a count of the users in the repository.
Specified by:
countUsers in interface UsersRepository

getDomains

public java.lang.String getDomains()

dispose

public void dispose()
             throws java.lang.Exception
Disposes of all open directory contexts. Based on signature from interface Disposable in new Avalon


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