Exemplo n.º 1
0
  /**
   * Returns the {@link Set} of {@link AddeEntry}s that are known to work (for a given {@link
   * EntryType} of entries).
   *
   * @param type The {@code EntryType} you are interested in.
   * @return A {@code Set} of matching {@code RemoteAddeEntry}s. If there were no matches, an empty
   *     {@code Set} is returned.
   */
  public Set<AddeEntry> getVerifiedEntries(final EntryType type) {
    notNull(type);
    Set<AddeEntry> verified = newLinkedHashSet(trie.size());
    for (AddeEntry entry : trie.values()) {
      if (entry.getEntryType() != type) {
        continue;
      }

      if (entry instanceof LocalAddeEntry) {
        verified.add(entry);
      } else if (entry.getEntryValidity() == EntryValidity.VERIFIED) {
        verified.add(entry);
      }
    }
    return verified;
  }
Exemplo n.º 2
0
  public Set<AddeServer.Group> getIdvStyleRemoteGroups(final String server, final EntryType type) {
    Set<AddeServer.Group> idvGroups = newLinkedHashSet(trie.size());
    String typeStr = type.name();
    for (AddeEntry matched : trie.getPrefixedBy(server).values()) {
      if (matched == RemoteAddeEntry.INVALID_ENTRY) {
        continue;
      }

      if ((matched.getEntryStatus() == EntryStatus.ENABLED)
          && (matched.getEntryValidity() == EntryValidity.VERIFIED)
          && (matched.getEntryType() == type)) {
        String group = matched.getGroup();
        idvGroups.add(new AddeServer.Group(typeStr, group, group));
      }
    }
    return idvGroups;
  }