Search in sources :

Example 6 with ExportMonitor

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

the class TableContentProvider method processStop.

/**
	 * process stop logic
	 */
public void processStop() {
    if (manager != null) {
        if (!btnStop.isDisposed()) {
            btnStop.setEnabled(false);
            progressIndicator.done();
            for (ExportMonitor po : tableList) {
                if (po.getStatus() == ExportMonitor.STATUS_RUNNING) {
                    po.setStatus(ExportMonitor.STATUS_STOPED);
                }
            }
            tvProgress.refresh(tableList);
        }
        stop = true;
        manager.stopProcess();
    }
}
Also used : ExportMonitor(com.cubrid.common.ui.cubrid.table.dialog.exp.ExportMonitor)

Example 7 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 finish ,update table
	 * 
	 * @param evt FinishOneFileEvent
	 */
private void updateOneTableData(ExportDataFinishOneTableEvent 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.setStatus(ExportMonitor.STATUS_FINISHED);
            po.setElapsedTime(evt.getEventTime() - po.getBeginTime());
            tvProgress.refresh(tableList);
            break;
        }
    }
}
Also used : ExportMonitor(com.cubrid.common.ui.cubrid.table.dialog.exp.ExportMonitor)

Example 8 with ExportMonitor

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

the class TableContentProvider method updateTableData.

private void updateTableData(ExportDataEvent evt) {
    if (stop) {
        return;
    }
    String tableName = "";
    int successCount = 1;
    if (evt instanceof ExportDataSuccessEvent) {
        ExportDataSuccessEvent event = (ExportDataSuccessEvent) evt;
        tableName = event.getTableName();
        successCount = event.getSuccessCount();
    }
    for (ExportMonitor po : tableList) {
        if (po.getTableName().equals(tableName)) {
            long oldParseCount = po.getParseCount();
            po.setElapsedTime(evt.getEventTime() - po.getBeginTime());
            po.setParseCount(oldParseCount + successCount);
            po.setStatus(ExportMonitor.STATUS_RUNNING);
            tvProgress.refresh(tableList);
            break;
        }
    }
}
Also used : ExportMonitor(com.cubrid.common.ui.cubrid.table.dialog.exp.ExportMonitor) ExportDataSuccessEvent(com.cubrid.common.ui.cubrid.table.event.ExportDataSuccessEvent)

Example 9 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(ExportDataFailedOneTableEvent 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_FAILED);
            tvProgress.refresh(tableList);
            break;
        }
    }
}
Also used : ExportMonitor(com.cubrid.common.ui.cubrid.table.dialog.exp.ExportMonitor)

Example 10 with ExportMonitor

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

the class ExportDataViewPart method processStop.

/**
	 * process stop logic
	 */
public void processStop() {
    if (manager != null) {
        if (!btnStop.isDisposed()) {
            btnStop.setEnabled(false);
            progressIndicator.done();
            for (ExportMonitor po : monitorList) {
                if (po.getStatus() == ExportMonitor.STATUS_RUNNING) {
                    po.setStatus(ExportMonitor.STATUS_STOPED);
                }
            }
            tvProgress.refresh(monitorList);
        }
        stop = true;
        manager.stopProcess();
    }
    setHistroyWidgetStatus(true);
}
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