Search in sources :

Example 6 with GetBrokerStatusInfosTask

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();
    }
}
Also used : CommonTaskExec(com.cubrid.common.ui.spi.progress.CommonTaskExec) TaskExecutor(com.cubrid.common.ui.spi.progress.TaskExecutor) ServerInfo(com.cubrid.cubridmanager.core.common.model.ServerInfo) ApplyServerInfo(com.cubrid.cubridmanager.core.broker.model.ApplyServerInfo) BrokerInfos(com.cubrid.cubridmanager.core.broker.model.BrokerInfos) GetBrokerStatusInfosTask(com.cubrid.cubridmanager.core.broker.task.GetBrokerStatusInfosTask) ExecTaskWithProgress(com.cubrid.common.ui.spi.progress.ExecTaskWithProgress) BrokerInfoList(com.cubrid.cubridmanager.core.broker.model.BrokerInfoList) BrokerStatusInfos(com.cubrid.cubridmanager.core.broker.model.BrokerStatusInfos)

Example 7 with GetBrokerStatusInfosTask

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();
    }
}
Also used : BrokerInfos(com.cubrid.cubridmanager.core.broker.model.BrokerInfos) GetBrokerStatusInfosTask(com.cubrid.cubridmanager.core.broker.task.GetBrokerStatusInfosTask) BrokerInfoList(com.cubrid.cubridmanager.core.broker.model.BrokerInfoList)

Aggregations

GetBrokerStatusInfosTask (com.cubrid.cubridmanager.core.broker.task.GetBrokerStatusInfosTask)7 BrokerInfos (com.cubrid.cubridmanager.core.broker.model.BrokerInfos)5 BrokerStatusInfos (com.cubrid.cubridmanager.core.broker.model.BrokerStatusInfos)5 ApplyServerInfo (com.cubrid.cubridmanager.core.broker.model.ApplyServerInfo)4 BrokerInfoList (com.cubrid.cubridmanager.core.broker.model.BrokerInfoList)4 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)3 BrokerInfo (com.cubrid.cubridmanager.core.broker.model.BrokerInfo)2 CommonTaskExec (com.cubrid.common.ui.spi.progress.CommonTaskExec)1 ExecTaskWithProgress (com.cubrid.common.ui.spi.progress.ExecTaskWithProgress)1 TaskExecutor (com.cubrid.common.ui.spi.progress.TaskExecutor)1 CommonQueryTask (com.cubrid.cubridmanager.core.common.task.CommonQueryTask)1 GetHAConfParameterTask (com.cubrid.cubridmanager.core.common.task.GetHAConfParameterTask)1 BrokerNode (com.cubrid.cubridmanager.core.cubrid.service.model.BrokerNode)1 HaNode (com.cubrid.cubridmanager.core.cubrid.service.model.HaNode)1 NodeType (com.cubrid.cubridmanager.core.cubrid.service.model.NodeType)1 GetHeartbeatNodeInfoTask (com.cubrid.cubridmanager.core.mondashboard.task.GetHeartbeatNodeInfoTask)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1