Package com.unboundid.ldap.sdk
Interface LDAPInterface
- All Known Subinterfaces:
FullLDAPInterface
- All Known Implementing Classes:
AbstractConnectionPool,InMemoryDirectoryServer,LDAPConnection,LDAPConnectionPool,LDAPReadWriteConnectionPool,LDAPThreadLocalConnectionPool,MockableLDAPConnection
This interface defines a set of methods that are available for objects that
may be used to communicate with an LDAP directory server. This can be used
to facilitate development of methods which can be used for either a single
LDAP connection or an LDAP connection pool. Note that this interface does
not include support for bind or extended operations, as they may alter the
state of the underlying connection (or connection-like object), and care must
be taken when invoking such operations. The
At present, all implementations provided by the LDAP SDK are at least mostly threadsafe and can be used to process multiple requests concurrently. However, this is not a hard requirement and it is conceivable that in the future a new implementation could be added which is not inherently threadsafe. It is recommended that code which requires thread safety either provide their own external synchronization or use one of the subclasses which explicitly provides thread safety rather than relying on this generic interface.
FullLDAPInterface
interface is a subclass of this interface that does include support for
bind and extended operations, but those methods should be used with care to
ensure that they do not inappropriately alter the state of the associated
object.
At present, all implementations provided by the LDAP SDK are at least mostly threadsafe and can be used to process multiple requests concurrently. However, this is not a hard requirement and it is conceivable that in the future a new implementation could be added which is not inherently threadsafe. It is recommended that code which requires thread safety either provide their own external synchronization or use one of the subclasses which explicitly provides thread safety rather than relying on this generic interface.
-
Method Summary
Modifier and TypeMethodDescriptionadd(AddRequest addRequest) Processes the provided add request.Processes an add operation with the provided information.add(ReadOnlyAddRequest addRequest) Processes the provided add request.Processes an add operation with the provided information.Processes an add operation with the provided information.add(String dn, Collection<Attribute> attributes) Processes an add operation with the provided information.compare(CompareRequest compareRequest) Processes the provided compare request.compare(ReadOnlyCompareRequest compareRequest) Processes the provided compare request.Processes a compare operation with the provided information.delete(DeleteRequest deleteRequest) Processes the provided delete request.delete(ReadOnlyDeleteRequest deleteRequest) Processes the provided delete request.Deletes the entry with the specified DN.Retrieves the entry with the specified DN.Retrieves the entry with the specified DN.Retrieves the directory server root DSE.Retrieves the directory server schema definitions, using the subschema subentry DN contained in the server's root DSE.Retrieves the directory server schema definitions that govern the specified entry.modify(ModifyRequest modifyRequest) Processes the provided modify request.modify(ReadOnlyModifyRequest modifyRequest) Processes the provided modify request.Processes a modify request from the provided LDIF representation of the changes.modify(String dn, Modification mod) Applies the provided modification to the specified entry.modify(String dn, Modification... mods) Applies the provided set of modifications to the specified entry.modify(String dn, List<Modification> mods) Applies the provided set of modifications to the specified entry.modifyDN(ModifyDNRequest modifyDNRequest) Processes the provided modify DN request.modifyDN(ReadOnlyModifyDNRequest modifyDNRequest) Processes the provided modify DN request.Performs a modify DN operation with the provided information.Performs a modify DN operation with the provided information.search(ReadOnlySearchRequest searchRequest) Processes the provided search request.search(SearchRequest searchRequest) Processes the provided search request.search(SearchResultListener searchResultListener, String baseDN, SearchScope scope, DereferencePolicy derefPolicy, int sizeLimit, int timeLimit, boolean typesOnly, Filter filter, String... attributes) Processes a search operation with the provided information.search(SearchResultListener searchResultListener, String baseDN, SearchScope scope, DereferencePolicy derefPolicy, int sizeLimit, int timeLimit, boolean typesOnly, String filter, String... attributes) Processes a search operation with the provided information.search(SearchResultListener searchResultListener, String baseDN, SearchScope scope, Filter filter, String... attributes) Processes a search operation with the provided information.search(SearchResultListener searchResultListener, String baseDN, SearchScope scope, String filter, String... attributes) Processes a search operation with the provided information.search(String baseDN, SearchScope scope, DereferencePolicy derefPolicy, int sizeLimit, int timeLimit, boolean typesOnly, Filter filter, String... attributes) Processes a search operation with the provided information.search(String baseDN, SearchScope scope, DereferencePolicy derefPolicy, int sizeLimit, int timeLimit, boolean typesOnly, String filter, String... attributes) Processes a search operation with the provided information.search(String baseDN, SearchScope scope, Filter filter, String... attributes) Processes a search operation with the provided information.search(String baseDN, SearchScope scope, String filter, String... attributes) Processes a search operation with the provided information.searchForEntry(ReadOnlySearchRequest searchRequest) Processes the provided search request.searchForEntry(SearchRequest searchRequest) Processes the provided search request.searchForEntry(String baseDN, SearchScope scope, DereferencePolicy derefPolicy, int timeLimit, boolean typesOnly, Filter filter, String... attributes) Processes a search operation with the provided information.searchForEntry(String baseDN, SearchScope scope, DereferencePolicy derefPolicy, int timeLimit, boolean typesOnly, String filter, String... attributes) Processes a search operation with the provided information.searchForEntry(String baseDN, SearchScope scope, Filter filter, String... attributes) Processes a search operation with the provided information.searchForEntry(String baseDN, SearchScope scope, String filter, String... attributes) Processes a search operation with the provided information.
-
Method Details
-
getRootDSE
Retrieves the directory server root DSE.- Returns:
- The directory server root DSE, or
nullif it is not available. - Throws:
LDAPException- If a problem occurs while attempting to retrieve the server root DSE.
-
getSchema
Retrieves the directory server schema definitions, using the subschema subentry DN contained in the server's root DSE. For directory servers containing a single schema, this should be sufficient for all purposes. For servers with multiple schemas, it may be necessary to specify the DN of the target entry for which to obtain the associated schema.- Returns:
- The directory server schema definitions, or
nullif the schema information could not be retrieved (e.g, the client does not have permission to read the server schema). - Throws:
LDAPException- If a problem occurs while attempting to retrieve the server schema.
-
getSchema
Retrieves the directory server schema definitions that govern the specified entry. The subschemaSubentry attribute will be retrieved from the target entry, and then the appropriate schema definitions will be loaded from the entry referenced by that attribute. This may be necessary to ensure correct behavior in servers that support multiple schemas.- Parameters:
entryDN- The DN of the entry for which to retrieve the associated schema definitions. It may benullor an empty string if the subschemaSubentry attribute should be retrieved from the server's root DSE.- Returns:
- The directory server schema definitions, or
nullif the schema information could not be retrieved (e.g, the client does not have permission to read the server schema). - Throws:
LDAPException- If a problem occurs while attempting to retrieve the server schema.
-
getEntry
Retrieves the entry with the specified DN. All user attributes will be requested in the entry to return.- Parameters:
dn- The DN of the entry to retrieve. It must not benull.- Returns:
- The requested entry, or
nullif the target entry does not exist or no entry was returned (e.g., if the authenticated user does not have permission to read the target entry). - Throws:
LDAPException- If a problem occurs while sending the request or reading the response.
-
getEntry
@Nullable SearchResultEntry getEntry(@NotNull String dn, @Nullable String... attributes) throws LDAPException Retrieves the entry with the specified DN.- Parameters:
dn- The DN of the entry to retrieve. It must not benull.attributes- The set of attributes to request for the target entry. If it isnull, then all user attributes will be requested.- Returns:
- The requested entry, or
nullif the target entry does not exist or no entry was returned (e.g., if the authenticated user does not have permission to read the target entry). - Throws:
LDAPException- If a problem occurs while sending the request or reading the response.
-
add
Processes an add operation with the provided information.- Parameters:
dn- The DN of the entry to add. It must not benull.attributes- The set of attributes to include in the entry to add. It must not benull.- Returns:
- The result of processing the add operation.
- Throws:
LDAPException- If the server rejects the add request, or if a problem is encountered while sending the request or reading the response.
-
add
@NotNull LDAPResult add(@NotNull String dn, @NotNull Collection<Attribute> attributes) throws LDAPException Processes an add operation with the provided information.- Parameters:
dn- The DN of the entry to add. It must not benull.attributes- The set of attributes to include in the entry to add. It must not benull.- Returns:
- The result of processing the add operation.
- Throws:
LDAPException- If the server rejects the add request, or if a problem is encountered while sending the request or reading the response.
-
add
Processes an add operation with the provided information.- Parameters:
entry- The entry to add. It must not benull.- Returns:
- The result of processing the add operation.
- Throws:
LDAPException- If the server rejects the add request, or if a problem is encountered while sending the request or reading the response.
-
add
Processes an add operation with the provided information.- Parameters:
ldifLines- The lines that comprise an LDIF representation of the entry to add. It must not be empty ornull.- Returns:
- The result of processing the add operation.
- Throws:
LDIFException- If the provided entry lines cannot be decoded as an entry in LDIF form.LDAPException- If the server rejects the add request, or if a problem is encountered while sending the request or reading the response.
-
add
Processes the provided add request.- Parameters:
addRequest- The add request to be processed. It must not benull.- Returns:
- The result of processing the add operation.
- Throws:
LDAPException- If the server rejects the add request, or if a problem is encountered while sending the request or reading the response.
-
add
Processes the provided add request.- Parameters:
addRequest- The add request to be processed. It must not benull.- Returns:
- The result of processing the add operation.
- Throws:
LDAPException- If the server rejects the add request, or if a problem is encountered while sending the request or reading the response.
-
compare
@NotNull CompareResult compare(@NotNull String dn, @NotNull String attributeName, @NotNull String assertionValue) throws LDAPException Processes a compare operation with the provided information.- Parameters:
dn- The DN of the entry in which to make the comparison. It must not benull.attributeName- The attribute name for which to make the comparison. It must not benull.assertionValue- The assertion value to verify in the target entry. It must not benull.- Returns:
- The result of processing the compare operation.
- Throws:
LDAPException- If the server rejects the compare request, or if a problem is encountered while sending the request or reading the response.
-
compare
Processes the provided compare request.- Parameters:
compareRequest- The compare request to be processed. It must not benull.- Returns:
- The result of processing the compare operation.
- Throws:
LDAPException- If the server rejects the compare request, or if a problem is encountered while sending the request or reading the response.
-
compare
Processes the provided compare request.- Parameters:
compareRequest- The compare request to be processed. It must not benull.- Returns:
- The result of processing the compare operation.
- Throws:
LDAPException- If the server rejects the compare request, or if a problem is encountered while sending the request or reading the response.
-
delete
Deletes the entry with the specified DN.- Parameters:
dn- The DN of the entry to delete. It must not benull.- Returns:
- The result of processing the delete operation.
- Throws:
LDAPException- If the server rejects the delete request, or if a problem is encountered while sending the request or reading the response.
-
delete
Processes the provided delete request.- Parameters:
deleteRequest- The delete request to be processed. It must not benull.- Returns:
- The result of processing the delete operation.
- Throws:
LDAPException- If the server rejects the delete request, or if a problem is encountered while sending the request or reading the response.
-
delete
Processes the provided delete request.- Parameters:
deleteRequest- The delete request to be processed. It must not benull.- Returns:
- The result of processing the delete operation.
- Throws:
LDAPException- If the server rejects the delete request, or if a problem is encountered while sending the request or reading the response.
-
modify
Applies the provided modification to the specified entry.- Parameters:
dn- The DN of the entry to modify. It must not benull.mod- The modification to apply to the target entry. It must not benull.- Returns:
- The result of processing the modify operation.
- Throws:
LDAPException- If the server rejects the modify request, or if a problem is encountered while sending the request or reading the response.
-
modify
Applies the provided set of modifications to the specified entry.- Parameters:
dn- The DN of the entry to modify. It must not benull.mods- The set of modifications to apply to the target entry. It must not benullor empty. *- Returns:
- The result of processing the modify operation.
- Throws:
LDAPException- If the server rejects the modify request, or if a problem is encountered while sending the request or reading the response.
-
modify
@NotNull LDAPResult modify(@NotNull String dn, @NotNull List<Modification> mods) throws LDAPException Applies the provided set of modifications to the specified entry.- Parameters:
dn- The DN of the entry to modify. It must not benull.mods- The set of modifications to apply to the target entry. It must not benullor empty.- Returns:
- The result of processing the modify operation.
- Throws:
LDAPException- If the server rejects the modify request, or if a problem is encountered while sending the request or reading the response.
-
modify
@NotNull LDAPResult modify(@NotNull String... ldifModificationLines) throws LDIFException, LDAPException Processes a modify request from the provided LDIF representation of the changes.- Parameters:
ldifModificationLines- The lines that comprise an LDIF representation of a modify change record. It must not benullor empty.- Returns:
- The result of processing the modify operation.
- Throws:
LDIFException- If the provided set of lines cannot be parsed as an LDIF modify change record.LDAPException- If the server rejects the modify request, or if a problem is encountered while sending the request or reading the response.
-
modify
Processes the provided modify request.- Parameters:
modifyRequest- The modify request to be processed. It must not benull.- Returns:
- The result of processing the modify operation.
- Throws:
LDAPException- If the server rejects the modify request, or if a problem is encountered while sending the request or reading the response.
-
modify
Processes the provided modify request.- Parameters:
modifyRequest- The modify request to be processed. It must not benull.- Returns:
- The result of processing the modify operation.
- Throws:
LDAPException- If the server rejects the modify request, or if a problem is encountered while sending the request or reading the response.
-
modifyDN
@NotNull LDAPResult modifyDN(@NotNull String dn, @NotNull String newRDN, boolean deleteOldRDN) throws LDAPException Performs a modify DN operation with the provided information.- Parameters:
dn- The current DN for the entry to rename. It must not benull.newRDN- The new RDN to use for the entry. It must not benull.deleteOldRDN- Indicates whether to delete the current RDN value from the entry.- Returns:
- The result of processing the modify DN operation.
- Throws:
LDAPException- If the server rejects the modify DN request, or if a problem is encountered while sending the request or reading the response.
-
modifyDN
@NotNull LDAPResult modifyDN(@NotNull String dn, @NotNull String newRDN, boolean deleteOldRDN, @Nullable String newSuperiorDN) throws LDAPException Performs a modify DN operation with the provided information.- Parameters:
dn- The current DN for the entry to rename. It must not benull.newRDN- The new RDN to use for the entry. It must not benull.deleteOldRDN- Indicates whether to delete the current RDN value from the entry.newSuperiorDN- The new superior DN for the entry. It may benullif the entry is not to be moved below a new parent.- Returns:
- The result of processing the modify DN operation.
- Throws:
LDAPException- If the server rejects the modify DN request, or if a problem is encountered while sending the request or reading the response.
-
modifyDN
Processes the provided modify DN request.- Parameters:
modifyDNRequest- The modify DN request to be processed. It must not benull.- Returns:
- The result of processing the modify DN operation.
- Throws:
LDAPException- If the server rejects the modify DN request, or if a problem is encountered while sending the request or reading the response.
-
modifyDN
Processes the provided modify DN request.- Parameters:
modifyDNRequest- The modify DN request to be processed. It must not benull.- Returns:
- The result of processing the modify DN operation.
- Throws:
LDAPException- If the server rejects the modify DN request, or if a problem is encountered while sending the request or reading the response.
-
search
@NotNull SearchResult search(@NotNull String baseDN, @NotNull SearchScope scope, @NotNull String filter, @Nullable String... attributes) throws LDAPSearchException Processes a search operation with the provided information. The search result entries and references will be collected internally and included in theSearchResultobject that is returned.
Note that if the search does not complete successfully, anLDAPSearchExceptionwill be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, theLDAPSearchExceptionmethods likegetEntryCount,getSearchEntries,getReferenceCount, andgetSearchReferencesmay be used to obtain information about those entries and references.- Parameters:
baseDN- The base DN for the search request. It must not benull.scope- The scope that specifies the range of entries that should be examined for the search.filter- The string representation of the filter to use to identify matching entries. It must not benull.attributes- The set of attributes that should be returned in matching entries. It may benullor empty if the default attribute set (all user attributes) is to be requested.- Returns:
- A search result object that provides information about the processing of the search, including the set of matching entries and search references returned by the server.
- Throws:
LDAPSearchException- If the search does not complete successfully, or if a problem is encountered while parsing the provided filter string, sending the request, or reading the response. If one or more entries or references were returned before the failure was encountered, then theLDAPSearchExceptionobject may be examined to obtain information about those entries and/or references.
-
search
@NotNull SearchResult search(@NotNull String baseDN, @NotNull SearchScope scope, @NotNull Filter filter, @Nullable String... attributes) throws LDAPSearchException Processes a search operation with the provided information. The search result entries and references will be collected internally and included in theSearchResultobject that is returned.
Note that if the search does not complete successfully, anLDAPSearchExceptionwill be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, theLDAPSearchExceptionmethods likegetEntryCount,getSearchEntries,getReferenceCount, andgetSearchReferencesmay be used to obtain information about those entries and references.- Parameters:
baseDN- The base DN for the search request. It must not benull.scope- The scope that specifies the range of entries that should be examined for the search.filter- The filter to use to identify matching entries. It must not benull.attributes- The set of attributes that should be returned in matching entries. It may benullor empty if the default attribute set (all user attributes) is to be requested.- Returns:
- A search result object that provides information about the processing of the search, including the set of matching entries and search references returned by the server.
- Throws:
LDAPSearchException- If the search does not complete successfully, or if a problem is encountered while sending the request or reading the response. If one or more entries or references were returned before the failure was encountered, then theLDAPSearchExceptionobject may be examined to obtain information about those entries and/or references.
-
search
@NotNull SearchResult search(@Nullable SearchResultListener searchResultListener, @NotNull String baseDN, @NotNull SearchScope scope, @NotNull String filter, @Nullable String... attributes) throws LDAPSearchException Processes a search operation with the provided information.
Note that if the search does not complete successfully, anLDAPSearchExceptionwill be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, theLDAPSearchExceptionmethods likegetEntryCount,getSearchEntries,getReferenceCount, andgetSearchReferencesmay be used to obtain information about those entries and references (although if a search result listener was provided, then it will have been used to make any entries and references available, and they will not be available through thegetSearchEntriesandgetSearchReferencesmethods).- Parameters:
searchResultListener- The search result listener that should be used to return results to the client. It may benullif the search results should be collected internally and returned in theSearchResultobject.baseDN- The base DN for the search request. It must not benull.scope- The scope that specifies the range of entries that should be examined for the search.filter- The string representation of the filter to use to identify matching entries. It must not benull.attributes- The set of attributes that should be returned in matching entries. It may benullor empty if the default attribute set (all user attributes) is to be requested.- Returns:
- A search result object that provides information about the processing of the search, potentially including the set of matching entries and search references returned by the server.
- Throws:
LDAPSearchException- If the search does not complete successfully, or if a problem is encountered while parsing the provided filter string, sending the request, or reading the response. If one or more entries or references were returned before the failure was encountered, then theLDAPSearchExceptionobject may be examined to obtain information about those entries and/or references.
-
search
@NotNull SearchResult search(@Nullable SearchResultListener searchResultListener, @NotNull String baseDN, @NotNull SearchScope scope, @NotNull Filter filter, @Nullable String... attributes) throws LDAPSearchException Processes a search operation with the provided information.
Note that if the search does not complete successfully, anLDAPSearchExceptionwill be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, theLDAPSearchExceptionmethods likegetEntryCount,getSearchEntries,getReferenceCount, andgetSearchReferencesmay be used to obtain information about those entries and references (although if a search result listener was provided, then it will have been used to make any entries and references available, and they will not be available through thegetSearchEntriesandgetSearchReferencesmethods).- Parameters:
searchResultListener- The search result listener that should be used to return results to the client. It may benullif the search results should be collected internally and returned in theSearchResultobject.baseDN- The base DN for the search request. It must not benull.scope- The scope that specifies the range of entries that should be examined for the search.filter- The filter to use to identify matching entries. It must not benull.attributes- The set of attributes that should be returned in matching entries. It may benullor empty if the default attribute set (all user attributes) is to be requested.- Returns:
- A search result object that provides information about the processing of the search, potentially including the set of matching entries and search references returned by the server.
- Throws:
LDAPSearchException- If the search does not complete successfully, or if a problem is encountered while sending the request or reading the response. If one or more entries or references were returned before the failure was encountered, then theLDAPSearchExceptionobject may be examined to obtain information about those entries and/or references.
-
search
@NotNull SearchResult search(@NotNull String baseDN, @NotNull SearchScope scope, @NotNull DereferencePolicy derefPolicy, int sizeLimit, int timeLimit, boolean typesOnly, @NotNull String filter, @Nullable String... attributes) throws LDAPSearchException Processes a search operation with the provided information. The search result entries and references will be collected internally and included in theSearchResultobject that is returned.
Note that if the search does not complete successfully, anLDAPSearchExceptionwill be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, theLDAPSearchExceptionmethods likegetEntryCount,getSearchEntries,getReferenceCount, andgetSearchReferencesmay be used to obtain information about those entries and references.- Parameters:
baseDN- The base DN for the search request. It must not benull.scope- The scope that specifies the range of entries that should be examined for the search.derefPolicy- The dereference policy the server should use for any aliases encountered while processing the search.sizeLimit- The maximum number of entries that the server should return for the search. A value of zero indicates that there should be no limit.timeLimit- The maximum length of time in seconds that the server should spend processing this search request. A value of zero indicates that there should be no limit.typesOnly- Indicates whether to return only attribute names in matching entries, or both attribute names and values.filter- The string representation of the filter to use to identify matching entries. It must not benull.attributes- The set of attributes that should be returned in matching entries. It may benullor empty if the default attribute set (all user attributes) is to be requested.- Returns:
- A search result object that provides information about the processing of the search, including the set of matching entries and search references returned by the server.
- Throws:
LDAPSearchException- If the search does not complete successfully, or if a problem is encountered while parsing the provided filter string, sending the request, or reading the response. If one or more entries or references were returned before the failure was encountered, then theLDAPSearchExceptionobject may be examined to obtain information about those entries and/or references.
-
search
@NotNull SearchResult search(@NotNull String baseDN, @NotNull SearchScope scope, @NotNull DereferencePolicy derefPolicy, int sizeLimit, int timeLimit, boolean typesOnly, @NotNull Filter filter, @Nullable String... attributes) throws LDAPSearchException Processes a search operation with the provided information. The search result entries and references will be collected internally and included in theSearchResultobject that is returned.
Note that if the search does not complete successfully, anLDAPSearchExceptionwill be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, theLDAPSearchExceptionmethods likegetEntryCount,getSearchEntries,getReferenceCount, andgetSearchReferencesmay be used to obtain information about those entries and references.- Parameters:
baseDN- The base DN for the search request. It must not benull.scope- The scope that specifies the range of entries that should be examined for the search.derefPolicy- The dereference policy the server should use for any aliases encountered while processing the search.sizeLimit- The maximum number of entries that the server should return for the search. A value of zero indicates that there should be no limit.timeLimit- The maximum length of time in seconds that the server should spend processing this search request. A value of zero indicates that there should be no limit.typesOnly- Indicates whether to return only attribute names in matching entries, or both attribute names and values.filter- The filter to use to identify matching entries. It must not benull.attributes- The set of attributes that should be returned in matching entries. It may benullor empty if the default attribute set (all user attributes) is to be requested.- Returns:
- A search result object that provides information about the processing of the search, including the set of matching entries and search references returned by the server.
- Throws:
LDAPSearchException- If the search does not complete successfully, or if a problem is encountered while sending the request or reading the response. If one or more entries or references were returned before the failure was encountered, then theLDAPSearchExceptionobject may be examined to obtain information about those entries and/or references.
-
search
@NotNull SearchResult search(@Nullable SearchResultListener searchResultListener, @NotNull String baseDN, @NotNull SearchScope scope, @NotNull DereferencePolicy derefPolicy, int sizeLimit, int timeLimit, boolean typesOnly, @NotNull String filter, @Nullable String... attributes) throws LDAPSearchException Processes a search operation with the provided information.
Note that if the search does not complete successfully, anLDAPSearchExceptionwill be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, theLDAPSearchExceptionmethods likegetEntryCount,getSearchEntries,getReferenceCount, andgetSearchReferencesmay be used to obtain information about those entries and references (although if a search result listener was provided, then it will have been used to make any entries and references available, and they will not be available through thegetSearchEntriesandgetSearchReferencesmethods).- Parameters:
searchResultListener- The search result listener that should be used to return results to the client. It may benullif the search results should be collected internally and returned in theSearchResultobject.baseDN- The base DN for the search request. It must not benull.scope- The scope that specifies the range of entries that should be examined for the search.derefPolicy- The dereference policy the server should use for any aliases encountered while processing the search.sizeLimit- The maximum number of entries that the server should return for the search. A value of zero indicates that there should be no limit.timeLimit- The maximum length of time in seconds that the server should spend processing this search request. A value of zero indicates that there should be no limit.typesOnly- Indicates whether to return only attribute names in matching entries, or both attribute names and values.filter- The string representation of the filter to use to identify matching entries. It must not benull.attributes- The set of attributes that should be returned in matching entries. It may benullor empty if the default attribute set (all user attributes) is to be requested.- Returns:
- A search result object that provides information about the processing of the search, potentially including the set of matching entries and search references returned by the server.
- Throws:
LDAPSearchException- If the search does not complete successfully, or if a problem is encountered while parsing the provided filter string, sending the request, or reading the response. If one or more entries or references were returned before the failure was encountered, then theLDAPSearchExceptionobject may be examined to obtain information about those entries and/or references.
-
search
@NotNull SearchResult search(@Nullable SearchResultListener searchResultListener, @NotNull String baseDN, @NotNull SearchScope scope, @NotNull DereferencePolicy derefPolicy, int sizeLimit, int timeLimit, boolean typesOnly, @NotNull Filter filter, @Nullable String... attributes) throws LDAPSearchException Processes a search operation with the provided information.
Note that if the search does not complete successfully, anLDAPSearchExceptionwill be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, theLDAPSearchExceptionmethods likegetEntryCount,getSearchEntries,getReferenceCount, andgetSearchReferencesmay be used to obtain information about those entries and references (although if a search result listener was provided, then it will have been used to make any entries and references available, and they will not be available through thegetSearchEntriesandgetSearchReferencesmethods).- Parameters:
searchResultListener- The search result listener that should be used to return results to the client. It may benullif the search results should be collected internally and returned in theSearchResultobject.baseDN- The base DN for the search request. It must not benull.scope- The scope that specifies the range of entries that should be examined for the search.derefPolicy- The dereference policy the server should use for any aliases encountered while processing the search.sizeLimit- The maximum number of entries that the server should return for the search. A value of zero indicates that there should be no limit.timeLimit- The maximum length of time in seconds that the server should spend processing this search request. A value of zero indicates that there should be no limit.typesOnly- Indicates whether to return only attribute names in matching entries, or both attribute names and values.filter- The filter to use to identify matching entries. It must not benull.attributes- The set of attributes that should be returned in matching entries. It may benullor empty if the default attribute set (all user attributes) is to be requested.- Returns:
- A search result object that provides information about the processing of the search, potentially including the set of matching entries and search references returned by the server.
- Throws:
LDAPSearchException- If the search does not complete successfully, or if a problem is encountered while sending the request or reading the response. If one or more entries or references were returned before the failure was encountered, then theLDAPSearchExceptionobject may be examined to obtain information about those entries and/or references.
-
search
Processes the provided search request.
Note that if the search does not complete successfully, anLDAPSearchExceptionwill be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, theLDAPSearchExceptionmethods likegetEntryCount,getSearchEntries,getReferenceCount, andgetSearchReferencesmay be used to obtain information about those entries and references (although if a search result listener was provided, then it will have been used to make any entries and references available, and they will not be available through thegetSearchEntriesandgetSearchReferencesmethods).- Parameters:
searchRequest- The search request to be processed. It must not benull.- Returns:
- A search result object that provides information about the processing of the search, potentially including the set of matching entries and search references returned by the server.
- Throws:
LDAPSearchException- If the search does not complete successfully, or if a problem is encountered while sending the request or reading the response. If one or more entries or references were returned before the failure was encountered, then theLDAPSearchExceptionobject may be examined to obtain information about those entries and/or references.
-
search
@NotNull SearchResult search(@NotNull ReadOnlySearchRequest searchRequest) throws LDAPSearchException Processes the provided search request.
Note that if the search does not complete successfully, anLDAPSearchExceptionwill be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, theLDAPSearchExceptionmethods likegetEntryCount,getSearchEntries,getReferenceCount, andgetSearchReferencesmay be used to obtain information about those entries and references (although if a search result listener was provided, then it will have been used to make any entries and references available, and they will not be available through thegetSearchEntriesandgetSearchReferencesmethods).- Parameters:
searchRequest- The search request to be processed. It must not benull.- Returns:
- A search result object that provides information about the processing of the search, potentially including the set of matching entries and search references returned by the server.
- Throws:
LDAPSearchException- If the search does not complete successfully, or if a problem is encountered while sending the request or reading the response. If one or more entries or references were returned before the failure was encountered, then theLDAPSearchExceptionobject may be examined to obtain information about those entries and/or references.
-
searchForEntry
@Nullable SearchResultEntry searchForEntry(@NotNull String baseDN, @NotNull SearchScope scope, @NotNull String filter, @Nullable String... attributes) throws LDAPSearchException Processes a search operation with the provided information. It is expected that at most one entry will be returned from the search, and that no additional content from the successful search result (e.g., diagnostic message or response controls) are needed.
Note that if the search does not complete successfully, anLDAPSearchExceptionwill be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, theLDAPSearchExceptionmethods likegetEntryCount,getSearchEntries,getReferenceCount, andgetSearchReferencesmay be used to obtain information about those entries and references.- Parameters:
baseDN- The base DN for the search request. It must not benull.scope- The scope that specifies the range of entries that should be examined for the search.filter- The string representation of the filter to use to identify matching entries. It must not benull.attributes- The set of attributes that should be returned in matching entries. It may benullor empty if the default attribute set (all user attributes) is to be requested.- Returns:
- The entry that was returned from the search, or
nullif no entry was returned or the base entry does not exist. - Throws:
LDAPSearchException- If the search does not complete successfully, if more than a single entry is returned, or if a problem is encountered while parsing the provided filter string, sending the request, or reading the response. If one or more entries or references were returned before the failure was encountered, then theLDAPSearchExceptionobject may be examined to obtain information about those entries and/or references.
-
searchForEntry
@Nullable SearchResultEntry searchForEntry(@NotNull String baseDN, @NotNull SearchScope scope, @NotNull Filter filter, @Nullable String... attributes) throws LDAPSearchException Processes a search operation with the provided information. It is expected that at most one entry will be returned from the search, and that no additional content from the successful search result (e.g., diagnostic message or response controls) are needed.
Note that if the search does not complete successfully, anLDAPSearchExceptionwill be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, theLDAPSearchExceptionmethods likegetEntryCount,getSearchEntries,getReferenceCount, andgetSearchReferencesmay be used to obtain information about those entries and references.- Parameters:
baseDN- The base DN for the search request. It must not benull.scope- The scope that specifies the range of entries that should be examined for the search.filter- The string representation of the filter to use to identify matching entries. It must not benull.attributes- The set of attributes that should be returned in matching entries. It may benullor empty if the default attribute set (all user attributes) is to be requested.- Returns:
- The entry that was returned from the search, or
nullif no entry was returned or the base entry does not exist. - Throws:
LDAPSearchException- If the search does not complete successfully, if more than a single entry is returned, or if a problem is encountered while parsing the provided filter string, sending the request, or reading the response. If one or more entries or references were returned before the failure was encountered, then theLDAPSearchExceptionobject may be examined to obtain information about those entries and/or references.
-
searchForEntry
@Nullable SearchResultEntry searchForEntry(@NotNull String baseDN, @NotNull SearchScope scope, @NotNull DereferencePolicy derefPolicy, int timeLimit, boolean typesOnly, @NotNull String filter, @Nullable String... attributes) throws LDAPSearchException Processes a search operation with the provided information. It is expected that at most one entry will be returned from the search, and that no additional content from the successful search result (e.g., diagnostic message or response controls) are needed.
Note that if the search does not complete successfully, anLDAPSearchExceptionwill be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, theLDAPSearchExceptionmethods likegetEntryCount,getSearchEntries,getReferenceCount, andgetSearchReferencesmay be used to obtain information about those entries and references.- Parameters:
baseDN- The base DN for the search request. It must not benull.scope- The scope that specifies the range of entries that should be examined for the search.derefPolicy- The dereference policy the server should use for any aliases encountered while processing the search.timeLimit- The maximum length of time in seconds that the server should spend processing this search request. A value of zero indicates that there should be no limit.typesOnly- Indicates whether to return only attribute names in matching entries, or both attribute names and values.filter- The string representation of the filter to use to identify matching entries. It must not benull.attributes- The set of attributes that should be returned in matching entries. It may benullor empty if the default attribute set (all user attributes) is to be requested.- Returns:
- The entry that was returned from the search, or
nullif no entry was returned or the base entry does not exist. - Throws:
LDAPSearchException- If the search does not complete successfully, if more than a single entry is returned, or if a problem is encountered while parsing the provided filter string, sending the request, or reading the response. If one or more entries or references were returned before the failure was encountered, then theLDAPSearchExceptionobject may be examined to obtain information about those entries and/or references.
-
searchForEntry
@Nullable SearchResultEntry searchForEntry(@NotNull String baseDN, @NotNull SearchScope scope, @NotNull DereferencePolicy derefPolicy, int timeLimit, boolean typesOnly, @NotNull Filter filter, @Nullable String... attributes) throws LDAPSearchException Processes a search operation with the provided information. It is expected that at most one entry will be returned from the search, and that no additional content from the successful search result (e.g., diagnostic message or response controls) are needed.
Note that if the search does not complete successfully, anLDAPSearchExceptionwill be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, theLDAPSearchExceptionmethods likegetEntryCount,getSearchEntries,getReferenceCount, andgetSearchReferencesmay be used to obtain information about those entries and references.- Parameters:
baseDN- The base DN for the search request. It must not benull.scope- The scope that specifies the range of entries that should be examined for the search.derefPolicy- The dereference policy the server should use for any aliases encountered while processing the search.timeLimit- The maximum length of time in seconds that the server should spend processing this search request. A value of zero indicates that there should be no limit.typesOnly- Indicates whether to return only attribute names in matching entries, or both attribute names and values.filter- The filter to use to identify matching entries. It must not benull.attributes- The set of attributes that should be returned in matching entries. It may benullor empty if the default attribute set (all user attributes) is to be requested.- Returns:
- The entry that was returned from the search, or
nullif no entry was returned or the base entry does not exist. - Throws:
LDAPSearchException- If the search does not complete successfully, if more than a single entry is returned, or if a problem is encountered while parsing the provided filter string, sending the request, or reading the response. If one or more entries or references were returned before the failure was encountered, then theLDAPSearchExceptionobject may be examined to obtain information about those entries and/or references.
-
searchForEntry
@Nullable SearchResultEntry searchForEntry(@NotNull SearchRequest searchRequest) throws LDAPSearchException Processes the provided search request. It is expected that at most one entry will be returned from the search, and that no additional content from the successful search result (e.g., diagnostic message or response controls) are needed.
Note that if the search does not complete successfully, anLDAPSearchExceptionwill be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, theLDAPSearchExceptionmethods likegetEntryCount,getSearchEntries,getReferenceCount, andgetSearchReferencesmay be used to obtain information about those entries and references.- Parameters:
searchRequest- The search request to be processed. If it is configured with a search result listener or a size limit other than one, then the provided request will be duplicated with the appropriate settings.- Returns:
- The entry that was returned from the search, or
nullif no entry was returned or the base entry does not exist. - Throws:
LDAPSearchException- If the search does not complete successfully, if more than a single entry is returned, or if a problem is encountered while parsing the provided filter string, sending the request, or reading the response. If one or more entries or references were returned before the failure was encountered, then theLDAPSearchExceptionobject may be examined to obtain information about those entries and/or references.
-
searchForEntry
@Nullable SearchResultEntry searchForEntry(@NotNull ReadOnlySearchRequest searchRequest) throws LDAPSearchException Processes the provided search request. It is expected that at most one entry will be returned from the search, and that no additional content from the successful search result (e.g., diagnostic message or response controls) are needed.
Note that if the search does not complete successfully, anLDAPSearchExceptionwill be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, theLDAPSearchExceptionmethods likegetEntryCount,getSearchEntries,getReferenceCount, andgetSearchReferencesmay be used to obtain information about those entries and references.- Parameters:
searchRequest- The search request to be processed. If it is configured with a search result listener or a size limit other than one, then the provided request will be duplicated with the appropriate settings.- Returns:
- The entry that was returned from the search, or
nullif no entry was returned or the base entry does not exist. - Throws:
LDAPSearchException- If the search does not complete successfully, if more than a single entry is returned, or if a problem is encountered while parsing the provided filter string, sending the request, or reading the response. If one or more entries or references were returned before the failure was encountered, then theLDAPSearchExceptionobject may be examined to obtain information about those entries and/or references.
-