use of com.cubrid.cubridmanager.ui.spi.model.CubridBroker in project cubrid-manager by CUBRID.
the class StartBrokerAction method isSupportedNode.
/**
* Return whether this action support this object,if not support,this action
* will be disabled
*
* @see com.cubrid.common.ui.spi.action.ISelectionAction#isSupported(java
* .lang.Object)
* @param obj the object
* @return <code>true</code> if supported;<code>false</code>
*/
public static boolean isSupportedNode(Object obj) {
if (obj instanceof CubridBroker) {
CubridBroker selection = ((CubridBroker) obj);
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;
}
use of com.cubrid.cubridmanager.ui.spi.model.CubridBroker in project cubrid-manager by CUBRID.
the class BrokerStatusView method nodeChanged.
/**
* Response to node changes
*
* @param event the node changed event
*/
public void nodeChanged(CubridNodeChangedEvent event) {
ICubridNode eventNode = event.getCubridNode();
if (eventNode == null || brokerNode == null) {
return;
}
//if it is not in the same host,return
if (!eventNode.getServer().getId().equals(brokerNode.getServer().getId())) {
return;
}
String type = eventNode.getType();
if (!CubridNodeType.BROKER_FOLDER.equals(type)) {
return;
}
synchronized (this) {
String id = brokerNode.getId();
CubridBroker currentNode = (CubridBroker) eventNode.getChild(id);
this.brokerNode = currentNode;
if (currentNode == null || !currentNode.isRunning()) {
setRunflag(false);
this.setTitleImage(CubridManagerUIPlugin.getImage("icons/navigator/broker.png"));
if (asTableViewer != null && asTableViewer.getTable() != null && !asTableViewer.getTable().isDisposed()) {
asTableViewer.getTable().removeAll();
}
if (jqTableViewer != null && jqTableViewer.getTable() != null && !jqTableViewer.getTable().isDisposed()) {
jqTableViewer.getTable().removeAll();
}
} else {
setRunflag(true);
this.setTitleImage(CubridManagerUIPlugin.getImage("icons/navigator/broker_started.png"));
refresh(true, false);
}
}
}
Aggregations