com.fuse
Class FUSERegister

java.lang.Object
  extended by com.fuse.FUSERegister

public class FUSERegister
extends java.lang.Object

FUSERegister handles new user registrations and data updates.


Field Summary
protected  java.io.File registryDir
           
 java.text.SimpleDateFormat sdf
           
protected  FUSEUser utilityUser
           
 
Method Summary
 FUSEUser createNewUser()
          Construcst a new empty user instance
 FUSEUser loadUser(java.lang.String userName)
          Retrieves an user from the disk (or database)
 void save(FUSEUser user)
           
 FUSEUser saveUser(FUSEUser newUser)
          Stores a new user.
 FUSEUser updateUser(FUSEUser oldUser)
          Stores an existing user
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sdf

public java.text.SimpleDateFormat sdf

registryDir

protected java.io.File registryDir

utilityUser

protected FUSEUser utilityUser
Method Detail

saveUser

public FUSEUser saveUser(FUSEUser newUser)
                  throws UserExistsException,
                         DatabaseException
Stores a new user.

Parameters:
newUser - the new user object
Throws:
UserExistsException - if user with the same name already exists
java.io.IOException - if the user could not be written to disk
DatabaseException

createNewUser

public FUSEUser createNewUser()
Construcst a new empty user instance


updateUser

public FUSEUser updateUser(FUSEUser oldUser)
                    throws UserExistsException
Stores an existing user

Parameters:
newUser - the new user object
Throws:
UserExistsException - if user with the same name already exists
java.io.IOException - if the user could not be written to disk

loadUser

public FUSEUser loadUser(java.lang.String userName)
                  throws DatabaseException
Retrieves an user from the disk (or database)

Parameters:
userName -
Throws:
java.io.IOException - if the user cannot be loaded
DatabaseException

save

public void save(FUSEUser user)
          throws java.io.IOException
Throws:
java.io.IOException