public class LDAPConnection extends Object
Constructor and Description |
---|
LDAPConnection(String host,
int port,
LDAPConnectionOptions options)
Constructor for the LDAPConnection object.
|
LDAPConnection(String host,
int port,
LDAPConnectionOptions options,
PrintStream out,
PrintStream err)
Constructor for the LDAPConnection object.
|
Modifier and Type | Method and Description |
---|---|
void |
close(AtomicInteger nextMessageID)
Close the underlying ASN1 reader and writer, optionally sending an unbind
request before disconnecting.
|
void |
connectToHost(String bindDN,
String bindPassword)
Connects to the directory server instance running on specified hostname
and port number.
|
void |
connectToHost(String bindDN,
String bindPassword,
AtomicInteger nextMessageID)
Connects to the directory server instance running on specified hostname
and port number.
|
void |
connectToHost(String bindDN,
String bindPassword,
AtomicInteger nextMessageID,
int timeout)
Connects to the directory server instance running on specified hostname
and port number.
|
LDAPReader |
getLDAPReader()
Get the underlying LDAP reader.
|
LDAPWriter |
getLDAPWriter()
Get the underlying LDAP writer.
|
public LDAPConnection(String host, int port, LDAPConnectionOptions options)
host
- The hostname to send the request to.port
- The port number on which the directory server is accepting
requests.options
- The set of options for this connection.public LDAPConnection(String host, int port, LDAPConnectionOptions options, PrintStream out, PrintStream err)
host
- The hostname to send the request to.port
- The port number on which the directory server is accepting
requests.options
- The set of options for this connection.out
- The print stream to use for standard output.err
- The print stream to use for standard error.public void connectToHost(String bindDN, String bindPassword) throws LDAPConnectionException
bindDN
- The DN to bind with.bindPassword
- The password to bind with.LDAPConnectionException
- If a problem occurs while attempting to
establish the connection to the server.public void connectToHost(String bindDN, String bindPassword, AtomicInteger nextMessageID) throws LDAPConnectionException
bindDN
- The DN to bind with.bindPassword
- The password to bind with.nextMessageID
- The message ID counter that should be used for
operations performed while establishing the
connection.LDAPConnectionException
- If a problem occurs while attempting to
establish the connection to the server.public void connectToHost(String bindDN, String bindPassword, AtomicInteger nextMessageID, int timeout) throws LDAPConnectionException
bindDN
- The DN to bind with.bindPassword
- The password to bind with.nextMessageID
- The message ID counter that should be used for
operations performed while establishing the
connection.timeout
- The timeout to connect to the specified host. The
timeout is the timeout at the socket level in
milliseconds. If the timeout value is 0
,
no timeout is used.LDAPConnectionException
- If a problem occurs while attempting to
establish the connection to the server.public void close(AtomicInteger nextMessageID)
nextMessageID
- The message ID counter that should be used for
the unbind request, or null
if the
connection should be closed without an unbind
request.public LDAPWriter getLDAPWriter()
public LDAPReader getLDAPReader()
Copyright © 2010-2017 ForgeRock AS. All Rights Reserved.