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

All Known Subinterfaces:
LdapAsyncConnection
All Known Implementing Classes:
LdapNetworkConnection

public interface LdapConnection

The root interface for all the LDAP connection implementations.

Author:
Apache Directory Project

Method Summary
 void abandon(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
 AddResponse add(AddRequest addRequest)
          Add an entry present in the AddRequest to the server.
 void add(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
 BindResponse bind(BindRequest bindRequest)
          Bind to the server using a BindRequest object.
 void bind(Dn name)
          Unauthenticated authentication Bind on a server.
 void bind(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
 CompareResponse compare(CompareRequest compareRequest)
          Compares an entry's attribute's value with that of the given value.
 boolean compare(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(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(Dn dn, String attributeName, 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, 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.
 DeleteResponse delete(DeleteRequest deleteRequest)
          Performs a delete operation based on the delete request object.
 void delete(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(Dn dn)
          Tells if an Entry exists in the server.
 boolean exists(String dn)
          Tells if an Entry exists in the server.
 ExtendedResponse extended(ExtendedRequest extendedRequest)
          Performs an extended operation based on the Extended request object.
 ExtendedResponse extended(Oid oid)
          Sends a extended operation request to the server with the given OID and no value.
 ExtendedResponse extended(Oid oid, byte[] value)
          Sends a extended operation request to the server with the given OID and value.
 ExtendedResponse extended(String oid)
          Sends a extended operation request to the server with the given OID and no value.
 ExtendedResponse extended(String oid, byte[] value)
          Sends a extended operation request to the server with the given OID and value.
 LdapApiService getCodecService()
          Gets the LDAP CODEC service responsible for encoding and decoding messages.
 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
 Entry lookup(Dn dn)
          Searches for an entry having the given Dn.
 Entry lookup(Dn dn, Control[] controls, String... attributes)
          Searches for an entry having the given Dn.
 Entry lookup(Dn dn, String... attributes)
          Searches for an entry having the given Dn.
 Entry lookup(String dn)
          Searches for an entry having the given Dn.
 Entry lookup(String dn, Control[] controls, String... attributes)
          Searches for an entry having the given Dn.
 Entry lookup(String dn, String... attributes)
          Searches for an entry having the given Dn.
 void modify(Dn dn, Modification... modifications)
          Applies all the modifications to the entry specified by its Dn.
 void modify(Entry entry, ModificationOperation modOp)
          Modifies all the attributes present in the entry by applying the same operation.
 ModifyResponse modify(ModifyRequest modRequest)
          Performs an modify operation based on the modifications present in the ModifyRequest.
 void modify(String dn, Modification... modifications)
          Applies all the modifications to the entry specified by its Dn.
 ModifyDnResponse modifyDn(ModifyDnRequest modDnRequest)
          Performs the modifyDn operation based on the given ModifyDnRequest.
 void move(Dn entryDn, 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(Dn entryDn, Dn newDn)
          Moves and renames the given entryDn.
 void moveAndRename(Dn entryDn, 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(Dn entryDn, Rdn newRdn)
          Renames the given entryDn with new Rdn and deletes the old Rdn.
 void rename(Dn entryDn, 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.
 EntryCursor search(Dn baseDn, String filter, SearchScope scope, String... attributes)
          Do a search, on the base object, using the given filter.
 SearchCursor search(SearchRequest searchRequest)
          Performs search in a synchronous mode.
 EntryCursor search(String baseDn, String filter, SearchScope scope, String... attributes)
          Do a search, on the base object, using the given filter.
 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 LdapException,
                       IOException
Connect to the remote LDAP server.

Returns:
true if the connection is established, false otherwise
Throws:
LdapException - if some error occurred
IOException - if an I/O exception occurred

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(Entry entry)
         throws 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:
LdapException - if some error occurred

add

AddResponse add(AddRequest addRequest)
                throws 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:
LdapException - if some error occurred

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(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 LdapException,
                 IOException
Bind on a server, using the LdapConnectionConfig informations

Throws:
LdapException - if some error occurred
IOException - if an I/O exception occurred

anonymousBind

void anonymousBind()
                   throws LdapException,
                          IOException
Anonymous Bind on a server.

Throws:
LdapException - if some error occurred
IOException - if an I/O exception occurred

bind

void bind(String name)
          throws LdapException,
                 IOException
Unauthenticated authentication bind

Parameters:
name - The name we use to authenticate the user. It must be a valid Dn
Throws:
LdapException - if some error occurred
IOException - if an I/O exception occurred

bind

void bind(String name,
          String credentials)
          throws 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:
LdapException - if some error occurred
IOException - if an I/O exception occurred

bind

void bind(Dn name)
          throws 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:
LdapException - if some error occurred
IOException - if an I/O exception occurred

bind

void bind(Dn name,
          String credentials)
          throws 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:
LdapException - if some error occurred
IOException - if an I/O exception occurred

bind

BindResponse bind(BindRequest bindRequest)
                  throws 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:
LdapException - if some error occurred
IOException - if an I/O exception occurred

search

EntryCursor search(Dn baseDn,
                   String filter,
                   SearchScope scope,
                   String... attributes)
                   throws 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:
A search cursor on the result.
Throws:
LdapException - if some error occurred

search

EntryCursor search(String baseDn,
                   String filter,
                   SearchScope scope,
                   String... attributes)
                   throws 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:
A search cursor on the result.
Throws:
LdapException - if some error occurred

search

SearchCursor search(SearchRequest searchRequest)
                    throws LdapException
Performs search in a synchronous mode.

Parameters:
searchRequest - The search configuration
Returns:
a search cursor on the result.
Throws:
LdapException - if some error occurred

unBind

void unBind()
            throws LdapException
UnBind from a server. This is a request which expect no response.

Throws:
LdapException - if some error occurred

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(Dn dn,
            Modification... modifications)
            throws 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:
LdapException - in case of modify operation failure or timeout happens

modify

void modify(String dn,
            Modification... modifications)
            throws 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:
LdapException - in case of modify operation failure or timeout happens

modify

void modify(Entry entry,
            ModificationOperation modOp)
            throws 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:
LdapException - in case of modify operation failure or timeout happens

modify

ModifyResponse modify(ModifyRequest modRequest)
                      throws 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:
LdapException - in case of modify operation failure or timeout happens

rename

void rename(String entryDn,
            String newRdn)
            throws 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:
LdapException - if some error occurred
See Also:
rename(String, String, boolean)

rename

void rename(Dn entryDn,
            Rdn newRdn)
            throws 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:
LdapException - if some error occurred
See Also:
rename(org.apache.directory.shared.ldap.model.name.Dn, org.apache.directory.shared.ldap.model.name.Rdn, boolean)

rename

void rename(String entryDn,
            String newRdn,
            boolean deleteOldRdn)
            throws 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:
LdapException - if some error occurred
See Also:
rename(org.apache.directory.shared.ldap.model.name.Dn, org.apache.directory.shared.ldap.model.name.Rdn, boolean)

rename

void rename(Dn entryDn,
            Rdn newRdn,
            boolean deleteOldRdn)
            throws 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:
LdapException - if some error occurred

move

void move(String entryDn,
          String newSuperiorDn)
          throws 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:
LdapException - if some error occurred
See Also:
move(org.apache.directory.shared.ldap.model.name.Dn, org.apache.directory.shared.ldap.model.name.Dn)

move

void move(Dn entryDn,
          Dn newSuperiorDn)
          throws 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:
LdapException - if some error occurred

moveAndRename

void moveAndRename(Dn entryDn,
                   Dn newDn)
                   throws 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:
LdapException - if some error occurred
See Also:
moveAndRename(org.apache.directory.shared.ldap.model.name.Dn, org.apache.directory.shared.ldap.model.name.Dn, boolean)

moveAndRename

void moveAndRename(String entryDn,
                   String newDn)
                   throws 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:
LdapException - if some error occurred
See Also:
moveAndRename(org.apache.directory.shared.ldap.model.name.Dn, org.apache.directory.shared.ldap.model.name.Dn, boolean)

moveAndRename

void moveAndRename(Dn entryDn,
                   Dn newDn,
                   boolean deleteOldRdn)
                   throws 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:
LdapException - if some error occurred

moveAndRename

void moveAndRename(String entryDn,
                   String newDn,
                   boolean deleteOldRdn)
                   throws 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:
LdapException - if some error occurred

modifyDn

ModifyDnResponse modifyDn(ModifyDnRequest modDnRequest)
                          throws LdapException
Performs the modifyDn operation based on the given ModifyDnRequest.

Parameters:
modDnRequest - the request
Returns:
modifyDn operation's response
Throws:
LdapException - if some error occurred

delete

void delete(String dn)
            throws LdapException
Deletes the entry with the given Dn.

Parameters:
dn - the target entry's Dn as a String
Throws:
LdapException - If the Dn is not valid or if the deletion failed

delete

void delete(Dn dn)
            throws LdapException
Deletes the entry with the given Dn.

Parameters:
dn - the target entry's Dn
Throws:
LdapException - If the Dn is not valid or if the deletion failed

delete

DeleteResponse delete(DeleteRequest deleteRequest)
                      throws 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:
LdapException - If the Dn is not valid or if the deletion failed

compare

boolean compare(String dn,
                String attributeName,
                String value)
                throws 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:
LdapException - if some error occurred

compare

boolean compare(String dn,
                String attributeName,
                byte[] value)
                throws 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:
LdapException - if some error occurred

compare

boolean compare(String dn,
                String attributeName,
                Value<?> value)
                throws 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:
LdapException - if some error occurred

compare

boolean compare(Dn dn,
                String attributeName,
                String value)
                throws 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:
LdapException - if some error occurred

compare

boolean compare(Dn dn,
                String attributeName,
                byte[] value)
                throws 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:
LdapException - if some error occurred

compare

boolean compare(Dn dn,
                String attributeName,
                Value<?> value)
                throws 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:
LdapException - if some error occurred

compare

CompareResponse compare(CompareRequest compareRequest)
                        throws 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:
LdapException - if some error occurred

extended

ExtendedResponse extended(String oid)
                          throws 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:
LdapException - if some error occurred
See Also:
extended(org.apache.directory.shared.asn1.util.Oid, byte[])

extended

ExtendedResponse extended(String oid,
                          byte[] value)
                          throws 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:
LdapException - if some error occurred
See Also:
extended(org.apache.directory.shared.asn1.util.Oid, byte[])

extended

ExtendedResponse extended(Oid oid)
                          throws 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:
LdapException - if some error occurred
See Also:
extended(org.apache.directory.shared.asn1.util.Oid, byte[])

extended

ExtendedResponse extended(Oid oid,
                          byte[] value)
                          throws 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:
LdapException - if some error occurred

extended

ExtendedResponse extended(ExtendedRequest extendedRequest)
                          throws LdapException
Performs an extended operation based on the Extended request object.

Parameters:
extendedRequest - the extended operation's request
Returns:
Extended operation's response
Throws:
LdapException - If the Dn is not valid or if the extended operation failed

exists

boolean exists(String dn)
               throws 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:
LdapException - if some error occurred

exists

boolean exists(Dn dn)
               throws 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:
LdapException - if some error occurred

lookup

Entry lookup(Dn dn)
             throws 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:
LdapException - in case of any problems while searching for the Dn or if the returned response contains a referral
See Also:
lookup(org.apache.directory.shared.ldap.model.name.Dn, String...)

lookup

Entry lookup(String dn)
             throws 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:
LdapException - in case of any problems while searching for the Dn or if the returned response contains a referral
See Also:
lookup(String, String...)

lookup

Entry lookup(Dn dn,
             String... attributes)
             throws 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:
LdapException - in case of any problems while searching for the Dn or if the returned response contains a referral

lookup

Entry lookup(Dn dn,
             Control[] controls,
             String... attributes)
             throws 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:
LdapException - in case of any problems while searching for the Dn or if the returned response contains a referral

lookup

Entry lookup(String dn,
             String... attributes)
             throws 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:
LdapException - in case of any problems while searching for the Dn or if the returned response contains a referral
See Also:
lookup(org.apache.directory.shared.ldap.model.name.Dn, String...)

lookup

Entry lookup(String dn,
             Control[] controls,
             String... attributes)
             throws 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:
LdapException - in case of any problems while searching for the Dn or if the returned response contains a referral
See Also:
lookup(org.apache.directory.shared.ldap.model.name.Dn, String...)

isControlSupported

boolean isControlSupported(String controlOID)
                           throws 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:
LdapException - if some error occurred

getSupportedControls

List<String> getSupportedControls()
                                  throws LdapException
Get the Controls supported by server.

Returns:
a list of control OIDs supported by server
Throws:
LdapException - if some error occurred

loadSchema

void loadSchema()
                throws LdapException
Loads all the default schemas that are bundled with the API.

Note: This method enables all schemas prior to loading

Throws:
LdapException - in case of problems while loading the schema

getSchemaManager

SchemaManager getSchemaManager()
Returns:
The SchemaManager associated with this LdapConection if any

getCodecService

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


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