Methods Summary |
---|
public boolean | addUser(org.apache.james.services.User user)
if (m_forceUseJamesUser && user instanceof DefaultUser ) {
DefaultUser aUser = (DefaultUser)user;
user = new DefaultJamesUser(aUser.getUserName(),
aUser.getHashedPassword(),
aUser.getHashAlgorithm());
}
String key = user.getUserName();
if (m_users.containsKey(key)) return false;
m_users.put(key, user);
return true;
|
public void | addUser(java.lang.String name, java.lang.Object attributes)
try {
String passwordHash = DigestUtil.digestString(((String) attributes), "SHA");
User user;
if (m_forceUseJamesUser) {
user = new DefaultJamesUser(name, passwordHash, "SHA");
} else {
user = new DefaultUser(name, passwordHash, "SHA");
}
addUser(user);
} catch (Exception e) {
e.printStackTrace(); // encoding failed
}
|
public boolean | addUser(java.lang.String username, java.lang.String password)
if (m_users.containsKey(username)) return false;
try {
String passwordHash = DigestUtil.digestString((password), "SHA");
User user;
if (m_forceUseJamesUser) {
user = new DefaultJamesUser(username, passwordHash, "SHA");
} else {
user = new DefaultUser(username, passwordHash, "SHA");
}
return addUser(user);
} catch (Exception e) {
e.printStackTrace(); // encoding failed
}
return false;
|
public boolean | contains(java.lang.String name)
return m_users.containsKey(name);
|
public boolean | containsCaseInsensitive(java.lang.String name)
return false; // trivial implementation
|
public int | countUsers()
return m_users.size();
|
public java.lang.Object | getAttributes(java.lang.String name)
return null; // trivial implementation
|
public java.lang.String | getRealName(java.lang.String name)
return ((User) m_users.get(name)).getUserName();
|
public org.apache.james.services.User | getUserByName(java.lang.String name)
return (User) m_users.get(name);
|
public org.apache.james.services.User | getUserByNameCaseInsensitive(java.lang.String name)
return null; // trivial implementation
|
public java.util.Iterator | list()
return listUserNames().iterator();
|
protected java.util.List | listUserNames()
Iterator users = m_users.values().iterator();
List userNames = new LinkedList();
while ( users.hasNext() ) {
User user = (User)users.next();
userNames.add(user.getUserName());
}
return userNames;
|
public void | removeUser(java.lang.String name)
m_users.remove(name);
|
public void | setForceUseJamesUser()
m_forceUseJamesUser = true;
|
public boolean | test(java.lang.String name, java.lang.Object attributes)
return false; // trivial implementation
|
public boolean | test(java.lang.String name, java.lang.String password)
User user = getUserByName(name);
if (user == null) return false;
return user.verifyPassword(password);
|
public boolean | updateUser(org.apache.james.services.User user)
return false; // trivial implementation
|