Search in sources :

Example 1 with AbsExportDataHandler

use of com.cubrid.common.ui.cubrid.table.export.handler.AbsExportDataHandler in project cubrid-manager by CUBRID.

the class ExportDataThread method doRun.

protected void doRun() {
    exportDataEventHandler.handleEvent(new ExportDataBeginOneTableEvent(tableName));
    try {
        AbsExportDataHandler handler = ExportHandlerFactory.getExportHandler(dbInfo, exportConfig, exportDataEventHandler);
        handler.handle(tableName);
    } catch (Exception e) {
        isSuccess = false;
        LOGGER.error("", e);
    } catch (OutOfMemoryError error) {
        isSuccess = false;
        error.printStackTrace();
    } finally {
        if (isSuccess) {
            exportDataEventHandler.handleEvent(new ExportDataFinishOneTableEvent(tableName));
        } else {
            exportDataEventHandler.handleEvent(new ExportDataFailedOneTableEvent(tableName));
        }
    }
}
Also used : ExportDataFailedOneTableEvent(com.cubrid.common.ui.cubrid.table.event.ExportDataFailedOneTableEvent) AbsExportDataHandler(com.cubrid.common.ui.cubrid.table.export.handler.AbsExportDataHandler) ExportDataFinishOneTableEvent(com.cubrid.common.ui.cubrid.table.event.ExportDataFinishOneTableEvent) ExportDataBeginOneTableEvent(com.cubrid.common.ui.cubrid.table.event.ExportDataBeginOneTableEvent)

Example 2 with AbsExportDataHandler

use of com.cubrid.common.ui.cubrid.table.export.handler.AbsExportDataHandler in project cubrid-manager by CUBRID.

the class ExportLoadDBThread method doRun.

protected void doRun() {
    exportDataEventHandler.handleEvent(new ExportDataBeginOneTableEvent(exportConfig.getDataFilePath(ExportConfig.LOADDB_DATAFILEKEY)));
    try {
        AbsExportDataHandler handler = ExportHandlerFactory.getExportHandler(dbInfo, exportConfig, exportDataEventHandler);
        handler.handle(null);
    } catch (Exception e) {
        isSuccess = false;
        LOGGER.error("", e);
    } catch (OutOfMemoryError error) {
        isSuccess = false;
        error.printStackTrace();
    } finally {
        if (isSuccess) {
            exportDataEventHandler.handleEvent(new ExportDataFinishOneTableEvent(exportConfig.getDataFilePath(ExportConfig.LOADDB_DATAFILEKEY)));
        } else {
            exportDataEventHandler.handleEvent(new ExportDataFailedOneTableEvent(exportConfig.getDataFilePath(ExportConfig.LOADDB_DATAFILEKEY)));
        }
    }
}
Also used : ExportDataFailedOneTableEvent(com.cubrid.common.ui.cubrid.table.event.ExportDataFailedOneTableEvent) AbsExportDataHandler(com.cubrid.common.ui.cubrid.table.export.handler.AbsExportDataHandler) ExportDataFinishOneTableEvent(com.cubrid.common.ui.cubrid.table.event.ExportDataFinishOneTableEvent) ExportDataBeginOneTableEvent(com.cubrid.common.ui.cubrid.table.event.ExportDataBeginOneTableEvent)

Aggregations

ExportDataBeginOneTableEvent (com.cubrid.common.ui.cubrid.table.event.ExportDataBeginOneTableEvent)2 ExportDataFailedOneTableEvent (com.cubrid.common.ui.cubrid.table.event.ExportDataFailedOneTableEvent)2 ExportDataFinishOneTableEvent (com.cubrid.common.ui.cubrid.table.event.ExportDataFinishOneTableEvent)2 AbsExportDataHandler (com.cubrid.common.ui.cubrid.table.export.handler.AbsExportDataHandler)2