Package org.rhq.core.domain.measurement

Examples of org.rhq.core.domain.measurement.DataType


    }

    public void setMeasurementData(MeasurementReport report, Object value, MeasurementScheduleRequest request,
        MeasurementDefinition measurementDefinition) {

        DataType dataType = measurementDefinition.getDataType();
        switch (dataType) {
        case MEASUREMENT:
            try {
                MeasurementDataNumeric dataNumeric = new MeasurementDataNumeric(request, new Double(value.toString()));
                report.addData(dataNumeric);
View Full Code Here


public class JMSMessageCounterAdapter implements MeasurementAdapter {
    public void setMeasurementData(MeasurementReport report, MetaValue metaValue, MeasurementScheduleRequest request,
        MeasurementDefinition measurementDefinition) {
        // TODO: fix this
        CompositeValueSupport compositeValue = (CompositeValueSupport) metaValue;
        DataType dataType = measurementDefinition.getDataType();
        String metricName = request.getName();
        if (dataType.equals(DataType.MEASUREMENT)) {
            //@todo break out the getting the value out of the ValueSupport object
            MeasurementDataNumeric dataNumeric = new MeasurementDataNumeric(request,
                (Double) ((SimpleValueSupport) (compositeValue.get(metricName))).getValue());
            report.addData(dataNumeric);
        } else if (dataType.equals(DataType.TRAIT)) {
            //@todo break out the getting the value out of the ValueSupport object
            MeasurementDataTrait dataTrait = new MeasurementDataTrait(request,
                (String) ((SimpleValueSupport) (compositeValue.get(metricName))).getValue());
            report.addData(dataTrait);
        }
View Full Code Here

                MeasurementFacet measurementFacet = ComponentUtil.getComponent(resource.getId(),
                    MeasurementFacet.class, FacetLockType.READ, MEASUREMENT_FACET_METHOD_TIMEOUT, true, true, true);
                for (MeasurementDefinition metricDefinition : metricDefinitions) {
                    String name = metricDefinition.getName();
                    try {
                        DataType dataType = metricDefinition.getDataType();
                        if (dataType == DataType.MEASUREMENT || metricDefinition.getDataType() == DataType.TRAIT) {
                            MeasurementReport report = new MeasurementReport();
                            Set<MeasurementScheduleRequest> requests = new HashSet<MeasurementScheduleRequest>();
                            MeasurementScheduleRequest request = new MeasurementScheduleRequest(1, metricDefinition
                                .getName(), 0, true, metricDefinition.getDataType());
View Full Code Here

  public static String getMetricValue(MeasurementDefinition metricDefinition,
      MeasurementFacet measurementFacet) throws Exception {

    String name = metricDefinition.getName();
    DataType dataType = metricDefinition.getDataType();

    if (dataType == DataType.MEASUREMENT || dataType == DataType.TRAIT) {

      MeasurementReport report = new MeasurementReport();
      Set<MeasurementScheduleRequest> requests = new HashSet<MeasurementScheduleRequest>();
View Full Code Here

      if (trace) log.trace("Get values for these metrics: " + metrics);
      EmsBean bean = getEmsBean();
      bean.refreshAttributes();
      if (trace) log.trace("Querying returned bean: " + bean);
      for (MeasurementScheduleRequest req : metrics) {
         DataType type = req.getDataType();
         if (type == DataType.MEASUREMENT) {
            EmsAttribute att = bean.getAttribute(req.getName());
            if (att != null) {
               MeasurementDataNumeric res = constructNumericMeasure(att.getTypeClass(), att.getValue(), req);
               report.addData(res);
View Full Code Here

               EmsAttribute att = bean.getAttribute(attName);
               // Attribute values are of various data types
               if (att != null) {
                  Object o = att.getValue();
                  Class<?> attrType = att.getTypeClass();
                  DataType type = req.getDataType();
                  if (type == DataType.MEASUREMENT) {
                     if (o != null) {
                        MeasurementDataNumeric res = constructNumericMeasure(attrType, o, req);
                        if (res != null) report.addData(res);
                     } else {
View Full Code Here

      if (trace) log.tracef("Connection to ems server established: %s", conn);
      EmsBean bean = queryCacheManagerBean(conn);
      bean.refreshAttributes();
      if (trace) log.tracef("Querying returned bean: %s", bean);
      for (MeasurementScheduleRequest req : metrics) {
         DataType type = req.getDataType();
         if (type == DataType.MEASUREMENT) {
            EmsAttribute att = bean.getAttribute(req.getName());
            MeasurementDataNumeric res = constructNumericMeasure(att.getTypeClass(), att.getValue(), req);
            report.addData(res);
         } else if (type == DataType.TRAIT) {
View Full Code Here

               EmsAttribute att = bean.getAttribute(attName);
               // Attribute values are of various data types
               if (att != null) {
                  Object o = att.getValue();
                  Class attrType = att.getTypeClass();
                  DataType type = req.getDataType();
                  if (type == DataType.MEASUREMENT) {
                     if (o != null) {
                        MeasurementDataNumeric res = constructNumericMeasure(attrType, o, req);
                        if (res != null) report.addData(res);
                     } else {
View Full Code Here

      if (trace) log.trace("Connection to ems server established: %s", conn);
      EmsBean bean = queryCacheManagerBean(conn);
      bean.refreshAttributes();
      if (trace) log.trace("Querying returned bean: %s", bean);
      for (MeasurementScheduleRequest req : metrics) {
         DataType type = req.getDataType();
         if (type == DataType.MEASUREMENT) {
            String tmp = (String) bean.getAttribute(req.getName()).getValue();
            Double val = Double.valueOf(tmp);
            if (trace) log.trace("Metric (%s) is measurement with value %s", req.getName(), val);
            MeasurementDataNumeric res = new MeasurementDataNumeric(req, val);
View Full Code Here

               EmsAttribute att = bean.getAttribute(attName);
               // Attribute values are of various data types
               if (att != null) {
                  Object o = att.getValue();
                  Class attrType = att.getTypeClass();
                  DataType type = req.getDataType();
                  if (type == DataType.MEASUREMENT) {
                     if (o != null) {
                        MeasurementDataNumeric res = constructMeasurementDataNumeric(attrType, o, req);
                        if (res != null) report.addData(res);
                     } else {
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.measurement.DataType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.