@Mutable @ThreadSafety(level=NOT_THREADSAFE) public final class JSONFormattedControlDecodeBehavior extends java.lang.Object implements java.io.Serializable
JSONFormattedRequestControl
or
JSONFormattedResponseControl
as
Control
objects.
NOTE: This class, and other classes within the
com.unboundid.ldap.sdk.unboundidds
package structure, are only
supported for use against Ping Identity, UnboundID, and
Nokia/Alcatel-Lucent 8661 server products. These classes provide support
for proprietary functionality or for external specifications that are not
considered stable or mature enough to be guaranteed to work in an
interoperable way with other types of LDAP servers.
Constructor and Description |
---|
JSONFormattedControlDecodeBehavior()
Creates a new instance of this behavior with the default configuration.
|
Modifier and Type | Method and Description |
---|---|
boolean |
allowEmbeddedJSONFormattedControl()
Indicates whether to allow a JSON-formatted request or response control to
include another JSON-formatted request or response control in the set of
embedded controls.
|
void |
setAllowEmbeddedJSONFormattedControl(boolean allowEmbeddedJSONFormattedControl)
Specifies whether to allow a JSON-formatted request or response control to
include another JSON-formatted request or response control in the set of
embedded controls.
|
void |
setStrict(boolean strict)
Specifies whether to use strict mode when parsing JSON objects as controls.
|
void |
setThrowOnInvalidCriticalControl(boolean throwOnInvalidCriticalControl)
Specifies whether to throw an exception if the JSON-formatted request or
response control includes a JSON object that at least meets the basic
requirements for a JSON-formatted control with a criticality of
true , but that cannot be parsed as a valid Control instance
for some reason. |
void |
setThrowOnInvalidNonCriticalControl(boolean throwOnInvalidNonCriticalControl)
Specifies whether to throw an exception if the JSON-formatted request or
response control includes a JSON object that at least meets the basic
requirements for a JSON-formatted control with a criticality of
false , but that cannot be parsed as a valid Control
instance for some reason. |
void |
setThrowOnUnparsableObject(boolean throwOnUnparsableObject)
Specifies whether to throw an exception if the JSON-formatted request or
response control includes a JSON object that does not meet the basic
requirements for representing a valid JSON-formatted control, including
controls without the required
oid and criticality fields,
and controls with both value-base64 and value-json fields. |
boolean |
strict()
Indicates whether to use strict mode when parsing JSON objects as controls.
|
boolean |
throwOnInvalidCriticalControl()
Indicates whether to throw an exception if the JSON-formatted request or
response control includes a JSON object that at least meets the basic
requirements for a JSON-formatted control with a criticality of
true , but that cannot be parsed as a valid Control instance
for some reason. |
boolean |
throwOnInvalidNonCriticalControl()
Indicates whether to throw an exception if the JSON-formatted request or
response control includes a JSON object that at least meets the basic
requirements for a JSON-formatted control with a criticality of
false , but that cannot be parsed as a valid Control
instance for some reason. |
boolean |
throwOnUnparsableObject()
Indicates whether to throw an exception if the JSON-formatted request or
response control includes a JSON object that does not meet the basic
requirements for representing a valid JSON-formatted control, including
controls without the required
oid and criticality fields,
and controls with both value-base64 and value-json fields. |
java.lang.String |
toString()
Retrieves a string representation of this JSON-formatted control decode
behavior.
|
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this JSON-formatted control decode
behavior to the provided buffer.
|
public JSONFormattedControlDecodeBehavior()
throwOnUnparsableObject
is set to true
throwOnInvalidCriticalControl
is set to true
throwOnInvalidNonCriticalControl
is set to true
allowEmbeddedJSONFormattedControl
is set to
false
strict
is set to false
public boolean throwOnUnparsableObject()
oid
and criticality
fields,
and controls with both value-base64
and value-json
fields.
If strict mode is enabled, then this also includes unrecognized top-level
fields.true
if an exception should be thrown if a JSON-formatted
request or response control includes a JSON object that does not
meet the basic requirements for representing a valid
JSON-formatted control, or false
if any such JSON objects
should simply be ignored.public void setThrowOnUnparsableObject(boolean throwOnUnparsableObject)
oid
and criticality
fields,
and controls with both value-base64
and value-json
fields.
If strict mode is enabled, then this also includes unrecognized top-level
fields.throwOnUnparsableObject
- Indicates whether to throw an exception
for any JSON object that does not meet
the basic requirements for a
JSON-formatted control. If this is
true
, then an exception will be
thrown if any such JSON object is
encountered. If this is false
,
any such JSON objects will be ignored.public boolean throwOnInvalidCriticalControl()
true
, but that cannot be parsed as a valid Control
instance
for some reason. This may include a control with an OID for which
specific decoding support has been implemented but a problem is encountered
while trying to decode the JSON object as a control of that type, or a
control with an OID for which no specific decoding has been implemented but
includes a value specified using the value-json
format.true
if an exception should be thrown if a critical
control cannot be decoded as a valid control instance, or
false
if any such controls should be ignored.public void setThrowOnInvalidCriticalControl(boolean throwOnInvalidCriticalControl)
true
, but that cannot be parsed as a valid Control
instance
for some reason. This may include a control with an OID for which
specific decoding support has been implemented but a problem is encountered
while trying to decode the JSON object as a control of that type, or a
control with an OID for which no specific decoding has been implemented but
includes a value specified using the value-json
format.throwOnInvalidCriticalControl
- Indicates whether to throw an
exception for any well-formed JSON
object with a criticality of
true
that cannot be parsed
as a Control
. If this is
true
, then an exception will
be thrown if any such object is
encountered. If this is
false
, then any such JSON
objects will be ignored.public boolean throwOnInvalidNonCriticalControl()
false
, but that cannot be parsed as a valid Control
instance for some reason. This may include a control with an OID for which
specific decoding support has been implemented but a problem is encountered
while trying to decode the JSON object as a control of that type, or a
control with an OID for which no specific decoding has been implemented but
includes a value specified using the value-json
format.true
if an exception should be thrown if a non-critical
control cannot be decoded as a valid control instance, or
false
if any such controls should be ignored.public void setThrowOnInvalidNonCriticalControl(boolean throwOnInvalidNonCriticalControl)
false
, but that cannot be parsed as a valid Control
instance for some reason. This may include a control with an OID for which
specific decoding support has been implemented but a problem is encountered
while trying to decode the JSON object as a control of that type, or a
control with an OID for which no specific decoding has been implemented but
includes a value specified using the value-json
format.throwOnInvalidNonCriticalControl
- Indicates whether to throw an
exception for any well-formed
JSON object with a criticality of
false
that cannot be
parsed as a Control
. If
this is true
, then an
exception will be thrown if any
such object is encountered. If
this is false
, then any
such JSON objects will be
ignored.public boolean allowEmbeddedJSONFormattedControl()
true
if embedded JSON-formatted request or response
controls should be allowed, or false
if not.public void setAllowEmbeddedJSONFormattedControl(boolean allowEmbeddedJSONFormattedControl)
allowEmbeddedJSONFormattedControl
- Indicates whether to allow a
JSON-formatted request or
response control. If this is
true
, then an embedded
JSON-formatted control will
either result in an exception
(if the embedded control is
critical) or cause it to be
ignored with a non-fatal error
message (if it is not critical).
If this is false
, then
the JSON-formatted control will
be included directly in the list
of decoded controls that is
returned without attempting to
extract its embedded controls.public boolean strict()
true
if strict mode should be used when parsing JSON
objects as controls, or false
if a lenient mode should be
used.public void setStrict(boolean strict)
strict
- Indicates whether to use strict mode when parsing JSON
objects as controls. If this is true
, then strict
mode will be used. If this is false
, then a more
lenient mode will be used.@NotNull public java.lang.String toString()
toString
in class java.lang.Object