org.exolab.jms.authentication
Class UserManager

java.lang.Object
  |
  +--org.exolab.jms.authentication.UserManager

public class UserManager
extends java.lang.Object

The user manager is responsible for creating and managing users.

Version:
$Revision: 1.3 $ $Date: 2003/08/07 13:32:49 $
Author:
Knut Lerpold

Constructor Summary
protected UserManager()
          Construct a new UserManager
 
Method Summary
protected  void addToUserCache(User user)
          Add the specified entry to the user cache, if it doesn't already exist.
 boolean createUser(User user)
          Create a new user
 boolean deleteUser(User user)
          Delete a users
 void destroy()
          Destroy this manager.
 User getUser(User user)
          Return a user
protected  void init()
          Initialise user manager.
protected  void registerConfiguredUsers()
          Registers users specified in the configuration
protected  void removeFromUserCache(User user)
          Remove the specified user from the cache
 boolean updateUser(User user)
          Update user.
 java.util.Iterator userNames()
          Return a list of user names currently supported by the user manager.
 boolean validateUser(java.lang.String username, java.lang.String password)
          Determines if a user's name and password are valid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserManager

protected UserManager()
               throws org.exolab.core.service.ServiceException
Construct a new UserManager
Throws:
org.exolab.core.service.ServiceException - if the service cannot be initialised
Method Detail

createUser

public boolean createUser(User user)
Create a new user
Parameters:
user - the userobject containing username and password
Returns:
true if the user is created otherwise false

updateUser

public boolean updateUser(User user)
Update user. Only possible update is password.
Parameters:
user - the userobject containing the username
Returns:
true if password is updated otherwise false

deleteUser

public boolean deleteUser(User user)
Delete a users
Parameters:
user - the userobject containing the username
Returns:
true if the is removed otherwise false

getUser

public User getUser(User user)
Return a user
Parameters:
user - the userobject containing the username
Returns:
a User

userNames

public java.util.Iterator userNames()
Return a list of user names currently supported by the user manager. This includes all types of users.
Returns:
an enumeration of the user names

destroy

public void destroy()
Destroy this manager. This is brutal and final

validateUser

public boolean validateUser(java.lang.String username,
                            java.lang.String password)
Determines if a user's name and password are valid
Parameters:
username - the user's name
password - the user's password
Returns:
true if the name and password are valid, otherwise false

init

protected void init()
             throws org.exolab.core.service.ServiceException
Initialise user manager.
Throws:
org.exolab.core.service.ServiceException - if the user manager cannot be initialised

addToUserCache

protected void addToUserCache(User user)
Add the specified entry to the user cache, if it doesn't already exist.
Parameters:
user - - user to add

removeFromUserCache

protected void removeFromUserCache(User user)
Remove the specified user from the cache
Parameters:
user - the user to remove

registerConfiguredUsers

protected void registerConfiguredUsers()
Registers users specified in the configuration


Copyright © 1999-2004 The OpenJMS Group. All Rights Reserved.