@Override
  public void collect(Entry entry) {
    LOGGER.info("Collecting ldap attributes/values form entry with dn: [{}]", entry.getDn());

    for (String attributeValue : occurrenceMap().keySet()) {
      if (applies(entry, attributeValue)) {

        Integer cnt = occurrenceMap().get(attributeValue).intValue();
        if (weightsMap().containsKey(attributeValue)) {
          cnt = cnt + weightsMap().get(attributeValue);
        } else {
          cnt = cnt + 1;
        }
        occurrenceMap().put(attributeValue, cnt);

        LOGGER.info("Collected potential name attr: {}, count: {}", attributeValue, cnt);

      } else {
        LOGGER.info("The result entry doesn't contain the attribute: [{}]", attributeValue);
      }
    }
  }
Collects the information about the attribute to be detected from the provided entry.

@param entry a result entry returned by a search operation
ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/OccurrenceAndWeightBasedDetector.java