@Deprecated public abstract class AbstractJdbcUsersRepository extends org.apache.james.user.lib.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). |
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,String> |
m_sqlParameters
Deprecated.
|
| 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(org.apache.james.user.api.model.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(org.apache.james.user.api.model.User user)
Deprecated.
Removes a user from the underlying repository.
|
protected void |
doUpdateUser(org.apache.james.user.api.model.User user)
Deprecated.
Updates a user record to match the supplied User.
|
org.apache.james.user.api.model.User |
getUserByName(String name)
Deprecated.
Get the user object with the specified user name.
|
protected org.apache.james.user.api.model.User |
getUserByName(String name,
boolean ignoreCase)
Deprecated.
Gets a user by name, ignoring case if specified.
|
protected org.apache.james.user.api.model.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<org.apache.james.user.api.model.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 org.apache.james.user.api.model.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(org.apache.james.filesystem.api.FileSystem system)
Deprecated.
Sets the filesystem service
|
protected abstract void |
setUserForInsertStatement(org.apache.james.user.api.model.User user,
PreparedStatement userInsert)
Deprecated.
Set parameters of a PreparedStatement object with property values from a
User instance.
|
protected abstract void |
setUserForUpdateStatement(org.apache.james.user.api.model.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, getDefaultVirtualHostingValue, getLogger, getUser, isAdministrator, isValidUsername, setDomainList, setEnableVirtualHosting, setLog, supportVirtualHostingprotected Map<String,String> m_sqlParameters
public AbstractJdbcUsersRepository()
public void removeUser(String userName) throws org.apache.james.user.api.UsersRepositoryException
userName - the user to be removedorg.apache.james.user.api.UsersRepositoryExceptionpublic org.apache.james.user.api.model.User getUserByName(String name) throws org.apache.james.user.api.UsersRepositoryException
name - the name of the user to retrieveorg.apache.james.user.api.UsersRepositoryExceptionpublic boolean contains(String name) throws org.apache.james.user.api.UsersRepositoryException
org.apache.james.user.api.UsersRepositoryExceptionpublic boolean containsCaseInsensitive(String name) throws org.apache.james.user.api.UsersRepositoryException
org.apache.james.user.api.UsersRepositoryExceptionpublic boolean test(String name, String password) throws org.apache.james.user.api.UsersRepositoryException
name - the name of the user to be testedpassword - the password to be testedorg.apache.james.user.api.UsersRepositoryExceptionpublic int countUsers() throws org.apache.james.user.api.UsersRepositoryException
org.apache.james.user.api.UsersRepositoryExceptionpublic Iterator<String> list() throws org.apache.james.user.api.UsersRepositoryException
org.apache.james.user.api.UsersRepositoryException@Inject public void setDatasource(DataSource m_datasource)
m_datasource - the DataSourceSelector@Inject public void setFileSystem(org.apache.james.filesystem.api.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 org.apache.james.user.lib.AbstractUsersRepositoryorg.apache.commons.configuration.ConfigurationExceptionAbstractUsersRepository.doConfigure(org.apache.commons.configuration.HierarchicalConfiguration)protected List<String> listUserNames() throws org.apache.james.user.api.UsersRepositoryException
List of Strings representing user
names.org.apache.james.user.api.UsersRepositoryExceptionprotected Iterator<org.apache.james.user.api.model.User> listAllUsers() throws org.apache.james.user.api.UsersRepositoryException
Iterator of Users.org.apache.james.user.api.UsersRepositoryExceptionprotected void doAddUser(org.apache.james.user.api.model.User user) throws org.apache.james.user.api.UsersRepositoryException
doAddUser in class org.apache.james.user.lib.AbstractJamesUsersRepositoryuser - the user to addorg.apache.james.user.api.UsersRepositoryExceptionprotected void doRemoveUser(org.apache.james.user.api.model.User user) throws org.apache.james.user.api.UsersRepositoryException
user - the user to removeorg.apache.james.user.api.UsersRepositoryExceptionprotected void doUpdateUser(org.apache.james.user.api.model.User user) throws org.apache.james.user.api.UsersRepositoryException
doUpdateUser in class org.apache.james.user.lib.AbstractJamesUsersRepositoryuser - the user to updateorg.apache.james.user.api.UsersRepositoryExceptionprotected org.apache.james.user.api.model.User getUserByNameIterating(String name, boolean ignoreCase) throws org.apache.james.user.api.UsersRepositoryException
name.name - the name of the user being retrievedignoreCase - whether the name is regarded as case-insensitiveorg.apache.james.user.api.UsersRepositoryExceptionprotected org.apache.james.user.api.model.User getUserByName(String name, boolean ignoreCase) throws org.apache.james.user.api.UsersRepositoryException
name - the name of the user being retrievedignoreCase - whether the name is regarded as case-insensitiveorg.apache.james.user.api.UsersRepositoryExceptionprotected abstract org.apache.james.user.api.model.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(org.apache.james.user.api.model.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(org.apache.james.user.api.model.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-2017 The Apache Software Foundation. All Rights Reserved.