DefaultUsersJdbcRepositorypublic class DefaultUsersJdbcRepository extends AbstractJdbcUsersRepository A Jdbc-backed UserRepository which handles User instances
of the DefaultUser class.
Although this repository can handle subclasses of DefaultUser,
like DefaultJamesUser , only properties from
the DefaultUser class are persisted.
TODO Please note that default configuration uses JamesUsersJdbcRepository
instead of this class. So we could also delete this implementation. |
Methods Summary |
---|
public boolean | addUser(java.lang.String username, java.lang.String password)
User newbie = new DefaultUser(username, "SHA");
newbie.setPassword(password);
return addUser(newbie);
| protected org.apache.james.services.User | readUserFromResultSet(java.sql.ResultSet rsUsers)Reads properties for a User from an open ResultSet.
// Get the username, and build a DefaultUser with it.
String username = rsUsers.getString(1);
String passwordHash = rsUsers.getString(2);
String passwordAlg = rsUsers.getString(3);
DefaultUser user = new DefaultUser(username, passwordHash, passwordAlg);
return user;
| protected void | setUserForInsertStatement(org.apache.james.services.User user, java.sql.PreparedStatement userInsert)Set parameters of a PreparedStatement object with
property values from a User instance.
DefaultUser defUser = (DefaultUser)user;
userInsert.setString(1, defUser.getUserName());
userInsert.setString(2, defUser.getHashAlgorithm());
userInsert.setString(3, defUser.getHashedPassword());
| protected void | setUserForUpdateStatement(org.apache.james.services.User user, java.sql.PreparedStatement userUpdate)Set parameters of a PreparedStatement object with
property values from a User instance.
DefaultUser defUser = (DefaultUser)user;
userUpdate.setString(3, defUser.getUserName());
userUpdate.setString(1, defUser.getHashAlgorithm());
userUpdate.setString(2, defUser.getHashedPassword());
|
|