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
ZipExporterClassResourcesHint
to add custom classes to the generated JAR and configure the META-INF/MANIFEST.MF Main-Class entry Hint is used byExportDumpExtraInformationHint
to 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 void
finalizeWriteRowData(TableMetaData table)
Called after copying of a table row ends.void
finalizeWriteTableData(TableMetaData table)
Called after copying of a table ends.void
finishExport()
Finish exportvoid
flush()
Resets the output stream which reduces memory foot print drastically.void
initializeExport(ConnectorRepository connectorRepository, String connectorId, ExportDumpConnectorInfo exportDumpConnectionInfo)
Start exporting to a file.void
initializeWriteRowData(TableMetaData table)
Called before copying of a table row starts.void
initializeWriteTableData(TableMetaData tableMetaData)
Called before copying of a table starts.void
writeDatabaseMetaData(DatabaseMetaData databaseMetaData)
Dump database informationvoid
writeObject(Object obj)
void
writeTableHeader(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:
initializeExport
in interfaceExporter
- Throws:
IOException
-
finishExport
public void finishExport() throws Exception
Finish export- Specified by:
finishExport
in interfaceExporter
- Throws:
Exception
-
writeDatabaseMetaData
public void writeDatabaseMetaData(DatabaseMetaData databaseMetaData) throws IOException, SQLException
Dump database information- Specified by:
writeDatabaseMetaData
in interfaceExporter
- Throws:
IOException
SQLException
-
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:
writeTableHeader
in interfaceExporter
- Throws:
IOException
SQLException
-
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:
initializeWriteTableData
in interfaceExporter
- Throws:
IOException
-
finalizeWriteTableData
public void finalizeWriteTableData(TableMetaData table) throws IOException
Called after copying of a table ends. Close current ZIP entry.- Specified by:
finalizeWriteTableData
in interfaceExporter
- Throws:
IOException
-
initializeWriteRowData
public void initializeWriteRowData(TableMetaData table)
Called before copying of a table row starts. Does nothing.- Specified by:
initializeWriteRowData
in interfaceExporter
-
finalizeWriteRowData
public void finalizeWriteRowData(TableMetaData table)
Called after copying of a table row ends. Does nothing.- Specified by:
finalizeWriteRowData
in interfaceExporter
-
flush
public void flush() throws IOException
Resets the output stream which reduces memory foot print drastically. SeeObjectOutputStream.reset()
for details.- Specified by:
flush
in interfaceExporter
- Throws:
IOException
-
writeObject
public void writeObject(Object obj) throws IOException
- Specified by:
writeObject
in interfaceExporter
- Throws:
IOException
-
-