org.deegree_impl.services.wfs.configuration
Class ConfigurationFactory

java.lang.Object
  extended byorg.deegree_impl.services.wfs.configuration.ConfigurationFactory

public final class ConfigurationFactory
extends java.lang.Object

Author:
Andreas Poth

Field Summary
private static java.lang.String namespace
           
 
Constructor Summary
ConfigurationFactory()
           
 
Method Summary
private static Connection createConnection(org.w3c.dom.Element element)
          creates a Connection object that describes the JDBC connection paramter for accessing a database
static Connection createConnection(java.lang.String driver, java.lang.String logon, java.lang.String user, java.lang.String password)
          creates a Connection object that describes the JDBC connection paramter for accessing a database.
static Connection createConnectionOracle(java.lang.String driver, java.lang.String logon, java.lang.String user, java.lang.String password, java.lang.String spatialVersion)
          creates a Connection object that describes the JDBC connection paramter for accessing a database.
static Connection createConnectionSDE(java.lang.String driver, java.lang.String logon, java.lang.String user, java.lang.String password, java.lang.String sdeDatabase)
          creates a Connection object that describes the JDBC connection paramter for accessing a database.
static DatastoreConfiguration createDatastoreConfiguration(org.w3c.dom.Document doc)
          creates a DatastoreConfiguration object from a dom document
static DatastoreConfiguration createDatastoreConfiguration(java.io.Reader reader)
          creates a DatastoreConfiguration object from a dom document accessable by the submitted Reader
static DatastoreConfiguration createDatastoreConfiguration(java.lang.String name, int type, Connection connection, FeatureType[] featureTypes)
          creates a DatastoreConfiguration object
static FeatureType createFeatureType(java.lang.String name, OutputFormat[] outputFormats, java.util.HashMap properties, java.util.HashMap propertyTypes, java.util.HashMap datastoreFields, java.util.HashMap datastoreFieldTypes, java.util.HashMap dbFieldTypes, java.util.HashMap alias, java.util.HashMap aliasInv, MasterTable masterTable, RelatedTable[] relatedTables, java.lang.String crs, java.lang.String icrs)
          creates a description object for each feature type that's accessable through a datastore.
private static FeatureType[] createFeatureTypes(org.w3c.dom.NodeList nl, Connection con, int type)
          creates a description object for each feature type that's accessable through a datastore.
private static java.util.HashMap createGeoFieldIdentifiers(org.w3c.dom.NodeList nl)
          creates a description object for each gea column of a table
static GeoFieldIdentifier createGeoFieldIdentifiers(java.lang.String name, int dimension)
          creates a description object for a column containing geo-spatial data
private static java.util.HashMap[] createMappingFields(org.w3c.dom.NodeList nl)
          creates descrption objects for each field of the feature type to one or more database fields.
static java.util.HashMap[] createMappingFields(java.lang.String[] propertyNames, java.lang.String[] propertyTypes, java.lang.String[][] dataStoreFields, java.lang.String[][] dataStoreFieldTypes)
          creates descrption objects for each field of the feature type to map one or more database fields. each property is assigned toone or more datastroe fields.
private static MasterTable createMasterTable(org.w3c.dom.Element element, int type)
          create a description object for the master table of the feature type
static MasterTable createMasterTable(java.lang.String name, java.lang.String targetName, java.lang.String idField, boolean isNumber, boolean isAutoIncremented, boolean insertAllowed, boolean updateAllowed, boolean deleteAllowed, java.util.HashMap geoFields, java.util.HashMap references)
          create a description object for the master table of a feature type
static OutputFormat createOutputFormat(java.lang.String name, java.lang.String responsibleClass, ParameterList parameter, java.net.URL schemaLocation)
          creates a descrption object for a output format supported by a datastore for a feature type.
private static OutputFormat[] createOutputFormats(org.w3c.dom.Element element)
          creates a descrptions object for the output formats supported by the datastore for a feature type
private static ParameterList createParameterList(org.w3c.dom.NodeList nl)
          create additional parameters that shall be submitted to the resposible for a defined output format
private static java.util.HashMap createReferences(org.w3c.dom.NodeList nl)
          creates a description object for reference to a related table for the master table or an higher level related table
static Reference createReferences(java.lang.String tableField, boolean replaceable, java.lang.String targetTable, java.lang.String targetField)
          creates a description object for reference to a related table for the master table or an higher level related table
static RelatedTable createRelatedTable(java.lang.String name, java.lang.String targetName, java.lang.String idField, boolean isNumber, boolean isAutoIncremented, boolean insertAllowed, boolean updateAllowed, boolean deleteAllowed, java.util.HashMap geoFields, java.util.HashMap references, boolean joinTable)
          create a description object for a table of a feature type related direct or indirect to the master table
private static RelatedTable[] createRelatedTables(org.w3c.dom.NodeList nl)
          create a description object for each table of the feature type related direct or indirect to the master table
private static int getDataType(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

namespace

private static java.lang.String namespace
Constructor Detail

ConfigurationFactory

public ConfigurationFactory()
Method Detail

createDatastoreConfiguration

public static DatastoreConfiguration createDatastoreConfiguration(java.io.Reader reader)
                                                           throws WFSConfigurationException
creates a DatastoreConfiguration object from a dom document accessable by the submitted Reader

Throws:
WFSConfigurationException

createDatastoreConfiguration

public static DatastoreConfiguration createDatastoreConfiguration(org.w3c.dom.Document doc)
                                                           throws WFSConfigurationException
creates a DatastoreConfiguration object from a dom document

Throws:
WFSConfigurationException

createDatastoreConfiguration

public static DatastoreConfiguration createDatastoreConfiguration(java.lang.String name,
                                                                  int type,
                                                                  Connection connection,
                                                                  FeatureType[] featureTypes)
creates a DatastoreConfiguration object

Parameters:
name - of the datastore configuration
type - Type of the datastore to be described
connection - Connection if the datastore if a database
featureTypes - Feature type supported by the datastore
Returns:
DatastoreConfiguration

createConnection

private static Connection createConnection(org.w3c.dom.Element element)
                                    throws java.lang.Exception
creates a Connection object that describes the JDBC connection paramter for accessing a database

Throws:
java.lang.Exception

createConnection

public static Connection createConnection(java.lang.String driver,
                                          java.lang.String logon,
                                          java.lang.String user,
                                          java.lang.String password)
creates a Connection object that describes the JDBC connection paramter for accessing a database.

Parameters:
driver - name of the JDBC driver to be used
logon - connection description to a database
user - user name
password - users password

createConnectionOracle

public static Connection createConnectionOracle(java.lang.String driver,
                                                java.lang.String logon,
                                                java.lang.String user,
                                                java.lang.String password,
                                                java.lang.String spatialVersion)
creates a Connection object that describes the JDBC connection paramter for accessing a database.

Parameters:
driver - name of the JDBC driver to be used
logon - connection description to a database
user - user name
password - users password
spatialVersion - version of the spatial extension if a Oracle database shall be connected

createConnectionSDE

public static Connection createConnectionSDE(java.lang.String driver,
                                             java.lang.String logon,
                                             java.lang.String user,
                                             java.lang.String password,
                                             java.lang.String sdeDatabase)
creates a Connection object that describes the JDBC connection paramter for accessing a database.

Parameters:
driver - name of the JDBC driver to be used
logon - connection description to a database
user - user name
password - users password
sdeDatabase -

createFeatureTypes

private static FeatureType[] createFeatureTypes(org.w3c.dom.NodeList nl,
                                                Connection con,
                                                int type)
                                         throws java.lang.Exception
creates a description object for each feature type that's accessable through a datastore.

Throws:
java.lang.Exception

createFeatureType

public static FeatureType createFeatureType(java.lang.String name,
                                            OutputFormat[] outputFormats,
                                            java.util.HashMap properties,
                                            java.util.HashMap propertyTypes,
                                            java.util.HashMap datastoreFields,
                                            java.util.HashMap datastoreFieldTypes,
                                            java.util.HashMap dbFieldTypes,
                                            java.util.HashMap alias,
                                            java.util.HashMap aliasInv,
                                            MasterTable masterTable,
                                            RelatedTable[] relatedTables,
                                            java.lang.String crs,
                                            java.lang.String icrs)
creates a description object for each feature type that's accessable through a datastore.

Parameters:
name - Name of the feature type
outputFormats - Output formats supported by the feature type
properties - Mapping between properties and datastore fields
propertyTypes - Mapping between properties and their data types
datastoreFields - Mapping between datastore fields and properties
datastoreFieldTypes - Mapping between datastore fields and their data types
dbFieldTypes - Mapping between db fields and their data types
masterTable - Description of the features types master table
relatedTables - Description of the feature types related tables
crs - Coordinate reference system of the feature type
icrs - Coordinate reference system code of the feature type as it is used within the datasource

createOutputFormats

private static OutputFormat[] createOutputFormats(org.w3c.dom.Element element)
                                           throws java.lang.Exception
creates a descrptions object for the output formats supported by the datastore for a feature type

Throws:
java.lang.Exception

createOutputFormat

public static OutputFormat createOutputFormat(java.lang.String name,
                                              java.lang.String responsibleClass,
                                              ParameterList parameter,
                                              java.net.URL schemaLocation)
creates a descrption object for a output format supported by a datastore for a feature type.

Parameters:
name - Name of the output format
responsibleClass - Class that's responsible for creating the output format
parameter - List of parameters that will be submitted to the responsible class
schemaLocation - URL of the XML schema describing the output format
Returns:
A OutputFormat object.

createParameterList

private static ParameterList createParameterList(org.w3c.dom.NodeList nl)
create additional parameters that shall be submitted to the resposible for a defined output format


createMappingFields

private static java.util.HashMap[] createMappingFields(org.w3c.dom.NodeList nl)
creates descrption objects for each field of the feature type to one or more database fields.


createMappingFields

public static java.util.HashMap[] createMappingFields(java.lang.String[] propertyNames,
                                                      java.lang.String[] propertyTypes,
                                                      java.lang.String[][] dataStoreFields,
                                                      java.lang.String[][] dataStoreFieldTypes)
                                               throws java.lang.Exception
creates descrption objects for each field of the feature type to map one or more database fields. each property is assigned toone or more datastroe fields. so all submitted arrays have the same size. the datastore fields and types must have the same column number.

Parameters:
propertyNames - array of property names
propertyTypes - Array containing one type for each named property
dataStoreFields - datastore fields assigned to the properties
dataStoreFieldTypes - types of the datastore fields.
Returns:
array HashMap containing the mappings
Throws:
java.lang.Exception

getDataType

private static int getDataType(java.lang.String s)
Parameters:
s -
Returns:

createMasterTable

private static MasterTable createMasterTable(org.w3c.dom.Element element,
                                             int type)
                                      throws java.io.IOException
create a description object for the master table of the feature type

Throws:
java.io.IOException

createMasterTable

public static MasterTable createMasterTable(java.lang.String name,
                                            java.lang.String targetName,
                                            java.lang.String idField,
                                            boolean isNumber,
                                            boolean isAutoIncremented,
                                            boolean insertAllowed,
                                            boolean updateAllowed,
                                            boolean deleteAllowed,
                                            java.util.HashMap geoFields,
                                            java.util.HashMap references)
create a description object for the master table of a feature type

Parameters:
name - Name of the table
targetName - Name that shall be used for this table within FaetureType objects
idField - Name of the field that shall be used as id for the tables content
isNumber - True if the ID-field if of a number type
isAutoIncremented - True if the values of the ID-field will be incremented automaticly by the datastore (database)
geoFields - names and dimensions of the tables geo-spatial fields
references - names and descriptions of references to other tables
Returns:
MasterTable

createReferences

private static java.util.HashMap createReferences(org.w3c.dom.NodeList nl)
creates a description object for reference to a related table for the master table or an higher level related table


createReferences

public static Reference createReferences(java.lang.String tableField,
                                         boolean replaceable,
                                         java.lang.String targetTable,
                                         java.lang.String targetField)
creates a description object for reference to a related table for the master table or an higher level related table

Parameters:
tableField - Name of the field that shall be interpreted as reference
replaceable - True if the field shall be replaced by the refrenced content
targetTable - Name of the table that is referenced
targetField - Name of the target tables field that must match the tableField
Returns:
Reference

createGeoFieldIdentifiers

private static java.util.HashMap createGeoFieldIdentifiers(org.w3c.dom.NodeList nl)
creates a description object for each gea column of a table


createGeoFieldIdentifiers

public static GeoFieldIdentifier createGeoFieldIdentifiers(java.lang.String name,
                                                           int dimension)
creates a description object for a column containing geo-spatial data

Parameters:
name - Name of the column containing geo-spatial data
dimension - Dimension of the geo-spatial data; just used for POINTDB
Returns:
GeoFieldIdentifier

createRelatedTables

private static RelatedTable[] createRelatedTables(org.w3c.dom.NodeList nl)
create a description object for each table of the feature type related direct or indirect to the master table


createRelatedTable

public static RelatedTable createRelatedTable(java.lang.String name,
                                              java.lang.String targetName,
                                              java.lang.String idField,
                                              boolean isNumber,
                                              boolean isAutoIncremented,
                                              boolean insertAllowed,
                                              boolean updateAllowed,
                                              boolean deleteAllowed,
                                              java.util.HashMap geoFields,
                                              java.util.HashMap references,
                                              boolean joinTable)
create a description object for a table of a feature type related direct or indirect to the master table

Parameters:
name - Name of the table
targetName - Name that shall be used for this table within FaetureType objects
idField - Name of the field that shall be used as id for the tables content
isNumber - True if the ID-field if of a number type
isAutoIncremented - True if the values of the ID-field will be incremented automaticly by the datastore (database)
geoFields - names and dimensions of the tables geo-spatial fields
references - names and descriptions of references to other tables
joinTable - True if the table is a join table
Returns:
RelatedTable