org.apache.wsrp4j.consumer.app.driver
Class UserRegistryImpl

java.lang.Object
  extended byorg.apache.wsrp4j.consumer.driver.GenericUserRegistryImpl
      extended byorg.apache.wsrp4j.consumer.app.driver.UserRegistryImpl
All Implemented Interfaces:
StateChangedListener, UserRegistry

public class UserRegistryImpl
extends GenericUserRegistryImpl
implements StateChangedListener

Version:
$Id: UserRegistryImpl.java,v 1.4 2005/08/10 14:45:38 cziegeler Exp $

Field Summary
private static UserRegistry instance
           
private  PersistentDataObject persistentDataObject
           
private  PersistentHandler persistentHandler
           
 
Fields inherited from class org.apache.wsrp4j.consumer.driver.GenericUserRegistryImpl
 
Constructor Summary
private UserRegistryImpl()
           
 
Method Summary
 User addUser(User user)
          Add a user.
private  void deleteFile(User user)
          Delete the user from the persistent store
static UserRegistry getInstance()
           
 void removeAllUsers()
          Remove all users from the registry
 User removeUser(java.lang.String userID)
          Remove a user from the list of known user
private  void restore()
          Restores all available users from persistent file store
 void stateChanged(StateChangedEvent event)
          StateChanged event occured
private  void store(User user)
          Store user to persistent file
 
Methods inherited from class org.apache.wsrp4j.consumer.driver.GenericUserRegistryImpl
getAllUsers, getUser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static UserRegistry instance

persistentDataObject

private PersistentDataObject persistentDataObject

persistentHandler

private PersistentHandler persistentHandler
Constructor Detail

UserRegistryImpl

private UserRegistryImpl()
Method Detail

getInstance

public static UserRegistry getInstance()

removeUser

public User removeUser(java.lang.String userID)
Remove a user from the list of known user

Specified by:
removeUser in interface UserRegistry
Overrides:
removeUser in class GenericUserRegistryImpl
Parameters:
userID - The ID of the user
Returns:
The user which has been removed or null

removeAllUsers

public void removeAllUsers()
Description copied from interface: UserRegistry
Remove all users from the registry

Specified by:
removeAllUsers in interface UserRegistry
Overrides:
removeAllUsers in class GenericUserRegistryImpl

addUser

public User addUser(User user)
Add a user. If a record with the given userid already exists, the input UserContext object is returned, otherwise a null value.

Specified by:
addUser in interface UserRegistry
Overrides:
addUser in class GenericUserRegistryImpl
Parameters:
user - The user object to add
Returns:
Null on success or the input user object in case a user with the same user id already exists.

stateChanged

public void stateChanged(StateChangedEvent event)
StateChanged event occured

Specified by:
stateChanged in interface StateChangedListener
Parameters:
event -

restore

private void restore()
              throws WSRPException
Restores all available users from persistent file store

Throws:
WSRPException

store

private void store(User user)
            throws WSRPException
Store user to persistent file

Parameters:
user -
Throws:
WSRPException

deleteFile

private void deleteFile(User user)
Delete the user from the persistent store

Parameters:
user -


--