org.apache.james.userrepository
Class JamesUsersJdbcRepository

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLoggable
        |
        +--org.apache.james.userrepository.AbstractUsersRepository
              |
              +--org.apache.james.userrepository.AbstractJdbcUsersRepository
                    |
                    +--org.apache.james.userrepository.JamesUsersJdbcRepository
All Implemented Interfaces:
org.apache.avalon.framework.component.Component, org.apache.avalon.framework.component.Composable, 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 JamesUsersJdbcRepository
extends AbstractJdbcUsersRepository

A Jdbc-backed UserRepository which handles User instances of the DefaultJamesUser class, or any superclass.

Author:
Darrell DeBoer

Fields inherited from class org.apache.james.userrepository.AbstractJdbcUsersRepository
context, m_sqlParameters
 
Fields inherited from interface org.apache.james.services.UsersRepository
ROLE, USER
 
Constructor Summary
JamesUsersJdbcRepository()
           
 
Method Summary
protected  User readUserFromResultSet(java.sql.ResultSet rsUsers)
          Reads properties for a User from an open ResultSet.
protected  void setUserForInsertStatement(User user, java.sql.PreparedStatement userInsert)
          Set parameters of a PreparedStatement object with property values from a User instance.
protected  void setUserForUpdateStatement(User user, java.sql.PreparedStatement userUpdate)
          Set parameters of a PreparedStatement object with property values from a User instance.
 
Methods inherited from class org.apache.james.userrepository.AbstractJdbcUsersRepository
compose, configure, contextualize, doAddUser, doRemoveUser, doUpdateUser, getUserByName, initialize, listAllUsers
 
Methods inherited from class org.apache.james.userrepository.AbstractUsersRepository
addUser, addUser, contains, containsCaseInsensitive, countUsers, getAttributes, getRealName, getUserByName, getUserByNameCaseInsensitive, list, listUserNames, removeUser, test, test, updateUser
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable
getLogger, setLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.james.services.UsersRepository
addUser, addUser, contains, containsCaseInsensitive, countUsers, getAttributes, getRealName, getUserByName, getUserByNameCaseInsensitive, list, removeUser, test, test, updateUser
 
Methods inherited from interface org.apache.avalon.framework.logger.Loggable
setLogger
 

Constructor Detail

JamesUsersJdbcRepository

public JamesUsersJdbcRepository()
Method Detail

readUserFromResultSet

protected User readUserFromResultSet(java.sql.ResultSet rsUsers)
                              throws java.sql.SQLException
Description copied from class: AbstractJdbcUsersRepository
Reads properties for a User from an open ResultSet. Subclass implementations of this method must have knowledge of the fields presented by the "select" and "selectByLowercaseName" SQL statements. These implemenations may generate a subclass-specific User instance.
Overrides:
readUserFromResultSet in class AbstractJdbcUsersRepository
Following copied from class: org.apache.james.userrepository.AbstractJdbcUsersRepository
Parameters:
rsUsers - A ResultSet with a User record in the current row.
Returns:
A User instance
Throws:
java.sql.SQLException - if an exception occurs reading from the ResultSet

setUserForInsertStatement

protected void setUserForInsertStatement(User user,
                                         java.sql.PreparedStatement userInsert)
                                  throws java.sql.SQLException
Description copied from class: AbstractJdbcUsersRepository
Set parameters of a PreparedStatement object with property values from a User instance. Implementations of this method have knowledge of the parameter ordering of the "insert" SQL statement definition.
Overrides:
setUserForInsertStatement in class AbstractJdbcUsersRepository
Following copied from class: org.apache.james.userrepository.AbstractJdbcUsersRepository
Parameters:
user - a User instance, which should be an implementation class which is handled by this Repostory implementation.
userInsert - a PreparedStatement initialised with SQL taken from the "insert" SQL definition.
Throws:
java.sql.SQLException - if an exception occurs while setting parameter values.

setUserForUpdateStatement

protected void setUserForUpdateStatement(User user,
                                         java.sql.PreparedStatement userUpdate)
                                  throws java.sql.SQLException
Description copied from class: AbstractJdbcUsersRepository
Set parameters of a PreparedStatement object with property values from a User instance. Implementations of this method have knowledge of the parameter ordering of the "update" SQL statement definition.
Overrides:
setUserForUpdateStatement in class AbstractJdbcUsersRepository
Following copied from class: org.apache.james.userrepository.AbstractJdbcUsersRepository
Parameters:
user - a User instance, which should be an implementation class which is handled by this Repostory implementation.
userUpdate - a PreparedStatement initialised with SQL taken from the "update" SQL definition.
Throws:
java.sql.SQLException - if an exception occurs while setting parameter values.


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