Class ZipExporter
- java.lang.Object
-
- de.akquinet.jbosscc.guttenbase.export.zip.ZipExporter
-
- All Implemented Interfaces:
Exporter
public class ZipExporter extends Object implements Exporter
Export schema information and data into executable JAR file. Since it is in ZIP file format the resulting file may as well be inspected with a ZIP tool. The structure of the ZIP is based on the structure of a data base.© 2012-2034 akquinet tech@spree
- Author:
- M. Dahm
Hint is used by
ZipExporterClassResourcesHintto add custom classes to the generated JAR and configure the META-INF/MANIFEST.MF Main-Class entry Hint is used byExportDumpExtraInformationHintto add custom information to the generated JAR
-
-
Constructor Summary
Constructors Constructor Description ZipExporter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinalizeWriteRowData(TableMetaData table)Called after copying of a table row ends.voidfinalizeWriteTableData(TableMetaData table)Called after copying of a table ends.voidfinishExport()Finish exportvoidflush()Resets the output stream which reduces memory foot print drastically.voidinitializeExport(ConnectorRepository connectorRepository, String connectorId, ExportDumpConnectorInfo exportDumpConnectionInfo)Start exporting to a file.voidinitializeWriteRowData(TableMetaData table)Called before copying of a table row starts.voidinitializeWriteTableData(TableMetaData tableMetaData)Called before copying of a table starts.voidwriteDatabaseMetaData(DatabaseMetaData databaseMetaData)Dump database informationvoidwriteObject(Object obj)voidwriteTableHeader(ExportTableHeader exportTableHeader)Write table header when executing an INSERT statement.
-
-
-
Method Detail
-
initializeExport
public void initializeExport(ConnectorRepository connectorRepository, String connectorId, ExportDumpConnectorInfo exportDumpConnectionInfo) throws IOException
Start exporting to a file.- Specified by:
initializeExportin interfaceExporter- Throws:
IOException
-
finishExport
public void finishExport() throws ExceptionFinish export- Specified by:
finishExportin interfaceExporter- Throws:
Exception
-
writeDatabaseMetaData
public void writeDatabaseMetaData(DatabaseMetaData databaseMetaData) throws IOException, SQLException
Dump database information- Specified by:
writeDatabaseMetaDatain interfaceExporter- Throws:
IOExceptionSQLException
-
writeTableHeader
public void writeTableHeader(ExportTableHeader exportTableHeader) throws IOException, SQLException
Write table header when executing an INSERT statement. This is necessary to mark where data for a given table starts since some tables may be skipped during import. The header is written only once in fact. Does nothing.- Specified by:
writeTableHeaderin interfaceExporter- Throws:
IOExceptionSQLException
-
initializeWriteTableData
public void initializeWriteTableData(TableMetaData tableMetaData) throws IOException
Called before copying of a table starts. Open new ZIP entry. Data will be written to a temporary file first, because otherwise it may exceed the memory.- Specified by:
initializeWriteTableDatain interfaceExporter- Throws:
IOException
-
finalizeWriteTableData
public void finalizeWriteTableData(TableMetaData table) throws IOException
Called after copying of a table ends. Close current ZIP entry.- Specified by:
finalizeWriteTableDatain interfaceExporter- Throws:
IOException
-
initializeWriteRowData
public void initializeWriteRowData(TableMetaData table)
Called before copying of a table row starts. Does nothing.- Specified by:
initializeWriteRowDatain interfaceExporter
-
finalizeWriteRowData
public void finalizeWriteRowData(TableMetaData table)
Called after copying of a table row ends. Does nothing.- Specified by:
finalizeWriteRowDatain interfaceExporter
-
flush
public void flush() throws IOExceptionResets the output stream which reduces memory foot print drastically. SeeObjectOutputStream.reset()for details.- Specified by:
flushin interfaceExporter- Throws:
IOException
-
writeObject
public void writeObject(Object obj) throws IOException
- Specified by:
writeObjectin interfaceExporter- Throws:
IOException
-
-