Class LDAPConnection
- java.lang.Object
-
- com.unboundid.ldap.sdk.migrate.ldapjdk.LDAPConnection
-
@Mutable @NotExtensible @ThreadSafety(level=NOT_THREADSAFE) public class LDAPConnection extends java.lang.Object
This class provides an object that may be used to communicate with an LDAP directory server.
This class is primarily intended to be used in the process of updating applications which use the Netscape Directory SDK for Java to switch to or coexist with the UnboundID LDAP SDK for Java. For applications not written using the Netscape Directory SDK for Java, theLDAPConnectionclass should be used instead.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEREF_ALWAYSThe integer value for the DEREF_ALWAYS dereference policy.static intDEREF_FINDINGThe integer value for the DEREF_FINDING dereference policy.static intDEREF_NEVERThe integer value for the DEREF_NEVER dereference policy.static intDEREF_SEARCHINGThe integer value for the DEREF_SEARCHING dereference policy.static intSCOPE_BASEThe integer value for the SCOPE_BASE search scope.static intSCOPE_ONEThe integer value for the SCOPE_ONE search scope.static intSCOPE_SUBThe integer value for the SCOPE_SUB search scope.
-
Constructor Summary
Constructors Constructor Description LDAPConnection()Creates a new LDAP connection which will use the default socket factory.LDAPConnection(LDAPSocketFactory socketFactory)Creates a new LDAP connection which will use the provided socket factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabandon(int id)Sends a request to abandon the request with the specified message ID.voidabandon(LDAPSearchResults searchResults)Sends a request to abandon the provided search operation.voidadd(LDAPEntry entry)Adds the provided entry to the directory.voidadd(LDAPEntry entry, LDAPConstraints constraints)Adds the provided entry to the directory.voidauthenticate(int version, java.lang.String dn, java.lang.String password)Authenticates to the directory server using a simple bind with the provided information.voidauthenticate(int version, java.lang.String dn, java.lang.String password, LDAPConstraints constraints)Authenticates to the directory server using a simple bind with the provided information.voidauthenticate(java.lang.String dn, java.lang.String password)Authenticates to the directory server using a simple bind with the provided information.voidauthenticate(java.lang.String dn, java.lang.String password, LDAPConstraints constraints)Authenticates to the directory server using a simple bind with the provided information.voidbind(int version, java.lang.String dn, java.lang.String password)Authenticates to the directory server using a simple bind with the provided information.voidbind(int version, java.lang.String dn, java.lang.String password, LDAPConstraints constraints)Authenticates to the directory server using a simple bind with the provided information.voidbind(java.lang.String dn, java.lang.String password)Authenticates to the directory server using a simple bind with the provided information.voidbind(java.lang.String dn, java.lang.String password, LDAPConstraints constraints)Authenticates to the directory server using a simple bind with the provided information.booleancompare(java.lang.String dn, LDAPAttribute attribute)Indicates whether the specified entry has the given attribute value.booleancompare(java.lang.String dn, LDAPAttribute attribute, LDAPConstraints constraints)Indicates whether the specified entry has the given attribute value.voidconnect(int version, java.lang.String host, int port, java.lang.String dn, java.lang.String password)Attempts to establish and authenticate this connection with the provided information.voidconnect(int version, java.lang.String host, int port, java.lang.String dn, java.lang.String password, LDAPConstraints constraints)Attempts to establish and authenticate this connection with the provided information.voidconnect(java.lang.String host, int port)Attempts to establish this connection with the provided information.voidconnect(java.lang.String host, int port, java.lang.String dn, java.lang.String password)Attempts to establish and authenticate this connection with the provided information.voidconnect(java.lang.String host, int port, java.lang.String dn, java.lang.String password, LDAPConstraints constraints)Attempts to establish and authenticate this connection with the provided information.voiddelete(java.lang.String dn)Removes an entry from the directory.voiddelete(java.lang.String dn, LDAPConstraints constraints)Removes an entry from the directory.voiddisconnect()Unbinds and disconnects from the directory server.LDAPExtendedOperationextendedOperation(LDAPExtendedOperation extendedOperation)Processes an extended operation in the directory.LDAPExtendedOperationextendedOperation(LDAPExtendedOperation extendedOperation, LDAPConstraints constraints)Processes an extended operation in the directory.protected voidfinalize()Closes the connection to the server if the client forgets to do so.java.lang.StringgetAuthenticationDN()Retrieves the DN of the user that last authenticated on this connection.java.lang.StringgetAuthenticationPassword()Retrieves the password of the user that last authenticated on this connection.intgetConnectTimeout()Retrieves the maximum length of time to wait for the connection to be established, in seconds.LDAPConstraintsgetConstraints()Retrieves the constraints for this connection.java.lang.StringgetHost()Retrieves the address to which the connection is established.intgetPort()Retrieves the port to which the connection is established.LDAPControl[]getResponseControls()Retrieves the response controls from the last operation processed on this connection.LDAPConnectiongetSDKConnection()Retrieves theLDAPConnectionobject used to back this connection.LDAPSearchConstraintsgetSearchConstraints()Retrieves the search constraints for this connection.LDAPSocketFactorygetSocketFactory()Retrieves the socket factory for this LDAP connection, if specified.booleanisConnected()Indicates whether this connection is currently established.voidmodify(java.lang.String dn, LDAPModification mod)Modifies an entry in the directory.voidmodify(java.lang.String dn, LDAPModification[] mods)Modifies an entry in the directory.voidmodify(java.lang.String dn, LDAPModification[] mods, LDAPConstraints constraints)Modifies an entry in the directory.voidmodify(java.lang.String dn, LDAPModification mod, LDAPConstraints constraints)Modifies an entry in the directory.voidmodify(java.lang.String dn, LDAPModificationSet mods)Modifies an entry in the directory.voidmodify(java.lang.String dn, LDAPModificationSet mods, LDAPConstraints constraints)Modifies an entry in the directory.LDAPEntryread(java.lang.String dn)Retrieves an entry from the directory server.LDAPEntryread(java.lang.String dn, LDAPSearchConstraints constraints)Retrieves an entry from the directory server.LDAPEntryread(java.lang.String dn, java.lang.String[] attrs)Retrieves an entry from the directory server.LDAPEntryread(java.lang.String dn, java.lang.String[] attrs, LDAPSearchConstraints constraints)Retrieves an entry from the directory server.voidreconnect()Disconnects from the directory server and attempts to re-connect and re-authenticate.voidrename(java.lang.String dn, java.lang.String newRDN, boolean deleteOldRDN)Alters the DN of an entry in the directory.voidrename(java.lang.String dn, java.lang.String newRDN, boolean deleteOldRDN, LDAPConstraints constraints)Alters the DN of an entry in the directory.voidrename(java.lang.String dn, java.lang.String newRDN, java.lang.String newParentDN, boolean deleteOldRDN)Alters the DN of an entry in the directory.voidrename(java.lang.String dn, java.lang.String newRDN, java.lang.String newParentDN, boolean deleteOldRDN, LDAPConstraints constraints)Alters the DN of an entry in the directory.LDAPSearchResultssearch(java.lang.String baseDN, int scope, java.lang.String filter, java.lang.String[] attributes, boolean typesOnly)Processes a search in the directory server.LDAPSearchResultssearch(java.lang.String baseDN, int scope, java.lang.String filter, java.lang.String[] attributes, boolean typesOnly, LDAPSearchConstraints constraints)Processes a search in the directory server.voidsetConnectTimeout(int timeout)Specifies the maximum length of time to wait for the connection to be established, in seconds.voidsetConstraints(LDAPConstraints constraints)Updates the constraints for this connection.voidsetSearchConstraints(LDAPSearchConstraints searchConstraints)Updates the search constraints for this connection.voidsetSocketFactory(LDAPSocketFactory socketFactory)Sets the socket factory for this LDAP connection.
-
-
-
Field Detail
-
DEREF_NEVER
public static final int DEREF_NEVER
The integer value for the DEREF_NEVER dereference policy.
-
DEREF_SEARCHING
public static final int DEREF_SEARCHING
The integer value for the DEREF_SEARCHING dereference policy.
-
DEREF_FINDING
public static final int DEREF_FINDING
The integer value for the DEREF_FINDING dereference policy.
-
DEREF_ALWAYS
public static final int DEREF_ALWAYS
The integer value for the DEREF_ALWAYS dereference policy.
-
SCOPE_BASE
public static final int SCOPE_BASE
The integer value for the SCOPE_BASE search scope.- See Also:
- Constant Field Values
-
SCOPE_ONE
public static final int SCOPE_ONE
The integer value for the SCOPE_ONE search scope.- See Also:
- Constant Field Values
-
SCOPE_SUB
public static final int SCOPE_SUB
The integer value for the SCOPE_SUB search scope.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LDAPConnection
public LDAPConnection()
Creates a new LDAP connection which will use the default socket factory.
-
LDAPConnection
public LDAPConnection(LDAPSocketFactory socketFactory)
Creates a new LDAP connection which will use the provided socket factory.- Parameters:
socketFactory- The socket factory to use when creating the socket to use for communicating with the server.
-
-
Method Detail
-
finalize
protected void finalize() throws java.lang.Throwable
Closes the connection to the server if the client forgets to do so.- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable- If a problem occurs.
-
getSDKConnection
public LDAPConnection getSDKConnection()
Retrieves theLDAPConnectionobject used to back this connection.- Returns:
- The
com.unboundid.ldap.sdk.LDAPConnectionobject used to back this connection.
-
getHost
public java.lang.String getHost()
Retrieves the address to which the connection is established.- Returns:
- The address to which the connection is established.
-
getPort
public int getPort()
Retrieves the port to which the connection is established.- Returns:
- The port to which the connection is established.
-
getAuthenticationDN
public java.lang.String getAuthenticationDN()
Retrieves the DN of the user that last authenticated on this connection.- Returns:
- The DN of the user that last authenticated on this connection,
or
nullif it is not available.
-
getAuthenticationPassword
public java.lang.String getAuthenticationPassword()
Retrieves the password of the user that last authenticated on this connection.- Returns:
- The password of the user that last authenticated on this
connection, or
nullif it is not available.
-
getConnectTimeout
public int getConnectTimeout()
Retrieves the maximum length of time to wait for the connection to be established, in seconds.- Returns:
- The maximum length of time to wait for the connection to be established.
-
setConnectTimeout
public void setConnectTimeout(int timeout)
Specifies the maximum length of time to wait for the connection to be established, in seconds.- Parameters:
timeout- The maximum length of time to wait for the connection to be established.
-
getSocketFactory
public LDAPSocketFactory getSocketFactory()
Retrieves the socket factory for this LDAP connection, if specified.- Returns:
- The socket factory for this LDAP connection, or
nullif none has been provided.
-
setSocketFactory
public void setSocketFactory(LDAPSocketFactory socketFactory)
Sets the socket factory for this LDAP connection.- Parameters:
socketFactory- The socket factory for this LDAP connection.
-
getConstraints
public LDAPConstraints getConstraints()
Retrieves the constraints for this connection.- Returns:
- The constraints for this connection.
-
setConstraints
public void setConstraints(LDAPConstraints constraints)
Updates the constraints for this connection.- Parameters:
constraints- The constraints for this connection.
-
getSearchConstraints
public LDAPSearchConstraints getSearchConstraints()
Retrieves the search constraints for this connection.- Returns:
- The search constraints for this connection.
-
setSearchConstraints
public void setSearchConstraints(LDAPSearchConstraints searchConstraints)
Updates the search constraints for this connection.- Parameters:
searchConstraints- The search constraints for this connection.
-
getResponseControls
public LDAPControl[] getResponseControls()
Retrieves the response controls from the last operation processed on this connection.- Returns:
- The response controls from the last operation processed on this
connection, or
nullif there were none.
-
isConnected
public boolean isConnected()
Indicates whether this connection is currently established.- Returns:
trueif this connection is currently established, orfalseif not.
-
connect
public void connect(java.lang.String host, int port) throws LDAPException
Attempts to establish this connection with the provided information.- Parameters:
host- The address of the server to which the connection should be established.port- The port of the server to which the connection should be established.- Throws:
LDAPException- If a problem occurs while attempting to establish this connection.
-
connect
public void connect(java.lang.String host, int port, java.lang.String dn, java.lang.String password) throws LDAPException
Attempts to establish and authenticate this connection with the provided information.- Parameters:
host- The address of the server to which the connection should be established.port- The port of the server to which the connection should be established.dn- The DN to use to bind to the server.password- The password to use to bind to the server.- Throws:
LDAPException- If a problem occurs while attempting to establish or authenticate this connection. If an exception is thrown, then the connection will not be established.
-
connect
public void connect(java.lang.String host, int port, java.lang.String dn, java.lang.String password, LDAPConstraints constraints) throws LDAPException
Attempts to establish and authenticate this connection with the provided information.- Parameters:
host- The address of the server to which the connection should be established.port- The port of the server to which the connection should be established.dn- The DN to use to bind to the server.password- The password to use to bind to the server.constraints- The constraints to use when processing the bind.- Throws:
LDAPException- If a problem occurs while attempting to establish or authenticate this connection. If an exception is thrown, then the connection will not be established.
-
connect
public void connect(int version, java.lang.String host, int port, java.lang.String dn, java.lang.String password) throws LDAPException
Attempts to establish and authenticate this connection with the provided information.- Parameters:
version- The LDAP protocol version to use for the connection. This will be ignored, since this implementation only supports LDAPv3.host- The address of the server to which the connection should be established.port- The port of the server to which the connection should be established.dn- The DN to use to bind to the server.password- The password to use to bind to the server.- Throws:
LDAPException- If a problem occurs while attempting to establish or authenticate this connection. If an exception is thrown, then the connection will not be established.
-
connect
public void connect(int version, java.lang.String host, int port, java.lang.String dn, java.lang.String password, LDAPConstraints constraints) throws LDAPException
Attempts to establish and authenticate this connection with the provided information.- Parameters:
version- The LDAP protocol version to use for the connection. This will be ignored, since this implementation only supports LDAPv3.host- The address of the server to which the connection should be established.port- The port of the server to which the connection should be established.dn- The DN to use to bind to the server.password- The password to use to bind to the server.constraints- The constraints to use when processing the bind.- Throws:
LDAPException- If a problem occurs while attempting to establish or authenticate this connection. If an exception is thrown, then the connection will not be established.
-
disconnect
public void disconnect() throws LDAPException
Unbinds and disconnects from the directory server.- Throws:
LDAPException- If a problem occurs.
-
reconnect
public void reconnect() throws LDAPException
Disconnects from the directory server and attempts to re-connect and re-authenticate.- Throws:
LDAPException- If a problem occurs. If an exception is thrown, the connection will have been closed.
-
abandon
public void abandon(int id) throws LDAPException
Sends a request to abandon the request with the specified message ID.- Parameters:
id- The message ID of the operation to abandon.- Throws:
LDAPException- If a problem occurs while sending the request.
-
abandon
public void abandon(LDAPSearchResults searchResults) throws LDAPException
Sends a request to abandon the provided search operation.- Parameters:
searchResults- The search results object for the search to abandon.- Throws:
LDAPException- If a problem occurs while sending the request.
-
add
public void add(LDAPEntry entry) throws LDAPException
Adds the provided entry to the directory.- Parameters:
entry- The entry to be added.- Throws:
LDAPException- If a problem occurs while adding the entry.
-
add
public void add(LDAPEntry entry, LDAPConstraints constraints) throws LDAPException
Adds the provided entry to the directory.- Parameters:
entry- The entry to be added.constraints- The constraints to use for the add operation.- Throws:
LDAPException- If a problem occurs while adding the entry.
-
authenticate
public void authenticate(java.lang.String dn, java.lang.String password) throws LDAPException
Authenticates to the directory server using a simple bind with the provided information.- Parameters:
dn- The DN of the user for the bind.password- The password to use for the bind.- Throws:
LDAPException- If the bind attempt fails.
-
authenticate
public void authenticate(java.lang.String dn, java.lang.String password, LDAPConstraints constraints) throws LDAPException
Authenticates to the directory server using a simple bind with the provided information.- Parameters:
dn- The DN of the user for the bind.password- The password to use for the bind.constraints- The constraints to use for the bind operation.- Throws:
LDAPException- If the bind attempt fails.
-
authenticate
public void authenticate(int version, java.lang.String dn, java.lang.String password) throws LDAPException
Authenticates to the directory server using a simple bind with the provided information.- Parameters:
version- The LDAP protocol version to use. This will be ignored, since this implementation only supports LDAPv3.dn- The DN of the user for the bind.password- The password to use for the bind.- Throws:
LDAPException- If the bind attempt fails.
-
authenticate
public void authenticate(int version, java.lang.String dn, java.lang.String password, LDAPConstraints constraints) throws LDAPException
Authenticates to the directory server using a simple bind with the provided information.- Parameters:
version- The LDAP protocol version to use. This will be ignored, since this implementation only supports LDAPv3.dn- The DN of the user for the bind.password- The password to use for the bind.constraints- The constraints to use for the bind operation.- Throws:
LDAPException- If the bind attempt fails.
-
bind
public void bind(java.lang.String dn, java.lang.String password) throws LDAPException
Authenticates to the directory server using a simple bind with the provided information.- Parameters:
dn- The DN of the user for the bind.password- The password to use for the bind.- Throws:
LDAPException- If the bind attempt fails.
-
bind
public void bind(java.lang.String dn, java.lang.String password, LDAPConstraints constraints) throws LDAPException
Authenticates to the directory server using a simple bind with the provided information.- Parameters:
dn- The DN of the user for the bind.password- The password to use for the bind.constraints- The constraints to use for the bind operation.- Throws:
LDAPException- If the bind attempt fails.
-
bind
public void bind(int version, java.lang.String dn, java.lang.String password) throws LDAPException
Authenticates to the directory server using a simple bind with the provided information.- Parameters:
version- The LDAP protocol version to use. This will be ignored, since this implementation only supports LDAPv3.dn- The DN of the user for the bind.password- The password to use for the bind.- Throws:
LDAPException- If the bind attempt fails.
-
bind
public void bind(int version, java.lang.String dn, java.lang.String password, LDAPConstraints constraints) throws LDAPException
Authenticates to the directory server using a simple bind with the provided information.- Parameters:
version- The LDAP protocol version to use. This will be ignored, since this implementation only supports LDAPv3.dn- The DN of the user for the bind.password- The password to use for the bind.constraints- The constraints to use for the bind operation.- Throws:
LDAPException- If the bind attempt fails.
-
compare
public boolean compare(java.lang.String dn, LDAPAttribute attribute) throws LDAPException
Indicates whether the specified entry has the given attribute value.- Parameters:
dn- The DN of the entry to compare.attribute- The attribute (which must have exactly one value) to use for the comparison.- Returns:
trueif the compare matched the target entry, orfalseif not.- Throws:
LDAPException- If a problem occurs while processing the compare.
-
compare
public boolean compare(java.lang.String dn, LDAPAttribute attribute, LDAPConstraints constraints) throws LDAPException
Indicates whether the specified entry has the given attribute value.- Parameters:
dn- The DN of the entry to compare.attribute- The attribute (which must have exactly one value) to use for the comparison.constraints- The constraints to use for the compare operation.- Returns:
trueif the compare matched the target entry, orfalseif not.- Throws:
LDAPException- If a problem occurs while processing the compare.
-
delete
public void delete(java.lang.String dn) throws LDAPException
Removes an entry from the directory.- Parameters:
dn- The DN of the entry to delete.- Throws:
LDAPException- If a problem occurs while processing the delete.
-
delete
public void delete(java.lang.String dn, LDAPConstraints constraints) throws LDAPException
Removes an entry from the directory.- Parameters:
dn- The DN of the entry to delete.constraints- The constraints to use for the delete operation.- Throws:
LDAPException- If a problem occurs while processing the delete.
-
extendedOperation
public LDAPExtendedOperation extendedOperation(LDAPExtendedOperation extendedOperation) throws LDAPException
Processes an extended operation in the directory.- Parameters:
extendedOperation- The extended operation to process.- Returns:
- The result returned from the extended operation.
- Throws:
LDAPException- If a problem occurs while processing the operation.
-
extendedOperation
public LDAPExtendedOperation extendedOperation(LDAPExtendedOperation extendedOperation, LDAPConstraints constraints) throws LDAPException
Processes an extended operation in the directory.- Parameters:
extendedOperation- The extended operation to process.constraints- The constraints to use for the operation.- Returns:
- The result returned from the extended operation.
- Throws:
LDAPException- If a problem occurs while processing the operation.
-
modify
public void modify(java.lang.String dn, LDAPModification mod) throws LDAPException
Modifies an entry in the directory.- Parameters:
dn- The DN of the entry to modify.mod- The modification to apply to the entry.- Throws:
LDAPException- If a problem occurs while processing the delete.
-
modify
public void modify(java.lang.String dn, LDAPModification[] mods) throws LDAPException
Modifies an entry in the directory.- Parameters:
dn- The DN of the entry to modify.mods- The modifications to apply to the entry.- Throws:
LDAPException- If a problem occurs while processing the delete.
-
modify
public void modify(java.lang.String dn, LDAPModification mod, LDAPConstraints constraints) throws LDAPException
Modifies an entry in the directory.- Parameters:
dn- The DN of the entry to modify.mod- The modification to apply to the entry.constraints- The constraints to use for the modify operation.- Throws:
LDAPException- If a problem occurs while processing the delete.
-
modify
public void modify(java.lang.String dn, LDAPModification[] mods, LDAPConstraints constraints) throws LDAPException
Modifies an entry in the directory.- Parameters:
dn- The DN of the entry to modify.mods- The modifications to apply to the entry.constraints- The constraints to use for the modify operation.- Throws:
LDAPException- If a problem occurs while processing the delete.
-
modify
public void modify(java.lang.String dn, LDAPModificationSet mods) throws LDAPException
Modifies an entry in the directory.- Parameters:
dn- The DN of the entry to modify.mods- The modifications to apply to the entry.- Throws:
LDAPException- If a problem occurs while processing the delete.
-
modify
public void modify(java.lang.String dn, LDAPModificationSet mods, LDAPConstraints constraints) throws LDAPException
Modifies an entry in the directory.- Parameters:
dn- The DN of the entry to modify.mods- The modifications to apply to the entry.constraints- The constraints to use for the modify operation.- Throws:
LDAPException- If a problem occurs while processing the delete.
-
read
public LDAPEntry read(java.lang.String dn) throws LDAPException
Retrieves an entry from the directory server.- Parameters:
dn- The DN of the entry to retrieve.- Returns:
- The entry that was read.
- Throws:
LDAPException- If a problem occurs while performing the search.
-
read
public LDAPEntry read(java.lang.String dn, LDAPSearchConstraints constraints) throws LDAPException
Retrieves an entry from the directory server.- Parameters:
dn- The DN of the entry to retrieve.constraints- The constraints to use for the search operation.- Returns:
- The entry that was read.
- Throws:
LDAPException- If a problem occurs while performing the search.
-
read
public LDAPEntry read(java.lang.String dn, java.lang.String[] attrs) throws LDAPException
Retrieves an entry from the directory server.- Parameters:
dn- The DN of the entry to retrieve.attrs- The set of attributes to request.- Returns:
- The entry that was read.
- Throws:
LDAPException- If a problem occurs while performing the search.
-
read
public LDAPEntry read(java.lang.String dn, java.lang.String[] attrs, LDAPSearchConstraints constraints) throws LDAPException
Retrieves an entry from the directory server.- Parameters:
dn- The DN of the entry to retrieve.attrs- The set of attributes to request.constraints- The constraints to use for the search operation.- Returns:
- The entry that was read.
- Throws:
LDAPException- If a problem occurs while performing the search.
-
rename
public void rename(java.lang.String dn, java.lang.String newRDN, boolean deleteOldRDN) throws LDAPException
Alters the DN of an entry in the directory.- Parameters:
dn- The DN of the entry to modify.newRDN- The new RDN to use for the entry.deleteOldRDN- Indicates whether to remove the old RDN value(s).- Throws:
LDAPException- If a problem occurs while processing the delete.
-
rename
public void rename(java.lang.String dn, java.lang.String newRDN, boolean deleteOldRDN, LDAPConstraints constraints) throws LDAPException
Alters the DN of an entry in the directory.- Parameters:
dn- The DN of the entry to modify.newRDN- The new RDN to use for the entry.deleteOldRDN- Indicates whether to remove the old RDN value(s).constraints- The constraints to use for the modify operation.- Throws:
LDAPException- If a problem occurs while processing the delete.
-
rename
public void rename(java.lang.String dn, java.lang.String newRDN, java.lang.String newParentDN, boolean deleteOldRDN) throws LDAPException
Alters the DN of an entry in the directory.- Parameters:
dn- The DN of the entry to modify.newRDN- The new RDN to use for the entry.newParentDN- The DN of the new parent, ornullif it should not be moved below a new parent.deleteOldRDN- Indicates whether to remove the old RDN value(s).- Throws:
LDAPException- If a problem occurs while processing the delete.
-
rename
public void rename(java.lang.String dn, java.lang.String newRDN, java.lang.String newParentDN, boolean deleteOldRDN, LDAPConstraints constraints) throws LDAPException
Alters the DN of an entry in the directory.- Parameters:
dn- The DN of the entry to modify.newRDN- The new RDN to use for the entry.newParentDN- The DN of the new parent, ornullif it should not be moved below a new parent.deleteOldRDN- Indicates whether to remove the old RDN value(s).constraints- The constraints to use for the modify operation.- Throws:
LDAPException- If a problem occurs while processing the delete.
-
search
public LDAPSearchResults search(java.lang.String baseDN, int scope, java.lang.String filter, java.lang.String[] attributes, boolean typesOnly) throws LDAPException
Processes a search in the directory server.- Parameters:
baseDN- The base DN for the search.scope- The scope for the search.filter- The filter for the search.attributes- The set of attributes to request.typesOnly- Indicates whether to return attribute types only or both types and values.- Returns:
- The entry that was read.
- Throws:
LDAPException- If a problem occurs while performing the search.
-
search
public LDAPSearchResults search(java.lang.String baseDN, int scope, java.lang.String filter, java.lang.String[] attributes, boolean typesOnly, LDAPSearchConstraints constraints) throws LDAPException
Processes a search in the directory server.- Parameters:
baseDN- The base DN for the search.scope- The scope for the search.filter- The filter for the search.attributes- The set of attributes to request.typesOnly- Indicates whether to return attribute types only or both types and values.constraints- The constraints to use for the search operation.- Returns:
- The entry that was read.
- Throws:
LDAPException- If a problem occurs while performing the search.
-
-