org.apache.directory.ldap.client.api
Interface LdapConnection

All Known Subinterfaces:
LdapAsyncConnection
All Known Implementing Classes:
AbstractLdapConnection, LdapNetworkConnection

public interface LdapConnection

The root interface for all the LDAP connection implementations.

Author:
Apache Directory Project

Method Summary
 void abandon(org.apache.directory.api.ldap.model.message.AbandonRequest abandonRequest)
          An abandon request essentially with the request message ID of the operation to be canceled and/or potentially some controls and timeout (the controls and timeout are not mandatory).
 void abandon(int messageId)
          Abandons a request submitted to the server for performing a particular operation The abandonRequest is always non-blocking, because no response is expected
 org.apache.directory.api.ldap.model.message.AddResponse add(org.apache.directory.api.ldap.model.message.AddRequest addRequest)
          Add an entry present in the AddRequest to the server.
 void add(org.apache.directory.api.ldap.model.entry.Entry entry)
          Add an entry to the server.
 void anonymousBind()
          Anonymous Bind on a server.
 void bind()
          Bind on a server, using the LdapConnectionConfig informations
 org.apache.directory.api.ldap.model.message.BindResponse bind(org.apache.directory.api.ldap.model.message.BindRequest bindRequest)
          Bind to the server using a BindRequest object.
 void bind(org.apache.directory.api.ldap.model.name.Dn name)
          Unauthenticated authentication Bind on a server.
 void bind(org.apache.directory.api.ldap.model.name.Dn name, String credentials)
          Simple Bind on a server.
 void bind(String name)
          Unauthenticated authentication bind
 void bind(String name, String credentials)
          Simple Bind on a server.
 boolean close()
          Disconnect from the remote LDAP server
 org.apache.directory.api.ldap.model.message.CompareResponse compare(org.apache.directory.api.ldap.model.message.CompareRequest compareRequest)
          Compares an entry's attribute's value with that of the given value.
 boolean compare(org.apache.directory.api.ldap.model.name.Dn dn, String attributeName, byte[] value)
          Compares whether a given attribute's value matches that of the existing value of the attribute present in the entry with the given Dn.
 boolean compare(org.apache.directory.api.ldap.model.name.Dn dn, String attributeName, String value)
          Compares whether a given attribute's value matches that of the existing value of the attribute present in the entry with the given Dn.
 boolean compare(org.apache.directory.api.ldap.model.name.Dn dn, String attributeName, org.apache.directory.api.ldap.model.entry.Value<?> value)
          Compares whether a given attribute's value matches that of the existing value of the attribute present in the entry with the given Dn.
 boolean compare(String dn, String attributeName, byte[] value)
          Compares whether a given attribute's value matches that of the existing value of the attribute present in the entry with the given Dn.
 boolean compare(String dn, String attributeName, String value)
          Compares whether a given attribute's value matches that of the existing value of the attribute present in the entry with the given Dn.
 boolean compare(String dn, String attributeName, org.apache.directory.api.ldap.model.entry.Value<?> value)
          Compares whether a given attribute's value matches that of the existing value of the attribute present in the entry with the given Dn.
 boolean connect()
          Connect to the remote LDAP server.
 org.apache.directory.api.ldap.model.message.DeleteResponse delete(org.apache.directory.api.ldap.model.message.DeleteRequest deleteRequest)
          Performs a delete operation based on the delete request object.
 void delete(org.apache.directory.api.ldap.model.name.Dn dn)
          Deletes the entry with the given Dn.
 void delete(String dn)
          Deletes the entry with the given Dn.
 boolean doesFutureExistFor(int messageId)
          Checks if there is a ResponseFuture associated with the given message ID.
 boolean exists(org.apache.directory.api.ldap.model.name.Dn dn)
          Tells if an Entry exists in the server.
 boolean exists(String dn)
          Tells if an Entry exists in the server.
 org.apache.directory.api.ldap.model.message.ExtendedResponse extended(org.apache.directory.api.ldap.model.message.ExtendedRequest extendedRequest)
          Performs an extended operation based on the Extended request object.
 org.apache.directory.api.ldap.model.message.ExtendedResponse extended(org.apache.directory.api.asn1.util.Oid oid)
          Sends a extended operation request to the server with the given OID and no value.
 org.apache.directory.api.ldap.model.message.ExtendedResponse extended(org.apache.directory.api.asn1.util.Oid oid, byte[] value)
          Sends a extended operation request to the server with the given OID and value.
 org.apache.directory.api.ldap.model.message.ExtendedResponse extended(String oid)
          Sends a extended operation request to the server with the given OID and no value.
 org.apache.directory.api.ldap.model.message.ExtendedResponse extended(String oid, byte[] value)
          Sends a extended operation request to the server with the given OID and value.
 org.apache.directory.api.ldap.codec.api.BinaryAttributeDetector getBinaryAttributeDetector()
           
 org.apache.directory.api.ldap.codec.api.LdapApiService getCodecService()
          Gets the LDAP CODEC service responsible for encoding and decoding messages.
 org.apache.directory.api.ldap.model.entry.Entry getRootDse()
          Get back the RooDSE from the connected server.
 org.apache.directory.api.ldap.model.entry.Entry getRootDse(String... attributes)
          Get back the RooDSE from the connected server.
 org.apache.directory.api.ldap.model.schema.SchemaManager getSchemaManager()
           
 List<String> getSupportedControls()
          Get the Controls supported by server.
 boolean isAuthenticated()
          Check if we are authenticated
 boolean isConnected()
          Check if we are connected
 boolean isControlSupported(String controlOID)
          Checks if a control with the given OID is supported.
 void loadSchema()
          Loads all the default schemas that are bundled with the API.

Note: This method enables all schemas prior to loading
 org.apache.directory.api.ldap.model.entry.Entry lookup(org.apache.directory.api.ldap.model.name.Dn dn)
          Searches for an entry having the given Dn.
 org.apache.directory.api.ldap.model.entry.Entry lookup(org.apache.directory.api.ldap.model.name.Dn dn, org.apache.directory.api.ldap.model.message.Control[] controls, String... attributes)
          Searches for an entry having the given Dn.
 org.apache.directory.api.ldap.model.entry.Entry lookup(org.apache.directory.api.ldap.model.name.Dn dn, String... attributes)
          Searches for an entry having the given Dn.
 org.apache.directory.api.ldap.model.entry.Entry lookup(String dn)
          Searches for an entry having the given Dn.
 org.apache.directory.api.ldap.model.entry.Entry lookup(String dn, org.apache.directory.api.ldap.model.message.Control[] controls, String... attributes)
          Searches for an entry having the given Dn.
 org.apache.directory.api.ldap.model.entry.Entry lookup(String dn, String... attributes)
          Searches for an entry having the given Dn.
 void modify(org.apache.directory.api.ldap.model.name.Dn dn, org.apache.directory.api.ldap.model.entry.Modification... modifications)
          Applies all the modifications to the entry specified by its Dn.
 void modify(org.apache.directory.api.ldap.model.entry.Entry entry, org.apache.directory.api.ldap.model.entry.ModificationOperation modOp)
          Modifies all the attributes present in the entry by applying the same operation.
 org.apache.directory.api.ldap.model.message.ModifyResponse modify(org.apache.directory.api.ldap.model.message.ModifyRequest modRequest)
          Performs an modify operation based on the modifications present in the ModifyRequest.
 void modify(String dn, org.apache.directory.api.ldap.model.entry.Modification... modifications)
          Applies all the modifications to the entry specified by its Dn.
 org.apache.directory.api.ldap.model.message.ModifyDnResponse modifyDn(org.apache.directory.api.ldap.model.message.ModifyDnRequest modDnRequest)
          Performs the modifyDn operation based on the given ModifyDnRequest.
 void move(org.apache.directory.api.ldap.model.name.Dn entryDn, org.apache.directory.api.ldap.model.name.Dn newSuperiorDn)
          Moves the given entry Dn under the new superior Dn.
 void move(String entryDn, String newSuperiorDn)
          Moves the given entry Dn under the new superior Dn.
 void moveAndRename(org.apache.directory.api.ldap.model.name.Dn entryDn, org.apache.directory.api.ldap.model.name.Dn newDn)
          Moves and renames the given entryDn.
 void moveAndRename(org.apache.directory.api.ldap.model.name.Dn entryDn, org.apache.directory.api.ldap.model.name.Dn newDn, boolean deleteOldRdn)
          Moves and renames the given entryDn.
 void moveAndRename(String entryDn, String newDn)
          Moves and renames the given entryDn.The old Rdn will be deleted
 void moveAndRename(String entryDn, String newDn, boolean deleteOldRdn)
          Moves and renames the given entryDn.
 void rename(org.apache.directory.api.ldap.model.name.Dn entryDn, org.apache.directory.api.ldap.model.name.Rdn newRdn)
          Renames the given entryDn with new Rdn and deletes the old Rdn.
 void rename(org.apache.directory.api.ldap.model.name.Dn entryDn, org.apache.directory.api.ldap.model.name.Rdn newRdn, boolean deleteOldRdn)
          Renames the given entryDn with new Rdn and deletes the old Rdn if deleteOldRdn is set to true.
 void rename(String entryDn, String newRdn)
          Renames the given entryDn with new Rdn and deletes the old Rdn.
 void rename(String entryDn, String newRdn, boolean deleteOldRdn)
          Renames the given entryDn with new Rdn and deletes the old Rdn if deleteOldRdn is set to true.
 org.apache.directory.api.ldap.model.cursor.EntryCursor search(org.apache.directory.api.ldap.model.name.Dn baseDn, String filter, org.apache.directory.api.ldap.model.message.SearchScope scope, String... attributes)
          Do a search, on the base object, using the given filter.
 org.apache.directory.api.ldap.model.cursor.SearchCursor search(org.apache.directory.api.ldap.model.message.SearchRequest searchRequest)
          Performs search in a synchronous mode.
 org.apache.directory.api.ldap.model.cursor.EntryCursor search(String baseDn, String filter, org.apache.directory.api.ldap.model.message.SearchScope scope, String... attributes)
          Do a search, on the base object, using the given filter.
 void setBinaryAttributeDetector(org.apache.directory.api.ldap.codec.api.BinaryAttributeDetector binaryAttributeDetecter)
          Sets the object responsible for the detection of binary attributes
 void setTimeOut(long timeOut)
          Set the timeOut for the responses.
 void unBind()
          UnBind from a server.
 

Method Detail

isConnected

boolean isConnected()
Check if we are connected

Returns:
true if we are connected.

isAuthenticated

boolean isAuthenticated()
Check if we are authenticated

Returns:
true if we are connected.

connect

boolean connect()
                throws org.apache.directory.api.ldap.model.exception.LdapException,
                       IOException
Connect to the remote LDAP server.

Returns:
true if the connection is established, false otherwise
Throws:
{@link - LdapException} if some error occurred
IOException - if an I/O exception occurred
org.apache.directory.api.ldap.model.exception.LdapException

close

boolean close()
              throws IOException
Disconnect from the remote LDAP server

Returns:
true if the connection is closed, false otherwise
Throws:
IOException - if some I/O error occurs

add

void add(org.apache.directory.api.ldap.model.entry.Entry entry)
         throws org.apache.directory.api.ldap.model.exception.LdapException
Add an entry to the server. This is a blocking add : the user has to wait for the response until the AddResponse is returned.

Parameters:
entry - The entry to add
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException

add

org.apache.directory.api.ldap.model.message.AddResponse add(org.apache.directory.api.ldap.model.message.AddRequest addRequest)
                                                            throws org.apache.directory.api.ldap.model.exception.LdapException
Add an entry present in the AddRequest to the server.

Parameters:
addRequest - the request object containing an entry and controls(if any)
Returns:
the add operation's response
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException

abandon

void abandon(int messageId)
Abandons a request submitted to the server for performing a particular operation The abandonRequest is always non-blocking, because no response is expected

Parameters:
messageId - the ID of the request message sent to the server

abandon

void abandon(org.apache.directory.api.ldap.model.message.AbandonRequest abandonRequest)
An abandon request essentially with the request message ID of the operation to be canceled and/or potentially some controls and timeout (the controls and timeout are not mandatory). The abandonRequest is always non-blocking, because no response is expected

Parameters:
abandonRequest - the abandon operation's request

bind

void bind()
          throws org.apache.directory.api.ldap.model.exception.LdapException,
                 IOException
Bind on a server, using the LdapConnectionConfig informations

Throws:
{@link - LdapException} if some error occurred
IOException - if an I/O exception occurred
org.apache.directory.api.ldap.model.exception.LdapException

anonymousBind

void anonymousBind()
                   throws org.apache.directory.api.ldap.model.exception.LdapException,
                          IOException
Anonymous Bind on a server.

Throws:
{@link - LdapException} if some error occurred
IOException - if an I/O exception occurred
org.apache.directory.api.ldap.model.exception.LdapException

bind

void bind(String name)
          throws org.apache.directory.api.ldap.model.exception.LdapException,
                 IOException
Unauthenticated authentication bind

Parameters:
name - The name we use to authenticate the user. It must be a valid Dn
Throws:
{@link - LdapException} if some error occurred
IOException - if an I/O exception occurred
org.apache.directory.api.ldap.model.exception.LdapException

bind

void bind(String name,
          String credentials)
          throws org.apache.directory.api.ldap.model.exception.LdapException,
                 IOException
Simple Bind on a server.

Parameters:
name - The name we use to authenticate the user. It must be a valid Dn
credentials - The password. It can't be null
Throws:
{@link - LdapException} if some error occurred
IOException - if an I/O exception occurred
org.apache.directory.api.ldap.model.exception.LdapException

bind

void bind(org.apache.directory.api.ldap.model.name.Dn name)
          throws org.apache.directory.api.ldap.model.exception.LdapException,
                 IOException
Unauthenticated authentication Bind on a server.

Parameters:
name - The name we use to authenticate the user. It must be a valid Dn
Throws:
{@link - LdapException} if some error occurred
IOException - if an I/O exception occurred
org.apache.directory.api.ldap.model.exception.LdapException

bind

void bind(org.apache.directory.api.ldap.model.name.Dn name,
          String credentials)
          throws org.apache.directory.api.ldap.model.exception.LdapException,
                 IOException
Simple Bind on a server.

Parameters:
name - The name we use to authenticate the user. It must be a valid Dn
credentials - The password. It can't be null
Throws:
{@link - LdapException} if some error occurred
IOException - if an I/O exception occurred
org.apache.directory.api.ldap.model.exception.LdapException

bind

org.apache.directory.api.ldap.model.message.BindResponse bind(org.apache.directory.api.ldap.model.message.BindRequest bindRequest)
                                                              throws org.apache.directory.api.ldap.model.exception.LdapException,
                                                                     IOException
Bind to the server using a BindRequest object.

Parameters:
bindRequest - The BindRequest POJO containing all the needed parameters
Returns:
A LdapResponse containing the result
Throws:
{@link - LdapException} if some error occurred
IOException - if an I/O exception occurred
org.apache.directory.api.ldap.model.exception.LdapException

search

org.apache.directory.api.ldap.model.cursor.EntryCursor search(org.apache.directory.api.ldap.model.name.Dn baseDn,
                                                              String filter,
                                                              org.apache.directory.api.ldap.model.message.SearchScope scope,
                                                              String... attributes)
                                                              throws org.apache.directory.api.ldap.model.exception.LdapException
Do a search, on the base object, using the given filter. The SearchRequest parameters default to : Scope : ONE DerefAlias : ALWAYS SizeLimit : none TimeLimit : none TypesOnly : false Attributes : all the user's attributes. This method is blocking.

Parameters:
baseDn - The base for the search. It must be a valid Dn, and can't be emtpy
filter - The filter to use for this search. It can't be empty
scope - The search scope : OBJECT, ONELEVEL or SUBTREE
attributes - The attributes to use for this search
Returns:
An EntryCursor on the result.
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException

search

org.apache.directory.api.ldap.model.cursor.EntryCursor search(String baseDn,
                                                              String filter,
                                                              org.apache.directory.api.ldap.model.message.SearchScope scope,
                                                              String... attributes)
                                                              throws org.apache.directory.api.ldap.model.exception.LdapException
Do a search, on the base object, using the given filter. The SearchRequest parameters default to : Scope : ONE DerefAlias : ALWAYS SizeLimit : none TimeLimit : none TypesOnly : false Attributes : all the user's attributes. This method is blocking.

Parameters:
baseDn - The base for the search. It must be a valid Dn, and can't be emtpy
filter - The filter to use for this search. It can't be empty
scope - The search scope : OBJECT, ONELEVEL or SUBTREE
attributes - The attributes to use for this search
Returns:
An EntryCursor on the result.
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException

search

org.apache.directory.api.ldap.model.cursor.SearchCursor search(org.apache.directory.api.ldap.model.message.SearchRequest searchRequest)
                                                               throws org.apache.directory.api.ldap.model.exception.LdapException
Performs search in a synchronous mode.

Parameters:
searchRequest - The search configuration
Returns:
a SearchCursor on the result.
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException

unBind

void unBind()
            throws org.apache.directory.api.ldap.model.exception.LdapException
UnBind from a server. This is a request which expect no response.

Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException

setTimeOut

void setTimeOut(long timeOut)
Set the timeOut for the responses. We wont wait longer than this value.

Parameters:
timeOut - The timeout, in milliseconds

modify

void modify(org.apache.directory.api.ldap.model.name.Dn dn,
            org.apache.directory.api.ldap.model.entry.Modification... modifications)
            throws org.apache.directory.api.ldap.model.exception.LdapException
Applies all the modifications to the entry specified by its Dn.

Parameters:
dn - The entry's Dn
modifications - The list of modifications to be applied
Throws:
{@link - LdapException} in case of modify operation failure or timeout happens
org.apache.directory.api.ldap.model.exception.LdapException

modify

void modify(String dn,
            org.apache.directory.api.ldap.model.entry.Modification... modifications)
            throws org.apache.directory.api.ldap.model.exception.LdapException
Applies all the modifications to the entry specified by its Dn.

Parameters:
dn - The entry's Dn
modifications - The list of modifications to be applied
Throws:
{@link - LdapException} in case of modify operation failure or timeout happens
org.apache.directory.api.ldap.model.exception.LdapException

modify

void modify(org.apache.directory.api.ldap.model.entry.Entry entry,
            org.apache.directory.api.ldap.model.entry.ModificationOperation modOp)
            throws org.apache.directory.api.ldap.model.exception.LdapException
Modifies all the attributes present in the entry by applying the same operation.

Parameters:
entry - the entry with the attributes to be modified
modOp - the operation to be applied on all the attributes of the above entry
Throws:
{@link - LdapException} in case of modify operation failure or timeout happens
org.apache.directory.api.ldap.model.exception.LdapException

modify

org.apache.directory.api.ldap.model.message.ModifyResponse modify(org.apache.directory.api.ldap.model.message.ModifyRequest modRequest)
                                                                  throws org.apache.directory.api.ldap.model.exception.LdapException
Performs an modify operation based on the modifications present in the ModifyRequest.

Parameters:
modRequest - the request for modify operation
Returns:
the modify operation's response
Throws:
{@link - LdapException} in case of modify operation failure or timeout happens
org.apache.directory.api.ldap.model.exception.LdapException

rename

void rename(String entryDn,
            String newRdn)
            throws org.apache.directory.api.ldap.model.exception.LdapException
Renames the given entryDn with new Rdn and deletes the old Rdn.

Parameters:
entryDn - the target Dn
newRdn - new Rdn for the target Dn
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException
See Also:
rename(String, String, boolean)

rename

void rename(org.apache.directory.api.ldap.model.name.Dn entryDn,
            org.apache.directory.api.ldap.model.name.Rdn newRdn)
            throws org.apache.directory.api.ldap.model.exception.LdapException
Renames the given entryDn with new Rdn and deletes the old Rdn.

Parameters:
entryDn - the target Dn
newRdn - new Rdn for the target Dn
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException
See Also:
rename(org.apache.directory.api.ldap.model.name.Dn, org.apache.directory.api.ldap.model.name.Rdn, boolean)

rename

void rename(String entryDn,
            String newRdn,
            boolean deleteOldRdn)
            throws org.apache.directory.api.ldap.model.exception.LdapException
Renames the given entryDn with new Rdn and deletes the old Rdn if deleteOldRdn is set to true.

Parameters:
entryDn - the target Dn
newRdn - new Rdn for the target Dn
deleteOldRdn - flag to indicate whether to delete the old Rdn
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException
See Also:
rename(org.apache.directory.api.ldap.model.name.Dn, org.apache.directory.api.ldap.model.name.Rdn, boolean)

rename

void rename(org.apache.directory.api.ldap.model.name.Dn entryDn,
            org.apache.directory.api.ldap.model.name.Rdn newRdn,
            boolean deleteOldRdn)
            throws org.apache.directory.api.ldap.model.exception.LdapException
Renames the given entryDn with new Rdn and deletes the old Rdn if deleteOldRdn is set to true.

Parameters:
entryDn - the target Dn
newRdn - new Rdn for the target Dn
deleteOldRdn - flag to indicate whether to delete the old Rdn
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException

move

void move(String entryDn,
          String newSuperiorDn)
          throws org.apache.directory.api.ldap.model.exception.LdapException
Moves the given entry Dn under the new superior Dn.

Parameters:
entryDn - the Dn of the target entry
newSuperiorDn - Dn of the new parent/superior
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException
See Also:
move(org.apache.directory.api.ldap.model.name.Dn, org.apache.directory.api.ldap.model.name.Dn)

move

void move(org.apache.directory.api.ldap.model.name.Dn entryDn,
          org.apache.directory.api.ldap.model.name.Dn newSuperiorDn)
          throws org.apache.directory.api.ldap.model.exception.LdapException
Moves the given entry Dn under the new superior Dn.

Parameters:
entryDn - the Dn of the target entry
newSuperiorDn - Dn of the new parent/superior
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException

moveAndRename

void moveAndRename(org.apache.directory.api.ldap.model.name.Dn entryDn,
                   org.apache.directory.api.ldap.model.name.Dn newDn)
                   throws org.apache.directory.api.ldap.model.exception.LdapException
Moves and renames the given entryDn. The old Rdn will be deleted.

Parameters:
entryDn - The original entry Dn
newDn - The new Entry Dn
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException
See Also:
moveAndRename(org.apache.directory.api.ldap.model.name.Dn, org.apache.directory.api.ldap.model.name.Dn, boolean)

moveAndRename

void moveAndRename(String entryDn,
                   String newDn)
                   throws org.apache.directory.api.ldap.model.exception.LdapException
Moves and renames the given entryDn.The old Rdn will be deleted

Parameters:
entryDn - The original entry Dn
newDn - The new Entry Dn
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException
See Also:
moveAndRename(org.apache.directory.api.ldap.model.name.Dn, org.apache.directory.api.ldap.model.name.Dn, boolean)

moveAndRename

void moveAndRename(org.apache.directory.api.ldap.model.name.Dn entryDn,
                   org.apache.directory.api.ldap.model.name.Dn newDn,
                   boolean deleteOldRdn)
                   throws org.apache.directory.api.ldap.model.exception.LdapException
Moves and renames the given entryDn. The old Rdn will be deleted if requested.

Parameters:
entryDn - The original entry Dn
newDn - The new Entry Dn
deleteOldRdn - Tells if the old Rdn must be removed
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException

moveAndRename

void moveAndRename(String entryDn,
                   String newDn,
                   boolean deleteOldRdn)
                   throws org.apache.directory.api.ldap.model.exception.LdapException
Moves and renames the given entryDn. The old Rdn will be deleted if requested.

Parameters:
entryDn - The original entry Dn
newDn - The new Entry Dn
deleteOldRdn - Tells if the old Rdn must be removed
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException

modifyDn

org.apache.directory.api.ldap.model.message.ModifyDnResponse modifyDn(org.apache.directory.api.ldap.model.message.ModifyDnRequest modDnRequest)
                                                                      throws org.apache.directory.api.ldap.model.exception.LdapException
Performs the modifyDn operation based on the given ModifyDnRequest.

Parameters:
modDnRequest - the request
Returns:
modifyDn operation's response
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException

delete

void delete(String dn)
            throws org.apache.directory.api.ldap.model.exception.LdapException
Deletes the entry with the given Dn.

Parameters:
dn - the target entry's Dn as a String
Throws:
{@link - LdapException} If the Dn is not valid or if the deletion failed
org.apache.directory.api.ldap.model.exception.LdapException

delete

void delete(org.apache.directory.api.ldap.model.name.Dn dn)
            throws org.apache.directory.api.ldap.model.exception.LdapException
Deletes the entry with the given Dn.

Parameters:
dn - the target entry's Dn
Throws:
{@link - LdapException} If the Dn is not valid or if the deletion failed
org.apache.directory.api.ldap.model.exception.LdapException

delete

org.apache.directory.api.ldap.model.message.DeleteResponse delete(org.apache.directory.api.ldap.model.message.DeleteRequest deleteRequest)
                                                                  throws org.apache.directory.api.ldap.model.exception.LdapException
Performs a delete operation based on the delete request object.

Parameters:
deleteRequest - the delete operation's request
Returns:
delete operation's response, null if a non-null listener value is provided
Throws:
{@link - LdapException} If the Dn is not valid or if the deletion failed
org.apache.directory.api.ldap.model.exception.LdapException

compare

boolean compare(String dn,
                String attributeName,
                String value)
                throws org.apache.directory.api.ldap.model.exception.LdapException
Compares whether a given attribute's value matches that of the existing value of the attribute present in the entry with the given Dn.

Parameters:
dn - the target entry's String Dn
attributeName - the attribute's name
value - a String value with which the target entry's attribute value to be compared with
Returns:
compare operation's response
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException

compare

boolean compare(String dn,
                String attributeName,
                byte[] value)
                throws org.apache.directory.api.ldap.model.exception.LdapException
Compares whether a given attribute's value matches that of the existing value of the attribute present in the entry with the given Dn.

Parameters:
dn - the target entry's String Dn
attributeName - the attribute's name
value - a byte[] value with which the target entry's attribute value to be compared with
Returns:
compare operation's response
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException

compare

boolean compare(String dn,
                String attributeName,
                org.apache.directory.api.ldap.model.entry.Value<?> value)
                throws org.apache.directory.api.ldap.model.exception.LdapException
Compares whether a given attribute's value matches that of the existing value of the attribute present in the entry with the given Dn.

Parameters:
dn - the target entry's String Dn
attributeName - the attribute's name
value - a Value value with which the target entry's attribute value to be compared with
Returns:
compare operation's response
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException

compare

boolean compare(org.apache.directory.api.ldap.model.name.Dn dn,
                String attributeName,
                String value)
                throws org.apache.directory.api.ldap.model.exception.LdapException
Compares whether a given attribute's value matches that of the existing value of the attribute present in the entry with the given Dn.

Parameters:
dn - the target entry's Dn
attributeName - the attribute's name
value - a String value with which the target entry's attribute value to be compared with
Returns:
compare operation's response
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException

compare

boolean compare(org.apache.directory.api.ldap.model.name.Dn dn,
                String attributeName,
                byte[] value)
                throws org.apache.directory.api.ldap.model.exception.LdapException
Compares whether a given attribute's value matches that of the existing value of the attribute present in the entry with the given Dn.

Parameters:
dn - the target entry's Dn
attributeName - the attribute's name
value - a byte[] value with which the target entry's attribute value to be compared with
Returns:
compare operation's response
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException

compare

boolean compare(org.apache.directory.api.ldap.model.name.Dn dn,
                String attributeName,
                org.apache.directory.api.ldap.model.entry.Value<?> value)
                throws org.apache.directory.api.ldap.model.exception.LdapException
Compares whether a given attribute's value matches that of the existing value of the attribute present in the entry with the given Dn.

Parameters:
dn - the target entry's Dn
attributeName - the attribute's name
value - a Value value with which the target entry's attribute value to be compared with
Returns:
compare operation's response
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException

compare

org.apache.directory.api.ldap.model.message.CompareResponse compare(org.apache.directory.api.ldap.model.message.CompareRequest compareRequest)
                                                                    throws org.apache.directory.api.ldap.model.exception.LdapException
Compares an entry's attribute's value with that of the given value.

Parameters:
compareRequest - the CompareRequest which contains the target Dn, attribute name and value
Returns:
compare operation's response
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException

extended

org.apache.directory.api.ldap.model.message.ExtendedResponse extended(String oid)
                                                                      throws org.apache.directory.api.ldap.model.exception.LdapException
Sends a extended operation request to the server with the given OID and no value.

Parameters:
oid - the object identifier of the extended operation
Returns:
extended operation's response
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException
See Also:
extended(org.apache.directory.api.asn1.util.Oid, byte[])

extended

org.apache.directory.api.ldap.model.message.ExtendedResponse extended(String oid,
                                                                      byte[] value)
                                                                      throws org.apache.directory.api.ldap.model.exception.LdapException
Sends a extended operation request to the server with the given OID and value.

Parameters:
oid - the object identifier of the extended operation
value - value to be used by the extended operation, can be a null value
Returns:
extended operation's response
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException
See Also:
extended(org.apache.directory.api.asn1.util.Oid, byte[])

extended

org.apache.directory.api.ldap.model.message.ExtendedResponse extended(org.apache.directory.api.asn1.util.Oid oid)
                                                                      throws org.apache.directory.api.ldap.model.exception.LdapException
Sends a extended operation request to the server with the given OID and no value.

Parameters:
oid - the object identifier of the extended operation
Returns:
extended operation's response
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException
See Also:
extended(org.apache.directory.api.asn1.util.Oid, byte[])

extended

org.apache.directory.api.ldap.model.message.ExtendedResponse extended(org.apache.directory.api.asn1.util.Oid oid,
                                                                      byte[] value)
                                                                      throws org.apache.directory.api.ldap.model.exception.LdapException
Sends a extended operation request to the server with the given OID and value.

Parameters:
oid - the object identifier of the extended operation
value - value to be used by the extended operation, can be a null value
Returns:
extended operation's response
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException

extended

org.apache.directory.api.ldap.model.message.ExtendedResponse extended(org.apache.directory.api.ldap.model.message.ExtendedRequest extendedRequest)
                                                                      throws org.apache.directory.api.ldap.model.exception.LdapException
Performs an extended operation based on the Extended request object.

Parameters:
extendedRequest - the extended operation's request
Returns:
Extended operation's response
Throws:
{@link - LdapException} If the Dn is not valid or if the extended operation failed
org.apache.directory.api.ldap.model.exception.LdapException

exists

boolean exists(String dn)
               throws org.apache.directory.api.ldap.model.exception.LdapException
Tells if an Entry exists in the server.

Parameters:
dn - The Dn for the entry we want to check the existence
Returns:
true if the entry exists, false otherwise. Note that if the entry exists but if the user does not have the permission to read it, false will also be returned
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException

exists

boolean exists(org.apache.directory.api.ldap.model.name.Dn dn)
               throws org.apache.directory.api.ldap.model.exception.LdapException
Tells if an Entry exists in the server.

Parameters:
dn - The Dn for the entry we want to check the existence
Returns:
true if the entry exists, false otherwise. Note that if the entry exists but if the user does not have the permission to read it, false will also be returned
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException

getRootDse

org.apache.directory.api.ldap.model.entry.Entry getRootDse()
                                                           throws org.apache.directory.api.ldap.model.exception.LdapException
Get back the RooDSE from the connected server. We only return the user attributes.

Returns:
The Entry containing all the information about the rootDSE
Throws:
{@link - LdapException} If the rootDSE can't be read
org.apache.directory.api.ldap.model.exception.LdapException

getRootDse

org.apache.directory.api.ldap.model.entry.Entry getRootDse(String... attributes)
                                                           throws org.apache.directory.api.ldap.model.exception.LdapException
Get back the RooDSE from the connected server. The user can provide the list of attributes he wants to get back. Sending "*" will return all the user attributes, sending "+" will return all the operational attributes;

Parameters:
attributes - The list of attributes to return
Returns:
The Entry containing all the information about the rootDSE
Throws:
{@link - LdapException} If the rootDSE can't be read
org.apache.directory.api.ldap.model.exception.LdapException

lookup

org.apache.directory.api.ldap.model.entry.Entry lookup(org.apache.directory.api.ldap.model.name.Dn dn)
                                                       throws org.apache.directory.api.ldap.model.exception.LdapException
Searches for an entry having the given Dn.

Parameters:
dn - the Dn of the entry to be fetched
Returns:
the Entry with the given Dn or null if no entry exists with that Dn
Throws:
{@link - LdapException} in case of any problems while searching for the Dn or if the returned response contains a referral
org.apache.directory.api.ldap.model.exception.LdapException
See Also:
lookup(org.apache.directory.api.ldap.model.name.Dn, String...)

lookup

org.apache.directory.api.ldap.model.entry.Entry lookup(String dn)
                                                       throws org.apache.directory.api.ldap.model.exception.LdapException
Searches for an entry having the given Dn.

Parameters:
dn - the Dn of the entry to be fetched
Returns:
the Entry with the given Dn or null if no entry exists with that Dn
Throws:
{@link - LdapException} in case of any problems while searching for the Dn or if the returned response contains a referral
org.apache.directory.api.ldap.model.exception.LdapException
See Also:
lookup(String, String...)

lookup

org.apache.directory.api.ldap.model.entry.Entry lookup(org.apache.directory.api.ldap.model.name.Dn dn,
                                                       String... attributes)
                                                       throws org.apache.directory.api.ldap.model.exception.LdapException
Searches for an entry having the given Dn.

Parameters:
dn - the Dn of the entry to be fetched
attributes - the attributes to be returned along with entry
Returns:
the Entry with the given Dn or null if no entry exists with that Dn
Throws:
{@link - LdapException} in case of any problems while searching for the Dn or if the returned response contains a referral
org.apache.directory.api.ldap.model.exception.LdapException

lookup

org.apache.directory.api.ldap.model.entry.Entry lookup(org.apache.directory.api.ldap.model.name.Dn dn,
                                                       org.apache.directory.api.ldap.model.message.Control[] controls,
                                                       String... attributes)
                                                       throws org.apache.directory.api.ldap.model.exception.LdapException
Searches for an entry having the given Dn.

Parameters:
dn - the Dn of the entry to be fetched
controls - the controls to use
attributes - the attributes to be returned along with entry
Returns:
the Entry with the given Dn or null if no entry exists with that Dn
Throws:
{@link - LdapException} in case of any problems while searching for the Dn or if the returned response contains a referral
org.apache.directory.api.ldap.model.exception.LdapException

lookup

org.apache.directory.api.ldap.model.entry.Entry lookup(String dn,
                                                       String... attributes)
                                                       throws org.apache.directory.api.ldap.model.exception.LdapException
Searches for an entry having the given Dn.

Parameters:
dn - the Dn of the entry to be fetched
attributes - the attributes to be returned along with entry
Returns:
the Entry with the given Dn or null if no entry exists with that Dn
Throws:
{@link - LdapException} in case of any problems while searching for the Dn or if the returned response contains a referral
org.apache.directory.api.ldap.model.exception.LdapException
See Also:
lookup(org.apache.directory.api.ldap.model.name.Dn, String...)

lookup

org.apache.directory.api.ldap.model.entry.Entry lookup(String dn,
                                                       org.apache.directory.api.ldap.model.message.Control[] controls,
                                                       String... attributes)
                                                       throws org.apache.directory.api.ldap.model.exception.LdapException
Searches for an entry having the given Dn.

Parameters:
dn - the Dn of the entry to be fetched
controls - the controls to use
attributes - the attributes to be returned along with entry
Returns:
the Entry with the given Dn or null if no entry exists with that Dn
Throws:
{@link - LdapException} in case of any problems while searching for the Dn or if the returned response contains a referral
org.apache.directory.api.ldap.model.exception.LdapException
See Also:
lookup(org.apache.directory.api.ldap.model.name.Dn, String...)

isControlSupported

boolean isControlSupported(String controlOID)
                           throws org.apache.directory.api.ldap.model.exception.LdapException
Checks if a control with the given OID is supported.

Parameters:
controlOID - the OID of the control
Returns:
true if the control is supported, false otherwise
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException

getSupportedControls

List<String> getSupportedControls()
                                  throws org.apache.directory.api.ldap.model.exception.LdapException
Get the Controls supported by server.

Returns:
a list of control OIDs supported by server
Throws:
{@link - LdapException} if some error occurred
org.apache.directory.api.ldap.model.exception.LdapException

loadSchema

void loadSchema()
                throws org.apache.directory.api.ldap.model.exception.LdapException
Loads all the default schemas that are bundled with the API.

Note: This method enables all schemas prior to loading

Throws:
{@link - LdapException} in case of problems while loading the schema
org.apache.directory.api.ldap.model.exception.LdapException

getSchemaManager

org.apache.directory.api.ldap.model.schema.SchemaManager getSchemaManager()
Returns:
The SchemaManager associated with this LdapConection if any

getCodecService

org.apache.directory.api.ldap.codec.api.LdapApiService getCodecService()
Gets the LDAP CODEC service responsible for encoding and decoding messages.

Returns:
The LDAP CODEC service.

doesFutureExistFor

boolean doesFutureExistFor(int messageId)
Checks if there is a ResponseFuture associated with the given message ID.

Parameters:
messageId - ID of the request
Returns:
true if there is a non-null future exists, false otherwise

getBinaryAttributeDetector

org.apache.directory.api.ldap.codec.api.BinaryAttributeDetector getBinaryAttributeDetector()
Returns:
the object responsible for the detection of binary attributes

setBinaryAttributeDetector

void setBinaryAttributeDetector(org.apache.directory.api.ldap.codec.api.BinaryAttributeDetector binaryAttributeDetecter)
Sets the object responsible for the detection of binary attributes



Copyright © 2009-2013 The Apache Software Foundation. All Rights Reserved.