src.server
Class Configuration

java.lang.Object
  extended bysrc.server.Configuration

public class Configuration
extends java.lang.Object

Configuration manager. This class handles all the configuration data for the system. Last updated $Date: 2005/08/09 21:00:21 $ by $Author: andreas $ Changelog: $Log: Configuration.html,v $ Revision 1.1.1.1 2005/08/09 21:00:21 andreas Initial entry Revision 1.7 2005/05/04 11:24:48 linus Made updates to: - Configuration handlign - Query testing - Module handling (including module settings). Revision 1.6 2005/05/02 14:52:50 linus Minor code changes. Revision 1.5 2005/04/30 09:14:22 andreas Fixed a couple of bugs. 1) Rereading a file now overwrites the previous entries, it doesn't duplicate them like before. 2) The default file handeling has been changed so that one can reset the file to default at Server startup (in case the static instance is lingering). Revision 1.4 2005/04/28 14:01:49 andreas getConfigItems now returns an empty vector if the item is empty. Revision 1.3 2005/04/27 11:58:15 linus Added configuration handling. Revision 1.2 2005/04/19 09:30:48 linus Updated class documentation.

Version:
$Revision: 1.1.1.1 $ TODO
Author:
linus

Field Summary
static Configuration instance
          Instance
 
Constructor Summary
Configuration()
           
 
Method Summary
 java.lang.Object getConfigItem(java.lang.String path)
          Operation to fetch a single config item.
 java.util.Vector getConfigItems(java.lang.String path)
          Operation to fetch the items under the path specified.
static Configuration getInstance()
          Used to get the object in singelton patterns.
 boolean readConfig()
          Used to read the configuration file to the system.
 void setConfigFile(java.lang.String configFile)
          Setter for the configuration file.
 void setConfigItems(java.lang.String path, java.util.Vector items)
          Sets the configuration items for the given section as defined by path.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

public static Configuration instance
Instance

Constructor Detail

Configuration

public Configuration()
Method Detail

getInstance

public static Configuration getInstance()
Used to get the object in singelton patterns.

Returns:
The one instance of the class.

readConfig

public boolean readConfig()
Used to read the configuration file to the system. This must be called before any of the other methods or else they will simply return empty responses.

Returns:
A value indicating success.

getConfigItem

public java.lang.Object getConfigItem(java.lang.String path)
Operation to fetch a single config item.


getConfigItems

public java.util.Vector getConfigItems(java.lang.String path)
Operation to fetch the items under the path specified. The number of items may be unlimited.

Parameters:
path - The path in the configuration file to fetch the items from. Ex. "modules.lunch.patterns".
Returns:
A vector containing the appropriate configuration items.

setConfigItems

public void setConfigItems(java.lang.String path,
                           java.util.Vector items)
Sets the configuration items for the given section as defined by path.

Parameters:
path - The path for which to set the items.

setConfigFile

public void setConfigFile(java.lang.String configFile)
Setter for the configuration file. Important is to re-read the configuration file after setting this.

Parameters:
configFile - The new configuration file