Search in sources :

Example 1 with SetHAConfParameterTask

use of com.cubrid.cubridmanager.core.common.task.SetHAConfParameterTask in project cubrid-manager by CUBRID.

the class HAPropertyPage method perform.

/**
	 * 
	 * Perform task and set parameter to cm.conf
	 * 
	 * @param confParaMap the conf parameters map
	 */
private void perform(Map<String, Map<String, String>> confParaMap) {
    CommonTaskExec taskExcutor = new CommonTaskExec(Messages.setHAConfTaskName);
    SetHAConfParameterTask task = new SetHAConfParameterTask(node.getServer().getServerInfo());
    task.setConfParameters(confParaMap);
    taskExcutor.addTask(task);
    new ExecTaskWithProgress(taskExcutor).exec(true, true);
    if (taskExcutor.isSuccess()) {
        CommonUITool.openInformationBox(Messages.titleSuccess, Messages.msgSetHAConfSuccess);
    }
}
Also used : CommonTaskExec(com.cubrid.common.ui.spi.progress.CommonTaskExec) SetHAConfParameterTask(com.cubrid.cubridmanager.core.common.task.SetHAConfParameterTask) ExecTaskWithProgress(com.cubrid.common.ui.spi.progress.ExecTaskWithProgress)

Example 2 with SetHAConfParameterTask

use of com.cubrid.cubridmanager.core.common.task.SetHAConfParameterTask in project cubrid-manager by CUBRID.

the class ConfigHAWizard method performFinish.

public boolean performFinish() {
    ServerInfo masterServerInfo = haModel.getMasterServer().getServer().getServerInfo();
    ServerInfo slaveServerInfo = haModel.getSlaveServer().getServer().getServerInfo();
    Map<String, Map<String, String>> masterParams = haModel.getMasterServer().getCubridParameters();
    Map<String, Map<String, String>> slaveParams = haModel.getSlaveServer().getCubridParameters();
    Map<String, Map<String, String>> masterHaParams = haModel.getMasterServer().getCubridHAParameters();
    Map<String, Map<String, String>> slaveHaParams = haModel.getSlaveServer().getCubridHAParameters();
    setCubridConfParameterTaskMaster = new SetCubridConfParameterTask(masterServerInfo);
    setCubridConfParameterTaskMaster.setConfParameters(masterParams);
    setHAConfParameterTaskMaster = new SetHAConfParameterTask(masterServerInfo);
    setHAConfParameterTaskMaster.setConfParameters(masterHaParams);
    setCubridConfParameterTaskSlave = new SetCubridConfParameterTask(slaveServerInfo);
    setCubridConfParameterTaskSlave.setConfParameters(slaveParams);
    setHAConfParameterTaskSlave = new SetHAConfParameterTask(slaveServerInfo);
    setHAConfParameterTaskSlave.setConfParameters(slaveHaParams);
    CommonTaskExec taskExec = new CommonTaskExec(Messages.msgUploading);
    taskExec.addTask(setCubridConfParameterTaskMaster);
    taskExec.addTask(setCubridConfParameterTaskSlave);
    taskExec.addTask(setHAConfParameterTaskMaster);
    taskExec.addTask(setHAConfParameterTaskSlave);
    new ExecTaskWithProgress(taskExec).exec();
    if (taskExec.isSuccess()) {
        StartHAServiceDialog dialog = new StartHAServiceDialog(getShell(), haModel);
        dialog.open();
        return true;
    } else {
        CommonUITool.openErrorBox(getErrMsg());
        return false;
    }
}
Also used : CommonTaskExec(com.cubrid.common.ui.spi.progress.CommonTaskExec) SetHAConfParameterTask(com.cubrid.cubridmanager.core.common.task.SetHAConfParameterTask) ServerInfo(com.cubrid.cubridmanager.core.common.model.ServerInfo) SetCubridConfParameterTask(com.cubrid.cubridmanager.core.common.task.SetCubridConfParameterTask) ExecTaskWithProgress(com.cubrid.common.ui.spi.progress.ExecTaskWithProgress) Map(java.util.Map) HashMap(java.util.HashMap)

Example 3 with SetHAConfParameterTask

use of com.cubrid.cubridmanager.core.common.task.SetHAConfParameterTask in project cubrid-manager by CUBRID.

the class ConfigParaHelp method performImportHAConf.

/**
	 * Perform the import task for ha.conf
	 * 
	 * @param serverInfo the CubridServer
	 * @param confParamList the List<String>
	 */
public static void performImportHAConf(ServerInfo serverInfo, List<String> confParamList) {
    CommonTaskExec taskExcutor = new CommonTaskExec(Messages.setHAConfTaskName);
    SetHAConfParameterTask task = new SetHAConfParameterTask(serverInfo);
    task.setConfContents(confParamList);
    taskExcutor.addTask(task);
    new ExecTaskWithProgress(taskExcutor).busyCursorWhile();
    if (taskExcutor.isSuccess()) {
        CommonUITool.openInformationBox(Messages.titleSuccess, Messages.msgSetHAConfSuccess);
    }
}
Also used : CommonTaskExec(com.cubrid.common.ui.spi.progress.CommonTaskExec) SetHAConfParameterTask(com.cubrid.cubridmanager.core.common.task.SetHAConfParameterTask) ExecTaskWithProgress(com.cubrid.common.ui.spi.progress.ExecTaskWithProgress)

Aggregations

CommonTaskExec (com.cubrid.common.ui.spi.progress.CommonTaskExec)3 ExecTaskWithProgress (com.cubrid.common.ui.spi.progress.ExecTaskWithProgress)3 SetHAConfParameterTask (com.cubrid.cubridmanager.core.common.task.SetHAConfParameterTask)3 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)1 SetCubridConfParameterTask (com.cubrid.cubridmanager.core.common.task.SetCubridConfParameterTask)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1