Search in sources :

Example 1 with StopShardTask

use of com.cubrid.cubridmanager.core.shard.task.StopShardTask 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());
}
Also used : CommonTaskExec(com.cubrid.common.ui.spi.progress.CommonTaskExec) TaskExecutor(com.cubrid.common.ui.spi.progress.TaskExecutor) ServerInfo(com.cubrid.cubridmanager.core.common.model.ServerInfo) TreeViewer(org.eclipse.jface.viewers.TreeViewer) CubridShard(com.cubrid.cubridmanager.ui.spi.model.CubridShard) ExecTaskWithProgress(com.cubrid.common.ui.spi.progress.ExecTaskWithProgress) StopShardTask(com.cubrid.cubridmanager.core.shard.task.StopShardTask)

Example 2 with StopShardTask

use of com.cubrid.cubridmanager.core.shard.task.StopShardTask 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());
}
Also used : CommonTaskExec(com.cubrid.common.ui.spi.progress.CommonTaskExec) TaskExecutor(com.cubrid.common.ui.spi.progress.TaskExecutor) ServerInfo(com.cubrid.cubridmanager.core.common.model.ServerInfo) TreeViewer(org.eclipse.jface.viewers.TreeViewer) ExecTaskWithProgress(com.cubrid.common.ui.spi.progress.ExecTaskWithProgress) CubridShardFolder(com.cubrid.cubridmanager.ui.spi.model.CubridShardFolder) StopShardTask(com.cubrid.cubridmanager.core.shard.task.StopShardTask)

Aggregations

CommonTaskExec (com.cubrid.common.ui.spi.progress.CommonTaskExec)2 ExecTaskWithProgress (com.cubrid.common.ui.spi.progress.ExecTaskWithProgress)2 TaskExecutor (com.cubrid.common.ui.spi.progress.TaskExecutor)2 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)2 StopShardTask (com.cubrid.cubridmanager.core.shard.task.StopShardTask)2 TreeViewer (org.eclipse.jface.viewers.TreeViewer)2 CubridShard (com.cubrid.cubridmanager.ui.spi.model.CubridShard)1 CubridShardFolder (com.cubrid.cubridmanager.ui.spi.model.CubridShardFolder)1