Search in sources :

Example 1 with MibObjProperty

use of org.opennms.netmgt.config.datacollection.MibObjProperty in project opennms by OpenNMS.

the class DefaultDataCollectionConfigDao method getMibObjProperties.

@Override
public List<MibObjProperty> getMibObjProperties(final String cName, final String aSysoid, final String anAddress) {
    LOG.debug("getMibObjProperties: collection: {} sysoid: {} address: {}", cName, aSysoid, anAddress);
    if (aSysoid == null) {
        LOG.debug("getMibObjProperties: aSysoid parameter is NULL...");
        return new ArrayList<MibObjProperty>();
    }
    final SnmpCollection collection = getSnmpCollection(getContainer(), cName);
    if (collection == null) {
        return Collections.emptyList();
    }
    final Systems systems = collection.getSystems();
    if (systems == null) {
        return Collections.emptyList();
    }
    final List<SystemDef> systemList = new ArrayList<SystemDef>();
    for (final SystemDef system : systems.getSystemDefs()) {
        if (systemDefMatches(system, aSysoid, anAddress)) {
            systemList.add(system);
        }
    }
    final List<MibObjProperty> mibProperties = new ArrayList<MibObjProperty>();
    for (final SystemDef system : systemList) {
        for (final String grpName : system.getCollect().getIncludeGroups()) {
            processGroupForProperties(cName, grpName, mibProperties);
        }
    }
    return mibProperties;
}
Also used : SnmpCollection(org.opennms.netmgt.config.datacollection.SnmpCollection) MibObjProperty(org.opennms.netmgt.config.datacollection.MibObjProperty) ArrayList(java.util.ArrayList) SystemDef(org.opennms.netmgt.config.datacollection.SystemDef) Systems(org.opennms.netmgt.config.datacollection.Systems)

Aggregations

ArrayList (java.util.ArrayList)1 MibObjProperty (org.opennms.netmgt.config.datacollection.MibObjProperty)1 SnmpCollection (org.opennms.netmgt.config.datacollection.SnmpCollection)1 SystemDef (org.opennms.netmgt.config.datacollection.SystemDef)1 Systems (org.opennms.netmgt.config.datacollection.Systems)1