@Extensible @ThreadSafety(level=NOT_THREADSAFE) public abstract class LDAPRequest extends java.lang.Object implements ReadOnlyLDAPRequest
LDAPRequest
objects are not immutable and should not be considered
threadsafe. A single LDAPRequest
object instance should not be used
concurrently by multiple threads, but instead each thread wishing to process
a request should have its own instance of that request. The
ReadOnlyLDAPRequest.duplicate()
method may be used to create an exact copy of a request
suitable for processing by a separate thread.
ExtendedRequest
and SASLBindRequest
subclasses are actually
intended to be extended by third-party code.Modifier | Constructor and Description |
---|---|
protected |
LDAPRequest(Control[] controls)
Creates a new LDAP request with the provided set of controls.
|
Modifier and Type | Method and Description |
---|---|
boolean |
followReferrals(LDAPConnection connection)
Indicates whether to automatically follow any referrals encountered while
processing this request.
|
Control |
getControl(java.lang.String oid)
Retrieves the control with the specified OID from this request.
|
java.util.List<Control> |
getControlList()
Retrieves a list containing the set of controls for this request.
|
Control[] |
getControls()
Retrieves the set of controls for this request.
|
IntermediateResponseListener |
getIntermediateResponseListener()
Retrieves the intermediate response listener for this request, if any.
|
abstract int |
getLastMessageID()
Retrieves the message ID for the last LDAP message sent using this request.
|
abstract OperationType |
getOperationType()
Retrieves the type of operation that is represented by this request.
|
long |
getResponseTimeoutMillis(LDAPConnection connection)
Retrieves the maximum length of time in milliseconds that processing on
this operation should be allowed to block while waiting for a response from
the server.
|
boolean |
hasControl()
Indicates whether this request contains at least one control.
|
boolean |
hasControl(java.lang.String oid)
Indicates whether this request contains at least one control with the
specified OID.
|
protected abstract LDAPResult |
process(LDAPConnection connection,
int depth)
Processes this operation using the provided connection and returns the
result.
|
void |
setFollowReferrals(java.lang.Boolean followReferrals)
Specifies whether to automatically follow any referrals encountered while
processing this request.
|
void |
setIntermediateResponseListener(IntermediateResponseListener listener)
Sets the intermediate response listener for this request.
|
void |
setResponseTimeoutMillis(long responseTimeout)
Specifies the maximum length of time in milliseconds that processing on
this operation should be allowed to block while waiting for a response
from the server.
|
java.lang.String |
toString()
Retrieves a string representation of this request.
|
abstract void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this request to the provided buffer.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
duplicate, duplicate, toCode
protected LDAPRequest(Control[] controls)
controls
- The set of controls to include in this LDAP request.public final Control[] getControls()
public final java.util.List<Control> getControlList()
getControlList
in interface ReadOnlyLDAPRequest
public final boolean hasControl()
hasControl
in interface ReadOnlyLDAPRequest
true
if this request contains at least one control, or
false
if not.public final boolean hasControl(java.lang.String oid)
hasControl
in interface ReadOnlyLDAPRequest
oid
- The object identifier for which to make the determination. It
must not be null
.true
if this request contains at least one control with
the specified OID, or false
if not.public final Control getControl(java.lang.String oid)
getControl
in interface ReadOnlyLDAPRequest
oid
- The object identifier for which to retrieve the corresponding
control. It must not be null
.null
if
no control with that OID is included in this request.public final long getResponseTimeoutMillis(LDAPConnection connection)
getResponseTimeoutMillis
in interface ReadOnlyLDAPRequest
connection
- The connection to use in order to retrieve the default
value, if appropriate. It may be null
to
retrieve the request-specific timeout (which may be
negative if no response-specific timeout has been set).public final void setResponseTimeoutMillis(long responseTimeout)
responseTimeout
- The maximum length of time in milliseconds that
processing on this operation should be allowed to
block while waiting for a response from the
server.public final boolean followReferrals(LDAPConnection connection)
followReferrals
in interface ReadOnlyLDAPRequest
connection
- The connection whose connection options may be used in
the course of making the determination. It must not
be null
.true
if any referrals encountered during processing should
be automatically followed, or false
if not.public final void setFollowReferrals(java.lang.Boolean followReferrals)
followReferrals
- Indicates whether to automatically follow any
referrals encountered while processing this
request. It may be null
to indicate that
the determination should be based on the
connection options for the connection used to
process the request.public final IntermediateResponseListener getIntermediateResponseListener()
null
if there is none.public final void setIntermediateResponseListener(IntermediateResponseListener listener)
listener
- The intermediate response listener for this request. It
may be null
to clear any existing listener.@InternalUseOnly protected abstract LDAPResult process(LDAPConnection connection, int depth) throws LDAPException
connection
- The connection to use to process the request.depth
- The current referral depth for this request. It should
always be one for the initial request, and should only
be incremented when following referrals.LDAPException
- If a problem occurs while processing the request.public abstract int getLastMessageID()
public abstract OperationType getOperationType()
public java.lang.String toString()
toString
in interface ReadOnlyLDAPRequest
toString
in class java.lang.Object
public abstract void toString(java.lang.StringBuilder buffer)
toString
in interface ReadOnlyLDAPRequest
buffer
- The buffer to which to append a string representation of
this request.