Package org.jmanage.core.management

Examples of org.jmanage.core.management.ObjectAttribute


        for(int i=0; i<numberOfAttrs; i++){
            Object[] cols = new Object[attributeValues.length + 1];
            cols[0] = ((ObjectAttribute)attrList.get(i)).getName();
            for(int j=0; j<attributeValues.length; j++){
                if(!attributeValues[j].isError()){
                    ObjectAttribute objAttribute =
                            (ObjectAttribute)attributeValues[j].getAttributeList().get(i);
                    cols[j+1] = objAttribute.getDisplayValue();
                }else{
                    // todo: this should come out of display value - rk
                    cols[j+1] = "<unavailable>";
                }
            }
View Full Code Here


                || sourceType.equals(AlertSourceConfig.SOURCE_TYPE_STRING_MONITOR)){
            Expression expr = new Expression(alertForm.getExpression());
            request.setAttribute("sourceMBean", expr.getMBeanName());
            request.setAttribute("attribute", expr.getTargetName());
            MBeanService mbeanService = ServiceFactory.getMBeanService();
            ObjectAttribute objAttr = mbeanService.getObjectAttribute(
                    Utils.getServiceContext(context, expr),
                    expr.getTargetName());
            request.setAttribute("currentAttrValue",
                    objAttr.getDisplayValue());

        }

        request.setAttribute("applications",
                ApplicationConfigManager.getAllApplications());
View Full Code Here

    }

    private void print(AttributeListData[] attrValues){
        assert attrValues.length == 1;
        for(Iterator it=attrValues[0].getAttributeList().iterator(); it.hasNext(); ){
            ObjectAttribute attribute= (ObjectAttribute)it.next();
            Out.print(attribute.getDisplayValue() + "\t");
        }
    }
View Full Code Here

                    AlertSourceConfig.SOURCE_TYPE_STRING_MONITOR) ){
                expression = new Expression(null, alertSrcConfig.getObjectName(),
                        alertSrcConfig.getAttributeName());
                request.setAttribute("attribute", alertSrcConfig.getAttributeName());
                MBeanService mbeanService = ServiceFactory.getMBeanService();
                ObjectAttribute objAttr = mbeanService.getObjectAttribute(
                    Utils.getServiceContext(context, expression),
                    expression.getTargetName());
                request.setAttribute("currentAttrValue",
                        objAttr.getDisplayValue());
                if(sourceType.equals(
                    AlertSourceConfig.SOURCE_TYPE_GAUGE_MONITOR)){
                    form.setMinAttributeValue(alertSrcConfig.getLowThreshold().toString());
                    form.setMaxAttributeValue(alertSrcConfig.getHighThreshold().toString());
                }else if(sourceType.equals(
View Full Code Here

      if(objectNamePattern != null && !anObjectName.getDisplayName().startsWith(objectNamePattern))
    continue;
      output.append("<tr>");
      List attributeValues = connection.getAttributes(anObjectName, attribs);
      for(Iterator it = attributeValues.iterator(); it.hasNext();){
    ObjectAttribute objAttribute = (ObjectAttribute)it.next();
    output.append("<td>").append(objAttribute.getDisplayValue()).append("</td>");             
      }
      output.append("</tr>");
  }
  output.append("</table>");
    }
View Full Code Here

     *
     * @param context
     */
    protected void drawInternal(DashboardContext context, StringBuffer output) {
        ServerConnection connection = context.getWebContext().getServerConnection();
        ObjectAttribute attributeValue =
                (ObjectAttribute)connection.getAttributes(objectName, new String[]{attribute}).get(0);

        String data= displayName != null && !displayName.equals("") ?
                "<b>" +displayName+" : </b>"+ attributeValue.getDisplayValue() :
                attributeValue.getDisplayValue();
        output.append(data);
    }
View Full Code Here

            List attributeList,
            ObjectAttributeInfo attrInfo){

        String attrName = attrInfo.getName();
        for(Iterator it=attributeList.iterator(); it.hasNext(); ){
            ObjectAttribute attribute = (ObjectAttribute)it.next();
            if(attribute != null && attribute.getName().equals(attrName)){
                return attribute;
            }
        }
        return new ObjectAttribute(attrName, ObjectAttribute.STATUS_NOT_FOUND, null);
    }
View Full Code Here

        StringTokenizer st = new StringTokenizer(displayNames, "|");
        MBeanService mbeanService = ServiceFactory.getMBeanService();
        for (Object anExpression : exprList) {
            Expression expression = (Expression) anExpression;
            ServiceContext srvcContext = null;
            ObjectAttribute objAttribute = null;
            try {
                srvcContext = Utils.getServiceContext(context, expression);
                objAttribute = mbeanService.getObjectAttribute(srvcContext,
                        expression.getTargetName());
            } finally {
                if (srvcContext != null)
                    srvcContext.getServerConnection().close();
            }
            assert objAttribute != null;
            assert objAttribute.getStatus() == ObjectAttribute.STATUS_OK;
            if(attribRepWhole.equals(expression.toString()))
              wholeAttrMap.put(st.nextToken(), objAttribute);
            else
              attrMap.put(st.nextToken(), objAttribute);
        }
View Full Code Here

        final DefaultPieDataset result = new DefaultPieDataset();
        if(whole.isEmpty()){
          double total = 0;
          for(String attribDispText : others.keySet()){
            ObjectAttribute otherAttrib = others.get(attribDispText);
            double segment = ((Long)otherAttrib.getValue()).doubleValue();
            total += segment;
          }
          for(String attribDispText : others.keySet()){
            ObjectAttribute otherAttrib = others.get(attribDispText);
            attribDispText += " in %";
            double segment = ((Long)otherAttrib.getValue()).doubleValue();
            segment = (100 * segment)/total;
            result.setValue(attribDispText, new Double(segment));
          }
        }else{
          String displayText = whole.keySet().iterator().next();
          ObjectAttribute attrib = whole.get(displayText);
          double wholeValue = ((Long)attrib.getValue()).doubleValue();
          double sumOthers = 0;
          for(String attribDispText : others.keySet()){
            ObjectAttribute otherAttrib = others.get(attribDispText);
            attribDispText += " in %";
            double segment = ((Long)otherAttrib.getValue()).doubleValue();
            segment = (100 * segment)/wholeValue;
            result.setValue(attribDispText, new Double(segment));
            sumOthers += segment;
          }
          displayText += " in %";
View Full Code Here

        List<ObjectAttribute> objectAttrList = new LinkedList<ObjectAttribute>();
        MBeanService mbeanService = ServiceFactory.getMBeanService();
        for (Object anExpression : exprList) {
            Expression expression = (Expression) anExpression;
            ServiceContext srvcContext = null;
            ObjectAttribute objAttribute = null;
            try {
                srvcContext = Utils.getServiceContext(context, expression);
                objAttribute = mbeanService.getObjectAttribute(srvcContext,
                        expression.getTargetName());
            } finally {
                if (srvcContext != null)
                    srvcContext.getServerConnection().close();
            }
            assert objAttribute != null;
            assert objAttribute.getStatus() == ObjectAttribute.STATUS_OK;
            objectAttrList.add(objAttribute);
        }
        request.setAttribute("objectAttrList", objectAttrList);
        return mapping.findForward(Forwards.SUCCESS);
    }
View Full Code Here

TOP

Related Classes of org.jmanage.core.management.ObjectAttribute

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.