Search in sources :

Example 1 with ResetLogTask

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

the class ResetAdminLogAction method run.

/**
	 * Reset Admin log
	 */
public void run() {
    if (!CommonUITool.openConfirmBox(Messages.warningResetAdminLog)) {
        return;
    }
    Object[] selected = this.getSelectedObj();
    LogInfo logInfo = (LogInfo) ((DefaultCubridNode) selected[0]).getAdapter(LogInfo.class);
    ResetLogTask resetLogTask = new ResetLogTask(((DefaultCubridNode) selected[0]).getServer().getServerInfo());
    resetLogTask.setPath(logInfo.getPath());
    TaskExecutor taskExecutor = new CommonTaskExec(Messages.resetAdminLogTaskName);
    taskExecutor.addTask(resetLogTask);
    new ExecTaskWithProgress(taskExecutor).exec();
    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) LogInfo(com.cubrid.cubridmanager.core.logs.model.LogInfo) ResetLogTask(com.cubrid.cubridmanager.core.logs.task.ResetLogTask) ExecTaskWithProgress(com.cubrid.common.ui.spi.progress.ExecTaskWithProgress)

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 LogInfo (com.cubrid.cubridmanager.core.logs.model.LogInfo)1 ResetLogTask (com.cubrid.cubridmanager.core.logs.task.ResetLogTask)1