@Extensible @NotMutable @ThreadSafety(level=NOT_THREADSAFE) public class ExtendedRequest extends LDAPRequest implements ProtocolOp
Modifier and Type | Field and Description |
---|---|
protected static byte |
TYPE_EXTENDED_REQUEST_OID
The BER type for the extended request OID element.
|
protected static byte |
TYPE_EXTENDED_REQUEST_VALUE
The BER type for the extended request value element.
|
Modifier | Constructor and Description |
---|---|
protected |
ExtendedRequest(ExtendedRequest extendedRequest)
Creates a new extended request with the information from the provided
extended request.
|
|
ExtendedRequest(java.lang.String oid)
Creates a new extended request with the provided OID and no value.
|
|
ExtendedRequest(java.lang.String oid,
ASN1OctetString value)
Creates a new extended request with the provided OID and value.
|
|
ExtendedRequest(java.lang.String oid,
ASN1OctetString value,
Control[] controls)
Creates a new extended request with the provided OID and value.
|
|
ExtendedRequest(java.lang.String oid,
Control[] controls)
Creates a new extended request with the provided OID and no value.
|
Modifier and Type | Method and Description |
---|---|
ExtendedRequest |
duplicate()
Creates a new instance of this LDAP request that may be modified without
impacting this request.
|
ExtendedRequest |
duplicate(Control[] controls)
Creates a new instance of this LDAP request that may be modified without
impacting this request.
|
ASN1Element |
encodeProtocolOp()
Encodes the extended request protocol op to an ASN.1 element.
|
java.lang.String |
getExtendedRequestName()
Retrieves the user-friendly name for the extended request, if available.
|
int |
getLastMessageID()
Retrieves the message ID for the last LDAP message sent using this request.
|
java.lang.String |
getOID()
Retrieves the OID for this extended request.
|
OperationType |
getOperationType()
Retrieves the type of operation that is represented by this request.
|
byte |
getProtocolOpType()
Retrieves the BER type for this protocol op.
|
ASN1OctetString |
getValue()
Retrieves the encoded value for this extended request, if available.
|
boolean |
hasValue()
Indicates whether this extended request has a value.
|
protected ExtendedResult |
process(LDAPConnection connection,
int depth)
Sends this extended request to the directory server over the provided
connection and returns the associated response.
|
void |
responseReceived(LDAPResponse response)
Indicates that the provided LDAP response has been received by from the
server.
|
void |
toCode(java.util.List<java.lang.String> lineList,
java.lang.String requestID,
int indentSpaces,
boolean includeProcessing)
Appends a number of lines comprising the Java source code that can be used
to recreate this request to the given list.
|
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this request to the provided buffer.
|
void |
writeTo(ASN1Buffer writer)
Writes an ASN.1-encoded representation of this LDAP protocol op to the
provided ASN.1 buffer.
|
followReferrals, getControl, getControlList, getControls, getIntermediateResponseListener, getResponseTimeoutMillis, hasControl, hasControl, setFollowReferrals, setIntermediateResponseListener, setResponseTimeoutMillis, toString
protected static final byte TYPE_EXTENDED_REQUEST_OID
protected static final byte TYPE_EXTENDED_REQUEST_VALUE
public ExtendedRequest(java.lang.String oid)
oid
- The OID for this extended request. It must not be
null
.public ExtendedRequest(java.lang.String oid, Control[] controls)
oid
- The OID for this extended request. It must not be
null
.controls
- The set of controls for this extended request.public ExtendedRequest(java.lang.String oid, ASN1OctetString value)
oid
- The OID for this extended request. It must not be
null
.value
- The encoded value for this extended request. It may be
null
if this request should not have a value.public ExtendedRequest(java.lang.String oid, ASN1OctetString value, Control[] controls)
oid
- The OID for this extended request. It must not be
null
.value
- The encoded value for this extended request. It may be
null
if this request should not have a value.controls
- The set of controls for this extended request.protected ExtendedRequest(ExtendedRequest extendedRequest)
extendedRequest
- The extended request that should be used to create
this new extended request.public final java.lang.String getOID()
public final boolean hasValue()
true
if this extended request has a value, or
false
if not.public final ASN1OctetString getValue()
null
if
this request does not have a value.public final byte getProtocolOpType()
getProtocolOpType
in interface ProtocolOp
public final void writeTo(ASN1Buffer writer)
writeTo
in interface ProtocolOp
writer
- The ASN.1 buffer to which the encoded representation should
be written.public ASN1Element encodeProtocolOp()
encodeProtocolOp
in interface ProtocolOp
protected ExtendedResult process(LDAPConnection connection, int depth) throws LDAPException
process
in class LDAPRequest
connection
- The connection to use to communicate with the directory
server.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 sending the request or
reading the response.@InternalUseOnly public final void responseReceived(LDAPResponse response) throws LDAPException
response
- The LDAP response that has been received from the server.
It may be null
if the connection has been closed
without having received any response.LDAPException
- If a problem occurs while handling the response.public final int getLastMessageID()
getLastMessageID
in class LDAPRequest
public final OperationType getOperationType()
getOperationType
in class LDAPRequest
public ExtendedRequest duplicate()
duplicate
in interface ReadOnlyLDAPRequest
public ExtendedRequest duplicate(Control[] controls)
duplicate
in interface ReadOnlyLDAPRequest
controls
- The set of controls to include in the duplicate request.public java.lang.String getExtendedRequestName()
public void toString(java.lang.StringBuilder buffer)
toString
in interface ProtocolOp
toString
in interface ReadOnlyLDAPRequest
toString
in class LDAPRequest
buffer
- The buffer to which to append a string representation of
this request.public void toCode(java.util.List<java.lang.String> lineList, java.lang.String requestID, int indentSpaces, boolean includeProcessing)
toCode
in interface ReadOnlyLDAPRequest
lineList
- The list to which the source code lines should
be added.requestID
- The name that should be used as an identifier
for the request. If this is null
or
empty, then a generic ID will be used.indentSpaces
- The number of spaces that should be used to
indent the generated code. It must not be
negative.includeProcessing
- Indicates whether the generated code should
include code required to actually process the
request and handle the result (if true
),
or just to generate the request (if
false
).