|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.unboundid.ldap.sdk.LDAPRequest
@Extensible @ThreadSafety(level=NOT_THREADSAFE) public abstract class LDAPRequest
This class provides a framework that should be extended by all types of LDAP
requests. It provides methods for interacting with the set of controls to
include as part of the request and configuring a response timeout, which is
the maximum length of time that the SDK should wait for a response to the
request before returning an error back to the caller.
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.
Note that even though this class is marked with the @Extensible annotation
type, it should not be directly subclassed by third-party code. Only the
ExtendedRequest
and SASLBindRequest
subclasses are actually
intended to be extended by third-party code.
Constructor Summary | |
---|---|
protected |
LDAPRequest(Control[] controls)
Creates a new LDAP request with the provided set of controls. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.unboundid.ldap.sdk.ReadOnlyLDAPRequest |
---|
duplicate, duplicate |
Constructor Detail |
---|
protected LDAPRequest(Control[] controls)
controls
- The set of controls to include in this LDAP request.Method Detail |
---|
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |