use of com.cubrid.cubridmanager.ui.spi.model.CubridBrokerFolder in project cubrid-manager by CUBRID.
the class BrokerEnvStatusView 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.BROKER_FOLDER.equals(cubridNode.getType())) {
String serverName = cubridNode.getServer().getLabel();
String port = cubridNode.getServer().getMonPort();
setPartName(Messages.bind(Messages.envHeadTitel, serverName, port));
CubridBrokerFolder brokerFolderNode = (CubridBrokerFolder) cubridNode;
if (brokerFolderNode != null && brokerFolderNode.isRunning()) {
this.setTitleImage(CubridManagerUIPlugin.getImage("icons/navigator/broker_service_started.png"));
} else {
this.setTitleImage(CubridManagerUIPlugin.getImage("icons/navigator/broker_group.png"));
}
runflag = brokerFolderNode == null ? false : brokerFolderNode.isRunning();
}
}
use of com.cubrid.cubridmanager.ui.spi.model.CubridBrokerFolder in project cubrid-manager by CUBRID.
the class StartRetargetAction method run.
/**
* start database or broker
*/
public void run() {
final Object[] obj = this.getSelectedObj();
if (!isSupported(obj[0])) {
return;
}
ICubridNode node = (ICubridNode) obj[0];
if (NodeType.SERVER.equals(node.getType())) {
StartServiceAction startServiceAction = (StartServiceAction) ActionManager.getInstance().getAction(StartServiceAction.ID);
startServiceAction.run();
}
if (node instanceof ISchemaNode) {
StartDatabaseAction startDatabaseAction = (StartDatabaseAction) ActionManager.getInstance().getAction(StartDatabaseAction.ID);
startDatabaseAction.run();
}
if (node instanceof CubridBroker) {
StartBrokerAction startBrokerAction = (StartBrokerAction) ActionManager.getInstance().getAction(StartBrokerAction.ID);
startBrokerAction.run();
}
if (node instanceof CubridBrokerFolder) {
StartBrokerEnvAction startBrokerEnvAction = (StartBrokerEnvAction) ActionManager.getInstance().getAction(StartBrokerEnvAction.ID);
startBrokerEnvAction.run();
}
}
use of com.cubrid.cubridmanager.ui.spi.model.CubridBrokerFolder in project cubrid-manager by CUBRID.
the class StopRetargetAction method run.
/**
* stop database or broker
*/
public void run() {
final Object[] obj = this.getSelectedObj();
if (!isSupported(obj[0])) {
return;
}
ICubridNode node = (ICubridNode) obj[0];
if (NodeType.SERVER.equals(node.getType())) {
StopServiceAction stopServiceAction = (StopServiceAction) ActionManager.getInstance().getAction(StopServiceAction.ID);
stopServiceAction.run();
}
if (node instanceof ISchemaNode) {
StopDatabaseAction stopDatabaseAction = (StopDatabaseAction) ActionManager.getInstance().getAction(StopDatabaseAction.ID);
stopDatabaseAction.run();
}
if (node instanceof CubridBroker) {
StopBrokerAction stopBrokerAction = (StopBrokerAction) ActionManager.getInstance().getAction(StopBrokerAction.ID);
stopBrokerAction.run();
}
if (node instanceof CubridBrokerFolder) {
StopBrokerEnvAction stopBrokerEnvAction = (StopBrokerEnvAction) ActionManager.getInstance().getAction(StopBrokerEnvAction.ID);
stopBrokerEnvAction.run();
}
}
use of com.cubrid.cubridmanager.ui.spi.model.CubridBrokerFolder in project cubrid-manager by CUBRID.
the class BrokerEnvStatusView method nodeChanged.
/**
* Response to cubrid node changes
*
* @param event the event
*/
public void nodeChanged(CubridNodeChangedEvent event) {
ICubridNode eventNode = event.getCubridNode();
if (eventNode == null || this.cubridNode == null) {
return;
}
//if it is not in the same host,return
if (!eventNode.getServer().getId().equals(this.cubridNode.getServer().getId())) {
return;
}
//if changed node is not broker folder or server,return
String type = eventNode.getType();
if (!CubridNodeType.BROKER_FOLDER.equals(type) && !CubridNodeType.SERVER.equals(type)) {
return;
}
synchronized (this) {
if (type == NodeType.SERVER) {
String id = eventNode.getId();
CubridBrokerFolder currentNode = (CubridBrokerFolder) eventNode.getChild(id);
this.cubridNode = currentNode;
} else {
this.cubridNode = eventNode;
}
if (this.cubridNode == null || !((CubridBrokerFolder) eventNode).isRunning()) {
setRunflag(false);
this.setTitleImage(CubridManagerUIPlugin.getImage("icons/navigator/broker_group.png"));
return;
} else {
setRunflag(true);
this.setTitleImage(CubridManagerUIPlugin.getImage("icons/navigator/broker_service_started.png"));
}
refresh(true, false);
}
}
use of com.cubrid.cubridmanager.ui.spi.model.CubridBrokerFolder in project cubrid-manager by CUBRID.
the class RestartBrokerAction method isSupportedNode.
public static boolean isSupportedNode(Object obj) {
if (obj instanceof CubridBroker) {
CubridBroker selection = ((CubridBroker) obj);
if (selection.getServer() == null || selection.getServer().getServerInfo() == null) {
return false;
}
ServerUserInfo userInfo = selection.getServer().getServerInfo().getLoginedUserInfo();
if (userInfo == null || CasAuthType.AUTH_ADMIN != userInfo.getCasAuth()) {
return false;
}
CubridBrokerFolder parent = (CubridBrokerFolder) (selection.getParent());
return parent.isRunning() && selection.isRunning();
}
return false;
}
Aggregations