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();
}
Aggregations