use of com.cubrid.cubridmanager.core.broker.task.GetBrokerStatusInfosTask in project cubrid-manager by CUBRID.
the class BrokerStatusView method initValue.
/**
* Initializes the parameters of this view
*/
public void initValue() {
if (null == getCubridNode() || !CubridNodeType.BROKER.equals(getCubridNode().getType())) {
return;
}
brokerNode = (CubridBroker) getCubridNode();
nodeName = brokerNode.getLabel().trim();
serverName = brokerNode.getServer().getLabel();
port = brokerNode.getServer().getMonPort();
ServerInfo serverInfo = brokerNode.getServer().getServerInfo();
//get basic info
BrokerInfos brokerInfos = new BrokerInfos();
//brokerInfos.setBname(nodeName);
final GetBrokerStatusInfosTask<BrokerInfos> basicTask = new GetBrokerStatusInfosTask<BrokerInfos>(serverInfo, CommonSendMsg.getGetBrokerStatusItems(), brokerInfos);
basicTask.setBrokerName(nodeName);
//get status
BrokerStatusInfos brokerStatusInfos = new BrokerStatusInfos();
final GetBrokerStatusInfosTask<BrokerStatusInfos> statisTask = new GetBrokerStatusInfosTask<BrokerStatusInfos>(serverInfo, CommonSendMsg.getGetBrokerStatusItems(), brokerStatusInfos);
statisTask.setBrokerName(nodeName);
TaskExecutor taskExecutor = new CommonTaskExec(Messages.showBrokerStatusTaskName);
taskExecutor.addTask(basicTask);
taskExecutor.addTask(statisTask);
new ExecTaskWithProgress(taskExecutor).exec();
if (!taskExecutor.isSuccess()) {
return;
}
brokerInfos = basicTask.getResultModel();
if (null != brokerInfos) {
BrokerInfoList list = brokerInfos.getBorkerInfoList();
if (list != null && list.getBrokerInfoList() != null) {
basicInfoLst = list.getBrokerInfoList();
}
}
brokerStatusInfos = statisTask.getResultModel();
if (brokerStatusInfos != null) {
asinfoLst = brokerStatusInfos.getAsinfo();
jobinfoLst = brokerStatusInfos.getJobinfo();
}
}
use of com.cubrid.cubridmanager.core.broker.task.GetBrokerStatusInfosTask in project cubrid-manager by CUBRID.
the class BrokerStatusView method refreshBasicTable.
/**
* refresh the basic info table viewer
*
* @param serverInfo the instance of ServerInfo
*/
private void refreshBasicTable(ServerInfo serverInfo) {
BrokerInfos brokerInfos = new BrokerInfos();
final GetBrokerStatusInfosTask<BrokerInfos> basicTask = new GetBrokerStatusInfosTask<BrokerInfos>(serverInfo, CommonSendMsg.getGetBrokerStatusItems(), brokerInfos);
basicTask.setBrokerName(nodeName);
basicTask.execute();
brokerInfos = basicTask.getResultModel();
if (null != brokerInfos) {
BrokerInfoList list = brokerInfos.getBorkerInfoList();
if (list != null && list.getBrokerInfoList() != null) {
basicInfoLst = list.getBrokerInfoList();
}
}
if (basicTableViewer != null) {
basicTableViewer.setInput(basicInfoLst);
basicTableViewer.refresh();
}
}
Aggregations