Search in sources :

Example 1 with HostStatEnum

use of com.cubrid.cubridmanager.core.monitoring.model.HostStatEnum in project cubrid-manager by CUBRID.

the class HostSystemMonitorViewPart method init.

/**
	 * @param site IViewSite the view site
	 * @throws PartInitException if this view was not initialized successfully
	 * @see com.cubrid.common.ui.spi.part.CubridViewPart#init(org.eclipse.ui.IViewSite)
	 */
public void init(IViewSite site) throws PartInitException {
    super.init(site);
    hostStatDataProxy = new HostStatDataProxy();
    serverInfo = cubridNode.getServer().getServerInfo();
    if (serverInfo != null) {
        String hostAddress = serverInfo.getHostAddress();
        int monPort = serverInfo.getHostMonPort();
        historyFileName = HistoryComposite.HOST_SYSMON_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);
        List<String> typeLst = new ArrayList<String>();
        for (HostStatEnum hostEnum : HostStatEnum.values()) {
            typeLst.add(hostEnum.getName());
        }
        typeNames = typeLst.toArray(new String[typeLst.size()]);
    }
}
Also used : HostStatEnum(com.cubrid.cubridmanager.core.monitoring.model.HostStatEnum) IPath(org.eclipse.core.runtime.IPath) ArrayList(java.util.ArrayList) HostStatDataProxy(com.cubrid.cubridmanager.core.monitoring.model.HostStatDataProxy) HistoryFileHelp(com.cubrid.cubridmanager.ui.mondashboard.editor.HistoryFileHelp)

Example 2 with HostStatEnum

use of com.cubrid.cubridmanager.core.monitoring.model.HostStatEnum 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)

Aggregations

HostStatEnum (com.cubrid.cubridmanager.core.monitoring.model.HostStatEnum)2 ArrayList (java.util.ArrayList)2 IPath (org.eclipse.core.runtime.IPath)2 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)1 ServerType (com.cubrid.cubridmanager.core.common.model.ServerType)1 BrokerDiagEnum (com.cubrid.cubridmanager.core.monitoring.model.BrokerDiagEnum)1 HostStatDataProxy (com.cubrid.cubridmanager.core.monitoring.model.HostStatDataProxy)1 HistoryFileHelp (com.cubrid.cubridmanager.ui.mondashboard.editor.HistoryFileHelp)1 DataGeneratorPool (com.cubrid.cubridmanager.ui.mondashboard.editor.dispatcher.DataGeneratorPool)1 DataProvider (com.cubrid.cubridmanager.ui.mondashboard.editor.dispatcher.DataProvider)1