use of com.cubrid.common.ui.spi.progress.CommonTaskExec in project cubrid-manager by CUBRID.
the class StopShardEnvAction method run.
/**
* Override the run method in order to complete stopping broker environment
*/
public void run() {
final Object[] obj = this.getSelectedObj();
CubridShardFolder selection = (CubridShardFolder) obj[0];
if (null == selection) {
return;
}
if (!CommonUITool.openConfirmBox(CONFIRM_CONTENT)) {
return;
}
ServerInfo serverInfo = selection.getServer().getServerInfo();
StopShardTask task = new StopShardTask(serverInfo, null);
TaskExecutor taskExecutor = new CommonTaskExec(Messages.stopShardEnvActionName);
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());
}
use of com.cubrid.common.ui.spi.progress.CommonTaskExec in project cubrid-manager by CUBRID.
the class AddShardWizard method performFinish.
/**
* Called when user clicks Finish
*
* @return boolean
*/
public boolean performFinish() {
ShardsTaskFactory taskFactory = new ShardsTaskFactory(this.server.getServerInfo(), this.shards);
taskFactory.addUpdateFile(this.shard, null);
CommonTaskExec taskExec = new CommonTaskExec(Messages.msgUploading);
taskExec.setTask(taskFactory.generateTasks());
new ExecTaskWithProgress(taskExec).exec();
if (taskExec.isSuccess()) {
close();
return true;
} else {
CommonUITool.openErrorBox(Messages.errAddShardBroker);
return false;
}
}
use of com.cubrid.common.ui.spi.progress.CommonTaskExec in project cubrid-manager by CUBRID.
the class StopBrokerAction method run.
/**
* Override the run method in order to complete stopping broker environment
*/
public void run() {
if (!CommonUITool.openConfirmBox(CONFIRM_CONTENT)) {
return;
}
final Object[] obj = this.getSelectedObj();
DefaultCubridNode selection = (DefaultCubridNode) obj[0];
ServerInfo serverInfo = selection.getServer().getServerInfo();
StopBrokerTask task = new StopBrokerTask(serverInfo);
task.setBrokerName(selection.getLabel());
final String taskName = Messages.bind(Messages.stopBrokerTaskName, selection.getLabel());
TaskExecutor taskExecutor = new CommonTaskExec(taskName);
taskExecutor.addTask(task);
new ExecTaskWithProgress(taskExecutor).exec();
if (!taskExecutor.isSuccess()) {
return;
}
TreeViewer treeViewer = (TreeViewer) this.getSelectionProvider();
CommonUITool.refreshNavigatorTree(treeViewer, selection.getParent());
ActionManager.getInstance().fireSelectionChanged(getSelection());
}
use of com.cubrid.common.ui.spi.progress.CommonTaskExec in project cubrid-manager by CUBRID.
the class BrokerStatusView method initValue.
/**
* Initializes the parameters of this view
*/
public void initValue() {
if (null == getCubridNode() || !CubridNodeType.BROKER.equals(getCubridNode().getType())) {
return;
}
brokerNode = (CubridBroker) getCubridNode();
nodeName = brokerNode.getLabel().trim();
serverName = brokerNode.getServer().getLabel();
port = brokerNode.getServer().getMonPort();
ServerInfo serverInfo = brokerNode.getServer().getServerInfo();
//get basic info
BrokerInfos brokerInfos = new BrokerInfos();
//brokerInfos.setBname(nodeName);
final GetBrokerStatusInfosTask<BrokerInfos> basicTask = new GetBrokerStatusInfosTask<BrokerInfos>(serverInfo, CommonSendMsg.getGetBrokerStatusItems(), brokerInfos);
basicTask.setBrokerName(nodeName);
//get status
BrokerStatusInfos brokerStatusInfos = new BrokerStatusInfos();
final GetBrokerStatusInfosTask<BrokerStatusInfos> statisTask = new GetBrokerStatusInfosTask<BrokerStatusInfos>(serverInfo, CommonSendMsg.getGetBrokerStatusItems(), brokerStatusInfos);
statisTask.setBrokerName(nodeName);
TaskExecutor taskExecutor = new CommonTaskExec(Messages.showBrokerStatusTaskName);
taskExecutor.addTask(basicTask);
taskExecutor.addTask(statisTask);
new ExecTaskWithProgress(taskExecutor).exec();
if (!taskExecutor.isSuccess()) {
return;
}
brokerInfos = basicTask.getResultModel();
if (null != brokerInfos) {
BrokerInfoList list = brokerInfos.getBorkerInfoList();
if (list != null && list.getBrokerInfoList() != null) {
basicInfoLst = list.getBrokerInfoList();
}
}
brokerStatusInfos = statisTask.getResultModel();
if (brokerStatusInfos != null) {
asinfoLst = brokerStatusInfos.getAsinfo();
jobinfoLst = brokerStatusInfos.getJobinfo();
}
}
use of com.cubrid.common.ui.spi.progress.CommonTaskExec in project cubrid-manager by CUBRID.
the class DatabaseConfigPropertyPage method perform.
/**
* Perform the task and set cubrid.conf file parameter
*
* @param confParaMap the conf parameters map
*/
private void perform(Map<String, Map<String, String>> confParaMap) {
SetCubridConfParameterTask task = new SetCubridConfParameterTask(node.getServer().getServerInfo());
task.setConfParameters(confParaMap);
CommonTaskExec taskExcutor = new CommonTaskExec(Messages.setCubridParameterTaskName);
taskExcutor.addTask(task);
new ExecTaskWithProgress(taskExcutor).exec(true, true);
if (taskExcutor.isSuccess()) {
CommonUITool.openInformationBox(Messages.titleSuccess, Messages.msgChangeServerParaSuccess);
}
}
Aggregations