Search in sources :

Example 1 with HARoleChangeTask

use of com.cubrid.cubridmanager.core.mondashboard.task.HARoleChangeTask in project cubrid-manager by CUBRID.

the class HARoleChangeAction method run.

/**
	 * HA role change.
	 */
public void run() {
    Object[] obj = this.getSelectedObj();
    if (!isSupported(obj[0])) {
        setEnabled(false);
        return;
    }
    TaskExecutor taskExcutor = new CommonTaskExec(Messages.changeRoleTaskName);
    HostMonitorPart hostPart = (HostMonitorPart) obj[0];
    //deactive data gather first.
    hostPart.stopMonitorGather();
    //role change task execution.
    HARoleChangeTask task = new HARoleChangeTask(((HostNode) hostPart.getModel()).getServerInfo());
    taskExcutor.addTask(task);
    new ExecTaskWithProgress(taskExcutor).exec();
    hostPart.startMonitorGather();
}
Also used : CommonTaskExec(com.cubrid.common.ui.spi.progress.CommonTaskExec) TaskExecutor(com.cubrid.common.ui.spi.progress.TaskExecutor) HARoleChangeTask(com.cubrid.cubridmanager.core.mondashboard.task.HARoleChangeTask) ExecTaskWithProgress(com.cubrid.common.ui.spi.progress.ExecTaskWithProgress) HostMonitorPart(com.cubrid.cubridmanager.ui.mondashboard.editor.parts.HostMonitorPart)

Aggregations

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 HARoleChangeTask (com.cubrid.cubridmanager.core.mondashboard.task.HARoleChangeTask)1 HostMonitorPart (com.cubrid.cubridmanager.ui.mondashboard.editor.parts.HostMonitorPart)1