private AttributeGroupType findGroup(Map<String, AttributeGroupType> groupTypes, MibObject mibObject) { AttributeGroupType groupType = groupTypes.get(mibObject.getGroupName()); if (groupType == null) { groupType = new AttributeGroupType(mibObject.getGroupName(), mibObject.getGroupIfType()); groupTypes.put(mibObject.getGroupName(), groupType); } return groupType; }
/** * <p>loadAliasAttributeTypes</p> * * @param agent a {@link org.opennms.netmgt.collection.api.CollectionAgent} object. * @return a {@link java.util.List} object. */ public List<SnmpAttributeType> loadAliasAttributeTypes(SnmpCollectionAgent agent) { IfAliasResourceType resType = getIfAliasResourceType(agent); MibObject ifAliasMibObject = new MibObject(); ifAliasMibObject.setOid(".1.3.6.1.2.1.31.1.1.1.18"); ifAliasMibObject.setAlias("ifAlias"); ifAliasMibObject.setType("string"); ifAliasMibObject.setInstance("ifIndex"); ifAliasMibObject.setGroupName("aliasedResource"); ifAliasMibObject.setGroupIfType(AttributeGroupType.IF_TYPE_ALL); AttributeGroupType groupType = new AttributeGroupType(ifAliasMibObject.getGroupName(), ifAliasMibObject.getGroupIfType()); SnmpAttributeType type = SnmpAttributeType.create(resType, resType.getCollectionName(), ifAliasMibObject, groupType); return Collections.singletonList(type); }