@Override public String render(CompAttrib input) { return input.getName(); } });
@Override public String render(CompAttrib input) { return input.getName(); } });
/** * Extracts all Composite members from a given composite attribute name. * * @param bean The mbean the composite attribute belongs to. * @param compAttributeName The composite attribute name. * @return A list of all Composite Members of the given composite attribute. May be empty. The list is unmodifiable. */ private List<CompMember> getCompositeMembers(Mbean bean, String compAttributeName) { for (CompAttrib eachAttrib : bean.getCompAttribList()) { if (Objects.equals(compAttributeName, eachAttrib.getName())) { List<CompMember> list = eachAttrib.getCompMemberList(); return Collections.unmodifiableList(list); } } return Collections.emptyList(); }
/** * Extracts all Composite members from a given composite attribute name. * * @param bean The mbean the composite attribute belongs to. * @param compAttributeName The composite attribute name. * @return A list of all Composite Members of the given composite attribute. May be empty. The list is unmodifiable. */ private List<CompMember> getCompositeMembers(Mbean bean, String compAttributeName) { for (CompAttrib eachAttrib : bean.getCompAttribList()) { if (Objects.equals(compAttributeName, eachAttrib.getName())) { List<CompMember> list = eachAttrib.getCompMemberList(); return Collections.unmodifiableList(list); } } return Collections.emptyList(); }
/** * Extracts all Attribute and Composite Attribute Names * from the given MBean. * * @param bean The MBean to extract attributes from. * @return An unmodifiable list of Attribute/Composite Attribute Names. */ private List<String> extractAttributeNames(Mbean bean) { List<String> attributes = new ArrayList<>(); for (Attrib eachAttrib : bean.getAttribList()) { attributes.add(eachAttrib.getName()); } for (CompAttrib eachCompAttrib : bean.getCompAttribList()) { attributes.add(eachCompAttrib.getName()); } return Collections.unmodifiableList(attributes); }
/** * Extracts all Attribute and Composite Attribute Names * from the given MBean. * * @param bean The MBean to extract attributes from. * @return An unmodifiable list of Attribute/Composite Attribute Names. */ private List<String> extractAttributeNames(Mbean bean) { List<String> attributes = new ArrayList<>(); for (Attrib eachAttrib : bean.getAttribList()) { attributes.add(eachAttrib.getName()); } for (CompAttrib eachCompAttrib : bean.getCompAttribList()) { attributes.add(eachCompAttrib.getName()); } return Collections.unmodifiableList(attributes); }
@Override public void setItemProperties(Item item, Object itemId) { item.getItemProperty(MBeansTree.MetaMBeansTreeItem.ICON).setValue(Config.Icons.DUMMY); item.getItemProperty(MBeansTree.MetaMBeansTreeItem.CAPTION).setValue(((CompAttrib) itemId).getName()); item.getItemProperty(MBeansTree.MetaMBeansTreeItem.TOOLTIP).setValue(((CompAttrib) itemId).getName()); } }
@Override public void setItemProperties(Item item, Object itemId) { item.getItemProperty(MBeansTree.MetaMBeansTreeItem.ICON).setValue(Config.Icons.DUMMY); item.getItemProperty(MBeansTree.MetaMBeansTreeItem.CAPTION).setValue(((CompAttrib) itemId).getName()); item.getItemProperty(MBeansTree.MetaMBeansTreeItem.TOOLTIP).setValue(((CompAttrib) itemId).getName()); } }
private String printInternalTree(Object itemId, int depth) { String tabs = ""; String ret = ""; for (int i = 0; i < depth; i++) { tabs += " "; } Object data = itemIdToDataMapping.get(itemId); String nodeDataAsString = data.toString(); if (data instanceof Mbean) { nodeDataAsString = ((Mbean) data).getObjectname(); } if (data instanceof CompAttrib) { nodeDataAsString = ((CompAttrib) data).getName(); } ret += tabs + nodeDataAsString + "\n"; if (hasChildren(itemId)) { for (Object eachChildItemId : getChildren(itemId)) { ret += printInternalTree(eachChildItemId, depth + 1); } } return ret; }
private String printInternalTree(Object itemId, int depth) { String tabs = ""; String ret = ""; for (int i = 0; i < depth; i++) { tabs += " "; } Object data = itemIdToDataMapping.get(itemId); String nodeDataAsString = data.toString(); if (data instanceof Mbean) { nodeDataAsString = ((Mbean) data).getObjectname(); } if (data instanceof CompAttrib) { nodeDataAsString = ((CompAttrib) data).getName(); } ret += tabs + nodeDataAsString + "\n"; if (hasChildren(itemId)) { for (Object eachChildItemId : getChildren(itemId)) { ret += printInternalTree(eachChildItemId, depth + 1); } } return ret; }
public void validate(CompAttrib compAttrib, ValidationResult validationResult) { validateInternal(new NameValidator(), compAttrib, compAttrib.getName(), validationResult); for (CompMember eachCompMember : selectionManager.getSelectedCompositeMembers(compAttrib)) { validate(eachCompMember, validationResult); } }
public void validate(CompAttrib compAttrib, ValidationResult validationResult) { validateInternal(new NameValidator(), compAttrib, compAttrib.getName(), validationResult); for (CompMember eachCompMember : selectionManager.getSelectedCompositeMembers(compAttrib)) { validate(eachCompMember, validationResult); } }
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; }
private Collection<Report> generateCompositeReportsByMBean(Mbean mbean) { Collection<Report> reports = new ArrayList<>(); for (CompAttrib compAttrib : mbean.getCompAttribList()) { String reportId = StringUtils.deleteWhitespace(mbean.getName()) + "." + compAttrib.getName() + "." + COMPOSITEREPORT; Report report = new Report(reportId, reportId, reportId, "verticalLabel"); for (CompMember compMember : compAttrib.getCompMemberList()) { report.addGraph(new Graph(compMember.getAlias(), compMember.getName(), compMember.getAlias(), Colors.getNextColor(), Colors.getNextColor(), Colors.getNextColor())); } reports.add(report); Colors.resetColor(); } return reports; }
private Collection<Report> generateCompositeReportsByMBean(Mbean mbean) { Collection<Report> reports = new ArrayList<>(); for (CompAttrib compAttrib : mbean.getCompAttribList()) { String reportId = StringUtils.deleteWhitespace(mbean.getName()) + "." + compAttrib.getName() + "." + COMPOSITEREPORT; Report report = new Report(reportId, reportId, reportId, "verticalLabel"); for (CompMember compMember : compAttrib.getCompMemberList()) { report.addGraph(new Graph(compMember.getAlias(), compMember.getName(), compMember.getAlias(), Colors.getNextColor(), Colors.getNextColor(), Colors.getNextColor())); } reports.add(report); Colors.resetColor(); } return reports; }
private Collection<Report> generateCompositeMemberReportsByMBean(Mbean mbean) { Collection<Report> reports = new ArrayList<>(); for (CompAttrib compAttrib : mbean.getCompAttribList()) { for (CompMember compMember : compAttrib.getCompMemberList()) { String reportId = StringUtils.deleteWhitespace(mbean.getName()) + "." + compAttrib.getName() + "." + compMember.getName() + "." + COMPOSITATTRIBEREPORT; Report report = new Report(reportId, reportId, reportId, "verticalLabel"); report.addGraph(new Graph(compMember.getAlias(), compMember.getName(), compMember.getAlias(), Colors.getNextColor(), Colors.getNextColor(), Colors.getNextColor())); reports.add(report); Colors.resetColor(); } } return reports; } }
private Collection<Report> generateCompositeMemberReportsByMBean(Mbean mbean) { Collection<Report> reports = new ArrayList<>(); for (CompAttrib compAttrib : mbean.getCompAttribList()) { for (CompMember compMember : compAttrib.getCompMemberList()) { String reportId = StringUtils.deleteWhitespace(mbean.getName()) + "." + compAttrib.getName() + "." + compMember.getName() + "." + COMPOSITATTRIBEREPORT; Report report = new Report(reportId, reportId, reportId, "verticalLabel"); report.addGraph(new Graph(compMember.getAlias(), compMember.getName(), compMember.getAlias(), Colors.getNextColor(), Colors.getNextColor(), Colors.getNextColor())); reports.add(report); Colors.resetColor(); } } return reports; } }
/** * Clones a CompAttrib object. Makes a deep copy! * * @param input * @return */ public static CompAttrib clone(CompAttrib input) { CompAttrib output = new CompAttrib(); output.setAlias(input.getAlias()); output.setName(input.getName()); output.setType(input.getType()); for (CompMember inputMember : input.getCompMemberList()) { output.addCompMember(clone(inputMember)); } return output; }
/** * Clones a CompAttrib object. Makes a deep copy! * * @param input * @return */ public static CompAttrib clone(CompAttrib input) { CompAttrib output = new CompAttrib(); output.setAlias(input.getAlias()); output.setName(input.getName()); output.setType(input.getType()); for (CompMember inputMember : input.getCompMemberList()) { output.addCompMember(clone(inputMember)); } return output; }