use of com.cubrid.cubridmanager.ui.mondashboard.editor.model.BrokerNode in project cubrid-manager by CUBRID.
the class BrokerDataProvider method getUpdateValue.
/**
*
* Get broker related update value
*
* @return DataChangedEvent
*
*/
public DataChangedEvent getUpdateValue() {
DataChangedEvent dataChangedEvent = new DataChangedEvent(this);
if (!isExecGetBrokerTask) {
setErrorMsg("");
return dataChangedEvent;
}
if (isExecGetBrokerTask) {
BrokerInfos brokerInfos = performGetBrokersInfoTask();
if (serverInfo != null) {
serverInfo.setBrokerInfos(brokerInfos);
}
BrokerStatusInfos brokerStatusInfos = performGetBrokersStatusTask();
if (brokerdiagRequestCount < 2) {
performGetBrokerDiagDataTask(null);
}
for (BrokerNode brokerNode : brokerNodeList) {
String brokerName = brokerNode.getBrokerName();
dataChangedEvent.getBrokerInfosMap().put(brokerName, brokerInfos);
dataChangedEvent.getBrokerStatusInfosMap().put(brokerName, brokerStatusInfos == null ? null : brokerStatusInfos.getSubBrokerByName(brokerName));
if (brokerdiagRequestCount >= 2) {
dataChangedEvent.getBrokerDiagDataMap().put(brokerName, performGetBrokerDiagDataTask(brokerName));
}
}
}
setErrorMsg(errorMsg);
if (errorMsg != null && errorMsg.trim().length() > 0) {
LOGGER.error(errorMsg);
}
return dataChangedEvent;
}
use of com.cubrid.cubridmanager.ui.mondashboard.editor.model.BrokerNode in project cubrid-manager by CUBRID.
the class DataGenerator method removeDataUpdateListener.
/**
*
* remove a instance of DataUpdateListener to make it can be update
*
* @param listener an instance of DataUpdateListener
*/
public void removeDataUpdateListener(DataUpdateListener listener) {
synchronized (listeners) {
listeners.remove(listener);
if (listeners.isEmpty()) {
setRunflag(false);
HostNode hostNode = null;
if (listener.getModel() instanceof HostNode) {
hostNode = (HostNode) listener.getModel();
} else if (listener.getModel() instanceof DatabaseNode) {
hostNode = ((DatabaseNode) listener.getModel()).getParent();
} else if (listener.getModel() instanceof BrokerNode) {
hostNode = ((BrokerNode) listener.getModel()).getParent();
}
if (hostNode != null) {
hostNode.setConnecting(false);
}
getThreadPoolManager().disposeAll();
DataGeneratorPool pool = DataGeneratorPool.getInstance();
pool.removeDataGenerator(getName());
}
}
}
use of com.cubrid.cubridmanager.ui.mondashboard.editor.model.BrokerNode in project cubrid-manager by CUBRID.
the class ShowBrokerClientAction method run.
/**
* Create a new figure in dashboard.
*
* @see org.eclipse.jface.action.Action#run()
*/
public void run() {
IStructuredSelection selection = (IStructuredSelection) getSelection();
BrokerMonitorPart cmp = (BrokerMonitorPart) selection.getFirstElement();
DashboardPart dp = (DashboardPart) cmp.getParent();
Dashboard db = (Dashboard) dp.getModel();
BrokerNode model = (BrokerNode) cmp.getModel();
ClientNode clientNode = db.getClientNodeByBroker(model);
if (this.isChecked()) {
if (null == clientNode) {
clientNode = new ClientNode();
clientNode.setBrokerNode(model);
db.addClientNode(clientNode);
}
clientNode.setVisible(true);
} else {
clientNode.setVisible(false);
}
db.refresh();
}
use of com.cubrid.cubridmanager.ui.mondashboard.editor.model.BrokerNode in project cubrid-manager by CUBRID.
the class ShowBrokerClientAction method isSupported.
/**
* Always support
*
* @see com.cubrid.common.ui.spi.action.ISelectionAction#isSupported(java.lang.Object)
* @param obj Object
* @return boolean support:true;not support:false;
*/
public boolean isSupported(Object obj) {
IStructuredSelection selection = (IStructuredSelection) getSelection();
if (!(selection.getFirstElement() instanceof BrokerMonitorPart)) {
return false;
}
BrokerMonitorPart cmp = (BrokerMonitorPart) selection.getFirstElement();
DashboardPart dp = (DashboardPart) cmp.getParent();
Dashboard db = (Dashboard) dp.getModel();
BrokerNode model = (BrokerNode) cmp.getModel();
ClientNode clientNode = db.getClientNodeByBroker(model);
setChecked(null != clientNode && clientNode.isVisible());
return true;
}
use of com.cubrid.cubridmanager.ui.mondashboard.editor.model.BrokerNode in project cubrid-manager by CUBRID.
the class ShowBrokerDabaseAction method run.
/**
* Create a new figure in dashboard.
*
* @see org.eclipse.jface.action.Action#run()
*/
public void run() {
IStructuredSelection selection = (IStructuredSelection) getSelection();
BrokerMonitorPart cmp = (BrokerMonitorPart) selection.getFirstElement();
DashboardPart dp = (DashboardPart) cmp.getParent();
Dashboard db = (Dashboard) dp.getModel();
BrokerNode model = (BrokerNode) cmp.getModel();
BrokerDBListNode brokerDBListNode = db.getBrokerDBListNodeByBroker(model);
if (isChecked()) {
if (null == brokerDBListNode) {
brokerDBListNode = new BrokerDBListNode();
brokerDBListNode.setBrokerNode(model);
db.addBrokerDBListNode(brokerDBListNode);
}
brokerDBListNode.setVisible(true);
} else {
brokerDBListNode.setVisible(false);
}
db.refresh();
}
Aggregations