Class JSONFormattedControlDecodeBehavior
java.lang.Object
com.unboundid.ldap.sdk.unboundidds.controls.JSONFormattedControlDecodeBehavior
- All Implemented Interfaces:
Serializable
@Mutable
@ThreadSafety(level=NOT_THREADSAFE)
public final class JSONFormattedControlDecodeBehavior
extends Object
implements Serializable
This enum defines options for the behaviors that should be used when trying
to decode JSON objects embedded in a
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.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of this behavior with the default configuration. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates 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.voidsetAllowEmbeddedJSONFormattedControl(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.voidsetStrict(boolean strict) Specifies whether to use strict mode when parsing JSON objects as controls.voidsetThrowOnInvalidCriticalControl(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 oftrue, but that cannot be parsed as a validControlinstance for some reason.voidsetThrowOnInvalidNonCriticalControl(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 offalse, but that cannot be parsed as a validControlinstance for some reason.voidsetThrowOnUnparsableObject(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 requiredoidandcriticalityfields, and controls with bothvalue-base64andvalue-jsonfields.booleanstrict()Indicates whether to use strict mode when parsing JSON objects as controls.booleanIndicates 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 oftrue, but that cannot be parsed as a validControlinstance for some reason.booleanIndicates 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 offalse, but that cannot be parsed as a validControlinstance for some reason.booleanIndicates 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 requiredoidandcriticalityfields, and controls with bothvalue-base64andvalue-jsonfields.toString()Retrieves a string representation of this JSON-formatted control decode behavior.voidtoString(StringBuilder buffer) Appends a string representation of this JSON-formatted control decode behavior to the provided buffer.
-
Constructor Details
-
JSONFormattedControlDecodeBehavior
public JSONFormattedControlDecodeBehavior()Creates a new instance of this behavior with the default configuration. The default configuration is as follows:throwOnUnparsableObjectis set totruethrowOnInvalidCriticalControlis set totruethrowOnInvalidNonCriticalControlis set totrueallowEmbeddedJSONFormattedControlis set tofalsestrictis set tofalse
-
-
Method Details
-
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 requiredoidandcriticalityfields, and controls with bothvalue-base64andvalue-jsonfields. If strict mode is enabled, then this also includes unrecognized top-level fields.- Returns:
trueif 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, orfalseif any such JSON objects should simply be ignored.
-
setThrowOnUnparsableObject
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 requiredoidandcriticalityfields, and controls with bothvalue-base64andvalue-jsonfields. If strict mode is enabled, then this also includes unrecognized top-level fields.- Parameters:
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 istrue, then an exception will be thrown if any such JSON object is encountered. If this isfalse, any such JSON objects will be ignored.
-
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 oftrue, but that cannot be parsed as a validControlinstance 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 thevalue-jsonformat.- Returns:
trueif an exception should be thrown if a critical control cannot be decoded as a valid control instance, orfalseif any such controls should be ignored.
-
setThrowOnInvalidCriticalControl
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 oftrue, but that cannot be parsed as a validControlinstance 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 thevalue-jsonformat.- Parameters:
throwOnInvalidCriticalControl- Indicates whether to throw an exception for any well-formed JSON object with a criticality oftruethat cannot be parsed as aControl. If this istrue, then an exception will be thrown if any such object is encountered. If this isfalse, then any such JSON objects will be ignored.
-
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 offalse, but that cannot be parsed as a validControlinstance 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 thevalue-jsonformat.- Returns:
trueif an exception should be thrown if a non-critical control cannot be decoded as a valid control instance, orfalseif any such controls should be ignored.
-
setThrowOnInvalidNonCriticalControl
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 offalse, but that cannot be parsed as a validControlinstance 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 thevalue-jsonformat.- Parameters:
throwOnInvalidNonCriticalControl- Indicates whether to throw an exception for any well-formed JSON object with a criticality offalsethat cannot be parsed as aControl. If this istrue, then an exception will be thrown if any such object is encountered. If this isfalse, then any such JSON objects will be ignored.
-
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. If embedded JSON-formatted controls are not allowed, then the attempt to decode will throw an exception if the control is critical, or it will be ignored with a non-fatal error message if the control is non-critical.- Returns:
trueif embedded JSON-formatted request or response controls should be allowed, orfalseif not.
-
setAllowEmbeddedJSONFormattedControl
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. If embedded JSON-formatted controls are not allowed, then the attempt to decode will throw an exception if the control is critical, or it will be ignored with a non-fatal error message if the control is non-critical.- Parameters:
allowEmbeddedJSONFormattedControl- Indicates whether to allow a JSON-formatted request or response control. If this istrue, 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 isfalse, 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.
-
strict
Indicates whether to use strict mode when parsing JSON objects as controls. This may include throwing an exception if a JSON object contains any unrecognized fields, or if the object violates any other control-specific constraints.- Returns:
trueif strict mode should be used when parsing JSON objects as controls, orfalseif a lenient mode should be used.
-
setStrict
Specifies whether to use strict mode when parsing JSON objects as controls. This may include throwing an exception if a JSON object contains any unrecognized fields, or if the object violates any other control-specific constraints.- Parameters:
strict- Indicates whether to use strict mode when parsing JSON objects as controls. If this istrue, then strict mode will be used. If this isfalse, then a more lenient mode will be used.
-
toString
Retrieves a string representation of this JSON-formatted control decode behavior. -
toString
Appends a string representation of this JSON-formatted control decode behavior to the provided buffer.- Parameters:
buffer- The buffer to which the string representation should be appended.
-