use of org.opends.server.protocols.internal.InternalSearchOperation in project midpoint by Evolveum.
the class OpenDJController method dumpTreeLevel.
private void dumpTreeLevel(StringBuilder sb, String dn, int indent) throws DirectoryException {
InternalSearchOperation op = getInternalConnection().processSearch(dn, SearchScope.SINGLE_LEVEL, DereferencePolicy.NEVER_DEREF_ALIASES, 100, 100, false, "(objectclass=*)", getSearchAttributes());
for (SearchResultEntry searchEntry : op.getSearchEntries()) {
ident(sb, indent);
sb.append(searchEntry.getDN().getRDN());
sb.append("\n");
dumpTreeLevel(sb, searchEntry.getDN().toString(), indent + 1);
}
}
use of org.opends.server.protocols.internal.InternalSearchOperation in project midpoint by Evolveum.
the class OpenDJController method fetchEntry.
public Entry fetchEntry(String dn) throws DirectoryException {
Validate.notNull(dn);
InternalSearchOperation op = getInternalConnection().processSearch(dn, SearchScope.BASE_OBJECT, DereferencePolicy.NEVER_DEREF_ALIASES, 100, 100, false, "(objectclass=*)", getSearchAttributes());
if (op.getEntriesSent() == 0) {
return null;
} else if (op.getEntriesSent() > 1) {
AssertJUnit.fail("Found too many entries (" + op.getEntriesSent() + ") for dn " + dn);
}
return op.getSearchEntries().get(0);
}
use of org.opends.server.protocols.internal.InternalSearchOperation in project midpoint by Evolveum.
the class OpenDJController method searchByEntryUuid.
// Generic utility methods
public Entry searchByEntryUuid(String entryUuid) throws DirectoryException {
InternalSearchOperation op = getInternalConnection().processSearch("dc=example,dc=com", SearchScope.WHOLE_SUBTREE, DereferencePolicy.NEVER_DEREF_ALIASES, 100, 100, false, "(entryUUID=" + entryUuid + ")", getSearchAttributes());
LinkedList<SearchResultEntry> searchEntries = op.getSearchEntries();
if (searchEntries == null || searchEntries.isEmpty()) {
return null;
}
if (searchEntries.size() > 1) {
AssertJUnit.fail("Multiple matches for Entry UUID " + entryUuid + ": " + searchEntries);
}
return searchEntries.get(0);
}
Aggregations