use of com.cubrid.cubridmanager.ui.spi.model.CubridShardFolder in project cubrid-manager by CUBRID.
the class ShardEnvStatusView method init.
/**
* Initializes this view with the given view site.
*
* @param site
* the view site
* @exception PartInitException
* if this view was not initialized successfully
*/
public void init(IViewSite site) throws PartInitException {
super.init(site);
if (null != cubridNode && CubridNodeType.SHARD_FOLDER.equals(cubridNode.getType())) {
String serverName = cubridNode.getServer().getLabel();
String port = cubridNode.getServer().getMonPort();
// Shard Broker Status - All@{0}-{1}
setPartName(Messages.bind(Messages.envHeadTitel, serverName, port));
CubridShardFolder shardFolderNode = (CubridShardFolder) cubridNode;
if (shardFolderNode != null && shardFolderNode.isRunning()) {
this.setTitleImage(CubridManagerUIPlugin.getImage("icons/navigator/broker_service_started.png"));
runflag = true;
} else {
this.setTitleImage(CubridManagerUIPlugin.getImage("icons/navigator/broker_group.png"));
}
}
}
use of com.cubrid.cubridmanager.ui.spi.model.CubridShardFolder in project cubrid-manager by CUBRID.
the class StopShardEnvAction method isSupportedNode.
/**
* Return whether this action support this object,if not support,this action
* will be disabled
*
* @param obj
* the object
* @return <code>true</code> if supported;<code>false</code>
*/
public static boolean isSupportedNode(Object obj) {
if (obj instanceof CubridShardFolder) {
CubridShardFolder selection = ((CubridShardFolder) obj);
if (!selection.isEnable()) {
return false;
}
ServerUserInfo userInfo = selection.getServer().getServerInfo().getLoginedUserInfo();
if (userInfo == null || CasAuthType.AUTH_ADMIN != userInfo.getCasAuth()) {
return false;
}
return selection.isRunning();
}
return false;
}
use of com.cubrid.cubridmanager.ui.spi.model.CubridShardFolder 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.cubridmanager.ui.spi.model.CubridShardFolder in project cubrid-manager by CUBRID.
the class ShowShardStatusAction method isSupported.
/**
* Return whether this action support this object,if not support,this action
* will be disabled
*
* @param obj
* the object
* @return <code>true</code> if supported;<code>false</code>
*/
public boolean isSupported(Object obj) {
if (obj instanceof CubridShardFolder) {
CubridShardFolder selection = ((CubridShardFolder) obj);
if (!selection.isEnable()) {
return false;
}
ServerUserInfo userInfo = selection.getServer().getServerInfo().getLoginedUserInfo();
if (userInfo == null || (CasAuthType.AUTH_ADMIN != userInfo.getCasAuth() && CasAuthType.AUTH_MONITOR != userInfo.getCasAuth())) {
return false;
}
return true;
}
return false;
}
Aggregations