use of com.cubrid.common.ui.spi.progress.CommonTaskExec 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;
}
}
use of com.cubrid.common.ui.spi.progress.CommonTaskExec in project cubrid-manager by CUBRID.
the class SettingCubridConfPage method loadServerData.
/**
* Load server data
*
* @param haServer
*/
private void loadServerData(HAServer haServer) {
CommonTaskExec taskExcutor = new CommonTaskExec(com.cubrid.cubridmanager.ui.host.Messages.getCubridConfTaskRunning);
GetCubridConfParameterTask getCubridConfParameterTask = new GetCubridConfParameterTask(haServer.getServer().getServerInfo());
taskExcutor.addTask(getCubridConfParameterTask);
new ExecTaskWithProgress(taskExcutor).busyCursorWhile();
if (taskExcutor.isSuccess()) {
Map<String, Map<String, String>> allConfigMap = getCubridConfParameterTask.getConfParameters();
haServer.setOriginCubridParameters(allConfigMap);
haServer.setCubridParameters(getConfigHAWizard().cloneParameters(allConfigMap));
appendDefaultHAConfig(haServer.getCubridParameters());
} else {
CommonUITool.openErrorBox(Messages.errLoadCubridConf);
}
}
use of com.cubrid.common.ui.spi.progress.CommonTaskExec in project cubrid-manager by CUBRID.
the class GenCertDialog method genCertFile.
private void genCertFile() {
GenerateCertificateTask task = new GenerateCertificateTask(serverInfo);
if (!StringUtil.isEmpty(countryText.getText())) {
task.setCName(countryText.getText());
}
if (!StringUtil.isEmpty(stateText.getText())) {
task.setStName(stateText.getText());
}
if (!StringUtil.isEmpty(cityText.getText())) {
task.setLonName(cityText.getText());
}
if (!StringUtil.isEmpty(organizationText.getText())) {
task.setOrgname(organizationText.getText());
}
if (!StringUtil.isEmpty(emailText.getText())) {
task.setEmail(emailText.getText());
}
int index = dateCombo.getSelectionIndex();
task.setDays(validValues[index]);
TaskExecutor taskExecutor = new CommonTaskExec(Messages.msgGenCert);
taskExecutor.addTask(task);
new ExecTaskWithProgress(taskExecutor).exec();
if (task.isSuccess()) {
serverInfo.setCertStatus(CertStatus.CUSTOMIZED);
CommonUITool.openInformationBox(Messages.titleRestartCMS, Messages.msgRestartCMS);
} else {
CommonUITool.openErrorBox(task.getErrorMsg());
}
}
use of com.cubrid.common.ui.spi.progress.CommonTaskExec in project cubrid-manager by CUBRID.
the class ShardsParameterPropertyPage method performOk.
/**
* Save the page content
*
* @return <code>true</code> if it saved successfully;<code>false</code>
* otherwise
*/
public boolean performOk() {
// TODO
shardListGroupPanel.save();
CommonTaskExec taskExec = new CommonTaskExec(Messages.msgOperating);
taskExec.setTask(shardListGroupPanel.generateTasks());
new ExecTaskWithProgress(taskExec).exec();
if (taskExec.isSuccess()) {
CommonUITool.openInformationBox(Messages.titleSuccess, Messages.restartShardBrokerMsg);
return true;
} else {
CommonUITool.openErrorBox(Messages.msgOperationFailed);
return false;
}
}
use of com.cubrid.common.ui.spi.progress.CommonTaskExec in project cubrid-manager by CUBRID.
the class StopShardAction method run.
/**
* Override the run method in order to complete stopping broker environment
*/
public void run() {
final Object[] obj = this.getSelectedObj();
CubridShard selection = (CubridShard) obj[0];
if (null == selection) {
return;
}
if (!CommonUITool.openConfirmBox(CONFIRM_CONTENT)) {
return;
}
ServerInfo serverInfo = selection.getServer().getServerInfo();
StopShardTask task = new StopShardTask(serverInfo, selection.getName());
TaskExecutor taskExecutor = new CommonTaskExec(Messages.stopShardActionName);
taskExecutor.addTask(task);
new ExecTaskWithProgress(taskExecutor).exec();
if (!taskExecutor.isSuccess()) {
return;
}
if (!task.isSuccess()) {
String msg = Messages.bind(Messages.errCanNotStopShardBroker, task.getErrorMsg());
CommonUITool.openErrorBox(msg);
return;
}
selection.setRunning(false);
TreeViewer treeViewer = (TreeViewer) this.getSelectionProvider();
CommonUITool.refreshNavigatorTree(treeViewer, selection);
ActionManager.getInstance().fireSelectionChanged(getSelection());
}
Aggregations