Search in sources :

Example 1 with ExportMonitor

use of com.cubrid.common.ui.cubrid.table.dialog.exp.ExportMonitor in project cubrid-manager by CUBRID.

the class TableContentProvider method updateOneTableData.

/**
	 * when one file begin, update table
	 * 
	 * @param evt BeginOneFileEvent
	 */
private void updateOneTableData(ExportDataBeginOneTableEvent evt) {
    if (stop) {
        return;
    }
    String tableName = evt.getTableName();
    for (int i = 0; i < tableList.size(); i++) {
        ExportMonitor po = tableList.get(i);
        if (po.getTableName().equals(tableName)) {
            po.setBeginTime(evt.getEventTime());
            po.setStatus(ExportMonitor.STATUS_RUNNING);
            tvProgress.refresh(tableList);
            break;
        }
    }
}
Also used : ExportMonitor(com.cubrid.common.ui.cubrid.table.dialog.exp.ExportMonitor)

Example 2 with ExportMonitor

use of com.cubrid.common.ui.cubrid.table.dialog.exp.ExportMonitor in project cubrid-manager by CUBRID.

the class TableContentProvider method initTableView.

/**
	 * intiTableView
	 */
private void initTableView() {
    if (exportConfig.getExportType() == ExportConfig.EXPORT_TO_FILE) {
        if (exportConfig.isExportSchema()) {
            ExportMonitor po = new ExportMonitor(ExportConfig.TASK_NAME_SCHEMA);
            po.setTotalCount(1);
            tableList.add(po);
            if (exportConfig.isExportIndex()) {
                ExportMonitor indexPo = new ExportMonitor(ExportConfig.TASK_NAME_INDEX);
                indexPo.setTotalCount(1);
                tableList.add(indexPo);
            }
            if (exportConfig.isExportSerial()) {
                ExportMonitor serialPo = new ExportMonitor(ExportConfig.TASK_NAME_SERIAL);
                serialPo.setTotalCount(1);
                tableList.add(serialPo);
            }
            if (exportConfig.isExportView()) {
                ExportMonitor viewPo = new ExportMonitor(ExportConfig.TASK_NAME_VIEW);
                viewPo.setTotalCount(1);
                tableList.add(viewPo);
            }
        }
        if (exportConfig.isExportData()) {
            for (String table : exportConfig.getTableNameList()) {
                ExportMonitor po = new ExportMonitor(table);
                po.setTotalCount(exportConfig.getTotalCount(table));
                tableList.add(po);
            }
            for (String sqlName : exportConfig.getSQLNameList()) {
                ExportMonitor po = new ExportMonitor(sqlName);
                po.setTotalCount(exportConfig.getTotalCount(sqlName));
                tableList.add(po);
            }
        }
    }
    //		
    //		else if (exportConfig.getExportType() == IExportConfig.EXPORT_TO_LOADDB) {
    //			if (exportConfig.isExportIndex()) {
    //				ExportMonitor indexPo = new ExportMonitor(
    //						exportConfig.getDataFilePath(IExportConfig.LOADDB_INDEXFILEKEY));
    //				indexPo.setTotalCount(1);
    //				tableList.add(indexPo);
    //			}
    //			if (exportConfig.isExportSchema()) {
    //				ExportMonitor schemaPo = new ExportMonitor(
    //						exportConfig.getDataFilePath(IExportConfig.LOADDB_SCHEMAFILEKEY));
    //				schemaPo.setTotalCount(1);
    //				tableList.add(schemaPo);
    //			}
    //
    //			if (exportConfig.isExportData()) {
    //				ExportMonitor po = new ExportMonitor(
    //						exportConfig.getDataFilePath(IExportConfig.LOADDB_DATAFILEKEY));
    //				po.setTotalCount(exportConfig.getTotalCount(IExportConfig.LOADDB_DATAFILEKEY));
    //				tableList.add(po);
    //			}
    //		}
    tvProgress.setInput(tableList);
}
Also used : ExportMonitor(com.cubrid.common.ui.cubrid.table.dialog.exp.ExportMonitor)

Example 3 with ExportMonitor

use of com.cubrid.common.ui.cubrid.table.dialog.exp.ExportMonitor in project cubrid-manager by CUBRID.

the class ExportDataViewPart method initTableView.

/**
	 * intiTableView
	 */
private void initTableView() {
    if (exportConfig.getExportType() == ExportConfig.EXPORT_TO_FILE) {
        if (exportConfig.isExportSchema()) {
            ExportMonitor po = new ExportMonitor(ExportConfig.TASK_NAME_SCHEMA);
            po.setTotalCount(1);
            monitorList.add(po);
            if (exportConfig.isExportIndex()) {
                ExportMonitor indexPo = new ExportMonitor(ExportConfig.TASK_NAME_INDEX);
                indexPo.setTotalCount(1);
                monitorList.add(indexPo);
            }
            if (exportConfig.isExportSerial()) {
                ExportMonitor serialPo = new ExportMonitor(ExportConfig.TASK_NAME_SERIAL);
                serialPo.setTotalCount(1);
                monitorList.add(serialPo);
            }
            if (exportConfig.isExportView()) {
                ExportMonitor viewPo = new ExportMonitor(ExportConfig.TASK_NAME_VIEW);
                viewPo.setTotalCount(1);
                monitorList.add(viewPo);
            }
        }
        if (exportConfig.isExportData()) {
            for (String table : exportConfig.getTableNameList()) {
                ExportMonitor po = new ExportMonitor(table);
                po.setTotalCount(exportConfig.getTotalCount(table));
                monitorList.add(po);
            }
            for (String sqlName : exportConfig.getSQLNameList()) {
                ExportMonitor po = new ExportMonitor(sqlName);
                po.setTotalCount(exportConfig.getTotalCount(sqlName));
                monitorList.add(po);
            }
        }
    } else if (exportConfig.getExportType() == ExportConfig.EXPORT_TO_LOADDB) {
        if (exportConfig.isExportIndex()) {
            ExportMonitor indexPo = new ExportMonitor(exportConfig.getDataFilePath(ExportConfig.LOADDB_INDEXFILEKEY));
            indexPo.setTotalCount(1);
            monitorList.add(indexPo);
        }
        if (exportConfig.isExportSchema()) {
            ExportMonitor schemaPo = new ExportMonitor(exportConfig.getDataFilePath(ExportConfig.LOADDB_SCHEMAFILEKEY));
            schemaPo.setTotalCount(1);
            monitorList.add(schemaPo);
        }
        if (exportConfig.isExportData()) {
            ExportMonitor po = new ExportMonitor(exportConfig.getDataFilePath(ExportConfig.LOADDB_DATAFILEKEY));
            po.setTotalCount(exportConfig.getTotalCount(ExportConfig.LOADDB_DATAFILEKEY));
            monitorList.add(po);
        }
    }
    tvProgress.setInput(monitorList);
}
Also used : ExportMonitor(com.cubrid.common.ui.cubrid.table.dialog.exp.ExportMonitor)

Example 4 with ExportMonitor

use of com.cubrid.common.ui.cubrid.table.dialog.exp.ExportMonitor in project cubrid-manager by CUBRID.

the class ExportDataViewPart method updateOneTableData.

/**
	 * when one file finish ,update table
	 * 
	 * @param evt FinishOneFileEvent
	 */
private void updateOneTableData(ExportDataFinishOneTableEvent evt) {
    if (stop) {
        return;
    }
    String tableName = evt.getTableName();
    for (int i = 0; i < monitorList.size(); i++) {
        ExportMonitor po = monitorList.get(i);
        if (po.getTableName().equals(tableName)) {
            po.setStatus(ExportMonitor.STATUS_FINISHED);
            po.setElapsedTime(evt.getEventTime() - po.getBeginTime());
            tvProgress.refresh(monitorList);
            break;
        }
    }
}
Also used : ExportMonitor(com.cubrid.common.ui.cubrid.table.dialog.exp.ExportMonitor)

Example 5 with ExportMonitor

use of com.cubrid.common.ui.cubrid.table.dialog.exp.ExportMonitor in project cubrid-manager by CUBRID.

the class ExportDataViewPart method updateOneTableData.

/**
	 * when one file begin, update table
	 * 
	 * @param evt BeginOneFileEvent
	 */
private void updateOneTableData(ExportDataFailedOneTableEvent evt) {
    if (stop) {
        return;
    }
    String tableName = evt.getTableName();
    for (int i = 0; i < monitorList.size(); i++) {
        ExportMonitor po = monitorList.get(i);
        if (po.getTableName().equals(tableName)) {
            po.setBeginTime(evt.getEventTime());
            po.setStatus(ExportMonitor.STATUS_FAILED);
            tvProgress.refresh(monitorList);
            break;
        }
    }
}
Also used : ExportMonitor(com.cubrid.common.ui.cubrid.table.dialog.exp.ExportMonitor)

Aggregations

ExportMonitor (com.cubrid.common.ui.cubrid.table.dialog.exp.ExportMonitor)12 ExportDataSuccessEvent (com.cubrid.common.ui.cubrid.table.event.ExportDataSuccessEvent)2