@Override public void visitCollect(final Collect collect) { //LOG.debug("visitCollect({})", collect); if (m_currentSystemDef == null) { throw new IllegalStateException("visitCollect called, but we don't have a current SystemDefImpl in-progress!"); } m_currentSystemDef.setIncludes(collect.getIncludeGroups().toArray(new String[0])); }
@Override @SuppressWarnings("unchecked") protected Collect getInternalValue() { Collect collect = new Collect(); if (selectField.getValue() instanceof Set) { Set<String> selected = (Set<String>) selectField.getValue(); for (String value : selected) { collect.addIncludeGroup(value); } } else { collect.addIncludeGroup((String)selectField.getValue()); } return collect; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((m_collect == null) ? 0 : m_collect.hashCode()); result = prime * result + ((m_ipList == null) ? 0 : m_ipList.hashCode()); result = prime * result + ((m_name == null) ? 0 : m_name.hashCode()); result = prime * result + ((m_systemDefChoice == null) ? 0 : m_systemDefChoice.hashCode()); return result; }
/** * Creates the basic system definition. * * @return the system definition */ public SystemDef createBasicSystemDef() { SystemDef sysDef = new SystemDef(); sysDef.setName("New System Definition"); sysDef.setSysoidMask(".1.3.6.1.4.1."); sysDef.setCollect(new Collect()); return sysDef; }
public void visit(final DatacollectionConfigVisitor visitor) { visitor.visitSystemDef(this); if (m_ipList != null) { m_ipList.visit(visitor); } if (m_collect != null) { m_collect.visit(visitor); } visitor.visitSystemDefComplete(); } }
return false; } else if (!m_collect.equals(other.m_collect)) { return false;
/** * Creates the basic system definition. * * @return the system definition */ public SystemDef createBasicSystemDef() { SystemDef sysDef = new SystemDef(); sysDef.setName("New System Definition"); sysDef.setSysoidMask(".1.3.6.1.4.1."); sysDef.setCollect(new Collect()); return sysDef; }
@Override protected void setInternalValue(Collect value) { selectField.setValue(new TreeSet<String>(value.getIncludeGroups())); }
@Override @SuppressWarnings("unchecked") protected Collect getInternalValue() { Collect collect = new Collect(); if (selectField.getValue() instanceof Set) { Set<String> selected = (Set<String>) selectField.getValue(); for (String value : selected) { collect.addIncludeGroup(value); } } else { collect.addIncludeGroup((String)selectField.getValue()); } return collect; }
@Override protected void setInternalValue(Collect value) { selectField.setValue(new TreeSet<String>(value.getIncludeGroups())); }
private void doVisit(Collect collect, DataCollectionVisitor visitor) { visitor.visitCollect(collect); // visit all the includeGroup specs for (Iterator<String> it = collect.getIncludeGroups().iterator(); it.hasNext();) { String includeGroup = it.next(); doVisitIncludeGroup(includeGroup, visitor); } visitor.completeCollect(collect); }
@Override public Object generateCell(Table source, Object itemId, Object columnId) { final SystemDef s = container.getItem(itemId).getBean(); return s.getCollect() == null ? 0 : s.getCollect().getIncludeGroups().size(); } });
@Override public Object generateCell(Table source, Object itemId, Object columnId) { final SystemDef s = container.getItem(itemId).getBean(); return s.getCollect() == null ? 0 : s.getCollect().getIncludeGroups().size(); } });
@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<>(); } 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<>(); for (final SystemDef system : systems.getSystemDefs()) { if (systemDefMatches(system, aSysoid, anAddress)) { systemList.add(system); } } final List<MibObjProperty> mibProperties = new ArrayList<>(); for (final SystemDef system : systemList) { for (final String grpName : system.getCollect().getIncludeGroups()) { processGroupForProperties(cName, grpName, mibProperties); } } return mibProperties; }
/** * Gets the parent system definitions. * <p>The list of systemDef per SNMP collection that are referencing a given groupName</p> * * @param dataCollectionConfigDao the data collection configuration DAO * @param groupName the group name * @return the parent system definitions. */ private Set<String> getParentSystemDefs(final DataCollectionConfigDao dataCollectionConfigDao, String groupName) { Set<String> systemDefMap = new TreeSet<>(); for (final SnmpCollection collection : dataCollectionConfigDao.getRootDataCollection().getSnmpCollections()) { for (final SystemDef systemDef : collection.getSystems().getSystemDefs()) { for (final String group : systemDef.getCollect().getIncludeGroups()) { if (group.equals(groupName)) { systemDefMap.add(systemDef.getName() + '@' + collection.getName()); } } } } return systemDefMap; }
/** * Gets the parent system definitions. * <p>The list of systemDef per SNMP collection that are referencing a given groupName</p> * * @param dataCollectionConfigDao the data collection configuration DAO * @param groupName the group name * @return the parent system definitions. */ private Set<String> getParentSystemDefs(final DataCollectionConfigDao dataCollectionConfigDao, String groupName) { Set<String> systemDefMap = new TreeSet<>(); for (final SnmpCollection collection : dataCollectionConfigDao.getRootDataCollection().getSnmpCollections()) { for (final SystemDef systemDef : collection.getSystems().getSystemDefs()) { for (final String group : systemDef.getCollect().getIncludeGroups()) { if (group.equals(groupName)) { systemDefMap.add(systemDef.getName() + '@' + collection.getName()); } } } } return systemDefMap; }
for (final String grpName : system.getCollect().getIncludeGroups()) { processGroupName(cName, grpName, ifType, mibObjectList);
collection.getSystems().addSystemDef(systemDef); for (String groupName : systemDef.getCollect().getIncludeGroups()) { Group group = getMibObjectGroup(groupName, dataCollectionGroupName); if (group == null) {