|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiz.c24.io.api.Factory
public class Factory
A factory to initalize and create classes in the API.
Instances of this class should be retrieved via the
newInstance(java.io.File)
method, passing in a project file. OR
newInstance(java.net.URI)
method, passing in a file based uri with or without query scheme
e.g file://[path]?configuration=
Field Summary | |
---|---|
static int |
DATAMODEL
|
static int |
TRANSFORM
|
Method Summary | |
---|---|
Element |
createElement(String configName)
Creates a new Element from the specified configuration in the project file. |
Properties |
createInputDatabaseProperties(String id,
String configName)
Creates a new input set of database properties from the configuration element for the given ID. |
Properties |
createOutputDatabaseProperties(String id,
String configName)
Creates a new output database properties from configuration element with the given ID. |
Sink |
createSink(String id,
String configName)
Creates a new Sink for the given ID from the configuration element. |
Source |
createSource(String id,
String configName)
Creates a new Source with the given ID from the configuration element. |
Transform |
createTransform(String configName)
Creates a new Transform from the specified configuration in the project file. |
String[] |
getDatabaseInputIds(String configName)
Returns the ids of all database inputs specified in the configuration element An id in the returned array can be used in the #createInputDatabaseProperties(String) method. |
String[] |
getDatabaseOutputIds(String configName)
Returns the ids of all database outputs specified in the configuration element. |
String[] |
getSinkIds(String configName)
Returns the ids of all Sinks specified in the configuration element. |
String[] |
getSourceIds(String configName)
Returns the ids of all Sources specified in the configuration element. |
String |
getSourceSinkURI(String id,
String configName)
Returns the Source uri from the configuration element |
int |
getTargetType(String configName)
Returns a int depending on the target element. |
void |
initDomainConstraints()
Initializes the DomainConstraintManager from the project file, after clearing any current constraints. |
void |
initDomainConstraints(boolean clear)
Initializes the DomainConstraintManager from the project file, possibly clearing any current constraints first. |
void |
initInputDatabaseProperties(String id,
Properties properties,
String configName)
Initializes a set of input database properties for the specified configuration with the given ID. |
void |
initOutputDatabaseProperties(String id,
Properties properties,
String configName)
Initializes a set of output database properties from configuration with the given ID. |
static Object |
loadFromDatabase(Element element,
org.hibernate.cfg.Configuration cfg,
String primaryKey,
String sqlQuery,
String hqlQuery,
String dialect,
ClassLoader loader)
Loads an object from the specified database configuration using either a primary key, SQL query or HQL query. |
static ComplexDataObject |
loadFromSource(Element element,
Source src)
Loads an object from the specified source. |
static Factory |
newInstance(File file)
Creates a new instance of the factory from the specified project url using the default classloader. |
static Factory |
newInstance(File file,
ClassLoader loader)
Creates a new instance of the factory from the specified project file using the specified classloader. |
static Factory |
newInstance(URI uri)
Creates a new instance of the factory from the specified project file based uri. |
static Factory |
newInstance(URI uri,
ClassLoader loader)
Creates a new instance of the factory from the specified project file based uri using the specified classloader. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DATAMODEL
public static final int TRANSFORM
Method Detail |
---|
public String[] getDatabaseInputIds(String configName) throws FactoryException
#createInputDatabaseProperties(String)
method.
configName
- The name of the target configuration in the project file or
null
to use the default configuration.
FactoryException
public String[] getDatabaseOutputIds(String configName) throws FactoryException
#createOutputDatabaseProperties(String)
method.
configName
- The name of the target configuration in the project file or
null
to use the default configuration.
FactoryException
public String[] getSourceIds(String configName) throws FactoryException
An id in the returned array can be used in the #createSource(String)
method.
configName
- The name of the target configuration in the project file or
null
to use the default configuration.
FactoryException
public String[] getSinkIds(String configName) throws FactoryException
An id in the returned array can be used in the #createSink(String)
method.
configName
- The name of the target configuration in the project file or
null
to use the default configuration.
FactoryException
public Source createSource(String id, String configName) throws FactoryException
To create a new database connection, use
#createInputDatabaseProperties(String)
instead of this method.
id
- The id of the Source to create or null
to create the first Source appearing in the configuration element.configName
- The name of the target configuration or null
to use default configuration element.
FactoryException
- If no Source can be found for the specified ID.public String getSourceSinkURI(String id, String configName) throws FactoryException
id
- The id of the Source or null
to select the first source from the configuration element.configName
- The name of the target configuration or null
to use default configuration element.
FactoryException
- If no Source can be found for the specified ID.public Sink createSink(String id, String configName) throws FactoryException
To create a new database connection, use
#createOutputDatabaseProperties(String)
instead of this method.
id
- The id of the Sink to create or null
to create the first Sink appearing in the default configuration.configName
- The name of the target configuration or null
to use default configuration element. *
FactoryException
- If no Sink can be found for the specified ID.public Properties createInputDatabaseProperties(String id, String configName) throws FactoryException
id
- The id of the database input to create or null
to create the first database input
appearing in the specified configuration.configName
- The name of the target configuration or null
to use default configuration element.
FactoryException
- If no database input can be found for the specified ID.public void initInputDatabaseProperties(String id, Properties properties, String configName) throws FactoryException
id
- The id of the database input to create or null
to create the first database input
appearing in the specified configuration.properties
- The properties instance that will be populated with configuration.
FactoryException
- If no database input can be found for the specified ID.public Properties createOutputDatabaseProperties(String id, String configName) throws FactoryException
id
- The id of the database output to create or null
to create the first database output
appearing in the specified configuration.configName
- The name of the target configuration or null
to use default configuration element.
FactoryException
- If no database output can be found for the specified ID.public void initOutputDatabaseProperties(String id, Properties properties, String configName) throws FactoryException
id
- The id of the database output to create or null
to create the first database output
appearing in the specified configuration.properties
- The properties instance that will be populated with configuration.configName
- The name of the target configuration or null
to use default configuration element. *
FactoryException
- If no database output can be found for the specified ID.public void initDomainConstraints() throws FactoryException
DomainConstraintManager
from the project file, after clearing any current constraints.
FactoryException
- If the domain constraints in the project file are invalid in any way.public void initDomainConstraints(boolean clear) throws FactoryException
DomainConstraintManager
from the project file, possibly clearing any current constraints first.If
clear == false
the new constraints will be added to those already defined in the DomainConstraintManager
.
Any identifiers already registered will be overwritten.
NOTE: Please ensure that the c24-io-hibernate.jar and Hibernate with its dependant libraries
are added to your classpath (hibernate3.jar etc.).
For more information about the Hibernate please visit:
http://www.hibernate.org/
clear
- Whether to clear current domain constraints before re-initializing.
FactoryException
- If the domain constraints in the project file are invalid in any way.public static ComplexDataObject loadFromSource(Element element, Source src) throws FactoryException
element
- The element to parse against.src
- The Source object.
FactoryException
- If an error occours during parsing.public static Object loadFromDatabase(Element element, org.hibernate.cfg.Configuration cfg, String primaryKey, String sqlQuery, String hqlQuery, String dialect, ClassLoader loader) throws FactoryException
element
- The element to parse against.cfg
- The Source database properties.primaryKey
- The optional primary key of the object to be loaded.sqlQuery
- An optional SQL query to select the object to be loaded.hqlQuery
- An optional HQL query to select the object to be loaded.dialect
- the Hibernate database Dialectloader
- The class loader to be used to load the data.
FactoryException
- If an error occours during loading or if all primaryKey, sqlQuery and hqlQuery are null.public int getTargetType(String configName) throws FactoryException
The
- configuration name to be used from the project file.
FactoryException
- If the specified configuration element is not found.public Transform createTransform(String configName) throws FactoryException
The
- configuration name to be used from the project file.
FactoryException
- If there are any problems locating and instantiating the element class.public Element createElement(String configName) throws FactoryException
The
- configuration name to be used from the project file.
FactoryException
- If there are any problems locating and instantiating the element class.public static Factory newInstance(URI uri) throws FactoryException
file
- The project file based uri is generated by the Designer.
FactoryException
- If an error occours during the Factory's construction.public static Factory newInstance(URI uri, ClassLoader loader) throws FactoryException
file
- The project file based url should have been generated by the Designer/loader
- The class loader to be used by the factory.
FactoryException
- If an error occours during the Factory's construction.public static Factory newInstance(File file) throws FactoryException
file
- The project file which is created when the designer project is saved.
FactoryException
- If an error occours during the Factory's construction.public static Factory newInstance(File file, ClassLoader loader) throws FactoryException
file
- The project file which is created when the designer project is saved.loader
- The class loader to be used by the factory.
FactoryException
- If an error occours during the Factory's construction.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |