|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.unboundid.ldap.sdk.EntrySource
com.unboundid.ldap.sdk.DNEntrySource
@ThreadSafety(level=NOT_THREADSAFE) public final class DNEntrySource
This class provides an EntrySource that will retrieve entries
referenced by a provided set of DNs. The connection will remain open after
all entries have been read.
It is not necessary to close this entry source when it is no longer needed,
although there is no cost or penalty in doing so. Any exceptions thrown by
the nextEntry() method will have the mayContinueReading
value set to true.
DNEntrySource to iterate across the members of that
group:
Entry groupEntry =
connection.getEntry("cn=My Group,ou=Groups,dc=example,dc=com");
String[] memberValues = groupEntry.getAttributeValues("member");
if (memberValues != null)
{
DNEntrySource entrySource =
new DNEntrySource(connection, memberValues, "cn");
while (true)
{
Entry memberEntry = entrySource.nextEntry();
if (memberEntry == null)
{
break;
}
System.out.println("Retrieved member entry: " +
memberEntry.getAttributeValue("cn"));
}
}
| Constructor Summary | |
|---|---|
DNEntrySource(LDAPInterface connection,
java.util.Collection<java.lang.String> dns,
java.lang.String... attributes)
Creates a new DN entry source with the provided information. |
|
DNEntrySource(LDAPInterface connection,
DN[] dns,
java.lang.String... attributes)
Creates a new DN entry source with the provided information. |
|
DNEntrySource(LDAPInterface connection,
java.lang.String[] dns,
java.lang.String... attributes)
Creates a new DN entry source with the provided information. |
|
| Method Summary | |
|---|---|
void |
close()
Indicates that this entry source will no longer be needed and any resources associated with it may be closed. |
Entry |
nextEntry()
Retrieves the next entry from the entry source, if there is at least one remaining entry. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DNEntrySource(LDAPInterface connection,
DN[] dns,
java.lang.String... attributes)
connection - The connection to the directory server from which the
entries will be read. It must not be null.dns - The set of DNs to be read. It must not be
null.attributes - The set of attributes to include in entries that are
returned. If this is empty or null, then all
user attributes will be requested.
public DNEntrySource(LDAPInterface connection,
java.lang.String[] dns,
java.lang.String... attributes)
connection - The connection to the directory server from which the
entries will be read. It must not be null.dns - The set of DNs to be read. It must not be
null.attributes - The set of attributes to include in entries that are
returned. If this is empty or null, then all
user attributes will be requested.
public DNEntrySource(LDAPInterface connection,
java.util.Collection<java.lang.String> dns,
java.lang.String... attributes)
connection - The connection to the directory server from which the
entries will be read. It must not be null.dns - The set of DNs to be read. It must not be
null.attributes - The set of attributes to include in entries that are
returned. If this is empty or null, then all
user attributes will be requested.| Method Detail |
|---|
public Entry nextEntry()
throws EntrySourceException
nextEntry in class EntrySourcenull if there are
no more entries to retrieve..
EntrySourceException - If a problem occurs while attempting to read
the next entry from the entry source.public void close()
close in class EntrySource
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||