|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Observable
de.folt.models.documentmodel.document.XmlDocument
de.folt.models.datamodel.DataSourceConfigurations
public class DataSourceConfigurations
This class implements DataSourceConfigurations. DataSourceConfigurations basically are a list of different DataSources. DataSources are added or deleted when the DataSource createDataSource method is called. The class supplied various methods adding, deleting, retrieving DataSources. The data sources are stored in an xml file.
| Constructor Summary | |
|---|---|
DataSourceConfigurations()
|
|
DataSourceConfigurations(java.lang.String configurationFileName)
Creates DataSourceConfigurations based on a given configurationFileName. |
|
| Method Summary | |
|---|---|
org.jdom.Element |
addConfiguration(java.lang.String configName)
addConfiguration add a new configuration with the name configName |
org.jdom.Element |
addConfiguration(java.lang.String configName,
java.lang.String dataSourceType,
DataSourceProperties dataSourceProperties)
addConfiguration add a new configuration with the name configName, a dataSourceType and the dataSourceProperties. |
void |
addPropertiesToDataModelProperties(java.lang.String name,
DataSourceProperties dataModelProperties)
addPropertiesToDataModelProperties add all the properties stored to the supplied DataSourceProperties |
boolean |
bDataSourceExistsInConfiguration(java.lang.String configName)
bDataSourceExistsInConfiguration check if a specific data source give by its name is registered in the database configuration |
static boolean |
createDataSourceConfiguration(java.lang.String pathName)
createDataSourceConfiguration create a new data source configuration file |
static boolean |
createDataSourceConfiguration(java.lang.String fileName,
java.lang.String directory)
createDataSourceConfiguration create a new data source configuration file |
org.jdom.Element |
getConfiguration(java.lang.String configName)
getConfiguration returns a dataSourceConfiguration Element based on its name |
java.lang.String |
getConfigurationFileName()
Get the name of file associated with the DataSourceConfigurations. |
static java.lang.String |
getConfigurationFileName(java.util.Hashtable<java.lang.String,java.lang.Object> message)
getConfigurationFileName get the configuration file name based on a given string. |
static java.lang.String |
getConfigurationFileName(java.lang.String dataSourceConfigurationsFile)
getConfigurationFileName get the configuration file name based on a given string. |
int |
getConfigurationIndex(java.lang.String configName)
getConfigurationIndex gets the configuration index |
java.lang.String[] |
getDataSources()
getDataSources get all the data sources names in the configuration |
java.lang.String[] |
getDataSources(boolean bSync)
|
java.lang.String[] |
getDataSources(java.lang.String dataSourceType)
getDataSources get all the data sources in the configuration of a specific data source type; e.g. |
java.lang.String[] |
getDataSources(java.lang.String dataSourceType,
boolean bSync)
|
java.util.Vector<java.lang.String[]> |
getDataSourcesWithType()
Method returns for all data source name, type and sync property |
java.lang.String |
getDataSourceType(java.lang.String name)
getDataSourceType returns the type of a data source stored in a data source configuration file |
static java.lang.String |
getDefaultDataSourceConfigurationsFileName()
|
static java.util.Vector<java.lang.String> |
getOpenTMSDatabases()
getOpenTMSDatabases returns all the existing OpenTMS data sources based on the OpenTMS Property "dataSourceConfigurationsFile" It uses the function String configfile = OpenTMSProperties.getInstance().getOpenTMSProperty ("dataSourceConfigurationsFile"); to determine the configuration file |
static java.util.Vector<java.lang.String[]> |
getOpenTMSDatabasesWithType()
getOpenTMSDatabasesWithType returns all the existing OpenTMS data sources together with its type based on the OpenTMS Property "dataSourceConfigurationsFile" It uses the function String configfile = OpenTMSProperties.getInstance().getOpenTMSProperty ("dataSourceConfigurationsFile"); to determine the configuration file Example where tmxDatabases is a Vector(String[]) String name = tmxDatabases.get(i)[0]; String type = tmxDatabases.get(i)[1]; |
java.lang.String |
getProperty(java.lang.String configName,
java.lang.String property)
getProperty returns a specific data configuration property based on the name |
static void |
main(java.lang.String[] args)
main Parameters: -list - list all data sources from getDefaultDataSourceConfigurationsFileName -remove if getDefaultDataSourceConfigurationsFileName file name does not exist it will be created and method returns |
static void |
mainold(java.lang.String[] args)
main |
boolean |
removeConfiguration(java.lang.String configName)
removeConfiguration remove a configuration from the data source configurations |
boolean |
saveToXmlFile(java.lang.String filename)
saveToXmlFile writes the document to the given file name |
void |
setConfigurationFileName(java.lang.String configurationFileName)
Explicitly set the name if DataSourceConfigurations |
| Methods inherited from class java.util.Observable |
|---|
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DataSourceConfigurations()
public DataSourceConfigurations(java.lang.String configurationFileName)
configurationFileName - the configuration file to use| Method Detail |
|---|
public static boolean createDataSourceConfiguration(java.lang.String pathName)
pathName - the full path name of the data source configuration
public static boolean createDataSourceConfiguration(java.lang.String fileName,
java.lang.String directory)
fileName - the file name of the data source configurationdirectory - the directory of the data source configurationpublic static java.lang.String getConfigurationFileName(java.util.Hashtable<java.lang.String,java.lang.Object> message)
message - the message containing the proposed name as key / value pair
for message.get("dataSourceConfigurationsFile");
public static java.lang.String getConfigurationFileName(java.lang.String dataSourceConfigurationsFile)
dataSourceConfigurationsFile - the proposed configuration file name
public static java.lang.String getDefaultDataSourceConfigurationsFileName()
public static java.util.Vector<java.lang.String> getOpenTMSDatabases()
public static java.util.Vector<java.lang.String[]> getOpenTMSDatabasesWithType()
Example where tmxDatabases is a Vector(String[]) String name = tmxDatabases.get(i)[0]; String type = tmxDatabases.get(i)[1];
public static void main(java.lang.String[] args)
args -
org.jdom.input.JDOMParseException
public static void mainold(java.lang.String[] args)
throws org.jdom.input.JDOMParseException
args -
org.jdom.input.JDOMParseExceptionpublic org.jdom.Element addConfiguration(java.lang.String configName)
configName - the name of the unique configuration
public org.jdom.Element addConfiguration(java.lang.String configName,
java.lang.String dataSourceType,
DataSourceProperties dataSourceProperties)
configName - the name of the unique configurationdataSourceProperties - the dataSourceProperties of the unique configurationdataSourceType - the type of the data source
public void addPropertiesToDataModelProperties(java.lang.String name,
DataSourceProperties dataModelProperties)
name - name of the data sourcedataModelProperties - the DataSourceProperties which should be enhanced with the
propertiespublic boolean bDataSourceExistsInConfiguration(java.lang.String configName)
configName - the name of data source
public org.jdom.Element getConfiguration(java.lang.String configName)
configName - the name of the configuration to find
public java.lang.String getConfigurationFileName()
public int getConfigurationIndex(java.lang.String configName)
configName - the name of the configuration to find
public java.lang.String[] getDataSources()
public java.lang.String[] getDataSources(boolean bSync)
bSync - true / false if true sync databases will be returned in case
of false the non sync databases
public java.lang.String[] getDataSources(java.lang.String dataSourceType)
dataSourceType -
public java.lang.String[] getDataSources(java.lang.String dataSourceType,
boolean bSync)
dataSourceType - the data source types to search forbSync - true or false depending if sync or non snc databases should be
returned
public java.util.Vector<java.lang.String[]> getDataSourcesWithType()
public java.lang.String getDataSourceType(java.lang.String name)
name - the data sorce name
public java.lang.String getProperty(java.lang.String configName,
java.lang.String property)
configName - the configuration nameproperty - the property name
public boolean removeConfiguration(java.lang.String configName)
databasename -
public boolean saveToXmlFile(java.lang.String filename)
XmlDocument
saveToXmlFile in class XmlDocumentfilename - the file anme for the output xml file
public void setConfigurationFileName(java.lang.String configurationFileName)
configurationFileName - the configurationFileName to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||