|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.glite.slcs.config.SLCSConfiguration
public abstract class SLCSConfiguration
SLCSConfiguration is a wrapper class for a XML file based configuration.
XMLConfiguration
Constructor Summary | |
---|---|
protected |
SLCSConfiguration()
Default constructor |
protected |
SLCSConfiguration(java.lang.String filename)
|
Method Summary | |
---|---|
protected abstract void |
checkConfiguration()
Checks the validity of the configuration |
boolean |
contains(java.lang.String name)
Checks if configuration key name is defined |
org.apache.commons.configuration.Configuration |
getConfiguration()
|
org.apache.commons.configuration.FileConfiguration |
getFileConfiguration()
|
protected java.lang.String |
getFilename()
|
int |
getInt(java.lang.String name)
|
java.util.List |
getList(java.lang.String name)
|
java.lang.String |
getString(java.lang.String name)
Returns the value of the key and throw exception if the key is not defined. |
java.lang.String |
getString(java.lang.String name,
boolean throwException)
Returns the value of the key and throw exception if the key is not defined only if throwException is true . |
protected org.apache.commons.configuration.FileConfiguration |
loadConfiguration(java.lang.String filename)
Creates a XMLConfiguration loaded with the given file. |
protected void |
setFileConfiguration(org.apache.commons.configuration.FileConfiguration configuration)
Sets the FileConfiguration and checks for validity. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected SLCSConfiguration()
protected SLCSConfiguration(java.lang.String filename) throws SLCSConfigurationException
filename
-
SLCSConfigurationException
Method Detail |
---|
protected org.apache.commons.configuration.FileConfiguration loadConfiguration(java.lang.String filename) throws SLCSConfigurationException
filename
- The file name to load the XML configuration from.
SLCSConfigurationException
- If a configuration error occurs while loading the XML file.protected abstract void checkConfiguration() throws SLCSConfigurationException
SLCSConfigurationException
- iff the configuration is not validpublic java.lang.String getString(java.lang.String name) throws SLCSConfigurationException
name
- The key of the value to get
SLCSConfigurationException
- if the key is missing from configuration or emptypublic java.lang.String getString(java.lang.String name, boolean throwException) throws SLCSConfigurationException
true
.
name
- The key name of the value to read.throwException
- Throw an exception if the key is not found or not.
null
if the key is not found or the value empty.
SLCSConfigurationException
public int getInt(java.lang.String name)
name
-
public java.util.List getList(java.lang.String name)
name
- The configuration key.
public boolean contains(java.lang.String name)
name
is defined
name
- The configuration key name.
true
iff the key is defined, false
otherwise.protected void setFileConfiguration(org.apache.commons.configuration.FileConfiguration configuration) throws SLCSConfigurationException
configuration
- The FileConfiguration to set.
SLCSConfigurationException
public org.apache.commons.configuration.FileConfiguration getFileConfiguration()
public org.apache.commons.configuration.Configuration getConfiguration()
protected java.lang.String getFilename()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |