/** * Find attribute. * * @param entity the entity * @param nameRegex the regular expression for entPhysicalName * @param attributeName the attribute name * @return the string */ private String findAttribute(OnmsHwEntity entity, String nameRegex, String attributeName) { if (entity.getEntPhysicalName().matches(nameRegex)) { return getAttributeValue(entity, attributeName); } for (OnmsHwEntity c : entity.getChildren()) { String v = findAttribute(c, nameRegex, attributeName); if (v != null) { return v; } } return null; }
@Override public void rowCompleted(SnmpRowResult row) { OnmsHwEntity entity = ((EntityPhysicalTableRow) row).getOnmsHwEntity(vendorAttributes, replacementMap); LOG.debug("rowCompleted: found entity {}, index: {}, parent: {}", entity.getEntPhysicalName(), entity.getEntPhysicalIndex(), entity.getEntPhysicalContainedIn()); if (entity.getEntPhysicalContainedIn() != null && entity.getEntPhysicalContainedIn() > 0) { OnmsHwEntity parent = getParent(entity.getEntPhysicalContainedIn().intValue()); if (parent != null) { LOG.debug("rowCompleted: adding child index {} to parent index {}", entity.getEntPhysicalIndex(), parent.getEntPhysicalIndex()); parent.addChildEntity(entity); } } entities.add(entity); }
builder.setEntPhysicalIsFru(entity.getEntPhysicalIsFRU()); if (entity.getEntPhysicalName() != null) { builder.setEntPhysicalName(entity.getEntPhysicalName());
builder.setEntPhysicalIsFru(entity.getEntPhysicalIsFRU()); if (entity.getEntPhysicalName() != null) { builder.setEntPhysicalName(entity.getEntPhysicalName());