src.server
Class UserSettings

java.lang.Object
  extended bysrc.server.UserSettings

public class UserSettings
extends java.lang.Object

Keeps track of user specific settings for modules. This can be used by the modules to simplify their handling of user specific settings. It stores a key/value pair connected to a UserId and module.

Version:
2005-maj-05

Constructor Summary
UserSettings(java.lang.String userId, Module module)
          Stores settings for a module connected to a specific userId.
 
Method Summary
 java.lang.String get(java.lang.String settingName)
          Get a stored user specific setting.
 void set(java.lang.String settingName, java.lang.String settingValue)
          Set a stored user specific setting.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserSettings

public UserSettings(java.lang.String userId,
                    Module module)
             throws java.lang.IllegalArgumentException,
                    java.lang.IllegalStateException
Stores settings for a module connected to a specific userId.

Parameters:
userId - The userId to connect the settings to.
module - The ModuleClass that the settings should be connected to.
Throws:
java.lang.IllegalArgumentException - If the userId is not valid.
java.lang.IllegalStateException - If the module has not specified any settings in its configuration.
Method Detail

get

public java.lang.String get(java.lang.String settingName)
                     throws java.lang.IllegalArgumentException
Get a stored user specific setting.

Parameters:
settingName - The name of the setting.
Returns:
The value of the setting, a blank string if the value does not exist.
Throws:
java.lang.IllegalArgumentException - If the settingName is not valid.

set

public void set(java.lang.String settingName,
                java.lang.String settingValue)
         throws java.lang.IllegalArgumentException
Set a stored user specific setting.

Parameters:
settingName - The name to set the setting for.
settingValue - The value to set the setting to.
Throws:
java.lang.IllegalArgumentException - If the settingName is not valid.