Search in sources :

Example 1 with TargetConfigMap

use of com.cubrid.cubridmanager.ui.monitoring.editor.TargetConfigMap 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 2 with TargetConfigMap

use of com.cubrid.cubridmanager.ui.monitoring.editor.TargetConfigMap in project cubrid-manager by CUBRID.

the class DiagStatusMonitorTemplateDialog method okPressed.

/**
	 * Executes the task when "ok" button is pressed
	 */
@Override
public void okPressed() {
    String name = nameText.getText().trim();
    statusTemplateInfo.setName(name);
    String desc = discriptionText.getText().trim();
    statusTemplateInfo.setDesc(desc);
    String samplingTerm = samplingTermscombo.getText().trim();
    statusTemplateInfo.setSampling_term(samplingTerm);
    String dbName = "";
    if (targetDbNameCombo != null && targetDbNameCombo.getEnabled()) {
        dbName = targetDbNameCombo.getText();
    }
    statusTemplateInfo.setDb_name(dbName);
    TargetConfigInfo targetConfigInfo = new TargetConfigInfo();
    TableItem[] tableItems = tagetTbl.getItems();
    for (TableItem item : tableItems) {
        assert (null != item);
        String[] values = new String[] { "1", "1" };
        TargetConfigMap tcm = TargetConfigMap.getInstance();
        if (item.getText(1).equals(tcm.getShowOpenedPage())) {
            targetConfigInfo.setServer_query_opened_page(values);
        } else if (item.getText(1).equals(tcm.getShowSlowQuery())) {
            targetConfigInfo.setServer_query_slow_query(values);
        } else if (item.getText(1).equals(tcm.getShowFullScan())) {
            targetConfigInfo.setServer_query_full_scan(values);
        } else if (item.getText(1).equals(tcm.getShowCliRequest())) {
            targetConfigInfo.setServer_conn_cli_request(values);
        } else if (item.getText(1).equals(tcm.getShowAboutedClients())) {
            targetConfigInfo.setServer_conn_aborted_clients(values);
        } else if (item.getText(1).equals(tcm.getShowConnReq())) {
            targetConfigInfo.setServer_conn_conn_req(values);
        } else if (item.getText(1).equals(tcm.getShowConnRej())) {
            targetConfigInfo.setServer_conn_conn_reject(values);
        } else if (item.getText(1).equals(tcm.getShowPageWrite())) {
            targetConfigInfo.setServer_buffer_page_write(values);
        } else if (item.getText(1).equals(tcm.getShowPageRead())) {
            targetConfigInfo.setServer_buffer_page_read(values);
        } else if (item.getText(1).equals(tcm.getShowLockDeadlock())) {
            targetConfigInfo.setServer_lock_deadlock(values);
        } else if (item.getText(1).equals(tcm.getShowLockRequest())) {
            targetConfigInfo.setServer_lock_request(values);
        } else if (item.getText(1).equals(tcm.getShowStRequest())) {
            targetConfigInfo.setCas_st_request(values);
        } else if (item.getText(1).equals(tcm.getShowStTransaction())) {
            targetConfigInfo.setCas_st_transaction(values);
        } else if (item.getText(1).equals(tcm.getShowStActiveSession())) {
            targetConfigInfo.setCas_st_active_session(values);
        } else if (item.getText(1).equals(tcm.getShowStQuery())) {
            targetConfigInfo.setCas_st_query(values);
        } else if (item.getText(1).equals(tcm.getShowStLongQuery())) {
            targetConfigInfo.setCas_st_long_query(values);
        } else if (item.getText(1).equals(tcm.getShowStLongTran())) {
            targetConfigInfo.setCas_st_long_tran(values);
        } else if (item.getText(1).equals(tcm.getShowStErrQuery())) {
            targetConfigInfo.setCas_st_error_query(values);
        }
    }
    statusTemplateInfo.addTarget_config(targetConfigInfo);
    super.okPressed();
}
Also used : TargetConfigMap(com.cubrid.cubridmanager.ui.monitoring.editor.TargetConfigMap) TableItem(org.eclipse.swt.widgets.TableItem) TargetConfigInfo(com.cubrid.cubridmanager.core.monitoring.model.TargetConfigInfo)

Aggregations

TargetConfigMap (com.cubrid.cubridmanager.ui.monitoring.editor.TargetConfigMap)2 ServerType (com.cubrid.cubridmanager.core.common.model.ServerType)1 TargetConfigInfo (com.cubrid.cubridmanager.core.monitoring.model.TargetConfigInfo)1 EnumTargetConfig (com.cubrid.cubridmanager.ui.monitoring.editor.EnumTargetConfig)1 TargetConfig (com.cubrid.cubridmanager.ui.monitoring.editor.TargetConfig)1 TableItem (org.eclipse.swt.widgets.TableItem)1 TreeItem (org.eclipse.swt.widgets.TreeItem)1