WPI GDC CMS 0.0.1

org.wpi.gdc.cms.main
Class Config

java.lang.Object
  |
  +--org.wpi.gdc.cms.main.Config

public class Config
extends java.lang.Object

This class represents the configuration of the current CMS session. It is generally loaded off a configuration file.

Version:
1.2
Author:
dmpotter

Field Summary
protected  java.util.Properties dataSources
          A set of tag names and the corresponding class names.
protected  java.lang.String dbEngine
          String representation of the database engine.
protected  java.util.Properties dbProps
          Properties for the database.
protected  java.lang.String dbUrl
          String representation of the database URL.
protected  java.lang.String xmlParser
          SAX XML parser.
 
Constructor Summary
Config()
          Creates a new default configuration.
 
Method Summary
 java.lang.String getDataSource(java.lang.String id)
          Returns the datasource as specified in the configuration files associated with the given ID.
 java.util.Enumeration getDataSources()
           
 java.lang.String getDBEngine()
           
 java.util.Properties getDBProperties()
           
 java.lang.String getDBURL()
           
 boolean hasSessionID(java.lang.String sessionID)
          Session IDs are not implemented yet; this method is useless! Determines if the given session ID exists in this configuration.
static Config loadConfiguration(java.io.Reader r)
          Loads a configuration file.
 java.lang.String toString()
          Creates a string that describes this configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dbEngine

protected java.lang.String dbEngine
String representation of the database engine.

dbUrl

protected java.lang.String dbUrl
String representation of the database URL.

dbProps

protected java.util.Properties dbProps
Properties for the database.

dataSources

protected java.util.Properties dataSources
A set of tag names and the corresponding class names.

xmlParser

protected java.lang.String xmlParser
SAX XML parser.
Constructor Detail

Config

public Config()
Creates a new default configuration.
Method Detail

loadConfiguration

public static Config loadConfiguration(java.io.Reader r)
                                throws java.io.IOException,
                                       ConfigParseException
Loads a configuration file.

getDataSource

public java.lang.String getDataSource(java.lang.String id)
Returns the datasource as specified in the configuration files associated with the given ID.
Parameters:
id - the id for the datasource
Returns:
null if there is no datasource for that id, a string representing the source otherwise.

getDataSources

public java.util.Enumeration getDataSources()

getDBEngine

public java.lang.String getDBEngine()

getDBURL

public java.lang.String getDBURL()

getDBProperties

public java.util.Properties getDBProperties()

hasSessionID

public boolean hasSessionID(java.lang.String sessionID)
Session IDs are not implemented yet; this method is useless! Determines if the given session ID exists in this configuration.
Parameters:
sessionID - the session ID to check
Returns:
Always returns false! True if the session ID exists in this configuration, false otherwise.

toString

public java.lang.String toString()
Creates a string that describes this configuration. The string is long but very useful for debugging. It is not XML. It is also not localized.
Overrides:
toString in class java.lang.Object
Returns:
a very long string

WPI GDC CMS 0.0.1

Copyright © 2001 WPI Game Development Club. All Rights Reserved.