@Deprecated public abstract class AbstractJdbcUsersRepository extends AbstractJamesUsersRepository
| Required | |
| select | Select all users. |
| insert | Insert a user. |
| update | Update a user. |
| delete | Delete a user by name. |
| createTable | Create the users table. |
| Optional | |
| selectByLowercaseName | Select a user by name (case-insensitive lowercase). |
RecipientRewriteTable.ErrorMappingException| Modifier and Type | Field and Description |
|---|---|
protected Map<String,String> |
m_sqlParameters
Deprecated.
|
enableAliases, enableForwarding, ignoreCaseALIASDOMAIN_PREFIX, ERROR_PREFIX, REGEX_PREFIX, WILDCARD| Constructor and Description |
|---|
AbstractJdbcUsersRepository()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(String name)
Deprecated.
Returns whether or not this user is in the repository
|
boolean |
containsCaseInsensitive(String name)
Deprecated.
Returns whether or not this user is in the repository.
|
int |
countUsers()
Deprecated.
Returns a count of the users in the repository.
|
protected void |
doAddUser(User user)
Deprecated.
Adds a user to the underlying Repository.
|
protected void |
doConfigure(org.apache.commons.configuration.HierarchicalConfiguration configuration)
Deprecated.
Configures the UserRepository for JDBC access.
|
protected void |
doRemoveUser(User user)
Deprecated.
Removes a user from the underlying repository.
|
protected void |
doUpdateUser(User user)
Deprecated.
Updates a user record to match the supplied User.
|
User |
getUserByName(String name)
Deprecated.
Get the user object with the specified user name.
|
protected User |
getUserByName(String name,
boolean ignoreCase)
Deprecated.
Gets a user by name, ignoring case if specified.
|
protected User |
getUserByNameIterating(String name,
boolean ignoreCase)
Deprecated.
Gets a user by name, ignoring case if specified.
|
void |
init()
Deprecated.
Initialises the JDBC repository.
|
Iterator<String> |
list()
Deprecated.
List users in repository.
|
protected Iterator<User> |
listAllUsers()
Deprecated.
Returns a list populated with all of the Users in the repository.
|
protected List<String> |
listUserNames()
Deprecated.
Produces the complete list of User names, with correct case.
|
protected abstract User |
readUserFromResultSet(ResultSet rsUsers)
Deprecated.
Reads properties for a User from an open ResultSet.
|
void |
removeUser(String userName)
Deprecated.
Removes a user from the repository
|
void |
setDatasource(DataSource m_datasource)
Deprecated.
Set the DataSourceSelector
|
void |
setFileSystem(FileSystem system)
Deprecated.
Sets the filesystem service
|
protected abstract void |
setUserForInsertStatement(User user,
PreparedStatement userInsert)
Deprecated.
Set parameters of a PreparedStatement object with property values from a
User instance.
|
protected abstract void |
setUserForUpdateStatement(User user,
PreparedStatement userUpdate)
Deprecated.
Set parameters of a PreparedStatement object with property values from a
User instance.
|
boolean |
test(String name,
String password)
Deprecated.
Test if user with name 'name' has password 'password'.
|
addAddressMapping, addAliasDomainMapping, addErrorMapping, addMapping, addRegexMapping, configure, doAddUser, getAllMappings, getMappings, getUserDomainMappings, removeAddressMapping, removeAliasDomainMapping, removeErrorMapping, removeMapping, removeRegexMapping, setEnableAliases, setEnableForwarding, setIgnoreCase, updateUseraddUser, getLogger, isValidUsername, setDomainList, setEnableVirtualHosting, setLog, supportVirtualHostingclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddUser, supportVirtualHostingpublic void removeUser(String userName) throws UsersRepositoryException
userName - the user to be removedUsersRepositoryExceptionpublic User getUserByName(String name) throws UsersRepositoryException
name - the name of the user to retrieveUsersRepositoryException - if errorpublic boolean contains(String name) throws UsersRepositoryException
name - the name to check in the repositoryUsersRepositoryException - if errorpublic boolean containsCaseInsensitive(String name) throws UsersRepositoryException
UsersRepositoryExceptionpublic boolean test(String name, String password) throws UsersRepositoryException
name - the name of the user to be testedpassword - the password to be testedUsersRepositoryException - if errorpublic int countUsers()
throws UsersRepositoryException
UsersRepositoryException - if errorpublic Iterator<String> list() throws UsersRepositoryException
UsersRepositoryException - if errorpublic void setDatasource(DataSource m_datasource)
m_datasource - the DataSourceSelectorpublic void setFileSystem(FileSystem system)
system - the new service@PostConstruct public void init() throws Exception
Exception - if an error occursprotected void doConfigure(org.apache.commons.configuration.HierarchicalConfiguration configuration)
throws org.apache.commons.configuration.ConfigurationException
Configures the UserRepository for JDBC access.
Requires a configuration element in the .conf.xml file of the form:
<repository name="so even "
class="org.apache.james.userrepository.JamesUsersJdbcRepository">
<!-- Name of the datasource to use -->
<data-source>MailDb</data-source>
<!-- File to load the SQL definitions from -->
<sqlFile>dist/conf/sqlResources.xml</sqlFile>
<!-- replacement parameters for the sql file -->
<sqlParameters table="JamesUsers"/>
</repository>
doConfigure in class AbstractUsersRepositoryorg.apache.commons.configuration.ConfigurationExceptionAbstractUsersRepository.doConfigure(org.apache.commons.configuration.HierarchicalConfiguration)protected List<String> listUserNames() throws UsersRepositoryException
List of Strings representing user
names.UsersRepositoryExceptionprotected Iterator<User> listAllUsers() throws UsersRepositoryException
Iterator of Users.UsersRepositoryExceptionprotected void doAddUser(User user) throws UsersRepositoryException
doAddUser in class AbstractJamesUsersRepositoryuser - the user to addUsersRepositoryExceptionprotected void doRemoveUser(User user) throws UsersRepositoryException
user - the user to removeUsersRepositoryExceptionprotected void doUpdateUser(User user) throws UsersRepositoryException
doUpdateUser in class AbstractJamesUsersRepositoryuser - the user to updateUsersRepositoryExceptionprotected User getUserByNameIterating(String name, boolean ignoreCase) throws UsersRepositoryException
name.name - the name of the user being retrievedignoreCase - whether the name is regarded as case-insensitiveUsersRepositoryExceptionprotected User getUserByName(String name, boolean ignoreCase) throws UsersRepositoryException
name - the name of the user being retrievedignoreCase - whether the name is regarded as case-insensitiveUsersRepositoryExceptionprotected abstract User readUserFromResultSet(ResultSet rsUsers) throws SQLException
rsUsers - A ResultSet with a User record in the current row.SQLException - if an exception occurs reading from the ResultSetprotected abstract void setUserForInsertStatement(User user, PreparedStatement userInsert) throws SQLException
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.SQLException - if an exception occurs while setting parameter values.protected abstract void setUserForUpdateStatement(User user, PreparedStatement userUpdate) throws SQLException
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.SQLException - if an exception occurs while setting parameter values.Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.