public interface LdapConnectionOperations
LdapConnectionTemplate. This interface can be useful for unit testing
in order to stub out methods.| Modifier and Type | Method and Description |
|---|---|
org.apache.directory.api.ldap.model.message.AddResponse |
add(org.apache.directory.api.ldap.model.message.AddRequest addRequest)
Adds an entry specified by an AddRequest to the LDAP server.
|
org.apache.directory.api.ldap.model.message.AddResponse |
add(org.apache.directory.api.ldap.model.name.Dn dn,
org.apache.directory.api.ldap.model.entry.Attribute... attributes)
Adds an entry specified by a Dn and an array of Attribute's to the LDAP
server.
|
org.apache.directory.api.ldap.model.message.AddResponse |
add(org.apache.directory.api.ldap.model.name.Dn dn,
RequestBuilder<org.apache.directory.api.ldap.model.message.AddRequest> requestBuilder)
Adds an entry specified by a Dn, to be filled out by a RequestBuilder,
to the LDAP server.
|
PasswordWarning |
authenticate(org.apache.directory.api.ldap.model.name.Dn userDn,
char[] password)
Attempts to authenticate the supplied credentials.
|
PasswordWarning |
authenticate(org.apache.directory.api.ldap.model.name.Dn baseDn,
String filter,
org.apache.directory.api.ldap.model.message.SearchScope scope,
char[] password)
Attempts to authenticate the supplied credentials against the first
entry found matching the search criteria.
|
PasswordWarning |
authenticate(org.apache.directory.api.ldap.model.message.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,
org.apache.directory.api.ldap.model.message.SearchScope scope,
char[] password)
Attempts to authenticate the supplied credentials against the first
entry found matching the search criteria.
|
org.apache.directory.api.ldap.model.message.DeleteResponse |
delete(org.apache.directory.api.ldap.model.message.DeleteRequest deleteRequest)
Deletes an entry specified by a DeleteRequest from the LDAP server.
|
org.apache.directory.api.ldap.model.message.DeleteResponse |
delete(org.apache.directory.api.ldap.model.name.Dn dn)
Deletes an entry specified by Dn from the LDAP server.
|
org.apache.directory.api.ldap.model.message.DeleteResponse |
delete(org.apache.directory.api.ldap.model.name.Dn dn,
RequestBuilder<org.apache.directory.api.ldap.model.message.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(org.apache.directory.api.ldap.model.name.Dn dn,
EntryMapper<T> entryMapper)
Performs a lookup, and supplies the matching entry to the
entryMapper. |
<T> T |
lookup(org.apache.directory.api.ldap.model.name.Dn dn,
String[] attributes,
EntryMapper<T> entryMapper)
Performs a lookup, requesting
attributes, and supplies
the matching entry to the entryMapper. |
org.apache.directory.api.ldap.model.message.ModifyResponse |
modify(org.apache.directory.api.ldap.model.name.Dn dn,
RequestBuilder<org.apache.directory.api.ldap.model.message.ModifyRequest> requestBuilder)
Modifies an entry specified by Dn, and whose request is configured
by a RequestBuilder, on the LDAP server.
|
org.apache.directory.api.ldap.model.message.ModifyResponse |
modify(org.apache.directory.api.ldap.model.message.ModifyRequest modifyRequest)
Modifies an entry specified by a ModifyRequest on the LDAP server.
|
void |
modifyPassword(org.apache.directory.api.ldap.model.name.Dn userDn,
char[] newPassword)
Modifies the password for
userDn to
newPassword using the admin account. |
void |
modifyPassword(org.apache.directory.api.ldap.model.name.Dn userDn,
char[] oldPassword,
char[] newPassword)
Modifies the password for
userDn from
oldPassword to newPassword. |
void |
modifyPassword(org.apache.directory.api.ldap.model.name.Dn userDn,
char[] oldPassword,
char[] newPassword,
boolean asAdmin)
Modifies the password for
userDn from
oldPassword to newPassword, optionally using
an admin account. |
<T extends org.apache.directory.api.ldap.model.message.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(org.apache.directory.api.ldap.model.name.Dn baseDn,
FilterBuilder filter,
org.apache.directory.api.ldap.model.message.SearchScope scope,
EntryMapper<T> entryMapper)
Searches for the entries matching the supplied criteria, feeding the
result into the
entryMapper. |
<T> List<T> |
search(org.apache.directory.api.ldap.model.name.Dn baseDn,
FilterBuilder filter,
org.apache.directory.api.ldap.model.message.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(org.apache.directory.api.ldap.model.name.Dn baseDn,
String filter,
org.apache.directory.api.ldap.model.message.SearchScope scope,
EntryMapper<T> entryMapper)
Searches for the entries matching the supplied criteria, feeding the
result into the
entryMapper. |
<T> List<T> |
search(org.apache.directory.api.ldap.model.name.Dn baseDn,
String filter,
org.apache.directory.api.ldap.model.message.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(org.apache.directory.api.ldap.model.message.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,
org.apache.directory.api.ldap.model.message.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,
org.apache.directory.api.ldap.model.message.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,
org.apache.directory.api.ldap.model.message.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,
org.apache.directory.api.ldap.model.message.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(org.apache.directory.api.ldap.model.name.Dn baseDn,
FilterBuilder filter,
org.apache.directory.api.ldap.model.message.SearchScope scope,
EntryMapper<T> entryMapper)
Searches for the first entry matching the supplied criteria, feeding the
result into the
entryMapper. |
<T> T |
searchFirst(org.apache.directory.api.ldap.model.name.Dn baseDn,
FilterBuilder filter,
org.apache.directory.api.ldap.model.message.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(org.apache.directory.api.ldap.model.name.Dn baseDn,
String filter,
org.apache.directory.api.ldap.model.message.SearchScope scope,
EntryMapper<T> entryMapper)
Searches for the first entry matching the supplied criteria, feeding the
result into the
entryMapper. |
<T> T |
searchFirst(org.apache.directory.api.ldap.model.name.Dn baseDn,
String filter,
org.apache.directory.api.ldap.model.message.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(org.apache.directory.api.ldap.model.message.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,
org.apache.directory.api.ldap.model.message.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,
org.apache.directory.api.ldap.model.message.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,
org.apache.directory.api.ldap.model.message.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,
org.apache.directory.api.ldap.model.message.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. |
org.apache.directory.api.ldap.model.message.AddResponse add(org.apache.directory.api.ldap.model.message.AddRequest addRequest)
addRequest - The requestorg.apache.directory.api.ldap.model.message.AddResponse add(org.apache.directory.api.ldap.model.name.Dn dn,
org.apache.directory.api.ldap.model.entry.Attribute... attributes)
dn - The distinguished name of the new entryattributes - The attributes of the new entryorg.apache.directory.api.ldap.model.message.AddResponse add(org.apache.directory.api.ldap.model.name.Dn dn,
RequestBuilder<org.apache.directory.api.ldap.model.message.AddRequest> requestBuilder)
dn - The distinguished name of the new entryrequestBuilder - The request builderPasswordWarning authenticate(String baseDn, String filter, org.apache.directory.api.ldap.model.message.SearchScope scope, char[] password) throws PasswordException
baseDn - filter - scope - password - PasswordException#authenticate(Dn, char[])},
#searchFirst(String, String, SearchScope, EntryMapper)}PasswordWarning authenticate(org.apache.directory.api.ldap.model.name.Dn baseDn, String filter, org.apache.directory.api.ldap.model.message.SearchScope scope, char[] password) throws PasswordException
baseDn - filter - scope - password - PasswordException#authenticate(Dn, char[])},
#searchFirst(Dn, String, SearchScope, EntryMapper)}PasswordWarning authenticate(org.apache.directory.api.ldap.model.message.SearchRequest searchRequest, char[] password) throws PasswordException
baseDn - filter - scope - password - PasswordException#authenticate(Dn, char[])},
#searchFirst(SearchRequest, EntryMapper)}PasswordWarning authenticate(org.apache.directory.api.ldap.model.name.Dn userDn, char[] password) throws PasswordException
userDn - The distinguished name of the userpassword - The passwordPasswordException - If authentication failsorg.apache.directory.api.ldap.model.message.DeleteResponse delete(org.apache.directory.api.ldap.model.message.DeleteRequest deleteRequest)
deleteRequest - The requestorg.apache.directory.api.ldap.model.message.DeleteResponse delete(org.apache.directory.api.ldap.model.name.Dn dn)
dn - The distinguished name of the entryorg.apache.directory.api.ldap.model.message.DeleteResponse delete(org.apache.directory.api.ldap.model.name.Dn dn,
RequestBuilder<org.apache.directory.api.ldap.model.message.DeleteRequest> requestBuilder)
dn - The distinguished name of the entryrequestBuilder - The RequestBuilder<T> T execute(ConnectionCallback<T> connectionCallback)
connectionCallback, supplying it a managed
connection.connectionCallback - The callback<T> T lookup(org.apache.directory.api.ldap.model.name.Dn dn,
EntryMapper<T> entryMapper)
entryMapper.dn - The distinguished name of the entryentryMapper - The mapper from entry to model objectentryMapper returns<T> T lookup(org.apache.directory.api.ldap.model.name.Dn dn,
String[] attributes,
EntryMapper<T> entryMapper)
attributes, and supplies
the matching entry to the entryMapper.dn - The distinguished name of the entryattributes - The attributes to be fetchedentryMapper - The mapper from entry to model objectentryMapper returnsvoid modifyPassword(org.apache.directory.api.ldap.model.name.Dn userDn,
char[] newPassword)
throws PasswordException
userDn to
newPassword using the admin account.userDn - newPassword - PasswordException#modifyPassword(Dn, char[], char[], boolean)}void modifyPassword(org.apache.directory.api.ldap.model.name.Dn userDn,
char[] oldPassword,
char[] newPassword)
throws PasswordException
userDn from
oldPassword to newPassword.userDn - oldPassword - newPassword - PasswordException#modifyPassword(Dn, char[], char[], boolean)}void modifyPassword(org.apache.directory.api.ldap.model.name.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.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 failsorg.apache.directory.api.ldap.model.message.ModifyResponse modify(org.apache.directory.api.ldap.model.message.ModifyRequest modifyRequest)
modifyRequest - The requestorg.apache.directory.api.ldap.model.message.ModifyResponse modify(org.apache.directory.api.ldap.model.name.Dn dn,
RequestBuilder<org.apache.directory.api.ldap.model.message.ModifyRequest> requestBuilder)
dn - The distinguished name of the entryrequestBuilder - The RequestBuilder<T extends org.apache.directory.api.ldap.model.message.ResultResponse> T responseOrException(T response)
ResultCodeEnum#SUCCESS, an exception is thrown. This method is
intened to be used inline:
template.responseOrException( template.delete( dn ) );
response - The response to check for successresponseLdapRequestUnsuccessfulException - If the response is not
ResultCodeEnum#SUCCESS<T> List<T> search(String baseDn, FilterBuilder filter, org.apache.directory.api.ldap.model.message.SearchScope scope, EntryMapper<T> entryMapper)
entryMapper.baseDn - filter - scope - entryMapper - #search(SearchRequest, EntryMapper)}<T> List<T> search(String baseDn, String filter, org.apache.directory.api.ldap.model.message.SearchScope scope, EntryMapper<T> entryMapper)
entryMapper.baseDn - filter - scope - entryMapper - #search(SearchRequest, EntryMapper)}<T> List<T> search(org.apache.directory.api.ldap.model.name.Dn baseDn, FilterBuilder filter, org.apache.directory.api.ldap.model.message.SearchScope scope, EntryMapper<T> entryMapper)
entryMapper.baseDn - filter - scope - entryMapper - #search(SearchRequest, EntryMapper)}<T> List<T> search(org.apache.directory.api.ldap.model.name.Dn baseDn, String filter, org.apache.directory.api.ldap.model.message.SearchScope scope, EntryMapper<T> entryMapper)
entryMapper.baseDn - filter - scope - entryMapper - #search(SearchRequest, EntryMapper)}<T> List<T> search(String baseDn, FilterBuilder filter, org.apache.directory.api.ldap.model.message.SearchScope scope, String[] attributes, EntryMapper<T> entryMapper)
entryMapper, querying only the requested
attributes.baseDn - filter - scope - attributes - entryMapper - #search(SearchRequest, EntryMapper)}<T> List<T> search(String baseDn, String filter, org.apache.directory.api.ldap.model.message.SearchScope scope, String[] attributes, EntryMapper<T> entryMapper)
entryMapper, querying only the requested
attributes.baseDn - filter - scope - attributes - entryMapper - #search(SearchRequest, EntryMapper)}<T> List<T> search(org.apache.directory.api.ldap.model.name.Dn baseDn, FilterBuilder filter, org.apache.directory.api.ldap.model.message.SearchScope scope, String[] attributes, EntryMapper<T> entryMapper)
entryMapper, querying only the requested
attributes.baseDn - filter - scope - attributes - entryMapper - #search(SearchRequest, EntryMapper)}<T> List<T> search(org.apache.directory.api.ldap.model.name.Dn baseDn, String filter, org.apache.directory.api.ldap.model.message.SearchScope scope, String[] attributes, EntryMapper<T> entryMapper)
entryMapper, querying only the requested
attributes.baseDn - filter - scope - attributes - entryMapper - #search(SearchRequest, EntryMapper)}<T> List<T> search(org.apache.directory.api.ldap.model.message.SearchRequest searchRequest, EntryMapper<T> entryMapper)
searchRequest, feeding the result into the
entryMapper.searchRequest - The search requestentryMapper - The mapper<T> T searchFirst(String baseDn, FilterBuilder filter, org.apache.directory.api.ldap.model.message.SearchScope scope, EntryMapper<T> entryMapper)
entryMapper.baseDn - filter - scope - entryMapper - #searchFirst(SearchRequest, EntryMapper)}<T> T searchFirst(String baseDn, String filter, org.apache.directory.api.ldap.model.message.SearchScope scope, EntryMapper<T> entryMapper)
entryMapper.baseDn - filter - scope - entryMapper - #searchFirst(SearchRequest, EntryMapper)}<T> T searchFirst(org.apache.directory.api.ldap.model.name.Dn baseDn,
FilterBuilder filter,
org.apache.directory.api.ldap.model.message.SearchScope scope,
EntryMapper<T> entryMapper)
entryMapper.baseDn - filter - scope - entryMapper - #searchFirst(SearchRequest, EntryMapper)}<T> T searchFirst(org.apache.directory.api.ldap.model.name.Dn baseDn,
String filter,
org.apache.directory.api.ldap.model.message.SearchScope scope,
EntryMapper<T> entryMapper)
entryMapper.baseDn - filter - scope - entryMapper - #searchFirst(SearchRequest, EntryMapper)}<T> T searchFirst(String baseDn, FilterBuilder filter, org.apache.directory.api.ldap.model.message.SearchScope scope, String[] attributes, EntryMapper<T> entryMapper)
entryMapper, querying only the requested
attributes.baseDn - filter - scope - attributes - entryMapper - #searchFirst(SearchRequest, EntryMapper)}<T> T searchFirst(String baseDn, String filter, org.apache.directory.api.ldap.model.message.SearchScope scope, String[] attributes, EntryMapper<T> entryMapper)
entryMapper, querying only the requested
attributes.baseDn - filter - scope - attributes - entryMapper - #searchFirst(SearchRequest, EntryMapper)}<T> T searchFirst(org.apache.directory.api.ldap.model.name.Dn baseDn,
FilterBuilder filter,
org.apache.directory.api.ldap.model.message.SearchScope scope,
String[] attributes,
EntryMapper<T> entryMapper)
entryMapper, querying only the requested
attributes.baseDn - filter - scope - attributes - entryMapper - #searchFirst(SearchRequest, EntryMapper)}<T> T searchFirst(org.apache.directory.api.ldap.model.name.Dn baseDn,
String filter,
org.apache.directory.api.ldap.model.message.SearchScope scope,
String[] attributes,
EntryMapper<T> entryMapper)
entryMapper, querying only the requested
attributes.baseDn - filter - scope - attributes - entryMapper - #searchFirst(SearchRequest, EntryMapper)}<T> T searchFirst(org.apache.directory.api.ldap.model.message.SearchRequest searchRequest,
EntryMapper<T> entryMapper)
searchRequest, feeding the result into the
entryMapper. This is basically the same as
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).searchRequest - The search requestentryMapper - The mapperCopyright © 2009–2016 The Apache Software Foundation. All rights reserved.