@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class PreReadRequestControl extends Control
PreReadResponseControl
containing a version of the entry as it before after applying that change.
Note that this response control will only be included if the operation was
successful, so it will not be provided if the operation failed for some
reason (e.g., if the change would have violated the server schema, or if the
requester did not have sufficient permission to perform that operation).
SearchRequest
. As is the case with a search
request, if no attributes are specified, then all user attributes will be
included.
PostReadRequestControl
for an example that illustrates its use.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PRE_READ_REQUEST_OID
The OID (1.3.6.1.1.13.1) for the pre-read request control.
|
Constructor and Description |
---|
PreReadRequestControl(boolean isCritical,
java.lang.String... attributes)
Creates a new pre-read request control that will retrieve the specified set
of attributes from the target entry.
|
PreReadRequestControl(Control control)
Creates a new pre-read request control which is decoded from the provided
generic control.
|
PreReadRequestControl(java.lang.String... attributes)
Creates a new pre-read request control that will retrieve the specified set
of attributes from the target entry.
|
Modifier and Type | Method and Description |
---|---|
static PreReadRequestControl |
decodeJSONControl(JSONObject controlObject,
boolean strict)
Attempts to decode the provided object as a JSON representation of a
pre-read request control.
|
java.lang.String[] |
getAttributes()
Retrieves the set of attributes that will be requested for inclusion in the
entry returned in the response control.
|
java.lang.String |
getControlName()
Retrieves the user-friendly name for this control, if available.
|
JSONObject |
toJSONControl()
Retrieves a representation of this pre-read request control as a JSON
object.
|
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this LDAP control to the provided
buffer.
|
decode, decode, decodeControls, decodeJSONControl, deregisterDecodeableControl, encode, encodeControls, equals, getOID, getValue, hashCode, hasValue, isCritical, readFrom, registerDecodeableControl, registerDecodeableControl, toString, writeTo
@NotNull public static final java.lang.String PRE_READ_REQUEST_OID
public PreReadRequestControl(@Nullable java.lang.String... attributes)
attributes
- The set of attributes to retrieve from the target
entry. It behaves in the same way as the set of
requested attributes for a search operation. If this
is empty or null
, then all user attributes
will be returned.public PreReadRequestControl(boolean isCritical, @Nullable java.lang.String... attributes)
isCritical
- Indicates whether this control should be marked
critical.attributes
- The set of attributes to retrieve from the target
entry. It behaves in the same way as the set of
requested attributes for a search operation. If this
is empty or null
, then all user attributes
will be returned.public PreReadRequestControl(@NotNull Control control) throws LDAPException
control
- The generic control to be decoded as a pre-read request
control.LDAPException
- If the provided control cannot be decoded as a
pre-read request control.@NotNull public java.lang.String[] getAttributes()
@NotNull public java.lang.String getControlName()
getControlName
in class Control
@NotNull public JSONObject toJSONControl()
oid
-- A mandatory string field whose value is the object
identifier for this control. For the pre-read request control, the
OID is "1.3.6.1.1.13.1".
control-name
-- An optional string field whose value is a
human-readable name for this control. This field is only intended for
descriptive purposes, and when decoding a control, the oid
field should be used to identify the type of control.
criticality
-- A mandatory Boolean field used to indicate
whether this control is considered critical.
value-base64
-- An optional string field whose value is a
base64-encoded representation of the raw value for this pre-read
request control. Exactly one of the value-base64
and
value-json
fields must be present.
value-json
-- An optional JSON object field whose value is a
user-friendly representation of the value for this pre-read request
control. Exactly one of the value-base64
and
value-json
fields must be present, and if the
value-json
field is used, then it will use the following
fields:
attributes
-- An optional array field whose values are
strings that represent the names of the attributes to include in
the entry returned in the response control.
toJSONControl
in class Control
@NotNull public static PreReadRequestControl decodeJSONControl(@NotNull JSONObject controlObject, boolean strict) throws LDAPException
controlObject
- The JSON object to be decoded. It must not be
null
.strict
- Indicates whether to use strict mode when decoding
the provided JSON object. If this is true
,
then this method will throw an exception if the
provided JSON object contains any unrecognized
fields. If this is false
, then unrecognized
fields will be ignored.LDAPException
- If the provided JSON object cannot be parsed as a
valid pre-read request control.