Search in sources :

Example 1 with DataProvider

use of com.cubrid.cubridmanager.ui.mondashboard.editor.dispatcher.DataProvider in project cubrid-manager by CUBRID.

the class BrokerMonitorPartHelper method activate.

/**
	 * Generate the DataUpdateListener
	 */
public void activate() {
    if (brokerNode == null) {
        return;
    }
    HostNode hostNode = brokerNode.getParent();
    String generatorName = hostNode.getUserName() + "@" + hostNode.getIp() + ":" + hostNode.getPort();
    generator = DataGeneratorPool.getInstance().getDataGenerator(generatorName, new DataProvider());
    generator.addDataUpdateListener(this);
}
Also used : DataProvider(com.cubrid.cubridmanager.ui.mondashboard.editor.dispatcher.DataProvider) HostNode(com.cubrid.cubridmanager.ui.mondashboard.editor.model.HostNode)

Example 2 with DataProvider

use of com.cubrid.cubridmanager.ui.mondashboard.editor.dispatcher.DataProvider in project cubrid-manager by CUBRID.

the class DatabaseMonitorPartHelper method activate.

/**
	 * Generate the DataUpdateListener
	 */
public void activate() {
    if (dbNode == null) {
        return;
    }
    HostNode hostNode = dbNode.getParent();
    String generatorName = hostNode.getUserName() + "@" + hostNode.getIp() + ":" + hostNode.getPort();
    generator = DataGeneratorPool.getInstance().getDataGenerator(generatorName, new DataProvider());
    generator.addDataUpdateListener(this);
}
Also used : DataProvider(com.cubrid.cubridmanager.ui.mondashboard.editor.dispatcher.DataProvider) HostNode(com.cubrid.cubridmanager.ui.mondashboard.editor.model.HostNode)

Example 3 with DataProvider

use of com.cubrid.cubridmanager.ui.mondashboard.editor.dispatcher.DataProvider in project cubrid-manager by CUBRID.

the class HostDashboardViewPart method init.

/**
	 * Initializes
	 *
	 * @param hostNode The HostNode
	 */
public void init(HostNode hostNode) {
    this.hostNode = hostNode;
    String partName = getPartName();
    String postfix = " - " + hostNode.getIp() + ":" + hostNode.getPort();
    if (!partName.endsWith(postfix)) {
        setPartName(partName + postfix);
    }
    ServerInfo serverInfo = hostNode.getServerInfo();
    ServerType serverType = null;
    if (serverInfo != null) {
        serverType = serverInfo.getServerType();
    }
    if (serverType != ServerType.DATABASE && brokerChartPart == null) {
        loadBrokerChart(chartComp);
        chartComp.layout();
        composite.layout();
    }
    if (serverInfo != null) {
        String hostAddress = serverInfo.getHostAddress();
        int monPort = serverInfo.getHostMonPort();
        historyFileName = HistoryComposite.HOSTDASHBOARD_HISTORY_FILE_PREFIX + hostAddress + "_" + monPort + HistoryComposite.HISTORY_SUFFIX;
        IPath histPath = CubridManagerCorePlugin.getDefault().getStateLocation();
        historyPath = histPath.toOSString() + File.separator + historyFileName;
        historyFileHelp = new HistoryFileHelp();
        historyFileHelp.setHistoryPath(historyPath);
        isNewBrokerDiag = CompatibleUtil.isNewBrokerDiag(serverInfo);
    }
    List<String> typeLst = new ArrayList<String>();
    for (HostStatEnum hostEnum : HostStatEnum.values()) {
        typeLst.add(hostEnum.getName());
    }
    for (BrokerDiagEnum brokerEnum : BrokerDiagEnum.values()) {
        typeLst.add(brokerEnum.getName());
    }
    typeNames = typeLst.toArray(new String[typeLst.size()]);
    DataGeneratorPool pool = DataGeneratorPool.getInstance();
    String generatorName = hostNode.getUserName() + "@" + hostNode.getIp() + ":" + hostNode.getPort();
    generator = pool.getDataGenerator(generatorName, new DataProvider());
    generator.addDataUpdateListener(this);
}
Also used : DataProvider(com.cubrid.cubridmanager.ui.mondashboard.editor.dispatcher.DataProvider) ServerType(com.cubrid.cubridmanager.core.common.model.ServerType) HostStatEnum(com.cubrid.cubridmanager.core.monitoring.model.HostStatEnum) IPath(org.eclipse.core.runtime.IPath) ServerInfo(com.cubrid.cubridmanager.core.common.model.ServerInfo) ArrayList(java.util.ArrayList) DataGeneratorPool(com.cubrid.cubridmanager.ui.mondashboard.editor.dispatcher.DataGeneratorPool) BrokerDiagEnum(com.cubrid.cubridmanager.core.monitoring.model.BrokerDiagEnum)

Example 4 with DataProvider

use of com.cubrid.cubridmanager.ui.mondashboard.editor.dispatcher.DataProvider in project cubrid-manager by CUBRID.

the class BrokerDashboardViewPart method init.

/**
	 * Initializes the parameters of this view
	 * 
	 * @param brokerNode the instance of BrokerNode
	 */
public void init(BrokerNode brokerNode) {
    this.brokerNode = brokerNode;
    String nodeName = brokerNode.getBrokerName();
    String partName = getPartName();
    HostNode hn = brokerNode.getParent();
    String postfix = " - " + nodeName + "@" + hn.getIp() + ":" + hn.getPort();
    if (!partName.endsWith(postfix)) {
        setPartName(partName + postfix);
    }
    serverInfo = hn.getServerInfo();
    String generatorName = hn.getUserName() + "@" + hn.getIp() + ":" + hn.getPort();
    generator = DataGeneratorPool.getInstance().getDataGenerator(generatorName, new DataProvider());
    generator.addDataUpdateListener(this);
}
Also used : DataProvider(com.cubrid.cubridmanager.ui.mondashboard.editor.dispatcher.DataProvider) HostNode(com.cubrid.cubridmanager.ui.mondashboard.editor.model.HostNode)

Example 5 with DataProvider

use of com.cubrid.cubridmanager.ui.mondashboard.editor.dispatcher.DataProvider in project cubrid-manager by CUBRID.

the class DatabaseDashboardViewPart method init.

/**
	 * Initializes
	 *
	 * @param dbNode The DatabaseNode
	 */
public void init(DatabaseNode dbNode) {
    this.dbNode = dbNode;
    HostNode hostNode = dbNode.getParent();
    String partName = getPartName();
    String suffix = " - " + dbNode.getDbName() + "@" + hostNode.getIp() + ":" + hostNode.getPort();
    if (!partName.endsWith(suffix)) {
        setPartName(partName + suffix);
    }
    ServerInfo serverInfo = hostNode.getServerInfo();
    if (serverInfo != null) {
        String hostAddress = serverInfo.getHostAddress();
        int monPort = serverInfo.getHostMonPort();
        historyFileName = HistoryComposite.DBDASHBOARD_HISTORY_FILE_PREFIX + dbNode.getDbName() + "@" + hostAddress + "_" + monPort + HistoryComposite.HISTORY_SUFFIX;
        IPath histPath = CubridManagerCorePlugin.getDefault().getStateLocation();
        historyPath = histPath.toOSString() + File.separator + historyFileName;
        historyFileHelp = new HistoryFileHelp();
        historyFileHelp.setHistoryPath(historyPath);
    }
    List<String> typeLst = new ArrayList<String>();
    for (DbProcStatEnum dbProcEnum : DbProcStatEnum.values()) {
        typeLst.add(dbProcEnum.getName());
    }
    for (StandbyServerStatEnum standbyEnum : StandbyServerStatEnum.values()) {
        typeLst.add(standbyEnum.getName());
    }
    for (DbStatDumpEnum dbDumpEnum : DbStatDumpEnum.values()) {
        typeLst.add(dbDumpEnum.getName());
    }
    typeNames = typeLst.toArray(new String[typeLst.size()]);
    DataGeneratorPool pool = DataGeneratorPool.getInstance();
    String generatorName = hostNode.getUserName() + "@" + hostNode.getIp() + ":" + hostNode.getPort();
    generator = pool.getDataGenerator(generatorName, new DataProvider());
    generator.addDataUpdateListener(this);
}
Also used : IPath(org.eclipse.core.runtime.IPath) ServerInfo(com.cubrid.cubridmanager.core.common.model.ServerInfo) StandbyServerStatEnum(com.cubrid.cubridmanager.core.monitoring.model.StandbyServerStatEnum) HostNode(com.cubrid.cubridmanager.ui.mondashboard.editor.model.HostNode) ArrayList(java.util.ArrayList) DataProvider(com.cubrid.cubridmanager.ui.mondashboard.editor.dispatcher.DataProvider) DbStatDumpEnum(com.cubrid.cubridmanager.core.monitoring.model.DbStatDumpEnum) DbProcStatEnum(com.cubrid.cubridmanager.core.monitoring.model.DbProcStatEnum) DataGeneratorPool(com.cubrid.cubridmanager.ui.mondashboard.editor.dispatcher.DataGeneratorPool)

Aggregations

DataProvider (com.cubrid.cubridmanager.ui.mondashboard.editor.dispatcher.DataProvider)7 HostNode (com.cubrid.cubridmanager.ui.mondashboard.editor.model.HostNode)4 DataGeneratorPool (com.cubrid.cubridmanager.ui.mondashboard.editor.dispatcher.DataGeneratorPool)3 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)2 ArrayList (java.util.ArrayList)2 IPath (org.eclipse.core.runtime.IPath)2 ServerType (com.cubrid.cubridmanager.core.common.model.ServerType)1 HAHostStatusInfo (com.cubrid.cubridmanager.core.mondashboard.model.HAHostStatusInfo)1 BrokerDiagEnum (com.cubrid.cubridmanager.core.monitoring.model.BrokerDiagEnum)1 DbProcStatEnum (com.cubrid.cubridmanager.core.monitoring.model.DbProcStatEnum)1 DbStatDumpEnum (com.cubrid.cubridmanager.core.monitoring.model.DbStatDumpEnum)1 HostStatEnum (com.cubrid.cubridmanager.core.monitoring.model.HostStatEnum)1 IDiagPara (com.cubrid.cubridmanager.core.monitoring.model.IDiagPara)1 StandbyServerStatEnum (com.cubrid.cubridmanager.core.monitoring.model.StandbyServerStatEnum)1 MondashDataResult (com.cubrid.cubridmanager.ui.mondashboard.editor.dispatcher.MondashDataResult)1