Search in sources :

Example 11 with ServerType

use of com.cubrid.cubridmanager.core.common.model.ServerType in project cubrid-manager by CUBRID.

the class DiagStatusMonitorTemplateDialog method insertTreeObject.

/**
	 * Inserts terms to tree
	 * 
	 */
private void insertTreeObject() {
    TargetConfigMap targetConfigMap = TargetConfigMap.getInstance();
    EnumMap<EnumTargetConfig, TargetConfig> group = targetConfigMap.getMap();
    TreeItem root = new TreeItem(targetTree, SWT.NONE);
    root.setText(STATUS_MONITOR_LST);
    serverInfo = selection.getServer().getServerInfo();
    ServerType serverType = serverInfo.getServerType();
    TargetConfig tc = null;
    if (serverType == ServerType.BOTH || serverType == ServerType.DATABASE) {
        TreeItem db = new TreeItem(root, SWT.NONE);
        db.setText(STATUS_MONITOR_LST_DB);
        TreeItem serverQuery = new TreeItem(db, SWT.NONE);
        serverQuery.setText(targetConfigMap.getQueryCategory());
        TreeItem serverConn = new TreeItem(db, SWT.NONE);
        serverConn.setText(targetConfigMap.getConnCategory());
        TreeItem serverBuffer = new TreeItem(db, SWT.NONE);
        serverBuffer.setText(targetConfigMap.getBufferCategory());
        TreeItem serverLock = new TreeItem(db, SWT.NONE);
        serverLock.setText(targetConfigMap.getLockCategory());
        TreeItem queryOpenedPage = new TreeItem(serverQuery, SWT.NONE);
        TreeItem querySlowQuery = new TreeItem(serverQuery, SWT.NONE);
        TreeItem queryFullScan = new TreeItem(serverQuery, SWT.NONE);
        TreeItem connCliRequest = new TreeItem(serverConn, SWT.NONE);
        TreeItem connAbortedClients = new TreeItem(serverConn, SWT.NONE);
        TreeItem connConnReq = new TreeItem(serverConn, SWT.NONE);
        TreeItem connConnReject = new TreeItem(serverConn, SWT.NONE);
        TreeItem bufferPageWrite = new TreeItem(serverBuffer, SWT.NONE);
        TreeItem bufferPageRead = new TreeItem(serverBuffer, SWT.NONE);
        TreeItem lockDeadlock = new TreeItem(serverLock, SWT.NONE);
        TreeItem lockRequest = new TreeItem(serverLock, SWT.NONE);
        tc = group.get(EnumTargetConfig.SERVER_QUERY_OPENED_PAGE);
        queryOpenedPage.setData(tc);
        queryOpenedPage.setText(tc.getDisplayName());
        tc = group.get(EnumTargetConfig.SERVER_QUERY_SLOW_QUERY);
        querySlowQuery.setData(tc);
        querySlowQuery.setText(tc.getDisplayName());
        tc = group.get(EnumTargetConfig.SERVER_QUERY_FULL_SCAN);
        queryFullScan.setData(tc);
        queryFullScan.setText(tc.getDisplayName());
        tc = group.get(EnumTargetConfig.SERVER_CONN_CLI_REQUEST);
        connCliRequest.setData(tc);
        connCliRequest.setText(tc.getDisplayName());
        tc = group.get(EnumTargetConfig.SERVER_CONN_ABORTED_CLIENTS);
        connAbortedClients.setData(tc);
        connAbortedClients.setText(tc.getDisplayName());
        tc = group.get(EnumTargetConfig.SERVER_CONN_CONN_REQ);
        connConnReq.setData(tc);
        connConnReq.setText(tc.getDisplayName());
        tc = group.get(EnumTargetConfig.SERVER_CONN_CONN_REJ);
        connConnReject.setData(tc);
        connConnReject.setText(tc.getDisplayName());
        tc = group.get(EnumTargetConfig.SERVER_BUFFER_PAGE_WRITE);
        bufferPageWrite.setData(tc);
        bufferPageWrite.setText(tc.getDisplayName());
        tc = group.get(EnumTargetConfig.SERVER_BUFFER_PAGE_READ);
        bufferPageRead.setData(tc);
        bufferPageRead.setText(tc.getDisplayName());
        tc = group.get(EnumTargetConfig.SERVER_LOCK_DEADLOCK);
        lockDeadlock.setData(tc);
        lockDeadlock.setText(tc.getDisplayName());
        tc = group.get(EnumTargetConfig.SERVER_LOCK_REQUEST);
        lockRequest.setData(tc);
        lockRequest.setText(tc.getDisplayName());
        db.setExpanded(true);
    }
    if (serverType == ServerType.BOTH || serverType == ServerType.BROKER) {
        TreeItem broker = new TreeItem(root, SWT.NONE);
        broker.setText(STATUS_MONITOR_LST_BROKER);
        TreeItem activeSession = new TreeItem(broker, SWT.NONE);
        TreeItem requestSec = new TreeItem(broker, SWT.NONE);
        TreeItem querySec = new TreeItem(broker, SWT.NONE);
        TreeItem transactionSec = new TreeItem(broker, SWT.NONE);
        TreeItem longQuery = new TreeItem(broker, SWT.NONE);
        TreeItem longTran = new TreeItem(broker, SWT.NONE);
        TreeItem errQuery = new TreeItem(broker, SWT.NONE);
        tc = group.get(EnumTargetConfig.CAS_ST_ACTIVE_SESSION);
        activeSession.setData(tc);
        activeSession.setText(tc.getDisplayName());
        tc = group.get(EnumTargetConfig.CAS_ST_REQUEST);
        requestSec.setData(tc);
        requestSec.setText(tc.getDisplayName());
        tc = group.get(EnumTargetConfig.CAS_ST_QUERY);
        querySec.setData(tc);
        querySec.setText(tc.getDisplayName());
        tc = group.get(EnumTargetConfig.CAS_ST_TRANSACTION);
        transactionSec.setData(tc);
        transactionSec.setText(tc.getDisplayName());
        tc = group.get(EnumTargetConfig.CAS_ST_LONG_QUERY);
        longQuery.setData(tc);
        longQuery.setText(tc.getDisplayName());
        tc = group.get(EnumTargetConfig.CAS_ST_LONG_TRAN);
        longTran.setData(tc);
        longTran.setText(tc.getDisplayName());
        tc = group.get(EnumTargetConfig.CAS_ST_ERROR_QUERY);
        errQuery.setData(tc);
        errQuery.setText(tc.getDisplayName());
        broker.setExpanded(true);
    }
    root.setExpanded(true);
}
Also used : ServerType(com.cubrid.cubridmanager.core.common.model.ServerType) TargetConfigMap(com.cubrid.cubridmanager.ui.monitoring.editor.TargetConfigMap) TreeItem(org.eclipse.swt.widgets.TreeItem) EnumTargetConfig(com.cubrid.cubridmanager.ui.monitoring.editor.EnumTargetConfig) TargetConfig(com.cubrid.cubridmanager.ui.monitoring.editor.TargetConfig) EnumTargetConfig(com.cubrid.cubridmanager.ui.monitoring.editor.EnumTargetConfig)

Example 12 with ServerType

use of com.cubrid.cubridmanager.core.common.model.ServerType in project cubrid-manager by CUBRID.

the class DiagStatusMonitorTemplateDialog method createTemplateGroup.

/**
	 * Creates template group
	 * 
	 * @param composite The composite to contains the template group
	 */
private void createTemplateGroup(Composite composite) {
    final Group group = new Group(composite, SWT.RESIZE);
    group.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    group.setLayout(new GridLayout(4, false));
    group.setText(TEMPLATE_GROUP);
    final Label nameLabel = new Label(group, SWT.NONE);
    final GridData gdNameLabel = new GridData(SWT.CENTER, SWT.CENTER, false, false);
    gdNameLabel.widthHint = 90;
    nameLabel.setLayoutData(gdNameLabel);
    nameLabel.setText(TEMPLATE_NAME);
    nameText = new Text(group, SWT.BORDER);
    final GridData gdNameText = new GridData(SWT.FILL, SWT.CENTER, true, false);
    gdNameText.widthHint = 60;
    nameText.setLayoutData(gdNameText);
    final Label samplingTermsLbl = new Label(group, SWT.NONE);
    final GridData gdSamplingTermsLbl = new GridData(SWT.CENTER, SWT.CENTER, false, false);
    gdSamplingTermsLbl.widthHint = 130;
    samplingTermsLbl.setLayoutData(gdSamplingTermsLbl);
    samplingTermsLbl.setText(SAMPLE_TERM);
    samplingTermscombo = new Combo(group, SWT.NONE);
    final GridData gdSamplingTermscombo = new GridData(SWT.FILL, SWT.CENTER, true, false);
    gdSamplingTermscombo.widthHint = 60;
    samplingTermscombo.setLayoutData(gdSamplingTermscombo);
    samplingTermscombo.setItems(samplingTermsItems);
    samplingTermscombo.setText(samplingTermsItems[0]);
    final Label descriptionLabel = new Label(group, SWT.NONE);
    final GridData gdDescriptionLabel = new GridData(SWT.CENTER, SWT.CENTER, false, false);
    gdDescriptionLabel.widthHint = 90;
    descriptionLabel.setLayoutData(gdDescriptionLabel);
    descriptionLabel.setText(TEMPLATE_DESC);
    discriptionText = new Text(group, SWT.BORDER);
    final GridData gdDiscriptionText = new GridData(SWT.FILL, SWT.CENTER, true, false);
    gdDiscriptionText.widthHint = 60;
    discriptionText.setLayoutData(gdDiscriptionText);
    ServerType serverType = serverInfo.getServerType();
    if (serverType == ServerType.BOTH || serverType == ServerType.DATABASE) {
        final Label targetDbNameLbl = new Label(group, SWT.NONE);
        final GridData gdTargetDbNameLbl = new GridData(SWT.CENTER, SWT.CENTER, false, false);
        gdTargetDbNameLbl.widthHint = 130;
        targetDbNameLbl.setLayoutData(gdTargetDbNameLbl);
        targetDbNameLbl.setText(TARGET_DB);
        targetDbNameCombo = new Combo(group, SWT.NULL);
        final GridData gdTargetDbNameCombo = new GridData(SWT.FILL, SWT.CENTER, true, false);
        gdTargetDbNameCombo.widthHint = 60;
        targetDbNameCombo.setLayoutData(gdTargetDbNameCombo);
    }
}
Also used : Group(org.eclipse.swt.widgets.Group) ServerType(com.cubrid.cubridmanager.core.common.model.ServerType) GridLayout(org.eclipse.swt.layout.GridLayout) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) Combo(org.eclipse.swt.widgets.Combo)

Example 13 with ServerType

use of com.cubrid.cubridmanager.core.common.model.ServerType in project cubrid-manager by CUBRID.

the class CubridServerLoader method load.

/**
	 *
	 * Load children object for parent
	 *
	 * @param parent the parent node
	 * @param monitor the IProgressMonitor object
	 */
public void load(ICubridNode parent, IProgressMonitor monitor) {
    synchronized (this) {
        if (isLoaded()) {
            return;
        }
        parent.setEditorId(HostDashboardEditor.ID);
        CubridServer server = parent.getServer();
        if (!server.isConnected()) {
            parent.removeAllChild();
            CubridNodeManager.getInstance().fireCubridNodeChanged(new CubridNodeChangedEvent((ICubridNode) parent, CubridNodeChangedEventType.CONTAINER_NODE_REFRESH));
            return;
        }
        ServerType serverType = server.getServerInfo().getServerType();
        // add database folder
        if (serverType == ServerType.BOTH || serverType == ServerType.DATABASE) {
            String databaseFolderId = parent.getId() + NODE_SEPARATOR + DATABASE_FOLDER_ID;
            ICubridNode databaseFolder = parent.getChild(databaseFolderId);
            if (databaseFolder == null) {
                databaseFolder = new DefaultCubridNode(databaseFolderId, DATABASE_FOLDER_NAME, "icons/navigator/database_group.png");
                databaseFolder.setType(NodeType.DATABASE_FOLDER);
                databaseFolder.setContainer(true);
                ICubridNodeLoader loader = new CubridDatabasesFolderLoader();
                loader.setLevel(getLevel());
                databaseFolder.setLoader(loader);
                parent.addChild(databaseFolder);
                if (getLevel() == DEFINITE_LEVEL) {
                    databaseFolder.getChildren(monitor);
                }
            } else {
                if (databaseFolder.getLoader() != null && databaseFolder.getLoader().isLoaded()) {
                    databaseFolder.getLoader().setLoaded(false);
                    databaseFolder.getChildren(monitor);
                }
            }
        }
        ServerUserInfo userInfo = parent.getServer().getServerInfo().getLoginedUserInfo();
        // add broker folder
        if ((serverType == ServerType.BOTH || serverType == ServerType.BROKER) && userInfo != null && (CasAuthType.AUTH_ADMIN == userInfo.getCasAuth() || CasAuthType.AUTH_MONITOR == userInfo.getCasAuth())) {
            String brokerFolderId = parent.getId() + NODE_SEPARATOR + BROKER_FOLDER_ID;
            ICubridNode brokerFolder = parent.getChild(brokerFolderId);
            if (brokerFolder == null) {
                brokerFolder = new CubridBrokerFolder(brokerFolderId, BROKER_FOLDER_NAME, "icons/navigator/broker_group.png");
                ((CubridBrokerFolder) brokerFolder).setStartedIconPath("icons/navigator/broker_service_started.png");
                brokerFolder.setContainer(true);
                brokerFolder.setViewId(BrokerEnvStatusView.ID);
                ICubridNodeLoader loader = new CubridBrokersFolderLoader();
                loader.setLevel(getLevel());
                brokerFolder.setLoader(loader);
                parent.addChild(brokerFolder);
                if (getLevel() == DEFINITE_LEVEL) {
                    brokerFolder.getChildren(monitor);
                }
            } else {
                if (brokerFolder.getLoader() != null && brokerFolder.getLoader().isLoaded()) {
                    brokerFolder.getLoader().setLoaded(false);
                    brokerFolder.getChildren(monitor);
                }
            }
        }
        //			#2 Remove the legacy monitoring menu
        //			// add monitor folder
        //			if (userInfo != null
        //					&& (StatusMonitorAuthType.AUTH_ADMIN == userInfo.getStatusMonitorAuth() || StatusMonitorAuthType.AUTH_MONITOR == userInfo.getStatusMonitorAuth())) {
        //				String monitroingId = parent.getId() + NODE_SEPARATOR
        //						+ MONITORING_FOLDER_ID;
        //				ICubridNode monitoringFolder = parent.getChild(monitroingId);
        //				if (monitoringFolder == null) {
        //					monitoringFolder = new DefaultCubridNode(monitroingId,
        //							MONITORING_FOLDER_NAME,
        //							"icons/navigator/status_group.png");
        //					monitoringFolder.setType(CubridNodeType.MONITOR_FOLDER);
        //					monitoringFolder.setContainer(true);
        //					ICubridNodeLoader loader = new CubridMonitorFolderLoader();
        //					loader.setLevel(getLevel());
        //					monitoringFolder.setLoader(loader);
        //					parent.addChild(monitoringFolder);
        //					if (getLevel() == DEFINITE_LEVEL) {
        //						monitoringFolder.getChildren(monitor);
        //					}
        //				} else {
        //					if (monitoringFolder.getLoader() != null
        //							&& monitoringFolder.getLoader().isLoaded()) {
        //						monitoringFolder.getLoader().setLoaded(false);
        //						monitoringFolder.getChildren(monitor);
        //					}
        //				}
        //			}
        // add logs folder
        String logsFolderId = parent.getId() + NODE_SEPARATOR + LOGS_FOLDER_ID;
        ICubridNode logsFolder = parent.getChild(logsFolderId);
        if (logsFolder == null) {
            logsFolder = new DefaultCubridNode(logsFolderId, LOGS_FOLDER_NAME, "icons/navigator/log_group_big.png");
            logsFolder.setType(CubridNodeType.LOGS_FOLDER);
            logsFolder.setContainer(true);
            ICubridNodeLoader loader = new CubridLogsFolderLoader();
            loader.setLevel(getLevel());
            logsFolder.setLoader(loader);
            parent.addChild(logsFolder);
            if (getLevel() == DEFINITE_LEVEL) {
                logsFolder.getChildren(monitor);
            }
        } else {
            if (logsFolder.getLoader() != null && logsFolder.getLoader().isLoaded()) {
                logsFolder.getLoader().setLoaded(false);
                logsFolder.getChildren(monitor);
            }
        }
        if (server.isConnected() && CompatibleUtil.isSupportHA(server.getServerInfo())) {
            getHostStatus(server);
        }
        setLoaded(true);
        CubridNodeManager.getInstance().fireCubridNodeChanged(new CubridNodeChangedEvent((ICubridNode) parent, CubridNodeChangedEventType.CONTAINER_NODE_REFRESH));
    }
}
Also used : ServerType(com.cubrid.cubridmanager.core.common.model.ServerType) DefaultCubridNode(com.cubrid.common.ui.spi.model.DefaultCubridNode) ICubridNodeLoader(com.cubrid.common.ui.spi.model.ICubridNodeLoader) ServerUserInfo(com.cubrid.cubridmanager.core.common.model.ServerUserInfo) CubridNodeChangedEvent(com.cubrid.common.ui.spi.event.CubridNodeChangedEvent) ICubridNode(com.cubrid.common.ui.spi.model.ICubridNode) CubridServer(com.cubrid.common.ui.spi.model.CubridServer) CubridBrokerFolder(com.cubrid.cubridmanager.ui.spi.model.CubridBrokerFolder) CubridLogsFolderLoader(com.cubrid.cubridmanager.ui.spi.model.loader.logs.CubridLogsFolderLoader)

Example 14 with ServerType

use of com.cubrid.cubridmanager.core.common.model.ServerType in project cubrid-manager by CUBRID.

the class PreferenceUtil method createPropertyDialog.

/**
	 * Create property dialog related with CUBRID node
	 *
	 * @param parentShell the parent shell
	 * @param node the ICubridNode object
	 * @return the Dialog object
	 */
public static Dialog createPropertyDialog(Shell parentShell, ICubridNode node) {
    PreferenceManager mgr = new PreferenceManager();
    String type = node.getType();
    ServerType serverType = node.getServer().getServerInfo().getServerType();
    if (CubridNodeType.SERVER.equals(type)) {
        // cubrid manager server property
        ServerConfigPropertyPage cmServerPropertyPage = new ServerConfigPropertyPage(node, Messages.msgCmServerPropertyPageName);
        PreferenceNode cmServerNode = new PreferenceNode(Messages.msgCmServerPropertyPageName);
        cmServerNode.setPage(cmServerPropertyPage);
        mgr.addToRoot(cmServerNode);
        PreferenceNode categoryNode = createCategoryNode(Messages.msgConfigureParameterPageName, Messages.msgConfigureParameterPageName, Messages.msgDetailConfigureParameter);
        mgr.addToRoot(categoryNode);
        if (serverType == ServerType.BOTH || serverType == ServerType.DATABASE) {
            // service node
            ServicePropertyPage servicePorpertyPage = new ServicePropertyPage(node, Messages.msgServicePropertyPageName);
            PreferenceNode serviceNode = new PreferenceNode(Messages.msgServicePropertyPageName);
            serviceNode.setPage(servicePorpertyPage);
            categoryNode.add(serviceNode);
            // database server node
            DatabaseConfigPropertyPage databaseServerPorpertyPage = new DatabaseConfigPropertyPage(node, Messages.msgDatabaseServerCommonPropertyPageName, true);
            PreferenceNode databaseServerNode = new PreferenceNode(Messages.msgDatabaseServerCommonPropertyPageName);
            databaseServerNode.setPage(databaseServerPorpertyPage);
            categoryNode.add(databaseServerNode);
            // HA configuraiton
            if (CompatibleUtil.isSupportNewHAConfFile(node.getServer().getServerInfo())) {
                HAPropertyPage haPropertyPage = new HAPropertyPage(node, Messages.msgHAPropertyPageName);
                PreferenceNode haNode = new PreferenceNode(Messages.msgHAPropertyPageName);
                haNode.setPage(haPropertyPage);
                categoryNode.add(haNode);
            }
        }
        if (serverType == ServerType.BOTH || serverType == ServerType.BROKER) {
            // brokers node
            BrokersParameterPropertyPage brokersParameterPorpertyPage = new BrokersParameterPropertyPage(node, Messages.msgBrokerPropertyPageName);
            PreferenceNode brokersParameterNode = new PreferenceNode(Messages.msgBrokerPropertyPageName);
            brokersParameterNode.setPage(brokersParameterPorpertyPage);
            categoryNode.add(brokersParameterNode);
        }
        // mananger node
        ManagerServerPropertyPage managerPorpertyPage = new ManagerServerPropertyPage(node, Messages.msgManagerPropertyPageName);
        PreferenceNode managerNode = new PreferenceNode(Messages.msgManagerPropertyPageName);
        managerNode.setPage(managerPorpertyPage);
        categoryNode.add(managerNode);
        // query editor node
        if (serverType == ServerType.BOTH || serverType == ServerType.DATABASE) {
            CubridServer server = node.getServer();
            QueryOptionPreferencePage queryEditorPage = new QueryOptionPreferencePage(server);
            PreferenceNode queryEditorNode = new PreferenceNode(Messages.msgQueryPropertyPageName);
            queryEditorNode.setPage(queryEditorPage);
            mgr.addToRoot(queryEditorNode);
        }
    } else if (CubridNodeType.DATABASE_FOLDER.equals(type)) {
        // database server node
        DatabaseConfigPropertyPage databaseServerPorpertyPage = new DatabaseConfigPropertyPage(node, Messages.msgDatabaseServerCommonPropertyPageName, true);
        PreferenceNode databaseServerNode = new PreferenceNode(Messages.msgDatabaseServerCommonPropertyPageName);
        databaseServerNode.setPage(databaseServerPorpertyPage);
        mgr.addToRoot(databaseServerNode);
    } else if (CubridNodeType.DATABASE.equals(type)) {
        // database parameter
        DatabaseConfigPropertyPage databaseParameterPorpertyPage = new DatabaseConfigPropertyPage(node, Messages.msgDatabaseServerPropertyPageName, false);
        PreferenceNode databaseParameterNode = new PreferenceNode(Messages.msgDatabaseServerPropertyPageName);
        databaseParameterNode.setPage(databaseParameterPorpertyPage);
        // database query
        CubridDatabase database = (CubridDatabase) node;
        DatabaseConnectionPropertyPage page = new DatabaseConnectionPropertyPage(database, Messages.msgQueryPropertyPageName);
        PreferenceNode queryNode = new PreferenceNode(Messages.msgQueryPropertyPageName);
        queryNode.setPage(page);
        mgr.addToRoot(queryNode);
        mgr.addToRoot(databaseParameterNode);
    } else if (CubridNodeType.BROKER_FOLDER.equals(type)) {
        // brokers node
        BrokersParameterPropertyPage brokersParameterPorpertyPage = new BrokersParameterPropertyPage(node, Messages.msgBrokerPropertyPageName);
        PreferenceNode brokersParameterNode = new PreferenceNode(Messages.msgBrokerPropertyPageName);
        brokersParameterNode.setPage(brokersParameterPorpertyPage);
        mgr.addToRoot(brokersParameterNode);
    }
    if (CubridNodeType.BROKER.equals(type)) {
        BrokerParameterPropertyPage brokerParameterPorpertyPage = new BrokerParameterPropertyPage(node, node.getLabel());
        PreferenceNode brokerParameterNode = new PreferenceNode(node.getLabel());
        brokerParameterNode.setPage(brokerParameterPorpertyPage);
        mgr.addToRoot(brokerParameterNode);
    } else if (CubridNodeType.SHARD_FOLDER.equals(type)) {
        ShardsParameterPropertyPage shardsParameterPorpertyPage = new ShardsParameterPropertyPage(node, node.getName());
        PreferenceNode shardsParameterNode = new PreferenceNode(Messages.msgShardsFolderName);
        shardsParameterNode.setPage(shardsParameterPorpertyPage);
        mgr.addToRoot(shardsParameterNode);
    } else if (CubridNodeType.SHARD.equals(type)) {
        ShardParameterPropertyPage shardParameterPorpertyPage = new ShardParameterPropertyPage(node, node.getName());
        PreferenceNode shardParameterNode = new PreferenceNode(node.getName());
        shardParameterNode.setPage(shardParameterPorpertyPage);
        mgr.addToRoot(shardParameterNode);
    }
    CMPreferenceDialog dlg = new CMPreferenceDialog(parentShell, mgr, Messages.titlePropertiesDialog);
    dlg.setPreferenceStore(CubridManagerUIPlugin.getDefault().getPreferenceStore());
    return dlg;
}
Also used : ServerType(com.cubrid.cubridmanager.core.common.model.ServerType) ShardParameterPropertyPage(com.cubrid.cubridmanager.ui.shard.control.ShardParameterPropertyPage) BrokerParameterPropertyPage(com.cubrid.cubridmanager.ui.broker.control.BrokerParameterPropertyPage) PreferenceNode(org.eclipse.jface.preference.PreferenceNode) BrokersParameterPropertyPage(com.cubrid.cubridmanager.ui.broker.control.BrokersParameterPropertyPage) ShardsParameterPropertyPage(com.cubrid.cubridmanager.ui.shard.control.ShardsParameterPropertyPage) DatabaseConnectionPropertyPage(com.cubrid.cubridmanager.ui.cubrid.database.control.DatabaseConnectionPropertyPage) QueryOptionPreferencePage(com.cubrid.common.ui.query.preference.QueryOptionPreferencePage) CubridServer(com.cubrid.common.ui.spi.model.CubridServer) PreferenceManager(org.eclipse.jface.preference.PreferenceManager) CMPreferenceDialog(com.cubrid.common.ui.spi.dialog.CMPreferenceDialog) ServerConfigPropertyPage(com.cubrid.cubridmanager.ui.common.control.ServerConfigPropertyPage) ManagerServerPropertyPage(com.cubrid.cubridmanager.ui.common.control.ManagerServerPropertyPage) DatabaseConfigPropertyPage(com.cubrid.cubridmanager.ui.common.control.DatabaseConfigPropertyPage) HAPropertyPage(com.cubrid.cubridmanager.ui.common.control.HAPropertyPage) CubridDatabase(com.cubrid.common.ui.spi.model.CubridDatabase) ServicePropertyPage(com.cubrid.cubridmanager.ui.common.control.ServicePropertyPage)

Example 15 with ServerType

use of com.cubrid.cubridmanager.core.common.model.ServerType 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

ServerType (com.cubrid.cubridmanager.core.common.model.ServerType)26 ServerUserInfo (com.cubrid.cubridmanager.core.common.model.ServerUserInfo)10 Map (java.util.Map)9 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)7 MonitoringTask (com.cubrid.cubridmanager.core.common.task.MonitoringTask)7 DatabaseInfo (com.cubrid.cubridmanager.core.cubrid.database.model.DatabaseInfo)7 GetBrokerConfParameterTask (com.cubrid.cubridmanager.core.broker.task.GetBrokerConfParameterTask)6 GetCMConfParameterTask (com.cubrid.cubridmanager.core.common.task.GetCMConfParameterTask)6 GetCMUserListTask (com.cubrid.cubridmanager.core.common.task.GetCMUserListTask)6 GetCubridConfParameterTask (com.cubrid.cubridmanager.core.common.task.GetCubridConfParameterTask)6 GetEnvInfoTask (com.cubrid.cubridmanager.core.common.task.GetEnvInfoTask)6 GetDatabaseListTask (com.cubrid.cubridmanager.core.cubrid.database.task.GetDatabaseListTask)6 HashMap (java.util.HashMap)6 ITask (com.cubrid.common.core.task.ITask)5 CubridServer (com.cubrid.common.ui.spi.model.CubridServer)5 ArrayList (java.util.ArrayList)5 ICubridNode (com.cubrid.common.ui.spi.model.ICubridNode)4 UpdateCMUserTask (com.cubrid.cubridmanager.core.common.task.UpdateCMUserTask)4 CubridNodeChangedEvent (com.cubrid.common.ui.spi.event.CubridNodeChangedEvent)3 BrokerInfos (com.cubrid.cubridmanager.core.broker.model.BrokerInfos)3