public static Map<String, List<Attrib>> getAttributeMap(JmxCollection collection, String aSysoid, String anAddress) { final Map<String, List<Attrib>> attributeMap = new HashMap<String, List<Attrib>>(); if (aSysoid == null) { LOG.debug("getMibObjectList: aSysoid parameter is NULL..."); return attributeMap; } if (collection == null) { return attributeMap; } for(Mbean mbean : collection.getMbeans()) { // Make sure to create a new ArrayList because we add to it below List<Attrib> list = new ArrayList<Attrib>(mbean.getAttribList()); for(CompAttrib compAttrib : mbean.getCompAttribList()) { for (CompMember compMember : compAttrib.getCompMemberList()) { Attrib attribWrapper = new Attrib(); attribWrapper.setName(compAttrib.getName() + "|" + compMember.getName()); attribWrapper.setAlias(compMember.getAlias()); attribWrapper.setType(compMember.getType()); list.add(attribWrapper); } } attributeMap.put(mbean.getObjectname(), list); } return attributeMap; }
/** * Clones a CompMember object. Makes a deep copy! * * @param input * @return */ public static CompMember clone(CompMember input) { CompMember output = new CompMember(); output.setAlias(input.getAlias()); output.setMaxval(input.getMaxval()); output.setMinval(input.getMinval()); output.setName(input.getName()); output.setType(input.getType()); return output; } }
/** * Clones a CompMember object. Makes a deep copy! * * @param input * @return */ public static CompMember clone(CompMember input) { CompMember output = new CompMember(); output.setAlias(input.getAlias()); output.setMaxval(input.getMaxval()); output.setMinval(input.getMinval()); output.setName(input.getName()); output.setType(input.getType()); return output; } }