public class LdapConnectionTemplate extends Object implements LdapConnectionOperations, ModelFactory
Constructor and Description |
---|
LdapConnectionTemplate(LdapConnectionPool connectionPool)
Creates a new instance of LdapConnectionTemplate.
|
Modifier and Type | Method and Description |
---|---|
AddResponse |
add(AddRequest addRequest)
Adds an entry specified by an AddRequest to the LDAP server.
|
AddResponse |
add(Dn dn,
Attribute... attributes)
Adds an entry specified by a Dn and an array of Attribute's to the LDAP
server.
|
AddResponse |
add(Dn dn,
RequestBuilder<AddRequest> requestBuilder)
Adds an entry specified by a Dn, to be filled out by a RequestBuilder,
to the LDAP server.
|
PasswordWarning |
authenticate(Dn userDn,
char[] password)
Attempts to authenticate the supplied credentials.
|
PasswordWarning |
authenticate(Dn baseDn,
String filter,
SearchScope scope,
char[] password)
Attempts to authenticate the supplied credentials against the first
entry found matching the search criteria.
|
PasswordWarning |
authenticate(SearchRequest searchRequest,
char[] password)
Attempts to authenticate the supplied credentials against the first
entry found matching the search criteria.
|
PasswordWarning |
authenticate(String baseDn,
String filter,
SearchScope scope,
char[] password)
Attempts to authenticate the supplied credentials against the first
entry found matching the search criteria.
|
DeleteResponse |
delete(DeleteRequest deleteRequest)
Deletes an entry specified by a DeleteRequest from the LDAP server.
|
DeleteResponse |
delete(Dn dn)
Deletes an entry specified by Dn from the LDAP server.
|
DeleteResponse |
delete(Dn dn,
RequestBuilder<DeleteRequest> requestBuilder)
Deletes an entry specified by Dn, and whose request is configured
by a RequestBuilder, from the LDAP server.
|
<T> T |
execute(ConnectionCallback<T> connectionCallback)
Executes the
connectionCallback , supplying it a managed
connection. |
<T> T |
lookup(Dn dn,
EntryMapper<T> entryMapper)
Performs a lookup, and supplies the matching entry to the
entryMapper . |
<T> T |
lookup(Dn dn,
String[] attributes,
EntryMapper<T> entryMapper)
Performs a lookup, requesting
attributes , and supplies
the matching entry to the entryMapper . |
ModifyResponse |
modify(Dn dn,
RequestBuilder<ModifyRequest> requestBuilder)
Modifies an entry specified by Dn, and whose request is configured
by a RequestBuilder, on the LDAP server.
|
ModifyResponse |
modify(ModifyRequest modifyRequest)
Modifies an entry specified by a ModifyRequest on the LDAP server.
|
void |
modifyPassword(Dn userDn,
char[] newPassword)
Modifies the password for
userDn to
newPassword using the admin account. |
void |
modifyPassword(Dn userDn,
char[] oldPassword,
char[] newPassword)
Modifies the password for
userDn from
oldPassword to newPassword . |
void |
modifyPassword(Dn userDn,
char[] oldPassword,
char[] newPassword,
boolean asAdmin)
Modifies the password for
userDn from
oldPassword to newPassword , optionally using
an admin account. |
AddRequest |
newAddRequest(Entry entry)
Returns a new
AddRequest for the entry . |
Attribute |
newAttribute(String name)
Returns a new Attribute for with the provided
name and
a null value. |
Attribute |
newAttribute(String name,
byte[]... values)
Returns a new Attribute for with the provided
name and
value(s) . |
Attribute |
newAttribute(String name,
String... values)
Returns a new Attribute for with the provided
name and
value(s) . |
Attribute |
newAttribute(String name,
Value... values)
Returns a new Attribute for with the provided
name and
value(s) . |
DeleteRequest |
newDeleteRequest(Dn dn)
Returns a new
DeleteRequest for the dn . |
Dn |
newDn(String dn)
Returns a
Dn that represents dn . |
Entry |
newEntry(Dn dn)
Returns a
Entry with the specified dn . |
Entry |
newEntry(String dn)
Returns a
Entry with the specified dn . |
ModifyRequest |
newModifyRequest(Dn dn)
Returns a new
ModifyRequest for the dn . |
ModifyRequest |
newModifyRequest(String dn)
Returns a new
ModifyRequest for the dn . |
SearchRequest |
newSearchRequest(Dn baseDn,
FilterBuilder filter,
SearchScope scope)
Returns a new
SearchRequest over baseDn in
scope matching filter returning
all normal attributes for each matching entry. |
SearchRequest |
newSearchRequest(Dn baseDn,
FilterBuilder filter,
SearchScope scope,
String... attributes)
Returns a new
SearchRequest over baseDn in
scope matching filter returning
attributes for each matching entry. |
SearchRequest |
newSearchRequest(Dn baseDn,
String filter,
SearchScope scope)
Returns a new
SearchRequest over baseDn in
scope matching filter returning
all normal attributes for each matching entry. |
SearchRequest |
newSearchRequest(Dn baseDn,
String filter,
SearchScope scope,
String... attributes)
Returns a new
SearchRequest over baseDn in
scope matching filter returning
attributes for each matching entry. |
SearchRequest |
newSearchRequest(String baseDn,
FilterBuilder filter,
SearchScope scope)
Returns a new
SearchRequest over baseDn in
scope matching filter returning
all normal attributes for each matching entry. |
SearchRequest |
newSearchRequest(String baseDn,
FilterBuilder filter,
SearchScope scope,
String... attributes)
Returns a new
SearchRequest over baseDn in
scope matching filter returning
attributes for each matching entry. |
SearchRequest |
newSearchRequest(String baseDn,
String filter,
SearchScope scope)
Returns a new
SearchRequest over baseDn in
scope matching filter returning
all normal attributes for each matching entry. |
SearchRequest |
newSearchRequest(String baseDn,
String filter,
SearchScope scope,
String... attributes)
Returns a new
SearchRequest over baseDn in
scope matching filter returning
attributes for each matching entry. |
<T extends ResultResponse> |
responseOrException(T response)
Checks the supplied response for its result code, and if not
ResultCodeEnum#SUCCESS, an exception is thrown.
|
<T> List<T> |
search(Dn baseDn,
FilterBuilder filter,
SearchScope scope,
EntryMapper<T> entryMapper)
Searches for the entries matching the supplied criteria, feeding the
result into the
entryMapper . |
<T> List<T> |
search(Dn baseDn,
FilterBuilder filter,
SearchScope scope,
String[] attributes,
EntryMapper<T> entryMapper)
Searches for the entries matching the supplied criteria, feeding the
result into the
entryMapper , querying only the requested
attributes. |
<T> List<T> |
search(Dn baseDn,
String filter,
SearchScope scope,
EntryMapper<T> entryMapper)
Searches for the entries matching the supplied criteria, feeding the
result into the
entryMapper . |
<T> List<T> |
search(Dn baseDn,
String filter,
SearchScope scope,
String[] attributes,
EntryMapper<T> entryMapper)
Searches for the entries matching the supplied criteria, feeding the
result into the
entryMapper , querying only the requested
attributes. |
<T> List<T> |
search(SearchRequest searchRequest,
EntryMapper<T> entryMapper)
Searches for the entries matching the supplied
searchRequest , feeding the result into the
entryMapper . |
<T> List<T> |
search(String baseDn,
FilterBuilder filter,
SearchScope scope,
EntryMapper<T> entryMapper)
Searches for the entries matching the supplied criteria, feeding the
result into the
entryMapper . |
<T> List<T> |
search(String baseDn,
FilterBuilder filter,
SearchScope scope,
String[] attributes,
EntryMapper<T> entryMapper)
Searches for the entries matching the supplied criteria, feeding the
result into the
entryMapper , querying only the requested
attributes. |
<T> List<T> |
search(String baseDn,
String filter,
SearchScope scope,
EntryMapper<T> entryMapper)
Searches for the entries matching the supplied criteria, feeding the
result into the
entryMapper . |
<T> List<T> |
search(String baseDn,
String filter,
SearchScope scope,
String[] attributes,
EntryMapper<T> entryMapper)
Searches for the entries matching the supplied criteria, feeding the
result into the
entryMapper , querying only the requested
attributes. |
<T> T |
searchFirst(Dn baseDn,
FilterBuilder filter,
SearchScope scope,
EntryMapper<T> entryMapper)
Searches for the first entry matching the supplied criteria, feeding the
result into the
entryMapper . |
<T> T |
searchFirst(Dn baseDn,
FilterBuilder filter,
SearchScope scope,
String[] attributes,
EntryMapper<T> entryMapper)
Searches for the first entry matching the supplied criteria, feeding the
result into the
entryMapper , querying only the requested
attributes. |
<T> T |
searchFirst(Dn baseDn,
String filter,
SearchScope scope,
EntryMapper<T> entryMapper)
Searches for the first entry matching the supplied criteria, feeding the
result into the
entryMapper . |
<T> T |
searchFirst(Dn baseDn,
String filter,
SearchScope scope,
String[] attributes,
EntryMapper<T> entryMapper)
Searches for the first entry matching the supplied criteria, feeding the
result into the
entryMapper , querying only the requested
attributes. |
<T> T |
searchFirst(SearchRequest searchRequest,
EntryMapper<T> entryMapper)
Searches for the first entry matching the supplied
searchRequest , feeding the result into the
entryMapper . |
<T> T |
searchFirst(String baseDn,
FilterBuilder filter,
SearchScope scope,
EntryMapper<T> entryMapper)
Searches for the first entry matching the supplied criteria, feeding the
result into the
entryMapper . |
<T> T |
searchFirst(String baseDn,
FilterBuilder filter,
SearchScope scope,
String[] attributes,
EntryMapper<T> entryMapper)
Searches for the first entry matching the supplied criteria, feeding the
result into the
entryMapper , querying only the requested
attributes. |
<T> T |
searchFirst(String baseDn,
String filter,
SearchScope scope,
EntryMapper<T> entryMapper)
Searches for the first entry matching the supplied criteria, feeding the
result into the
entryMapper . |
<T> T |
searchFirst(String baseDn,
String filter,
SearchScope scope,
String[] attributes,
EntryMapper<T> entryMapper)
Searches for the first entry matching the supplied criteria, feeding the
result into the
entryMapper , querying only the requested
attributes. |
void |
setModelFactory(ModelFactory modelFactory)
Sets the
modelFactory implementation for this facade. |
void |
setPasswordPolicyResponder(PasswordPolicyResponder passwordPolicyResponder)
Sets the
passwordPolicyResponder implementation for this
facade. |
public LdapConnectionTemplate(LdapConnectionPool connectionPool)
connectionPool
- The pool to obtain connections from.public AddResponse add(Dn dn, Attribute... attributes)
add
in interface LdapConnectionOperations
dn
- The distinguished name of the new entryattributes
- The attributes of the new entrypublic AddResponse add(Dn dn, RequestBuilder<AddRequest> requestBuilder)
add
in interface LdapConnectionOperations
dn
- The distinguished name of the new entryrequestBuilder
- The request builderpublic AddResponse add(AddRequest addRequest)
add
in interface LdapConnectionOperations
addRequest
- The requestpublic PasswordWarning authenticate(String baseDn, String filter, SearchScope scope, char[] password) throws PasswordException
authenticate
in interface LdapConnectionOperations
baseDn
- The base DN from which to start the search for the user to authenticatefilter
- The filter selecting the entriesscope
- The scope to look frompassword
- The passwordPasswordException
- If the authentication failedLdapConnectionOperations.authenticate(Dn, char[])
,
LdapConnectionOperations.searchFirst(String, String, SearchScope, EntryMapper)
public PasswordWarning authenticate(Dn baseDn, String filter, SearchScope scope, char[] password) throws PasswordException
authenticate
in interface LdapConnectionOperations
baseDn
- The base DN from which to start the search for the user to authenticatefilter
- The filter selecting the entriesscope
- The scope to look frompassword
- The passwordPasswordException
- If the authentication failedLdapConnectionOperations.authenticate(Dn, char[])
,
LdapConnectionOperations.searchFirst(Dn, String, SearchScope, EntryMapper)
public PasswordWarning authenticate(SearchRequest searchRequest, char[] password) throws PasswordException
authenticate
in interface LdapConnectionOperations
searchRequest
- The SearchRequst to use to find the user to authenticatepassword
- The passwordPasswordException
- If the authentication failedLdapConnectionOperations.authenticate(Dn, char[])
,
LdapConnectionOperations.searchFirst(SearchRequest, EntryMapper)
public PasswordWarning authenticate(Dn userDn, char[] password) throws PasswordException
authenticate
in interface LdapConnectionOperations
userDn
- The distinguished name of the userpassword
- The passwordPasswordException
- If authentication failspublic DeleteResponse delete(Dn dn)
delete
in interface LdapConnectionOperations
dn
- The distinguished name of the entrypublic DeleteResponse delete(Dn dn, RequestBuilder<DeleteRequest> requestBuilder)
delete
in interface LdapConnectionOperations
dn
- The distinguished name of the entryrequestBuilder
- The RequestBuilderpublic DeleteResponse delete(DeleteRequest deleteRequest)
delete
in interface LdapConnectionOperations
deleteRequest
- The requestpublic <T> T execute(ConnectionCallback<T> connectionCallback)
connectionCallback
, supplying it a managed
connection.execute
in interface LdapConnectionOperations
T
- The type of the mapped entryconnectionCallback
- The callbackpublic <T> T lookup(Dn dn, EntryMapper<T> entryMapper)
entryMapper
.lookup
in interface LdapConnectionOperations
T
- The type of the mapped entrydn
- The distinguished name of the entryentryMapper
- The mapper from entry to model objectentryMapper
returnspublic <T> T lookup(Dn dn, String[] attributes, EntryMapper<T> entryMapper)
attributes
, and supplies
the matching entry to the entryMapper
.lookup
in interface LdapConnectionOperations
T
- The type of the mapped entrydn
- The distinguished name of the entryattributes
- The attributes to be fetchedentryMapper
- The mapper from entry to model objectentryMapper
returnspublic void modifyPassword(Dn userDn, char[] newPassword) throws PasswordException
userDn
to
newPassword
using the admin account.modifyPassword
in interface LdapConnectionOperations
userDn
- The DN of the entry we want to modify the pwassword fornewPassword
- The new passwordPasswordException
- If the password change failedLdapConnectionOperations.modifyPassword(Dn, char[], char[], boolean)
public void modifyPassword(Dn userDn, char[] oldPassword, char[] newPassword) throws PasswordException
userDn
from
oldPassword
to newPassword
.modifyPassword
in interface LdapConnectionOperations
userDn
- The DN of the entry we want to modify the pwassword foroldPassword
- The old passwordnewPassword
- The new passwordPasswordException
- If the password change failedLdapConnectionOperations.modifyPassword(Dn, char[], char[], boolean)
public void modifyPassword(Dn userDn, char[] oldPassword, char[] newPassword, boolean asAdmin) throws PasswordException
userDn
from
oldPassword
to newPassword
, optionally using
an admin account. If asAdmin
is true, then the operation
is performed in admin context which means oldPassword
is
may be null
.modifyPassword
in interface LdapConnectionOperations
userDn
- The distinguished name of the useroldPassword
- The users old password (optional if asAdmin is true)newPassword
- The users new passwordasAdmin
- If true, execute in admin contextPasswordException
- If the password modification failspublic ModifyResponse modify(Dn dn, RequestBuilder<ModifyRequest> requestBuilder)
modify
in interface LdapConnectionOperations
dn
- The distinguished name of the entryrequestBuilder
- The RequestBuilderpublic ModifyResponse modify(ModifyRequest modifyRequest)
modify
in interface LdapConnectionOperations
modifyRequest
- The requestpublic AddRequest newAddRequest(Entry entry)
AddRequest
for the entry
.newAddRequest
in interface ModelFactory
entry
- The Entry to addpublic Attribute newAttribute(String name)
name
and
a null value. This is useful for clearing out an Attribute with a
ModifyRequest, replace function.newAttribute
in interface ModelFactory
name
- The attribute's namepublic Attribute newAttribute(String name, byte[]... values)
name
and
value(s)
.newAttribute
in interface ModelFactory
name
- The attribute's namevalues
- The attribute's valuespublic Attribute newAttribute(String name, String... values)
name
and
value(s)
.newAttribute
in interface ModelFactory
name
- The attribute's namevalues
- The attribute's valuespublic Attribute newAttribute(String name, Value... values)
name
and
value(s)
.newAttribute
in interface ModelFactory
name
- The attribute's namevalues
- The attribute's valuespublic DeleteRequest newDeleteRequest(Dn dn)
DeleteRequest
for the dn
.newDeleteRequest
in interface ModelFactory
dn
- The Dn for the Entry to deletepublic Dn newDn(String dn)
Dn
that represents dn
.newDn
in interface ModelFactory
dn
- The Entry's Dnpublic Entry newEntry(String dn)
Entry
with the specified dn
.newEntry
in interface ModelFactory
dn
- The Entry's Dnpublic Entry newEntry(Dn dn)
Entry
with the specified dn
.newEntry
in interface ModelFactory
dn
- The Entry's Dnpublic ModifyRequest newModifyRequest(String dn)
ModifyRequest
for the dn
.newModifyRequest
in interface ModelFactory
dn
- The Dn of the entry to modifypublic ModifyRequest newModifyRequest(Dn dn)
ModifyRequest
for the dn
.newModifyRequest
in interface ModelFactory
dn
- The DN of the entry to modifypublic SearchRequest newSearchRequest(String baseDn, FilterBuilder filter, SearchScope scope)
SearchRequest
over baseDn
in
scope
matching filter
returning
all normal attributes for each matching entry.newSearchRequest
in interface ModelFactory
baseDn
- The base DN from which to start the searchfilter
- The filter selecting the entriesscope
- The scope to look frompublic SearchRequest newSearchRequest(String baseDn, String filter, SearchScope scope)
SearchRequest
over baseDn
in
scope
matching filter
returning
all normal attributes for each matching entry.newSearchRequest
in interface ModelFactory
baseDn
- The base DN from which to start the searchfilter
- The filter selecting the entriesscope
- The scope to look frompublic SearchRequest newSearchRequest(Dn baseDn, FilterBuilder filter, SearchScope scope)
SearchRequest
over baseDn
in
scope
matching filter
returning
all normal attributes for each matching entry.newSearchRequest
in interface ModelFactory
baseDn
- The base DN from which to start the searchfilter
- The filter selecting the entriesscope
- The scope to look frompublic SearchRequest newSearchRequest(Dn baseDn, String filter, SearchScope scope)
SearchRequest
over baseDn
in
scope
matching filter
returning
all normal attributes for each matching entry.newSearchRequest
in interface ModelFactory
baseDn
- The base DN from which to start the searchfilter
- The filter selecting the entriesscope
- The scope to look frompublic SearchRequest newSearchRequest(String baseDn, FilterBuilder filter, SearchScope scope, String... attributes)
SearchRequest
over baseDn
in
scope
matching filter
returning
attributes
for each matching entry.newSearchRequest
in interface ModelFactory
baseDn
- The base DN from which to start the searchfilter
- The filter selecting the entriesscope
- The scope to look fromattributes
- The list of AttributeType to returnpublic SearchRequest newSearchRequest(String baseDn, String filter, SearchScope scope, String... attributes)
SearchRequest
over baseDn
in
scope
matching filter
returning
attributes
for each matching entry.newSearchRequest
in interface ModelFactory
baseDn
- The base DN from which to start the searchfilter
- The filter selecting the entriesscope
- The scope to look fromattributes
- The list of AttributeType to returnpublic SearchRequest newSearchRequest(Dn baseDn, FilterBuilder filter, SearchScope scope, String... attributes)
SearchRequest
over baseDn
in
scope
matching filter
returning
attributes
for each matching entry.newSearchRequest
in interface ModelFactory
baseDn
- The base DN from which to start the searchfilter
- The filter selecting the entriesscope
- The scope to look fromattributes
- The list of AttributeType to returnpublic SearchRequest newSearchRequest(Dn baseDn, String filter, SearchScope scope, String... attributes)
SearchRequest
over baseDn
in
scope
matching filter
returning
attributes
for each matching entry.newSearchRequest
in interface ModelFactory
baseDn
- The base DN from which to start the searchfilter
- The filter selecting the entriesscope
- The scope to look fromattributes
- The list of AttributeType to returnpublic <T extends ResultResponse> T responseOrException(T response)
template.responseOrException( template.delete( dn ) );
responseOrException
in interface LdapConnectionOperations
T
- The type of responseresponse
- The response to check for successresponse
public <T> List<T> search(String baseDn, FilterBuilder filter, SearchScope scope, EntryMapper<T> entryMapper)
entryMapper
.search
in interface LdapConnectionOperations
T
- The type of the mapped entrybaseDn
- The base DN from which to start the searchfilter
- The filter selecting the entriesscope
- The scope to look fromentryMapper
- The mapperLdapConnectionOperations.search(SearchRequest, EntryMapper)
public <T> List<T> search(String baseDn, String filter, SearchScope scope, EntryMapper<T> entryMapper)
entryMapper
.search
in interface LdapConnectionOperations
T
- The type of the mapped entrybaseDn
- The base DN from which to start the searchfilter
- The filter selecting the entriesscope
- The scope to look fromentryMapper
- The mapperLdapConnectionOperations.search(SearchRequest, EntryMapper)
public <T> List<T> search(Dn baseDn, FilterBuilder filter, SearchScope scope, EntryMapper<T> entryMapper)
entryMapper
.search
in interface LdapConnectionOperations
T
- The type of the mapped entrybaseDn
- The base DN from which to start the searchfilter
- The filter selecting the entriesscope
- The scope to look fromentryMapper
- The mapperLdapConnectionOperations.search(SearchRequest, EntryMapper)
public <T> List<T> search(Dn baseDn, String filter, SearchScope scope, EntryMapper<T> entryMapper)
entryMapper
.search
in interface LdapConnectionOperations
T
- The type of the mapped entrybaseDn
- The base DN from which to start the searchfilter
- The filter selecting the entriesscope
- The scope to look fromentryMapper
- The mapperLdapConnectionOperations.search(SearchRequest, EntryMapper)
public <T> List<T> search(String baseDn, FilterBuilder filter, SearchScope scope, String[] attributes, EntryMapper<T> entryMapper)
entryMapper
, querying only the requested
attributes.search
in interface LdapConnectionOperations
T
- The type of the mapped entrybaseDn
- The base DN from which to start the searchfilter
- The filter selecting the entriesscope
- The scope to look fromattributes
- The list of AttributeType to returnentryMapper
- The mapperLdapConnectionOperations.search(SearchRequest, EntryMapper)
public <T> List<T> search(String baseDn, String filter, SearchScope scope, String[] attributes, EntryMapper<T> entryMapper)
entryMapper
, querying only the requested
attributes.search
in interface LdapConnectionOperations
T
- The type of the mapped entrybaseDn
- The base DN from which to start the searchfilter
- The filter selecting the entriesscope
- The scope to look fromattributes
- The list of AttributeType to returnentryMapper
- The mapperLdapConnectionOperations.search(SearchRequest, EntryMapper)
public <T> List<T> search(Dn baseDn, FilterBuilder filter, SearchScope scope, String[] attributes, EntryMapper<T> entryMapper)
entryMapper
, querying only the requested
attributes.search
in interface LdapConnectionOperations
T
- The type of the mapped entrybaseDn
- The base DN from which to start the searchfilter
- The filter selecting the entriesscope
- The scope to look fromattributes
- The list of AttributeType to returnentryMapper
- The mapperLdapConnectionOperations.search(SearchRequest, EntryMapper)
public <T> List<T> search(Dn baseDn, String filter, SearchScope scope, String[] attributes, EntryMapper<T> entryMapper)
entryMapper
, querying only the requested
attributes.search
in interface LdapConnectionOperations
T
- The type of the mapped entrybaseDn
- The base DN from which to start the searchfilter
- The filter selecting the entriesscope
- The scope to look fromattributes
- The list of AttributeType to returnentryMapper
- The mapperLdapConnectionOperations.search(SearchRequest, EntryMapper)
public <T> List<T> search(SearchRequest searchRequest, EntryMapper<T> entryMapper)
searchRequest
, feeding the result into the
entryMapper
.search
in interface LdapConnectionOperations
T
- The type of the mapped entrysearchRequest
- The search requestentryMapper
- The mapperpublic <T> T searchFirst(String baseDn, FilterBuilder filter, SearchScope scope, EntryMapper<T> entryMapper)
entryMapper
.searchFirst
in interface LdapConnectionOperations
T
- The type of the mapped entrybaseDn
- The base DN from which to start the searchfilter
- The filter selecting the entriesscope
- The scope to look fromentryMapper
- The mapperLdapConnectionOperations.searchFirst(SearchRequest, EntryMapper)
public <T> T searchFirst(String baseDn, String filter, SearchScope scope, EntryMapper<T> entryMapper)
entryMapper
.searchFirst
in interface LdapConnectionOperations
T
- The type of the mapped entrybaseDn
- The base DN from which to start the searchfilter
- The filter selecting the entriesscope
- The scope to look fromentryMapper
- The mapperLdapConnectionOperations.searchFirst(SearchRequest, EntryMapper)
public <T> T searchFirst(Dn baseDn, FilterBuilder filter, SearchScope scope, EntryMapper<T> entryMapper)
entryMapper
.searchFirst
in interface LdapConnectionOperations
T
- The type of the mapped entrybaseDn
- The base DN from which to start the searchfilter
- The filter selecting the entriesscope
- The scope to look fromentryMapper
- The mapperLdapConnectionOperations.searchFirst(SearchRequest, EntryMapper)
public <T> T searchFirst(Dn baseDn, String filter, SearchScope scope, EntryMapper<T> entryMapper)
entryMapper
.searchFirst
in interface LdapConnectionOperations
T
- The type of the mapped entrybaseDn
- The base DN from which to start the searchfilter
- The filter selecting the entriesscope
- The scope to look fromentryMapper
- The mapperLdapConnectionOperations.searchFirst(SearchRequest, EntryMapper)
public <T> T searchFirst(String baseDn, FilterBuilder filter, SearchScope scope, String[] attributes, EntryMapper<T> entryMapper)
entryMapper
, querying only the requested
attributes.searchFirst
in interface LdapConnectionOperations
T
- The type of the mapped entrybaseDn
- The base DN from which to start the searchfilter
- The filter selecting the entriesscope
- The scope to look fromattributes
- The list of AttributeType to returnentryMapper
- The mapperLdapConnectionOperations.searchFirst(SearchRequest, EntryMapper)
public <T> T searchFirst(String baseDn, String filter, SearchScope scope, String[] attributes, EntryMapper<T> entryMapper)
entryMapper
, querying only the requested
attributes.searchFirst
in interface LdapConnectionOperations
T
- The type of the mapped entrybaseDn
- The base DN from which to start the searchfilter
- The filter selecting the entriesscope
- The scope to look fromattributes
- The list of AttributeType to returnentryMapper
- The mapperLdapConnectionOperations.searchFirst(SearchRequest, EntryMapper)
public <T> T searchFirst(Dn baseDn, FilterBuilder filter, SearchScope scope, String[] attributes, EntryMapper<T> entryMapper)
entryMapper
, querying only the requested
attributes.searchFirst
in interface LdapConnectionOperations
T
- The type of the mapped entrybaseDn
- The base DN from which to start the searchfilter
- The filter selecting the entriesscope
- The scope to look fromattributes
- The list of AttributeType to returnentryMapper
- The mapperLdapConnectionOperations.searchFirst(SearchRequest, EntryMapper)
public <T> T searchFirst(Dn baseDn, String filter, SearchScope scope, String[] attributes, EntryMapper<T> entryMapper)
entryMapper
, querying only the requested
attributes.searchFirst
in interface LdapConnectionOperations
T
- The type of the mapped entrybaseDn
- The base DN from which to start the searchfilter
- The filter selecting the entriesscope
- The scope to look fromattributes
- The list of AttributeType to returnentryMapper
- The mapperLdapConnectionOperations.searchFirst(SearchRequest, EntryMapper)
public <T> T searchFirst(SearchRequest searchRequest, EntryMapper<T> entryMapper)
searchRequest
, feeding the result into the
entryMapper
. This is basically the same as
LdapConnectionOperations.search(SearchRequest, EntryMapper)
, but is optimized by
modifying the searchRequest
to set its size limit to 1.
The searchRequest
is returned to its original size limit
before this method returns (or throws an exception).searchFirst
in interface LdapConnectionOperations
T
- The type of the mapped entrysearchRequest
- The search requestentryMapper
- The mapperpublic void setModelFactory(ModelFactory modelFactory)
modelFactory
implementation for this facade.modelFactory
- The model factory implementationpublic void setPasswordPolicyResponder(PasswordPolicyResponder passwordPolicyResponder)
passwordPolicyResponder
implementation for this
facade.passwordPolicyResponder
- The password policy responder
implementationCopyright © 2003–2020 The Apache Software Foundation. All rights reserved.