Examples of EmsAttribute


Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

      Set<DiscoveredResourceDetails> entities = new HashSet<DiscoveredResourceDetails>();

        EmsBean serviceBean = context.getParentResourceComponent().getEmsBean();
        Set<EmsAttribute> attributeSet = serviceBean.getAttributes();
        for (Iterator i = attributeSet.iterator(); i.hasNext();) {
          EmsAttribute attr = (EmsAttribute) i.next();
          System.out.println(attr.getName());
            //entities.add(detail);
        }

        /*
        String serviceName = serviceBean.getBeanName().getKeyProperty(SERVICE_NAME);
View Full Code Here

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

  public Hashtable getVersionAttribute(ResourceDiscoveryContext<MBeanResourceComponent> context) {
      Hashtable ht = new Hashtable();

    try {
      EmsBean bean = context.getParentResourceComponent().getEmsConnection().getBean(SYSTEM_BEAN);
        EmsAttribute versionAttribute = bean.getAttribute(VERSION_NUMBER);   
        String version = (String) versionAttribute.refresh();
       
        EmsAttribute buildDateAttribute = bean.getAttribute(BUILD_DATE);
        String buildDate = (String) buildDateAttribute.refresh();
 
        EmsAttribute buildIDAttribute = bean.getAttribute(BUILD_ID);
        String buildID = (String) buildIDAttribute.refresh();
 
        ht.put(VERSION_NUMBER, version);
        ht.put(BUILD_DATE, buildDate);
        ht.put(BUILD_ID, buildID);
    } catch (Exception e) {
View Full Code Here

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

      Configuration pluginConfig = this.context.getPluginConfiguration();
      pluginConfig.put(new PropertySimple("type", "service"));
        for (MeasurementScheduleRequest request : requests) {
          String metricName = request.getName();
          if (metricName.equals(MEP)) {
            EmsAttribute attribute = getEmsBean().getAttribute(MEP);
            String processed = new String();
            if (attribute != null) {
              processed = (String) attribute.refresh();
            }
            report.addData(new MeasurementDataTrait(request, processed));
          } else if (metricName.equals(LIFECYCLE_STATE)) {
            EmsAttribute attribute = getEmsBean().getAttribute(LIFECYCLE_STATE);
            String processed = new String();
            if (attribute != null) {
              processed = (String) attribute.refresh();
            }
            report.addData(new MeasurementDataTrait(request, processed));
          } else if (metricName.equals(MAX_THREADS)) {
            EmsAttribute attribute = getEmsBean().getAttribute(MAX_THREADS);
            String processed = new String();
            if (attribute != null) {
              processed = (String) attribute.refresh();
            }
            report.addData(new MeasurementDataTrait(request, processed));           
          } else if (metricName.equals(START_DATE)) {
            EmsAttribute attribute = getEmsBean().getAttribute(START_DATE);
            String processed = new String();
            if (attribute != null) {
              processed = (String) attribute.refresh();
            }
            report.addData(new MeasurementDataTrait(request, processed));           
          } else if (metricName.equals(SERVICE_CATEGORY)) {
            EmsAttribute attribute = getEmsBean().getAttribute(SERVICE_CATEGORY);
            String processed = new String();
            if (attribute != null) {
              processed = (String) attribute.refresh();
            }
            report.addData(new MeasurementDataTrait(request, processed));           
          } else if (metricName.equals(SERVICE_NAME)) {
            EmsAttribute attribute = getEmsBean().getAttribute(SERVICE_NAME);
            String processed = new String();
            if (attribute != null) {
              processed = (String) attribute.refresh();
            }
            report.addData(new MeasurementDataTrait(request, processed));           
          } else if (metricName.equals(SERVICE_DESCRIPTION)) {
            EmsAttribute attribute = getEmsBean().getAttribute(SERVICE_DESCRIPTION);
            String processed = new String();
            if (attribute != null) {
              processed = (String) attribute.refresh();
            }
            report.addData(new MeasurementDataTrait(request, processed));           
          }
        }
    }
View Full Code Here

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

        String versionNumber;
    EmsBean bean = context.getParentResourceComponent().getEmsConnection().getBean(SOADiscoveryComponent.SYSTEM_BEAN);
    String resourceKey = null;

    try {
        EmsAttribute versionAttribute = bean.getAttribute(SOADiscoveryComponent.VERSION_NUMBER);   
        versionNumber = (String) versionAttribute.refresh();
        } catch (Exception e) {
          versionNumber = "";
        }

    for (Iterator i = jmxResources.iterator(); i.hasNext();) {
          String description = null;
          DiscoveredResourceDetails drd = (DiscoveredResourceDetails) i.next();
          resourceKey = drd.getResourceKey();
          try {
                EmsBean discoverBean = context.getParentResourceComponent().getEmsConnection().getBean(resourceKey);
                Set<EmsAttribute> attributeSet = discoverBean.getAttributes();
                for (Iterator ai = attributeSet.iterator(); ai.hasNext();) {
                    EmsAttribute attr = (EmsAttribute) ai.next();

                    if (attr.getName().endsWith(SERVICE_DESCRIPTION)) {
                        description = (String) attr.getValue();
                        if (description != null)
                        {
                            description = description.trim();
                        }
                    }
View Full Code Here

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

  * @see org.rhq.core.pluginapi.event.EventPoller#poll()
  */
  public synchronized Set<Event> poll() {
    if (emsbean != null) {
        try {
          EmsAttribute alertAttribute = emsbean.getAttribute(ALERTS_ATTRIBUTE);
          if (alertAttribute != null) {
            Vector<Hashtable> notifList = null;
            notifList = (Vector<Hashtable>) alertAttribute.refresh();
          for (Hashtable notifHash : notifList) {
              long timestamp = (new Long ((String) notifHash.get(NOTIFICATION_TIMESTAMP_LONG))).longValue();
               
              Event event = new Event(getEventType(),
                ((String)notifHash.get(NOTIFICATION_TYPE)),
View Full Code Here

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

       
        // Do two passes - one to grab the entity names (ex. "data fileraction"
        // and then a second to build up the metrics for the entity
        Set<EmsAttribute> attributeSet = actionBean.getAttributes();
        for (Iterator i = attributeSet.iterator(); i.hasNext();) {
          EmsAttribute attr = (EmsAttribute) i.next();
          if (attr.getName().endsWith(MESSAGES_SUCCESSFULLY_PROCESSED)) {
            String actionName = attr.getName().replaceAll(MESSAGES_SUCCESSFULLY_PROCESSED, "");
                DiscoveredResourceDetails detail = new DiscoveredResourceDetails(context.getResourceType(), actionName,
                        actionName, null, "Action Entity", null, null);
               
                Configuration pc = detail.getPluginConfiguration();
                ArrayList<Property> props = new ArrayList<Property>();
View Full Code Here

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

        try {
          EmsBean emsbean = getEmsBean();
          if (emsbean.isRegistered()) {
              String actionName = this.context.getResourceKey();
              actionName = actionName.trim();
            EmsAttribute attribute = this.bean.getAttribute(actionName + " " + SUCCESS_PROCESSED);
            if (attribute != null) {
              return AvailabilityType.UP;
            }
            return AvailabilityType.DOWN;
          } else {
View Full Code Here

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

      long counterBytesFailed = 0;
      long counterBytesProcessed = 0;
      for (MeasurementScheduleRequest request : requests) {
          String metricName = request.getName();
          if (metricName.equals (SUCCESS_METRIC_NAME)) {
            EmsAttribute attribute = this.bean.getAttribute(actionName + " " + SUCCESS_PROCESSED);
            Integer processed = new Integer(0);
            if (attribute != null) {
              processed = (Integer) attribute.refresh();
            }
            success = processed.intValue();
            counter += processed.intValue();
            report.addData(new MeasurementDataNumeric(request, new Double(processed.doubleValue())));
          } else if (metricName.equals(FAILED_METRIC_NAME)) {
            EmsAttribute attribute = this.bean.getAttribute(actionName + " " + FAILED_PROCESSED);
              Integer processed = new Integer(0);
              if (attribute != null) {
                processed = (Integer) attribute.refresh();
              }
              failed = processed.intValue();
              counter += processed.intValue();
            report.addData(new MeasurementDataNumeric(request, new Double(processed.doubleValue())));
          } else if (metricName.equals(PROCESSINGTIME_METRIC_NAME)) {
            EmsAttribute attribute = this.bean.getAttribute(actionName + " " + PROCESSING_TIME);
            Double processed = (Double) attribute.refresh();
            if (processed != null) {
                processed = new Double(processed.doubleValue() / 1000000);
              report.addData(new MeasurementDataNumeric(request, processed));
            } else {
              report.addData(new MeasurementDataNumeric(request, new Double(0)));
            }
          } else if (metricName.equals(BYTESPROCESSED_METRIC_NAME)) {
            EmsAttribute attribute = this.bean.getAttribute(actionName + " " + OVERALL_BYTES_PROCESSED);
            Long bytesProcessed = new Long(0);
            if (attribute != null) {
              bytesProcessed = (Long) attribute.refresh();
              counterBytesProcessed = bytesProcessed.longValue();
            }
            report.addData(new MeasurementDataNumeric(request, new Double(bytesProcessed.doubleValue())));
          } else if (metricName.equals(BYTESFAILED_METRIC_NAME)) {
            EmsAttribute attribute = this.bean.getAttribute(actionName + " " + OVERALL_BYTES_FAILED);
            Long bytesFailed = new Long(0);
            if (attribute != null) {
              bytesFailed = (Long) attribute.refresh();
              counterBytesFailed += bytesFailed.longValue();
            }
            report.addData(new MeasurementDataNumeric(request, new Double(bytesFailed.doubleValue())));           
          }
        }
View Full Code Here

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

      long bytesProcessed = 0;
      long bytesFailed = 0;
        for (MeasurementScheduleRequest request : requests) {
          String metricName = request.getName();
          if (metricName.equals(OVERALL_MESSAGE_METRIC)) {
            EmsAttribute attribute = getEmsBean().getAttribute(OVERALL_MESSAGE_COUNT);
            overallMessages = (Integer) attribute.refresh();
            report.addData(new MeasurementDataNumeric(request, new Double(overallMessages.doubleValue())));
          } else if (metricName.equals(OVERALL_TIME_PROCESSED_METRIC)) {
            EmsAttribute attribute = getEmsBean().getAttribute(OVERALL_TIME_PROCESSED);
            Long overallTimeProcessed = (Long) attribute.refresh();
            if (overallTimeProcessed != null) {
              Double timeProcessed = new Double(overallTimeProcessed.doubleValue() / 1000000);
              report.addData(new MeasurementDataNumeric(request, timeProcessed));
            } else {
              report.addData(new MeasurementDataNumeric(request, new Double(0)));
            }
          } else if (metricName.equals(OVERALL_BYTES_PROCESSED_METRIC)) {
            EmsAttribute attribute = getEmsBean().getAttribute(OVERALL_BYTES_PROCESSED);
            Long processed = new Long(0);
            if (attribute != null) {
              processed = (Long) attribute.refresh();
              bytesProcessed = processed.longValue();
            }
            report.addData(new MeasurementDataNumeric(request, new Double(processed.doubleValue())));
          } else if (metricName.equals(OVERALL_BYTES_FAILED_METRIC)) {
            EmsAttribute attribute = getEmsBean().getAttribute(OVERALL_BYTES_FAILED);
            Long processed = new Long(0);
            if (attribute != null) {
              processed = (Long) attribute.refresh();
              bytesFailed = processed.longValue();
            }
            report.addData(new MeasurementDataNumeric(request, new Double(processed.doubleValue())));           
          } else if (metricName.equals(OVERALL_BYTES_METRIC)) {
            EmsAttribute attribute = getEmsBean().getAttribute(OVERALL_BYTES_COUNT);
            Long processed = new Long(0);
            if (attribute != null) {
              processed = (Long) attribute.refresh();
            }
            report.addData(new MeasurementDataNumeric(request, new Double(processed.doubleValue())));
          }
        }
View Full Code Here

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

    private List<Object> getKeyspaces(EmsConnection emsConnection) {
        List<Object> value = null;

        EmsBean emsBean = loadBean(STORAGE_SERVICE_BEAN, emsConnection);
        if (emsBean != null) {
            EmsAttribute attribute = emsBean.getAttribute("Keyspaces");
            if (attribute != null) {
                value = (List<Object>) attribute.refresh();
            }
        }

        if (value == null) {
            value = new ArrayList<Object>();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.