Example usage for javax.management ObjectName unquote

List of usage examples for javax.management ObjectName unquote

Introduction

In this page you can find the example usage for javax.management ObjectName unquote.

Prototype

public static String unquote(String q) 

Source Link

Document

Returns an unquoted form of the given String.

Usage

From source file:psiprobe.controllers.certificates.ListCertificatesController.java

/**
 * To connector info.//w  w  w  .  java 2s .  co m
 *
 * @param protocol the protocol
 * @return the connector info
 * @throws IllegalAccessException the illegal access exception
 * @throws InvocationTargetException the invocation target exception
 */
private ConnectorInfo toConnectorInfo(AbstractHttp11JsseProtocol<?> protocol)
        throws IllegalAccessException, InvocationTargetException {
    ConnectorInfo info = new ConnectorInfo();
    BeanUtils.copyProperties(info, protocol);
    info.setName(ObjectName.unquote(info.getName()));
    return info;
}

From source file:org.apache.geode.tools.pulse.internal.data.JMXDataUpdater.java

private void updateClusterStatement(ObjectName mbeanName) throws IOException {

    try {/*from  w w  w.ja va  2 s .c o m*/

        AttributeList attributeList = this.mbs.getAttributes(mbeanName,
                PulseConstants.STATEMENT_MBEAN_ATTRIBUTES);
        // retrieve the full path of the region
        String statementDefinition = mbeanName.getKeyProperty("name");

        if (isQuoted(statementDefinition)) {
            statementDefinition = ObjectName.unquote(statementDefinition);
        }

        Cluster.Statement statement = cluster.getClusterStatements().get(statementDefinition);

        if (null == statement) {
            statement = new Cluster.Statement();
            statement.setQueryDefinition(statementDefinition);
        }

        for (int i = 0; i < attributeList.size(); i++) {
            Attribute attribute = (Attribute) attributeList.get(i);
            String name = attribute.getName();
            switch (name) {
            case PulseConstants.MBEAN_ATTRIBUTE_NUMTIMESCOMPILED:
                statement.setNumTimesCompiled(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_NUMEXECUTION:
                statement.setNumExecution(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_NUMEXECUTIONSINPROGRESS:
                statement.setNumExecutionsInProgress(
                        getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_NUMTIMESGLOBALINDEXLOOKUP:
                statement.setNumTimesGlobalIndexLookup(
                        getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_NUMROWSMODIFIED:
                statement.setNumRowsModified(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_PARSETIME:
                statement.setParseTime(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_BINDTIME:
                statement.setBindTime(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_OPTIMIZETIME:
                statement.setOptimizeTime(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_ROUTINGINFOTIME:
                statement.setRoutingInfoTime(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_GENERATETIME:
                statement.setGenerateTime(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_TOTALCOMPILATIONTIME:
                statement.setTotalCompilationTime(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_EXECUTIONTIME:
                statement.setExecutionTime(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_PROJECTIONTIME:
                statement.setProjectionTime(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_TOTALEXECUTIONTIME:
                statement.setTotalExecutionTime(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_ROWSMODIFICATIONTIME:
                statement.setRowsModificationTime(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_QNNUMROWSSEEN:
                statement.setqNNumRowsSeen(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_QNMSGSENDTIME:
                statement.setqNMsgSendTime(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_QNMSGSERTIME:
                statement.setqNMsgSerTime(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_QNRESPDESERTIME:
                statement.setqNRespDeSerTime(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            }
        }

        cluster.addClusterStatement(statementDefinition, statement);
        // TODO : to store data for sparklines later
        /*
         * region.getPutsPerSecTrend().add(region.getPutsRate());
         * region.getGetsPerSecTrend().add(region.getGetsRate());
         */
    } catch (InstanceNotFoundException | ReflectionException infe) {
        logger.warn(infe);
    }
}

From source file:com.pivotal.gemfire.tools.pulse.internal.data.JMXDataUpdater.java

private void updateClusterStatement(ObjectName mbeanName) throws IOException {

    try {/* ww  w.  j a va  2s .  c om*/

        AttributeList attributeList = this.mbs.getAttributes(mbeanName,
                PulseConstants.STATEMENT_MBEAN_ATTRIBUTES);
        // retrieve the full path of the region
        String statementDefinition = mbeanName.getKeyProperty("name");

        if (isQuoted(statementDefinition)) {
            statementDefinition = ObjectName.unquote(statementDefinition);
        }

        Cluster.Statement statement = cluster.getClusterStatements().get(statementDefinition);

        if (null == statement) {
            statement = new Cluster.Statement();
            statement.setQueryDefinition(statementDefinition);
        }

        for (int i = 0; i < attributeList.size(); i++) {

            Attribute attribute = (Attribute) attributeList.get(i);

            if (attribute.getName().equals(PulseConstants.MBEAN_ATTRIBUTE_NUMTIMESCOMPILED)) {
                statement.setNumTimesCompiled(getLongAttribute(attribute.getValue(), attribute.getName()));
            } else if (attribute.getName().equals(PulseConstants.MBEAN_ATTRIBUTE_NUMEXECUTION)) {
                statement.setNumExecution(getLongAttribute(attribute.getValue(), attribute.getName()));
            } else if (attribute.getName().equals(PulseConstants.MBEAN_ATTRIBUTE_NUMEXECUTIONSINPROGRESS)) {
                statement.setNumExecutionsInProgress(
                        getLongAttribute(attribute.getValue(), attribute.getName()));
            } else if (attribute.getName().equals(PulseConstants.MBEAN_ATTRIBUTE_NUMTIMESGLOBALINDEXLOOKUP)) {
                statement.setNumTimesGlobalIndexLookup(
                        getLongAttribute(attribute.getValue(), attribute.getName()));
            } else if (attribute.getName().equals(PulseConstants.MBEAN_ATTRIBUTE_NUMROWSMODIFIED)) {
                statement.setNumRowsModified(getLongAttribute(attribute.getValue(), attribute.getName()));
            } else if (attribute.getName().equals(PulseConstants.MBEAN_ATTRIBUTE_PARSETIME)) {
                statement.setParseTime(getLongAttribute(attribute.getValue(), attribute.getName()));
            } else if (attribute.getName().equals(PulseConstants.MBEAN_ATTRIBUTE_BINDTIME)) {
                statement.setBindTime(getLongAttribute(attribute.getValue(), attribute.getName()));
            } else if (attribute.getName().equals(PulseConstants.MBEAN_ATTRIBUTE_OPTIMIZETIME)) {
                statement.setOptimizeTime(getLongAttribute(attribute.getValue(), attribute.getName()));
            } else if (attribute.getName().equals(PulseConstants.MBEAN_ATTRIBUTE_ROUTINGINFOTIME)) {
                statement.setRoutingInfoTime(getLongAttribute(attribute.getValue(), attribute.getName()));
            } else if (attribute.getName().equals(PulseConstants.MBEAN_ATTRIBUTE_GENERATETIME)) {
                statement.setGenerateTime(getLongAttribute(attribute.getValue(), attribute.getName()));
            } else if (attribute.getName().equals(PulseConstants.MBEAN_ATTRIBUTE_TOTALCOMPILATIONTIME)) {
                statement.setTotalCompilationTime(getLongAttribute(attribute.getValue(), attribute.getName()));
            } else if (attribute.getName().equals(PulseConstants.MBEAN_ATTRIBUTE_EXECUTIONTIME)) {
                statement.setExecutionTime(getLongAttribute(attribute.getValue(), attribute.getName()));
            } else if (attribute.getName().equals(PulseConstants.MBEAN_ATTRIBUTE_PROJECTIONTIME)) {
                statement.setProjectionTime(getLongAttribute(attribute.getValue(), attribute.getName()));
            } else if (attribute.getName().equals(PulseConstants.MBEAN_ATTRIBUTE_TOTALEXECUTIONTIME)) {
                statement.setTotalExecutionTime(getLongAttribute(attribute.getValue(), attribute.getName()));
            } else if (attribute.getName().equals(PulseConstants.MBEAN_ATTRIBUTE_ROWSMODIFICATIONTIME)) {
                statement.setRowsModificationTime(getLongAttribute(attribute.getValue(), attribute.getName()));
            } else if (attribute.getName().equals(PulseConstants.MBEAN_ATTRIBUTE_QNNUMROWSSEEN)) {
                statement.setqNNumRowsSeen(getLongAttribute(attribute.getValue(), attribute.getName()));
            } else if (attribute.getName().equals(PulseConstants.MBEAN_ATTRIBUTE_QNMSGSENDTIME)) {
                statement.setqNMsgSendTime(getLongAttribute(attribute.getValue(), attribute.getName()));
            } else if (attribute.getName().equals(PulseConstants.MBEAN_ATTRIBUTE_QNMSGSERTIME)) {
                statement.setqNMsgSerTime(getLongAttribute(attribute.getValue(), attribute.getName()));
            }
            if (attribute.getName().equals(PulseConstants.MBEAN_ATTRIBUTE_QNRESPDESERTIME)) {
                statement.setqNRespDeSerTime(getLongAttribute(attribute.getValue(), attribute.getName()));
            }
        }

        cluster.addClusterStatement(statementDefinition, statement);
        // TODO : to store data for sparklines later
        /*
         * region.getPutsPerSecTrend().add(region.getPutsRate());
         * region.getGetsPerSecTrend().add(region.getGetsRate());
         */
    } catch (InstanceNotFoundException infe) {
        LOGGER.warning(infe);
    } catch (ReflectionException re) {
        LOGGER.warning(re);
    }
}

From source file:edu.nwpu.gemfire.monitor.data.JMXDataUpdater.java

private void updateClusterStatement(ObjectName mbeanName) throws IOException {

    try {//from  ww  w .  ja v  a2s.co  m

        AttributeList attributeList = this.mbs.getAttributes(mbeanName,
                PulseConstants.STATEMENT_MBEAN_ATTRIBUTES);
        // retrieve the full path of the region
        String statementDefinition = mbeanName.getKeyProperty("name");

        if (isQuoted(statementDefinition)) {
            statementDefinition = ObjectName.unquote(statementDefinition);
        }

        Cluster.Statement statement = cluster.getClusterStatements().get(statementDefinition);

        if (null == statement) {
            statement = new Cluster.Statement();
            statement.setQueryDefinition(statementDefinition);
        }

        for (int i = 0; i < attributeList.size(); i++) {
            Attribute attribute = (Attribute) attributeList.get(i);
            String name = attribute.getName();
            switch (name) {
            case PulseConstants.MBEAN_ATTRIBUTE_NUMTIMESCOMPILED:
                statement.setNumTimesCompiled(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_NUMEXECUTION:
                statement.setNumExecution(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_NUMEXECUTIONSINPROGRESS:
                statement.setNumExecutionsInProgress(
                        getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_NUMTIMESGLOBALINDEXLOOKUP:
                statement.setNumTimesGlobalIndexLookup(
                        getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_NUMROWSMODIFIED:
                statement.setNumRowsModified(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_PARSETIME:
                statement.setParseTime(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_BINDTIME:
                statement.setBindTime(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_OPTIMIZETIME:
                statement.setOptimizeTime(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_ROUTINGINFOTIME:
                statement.setRoutingInfoTime(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_GENERATETIME:
                statement.setGenerateTime(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_TOTALCOMPILATIONTIME:
                statement.setTotalCompilationTime(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_EXECUTIONTIME:
                statement.setExecutionTime(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_PROJECTIONTIME:
                statement.setProjectionTime(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_TOTALEXECUTIONTIME:
                statement.setTotalExecutionTime(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_ROWSMODIFICATIONTIME:
                statement.setRowsModificationTime(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_QNNUMROWSSEEN:
                statement.setqNNumRowsSeen(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_QNMSGSENDTIME:
                statement.setqNMsgSendTime(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_QNMSGSERTIME:
                statement.setqNMsgSerTime(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            case PulseConstants.MBEAN_ATTRIBUTE_QNRESPDESERTIME:
                statement.setqNRespDeSerTime(getLongAttribute(attribute.getValue(), attribute.getName()));
                break;
            }
        }

        cluster.addClusterStatement(statementDefinition, statement);
        // TODO : to store data for sparklines later
        /*
         * region.getPutsPerSecTrend().add(region.getPutsRate());
         * region.getGetsPerSecTrend().add(region.getGetsRate());
         */
    } catch (InstanceNotFoundException infe) {
        LOGGER.warning(infe);
    } catch (ReflectionException re) {
        LOGGER.warning(re);
    }
}