|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IConfigHandler
Interface for all ConfigHandlers.
Description:
-
Concurrency issues:
-
Method Summary | |
---|---|
java.lang.Object |
getNextSection(java.lang.Object oSection)
Returns the next section. |
java.lang.String |
getParam(java.lang.Object oSection,
java.lang.String sConfigItem)
Returns a String that contains the requested configuration
parameter. |
java.lang.Object |
getSection(java.lang.Object rootSection,
java.lang.String sectionType)
Get the first section. |
java.lang.Object |
getSection(java.lang.Object oRootSection,
java.lang.String sSectionType,
java.lang.String sSectionID)
Returns a sub-section from the configuration of the given root-section. |
void |
importConfig(java.io.File fConfig)
Deprecated. All config should be stored in only one config file. |
void |
init(java.io.File fConfig)
Initializes the ConfigHandler . |
void |
init(java.lang.String sUser,
java.lang.String sPassword,
java.lang.String sDatabaseURL,
java.lang.String sDatabaseTable,
java.lang.String sDriverName,
java.lang.String sConfigId)
Initializes the ConfigHandler . |
boolean |
removeSection(java.lang.Object oRootSection,
java.lang.String sSectionType)
Removes a specified configuration section. |
boolean |
removeSection(java.lang.Object oRootSection,
java.lang.String sSectionType,
java.lang.String sSectionID)
Removes a configuration section specified by section ID. |
void |
saveConfig()
Saves the configuration as is known by the ConfigHandler |
boolean |
setParam(java.lang.Object oSection,
java.lang.String sConfigItem,
java.lang.String sConfigValue,
boolean bMandatory)
Adds a config parameter to the given section. |
java.lang.Object |
setSection(java.lang.Object oRootSection,
java.lang.String sSectionType)
Get a sub-section. |
Method Detail |
---|
void init(java.io.File fConfig) throws ASelectConfigException
ConfigHandler
.
ConfigHandler
using a File
as source. fConfig != null
IConfigHandler
is initialized.
fConfig
- The File
that contains the configuration
ASelectConfigException
- If initialization fails.void init(java.lang.String sUser, java.lang.String sPassword, java.lang.String sDatabaseURL, java.lang.String sDatabaseTable, java.lang.String sDriverName, java.lang.String sConfigId) throws ASelectConfigException
ConfigHandler
.
ConfigHandler
using a database as source.
sUser != null
sPassword != null
sDatabaseURL != null
sDatabaseTable != null
sDriverName != null
sConfigId != null
IConfigHandler
implementation is initialized.
sUser
- Username that must be used to coneect to the databasesPassword
- Password for the user that must be used to connect to the
databasesDatabaseURL
- URL to the databasesDatabaseTable
- Database table in which the configuration is storedsDriverName
- The name of the driver that will be used to connect to the
databasesConfigId
- The ID of the configuration in which the specific
configuration is located
ASelectConfigException
- If initialization fails.java.lang.Object getSection(java.lang.Object oRootSection, java.lang.String sSectionType, java.lang.String sSectionID) throws ASelectConfigException
String
containing one '='
character (syntax: [param]=[value]).
oRootSection
- The section in which the requested section is located.sSectionType
- The type of the section, in XML the XML tag name.sSectionID
- The id of a section (syntax: [param]=[value])
ASelectConfigException
- If retrieving fails.java.lang.Object getSection(java.lang.Object rootSection, java.lang.String sectionType) throws ASelectConfigException
rootSection
- The root section.sectionType
- The type of section.
ASelectConfigException
- If retrieving fails.java.lang.Object setSection(java.lang.Object oRootSection, java.lang.String sSectionType) throws ASelectConfigException
null
: the first section will be
returned.
oRootSection
- Section that is used to resulve the subsectionsSectionType
- Type of the subsection that should be returned
ASelectConfigException
- Is setting session fails.boolean removeSection(java.lang.Object oRootSection, java.lang.String sSectionType) throws ASelectConfigException
oRootSection
- Section containing the section that must be removedsSectionType
- Type of the section that must be removed
ASelectConfigException
- If removinf fails.boolean removeSection(java.lang.Object oRootSection, java.lang.String sSectionType, java.lang.String sSectionID) throws ASelectConfigException
oRootSection
- Section containing the section that must be removedsSectionType
- Type of the section that must be removedsSectionID
- ID of section that must be removed (syntax: [name]=[value])
ASelectConfigException
- If removing fails.java.lang.String getParam(java.lang.Object oSection, java.lang.String sConfigItem) throws ASelectConfigException
String
that contains the requested configuration
parameter.
String
that will be returned will be retrieved from
the given config section and has the specified config item name.
oSection
- Section from which contains the parametersConfigItem
- The name of the config parameter
String
containing the requested config parameter
ASelectConfigException
- If retrieving fails.boolean setParam(java.lang.Object oSection, java.lang.String sConfigItem, java.lang.String sConfigValue, boolean bMandatory) throws ASelectConfigException
oSection
- The config section to which the parameter will be addedsConfigItem
- Name of the config parameter that will be addedsConfigValue
- Value of the config parameter that will be addedbMandatory
- TRUE if config parameter is requered in the section
ASelectConfigException
- If setting fails.java.lang.Object getNextSection(java.lang.Object oSection) throws ASelectConfigException
null
if no next
section can be found.
oSection
- Section that has the same type as the section that must be
returned
ASelectConfigException
- If retrieving failsvoid saveConfig() throws ASelectConfigException
ConfigHandler.
Description:
Writes the configuration to the physical storage. It will overwrite the
existing configuration.
Concurrency issues:
-
Preconditions:
-
Postconditions:
-
- Throws:
ASelectConfigException
- If saving fails
void importConfig(java.io.File fConfig) throws ASelectConfigException
ConfigHandler
.ConfigManager
must be initialized.
fConfig
- The configuration File
that will be imported in
the configuration that is known in the memory of the
ConfigHandler
ASelectConfigException
- If importing fails.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |