Search in sources :

Example 1 with DelManagerLogTask

use of com.cubrid.cubridmanager.core.logs.task.DelManagerLogTask in project cubrid-manager by CUBRID.

the class RemoveAllManagerLogAction method run.

/**
	 * Remove all manager logs
	 */
public void run() {
    if (!CommonUITool.openConfirmBox(Messages.warningRemoveManagerLog)) {
        return;
    }
    Object[] selected = this.getSelectedObj();
    String sendStr;
    if (((DefaultCubridNode) selected[0]).getId().indexOf("Access log") >= 0) {
        sendStr = "deleteaccesslog";
    } else {
        sendStr = "deleteerrorlog";
    }
    DelManagerLogTask delAllLogTask = new DelManagerLogTask(((DefaultCubridNode) selected[0]).getServer().getServerInfo(), sendStr);
    TaskExecutor taskExecutor = new CommonTaskExec(Messages.removeLogTaskName);
    taskExecutor.addTask(delAllLogTask);
    new ExecTaskWithProgress(taskExecutor).busyCursorWhile();
    if (taskExecutor.isSuccess()) {
        refreshLogEditor((ICubridNode) selected[0]);
        CommonUITool.openInformationBox(Messages.msgSuccess, Messages.msgDeleteAllLog);
    }
}
Also used : CommonTaskExec(com.cubrid.common.ui.spi.progress.CommonTaskExec) DefaultCubridNode(com.cubrid.common.ui.spi.model.DefaultCubridNode) TaskExecutor(com.cubrid.common.ui.spi.progress.TaskExecutor) ExecTaskWithProgress(com.cubrid.common.ui.spi.progress.ExecTaskWithProgress) DelManagerLogTask(com.cubrid.cubridmanager.core.logs.task.DelManagerLogTask)

Aggregations

DefaultCubridNode (com.cubrid.common.ui.spi.model.DefaultCubridNode)1 CommonTaskExec (com.cubrid.common.ui.spi.progress.CommonTaskExec)1 ExecTaskWithProgress (com.cubrid.common.ui.spi.progress.ExecTaskWithProgress)1 TaskExecutor (com.cubrid.common.ui.spi.progress.TaskExecutor)1 DelManagerLogTask (com.cubrid.cubridmanager.core.logs.task.DelManagerLogTask)1