sharpster.daemon.usermanagement
Class UserManager

java.lang.Object
  |
  +--sharpster.daemon.usermanagement.UserManager

public class UserManager
extends java.lang.Object

Class responsible of the management of users. Stores information about the external users which the daemon has knowledge of. It also keeps track of all the .le shares which the external users have made to the user of the local client.


Field Summary
 sharpster.common.KeyManager userKeyManager
          A class used to have cross references between users and their id's.
 
Constructor Summary
UserManager()
          Constructor
 
Method Summary
 void addFileAccess(sharpster.common.FileCollection files, java.lang.String fromUser)
          Adds information about files, which are shared to the user of the local client.
 void addUser(java.lang.String user)
          Add an external user.
 boolean checkUserExistance(java.lang.String user)
          Verifies that the given user exists.
 sharpster.common.ResponseCollection checkUsersExistance(sharpster.common.FileCollection files)
          Verifies that the users specified in the FileCollection object exists.
 java.lang.String[] getAllUsers()
          Returns all users that are stored in memory.
 net.jxta.id.ID getKey(java.lang.String user)
          Returns a unqiue key value for a given user.
 java.lang.String getUser(net.jxta.id.ID key)
          Returns a user, for a given key.
 void initialize()
          Perform evantual initialization.
 boolean loadFromFile(java.lang.String file)
          Loads user information from a configuration file.
 boolean saveToFile(java.lang.String file)
          Saves the user information to a configuration file.
 sharpster.common.ResponseCollection viewFileAccess()
          Returns information about which files the external users, which the daemon has knowledge of, have shared to the user of the local client.
 sharpster.common.ResponseCollection viewUsers()
          Returns information about the external users which the daemon has knowledge of.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

userKeyManager

public sharpster.common.KeyManager userKeyManager
A class used to have cross references between users and their id's.

Constructor Detail

UserManager

public UserManager()
Constructor

Method Detail

initialize

public void initialize()
Perform evantual initialization.


getKey

public net.jxta.id.ID getKey(java.lang.String user)
Returns a unqiue key value for a given user.


getUser

public java.lang.String getUser(net.jxta.id.ID key)
Returns a user, for a given key.


addUser

public void addUser(java.lang.String user)
Add an external user.


getAllUsers

public java.lang.String[] getAllUsers()
Returns all users that are stored in memory.


checkUsersExistance

public sharpster.common.ResponseCollection checkUsersExistance(sharpster.common.FileCollection files)
Verifies that the users specified in the FileCollection object exists.


checkUserExistance

public boolean checkUserExistance(java.lang.String user)
Verifies that the given user exists.


viewUsers

public sharpster.common.ResponseCollection viewUsers()
Returns information about the external users which the daemon has knowledge of.


viewFileAccess

public sharpster.common.ResponseCollection viewFileAccess()
Returns information about which files the external users, which the daemon has knowledge of, have shared to the user of the local client.


addFileAccess

public void addFileAccess(sharpster.common.FileCollection files,
                          java.lang.String fromUser)
Adds information about files, which are shared to the user of the local client.


saveToFile

public boolean saveToFile(java.lang.String file)
Saves the user information to a configuration file.


loadFromFile

public boolean loadFromFile(java.lang.String file)
Loads user information from a configuration file.