|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.enableit.db.darrt.AbstractFileHandler
|
+--org.enableit.db.darrt.AbstractSchemaHandler
|
+--org.enableit.db.darrt.DataHandler
Data manipulation routines required by Darrt library.
Provides the mechanism for importing and exporting data in several formats.
| Field Summary | |
static java.lang.String |
ABOUT
CVS info ABOUT this class and its current version |
static java.lang.String |
AT_TABLE
Attribute name holding table name. |
| Constructor Summary | |
DataHandler()
Default Constructor. |
|
| Method Summary | |
java.util.Map |
export()
Export data from the data source and table patterns configured. |
org.enableit.db.beans.RowSet |
getRowSetFromCSV(java.io.InputStream is,
org.enableit.db.beans.Table table)
Deprecated. The introduction of the DataParserFactory makes this obsolete. |
org.enableit.db.beans.RowSet |
getRowSetFromXML(java.io.InputStream is,
org.enableit.db.beans.Table table)
Deprecated. The introduction of the DataParserFactory makes this obsolete. |
org.enableit.db.beans.RowSet |
importData(org.enableit.db.beans.Provider target,
org.enableit.db.beans.RowSet rows)
Import the data in the row set into the specified database. |
void |
process(java.io.File file,
java.lang.String fileType)
Process the specified file by importing its data into the database specified by the Provider property. |
void |
setProvider(org.enableit.db.beans.Provider provider)
Specify database connection details. |
| Methods inherited from class org.enableit.db.darrt.AbstractSchemaHandler |
addListener, addListeners, diffSchemas, getDatabase, getDebug, getListeners, getOnlineRefSchema, getOnlineTargetSchema, getRefDatabase, getRefSchemaName, getRefSchemaUrl, getTablePattern, getTargetDatabase, getTargetSchemaUrl, setDebug, setOnlineRefSchema, setOnlineTargetSchema, setRefDatabase, setRefSchemaName, setRefSchemaUrl, setTablePattern, setTargetDatabase, setTargetSchemaUrl |
| Methods inherited from class org.enableit.db.darrt.AbstractFileHandler |
getOperDir, setOperDir |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String AT_TABLE
public static final java.lang.String ABOUT
| Constructor Detail |
public DataHandler()
| Method Detail |
public java.util.Map export()
throws SchemaHandlingException
java.util.Map of
org.w3c.dom.Documents, each holding data of one table.
SchemaHandlingException - If unable to export data for any reason.
public org.enableit.db.beans.RowSet importData(org.enableit.db.beans.Provider target,
org.enableit.db.beans.RowSet rows)
throws DBException
target - Database to install data in.rows - Data to insert.
DBException - If there is a problem importing the data.
public void process(java.io.File file,
java.lang.String fileType)
throws ConfigurationException,
DBException
Provider property.
process in interface FileProcessorfile - The file to upload. File may be in CSV, Excel or XML
format, see class description for details. Other formats can be
supported by subclassing this data handler and providing a method
with the signature: getRowSetFrom<file extension in upper case>(
:java.io.InputStream, :org.enableit.db.beans.Table)
: org.enableit.db.beans.RowSet fileType - The name of the table to insert into.
ConfigurationException - If the fileType specifies
an unknown table or the file does not have a supported
extension (e.g. .csv or .xml).
DBException - If the handling of the file goes wrong
in some recoverable way.
public void setProvider(org.enableit.db.beans.Provider provider)
throws DBException
setProvider in interface FileProcessorprovider - Provider to be used by the FileProcessor.
DBException - If the handling of the file goes wrong
in some recoverable way.
public org.enableit.db.beans.RowSet getRowSetFromXML(java.io.InputStream is,
org.enableit.db.beans.Table table)
throws java.io.IOException,
DBException
RowSet.
is - Any Reader wrapper to input stream.table - The name of the target Table for the RowSet.
java.io.IOException
DBException
public org.enableit.db.beans.RowSet getRowSetFromCSV(java.io.InputStream is,
org.enableit.db.beans.Table table)
throws java.io.IOException,
DBException
RowSet.
is - Any Reader wrapper to input stream.table - The name of the target Table for the RowSet.
java.io.IOException
DBException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||