Class AffinityRequestControl
- java.lang.Object
-
- com.unboundid.ldap.sdk.Control
-
- com.unboundid.ldap.sdk.forgerockds.controls.AffinityRequestControl
-
- All Implemented Interfaces:
java.io.Serializable
@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class AffinityRequestControl extends Control
This class provides an implementation of a control that can be used to establish an affinity for one or more operations through a ForgeRock Directory Proxy Server. The server will attempt to route operations with the same affinity value to the same backend server.
This request control has an OID of 1.3.6.1.4.1.36733.2.1.5.2, and its value is the desired affinity value (which may be an arbitrary string or set of bytes, and the LDAP SDK may automatically generate an affinity value if none is provided). The criticality may be either true or false.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
AFFINITY_REQUEST_OID
The OID (1.3.6.1.4.1.36733.2.1.5.2) for the affinity request control.
-
Constructor Summary
Constructors Constructor Description AffinityRequestControl(boolean isCritical)
Creates a new affinity request control with the specified criticality and a randomly generated affinity value.AffinityRequestControl(boolean isCritical, byte[] affinityValue)
Creates a new affinity request control with the specified criticality and the provided affinity value.AffinityRequestControl(boolean isCritical, ASN1OctetString affinityValue)
Creates a new affinity request control with the specified criticality and the provided affinity value.AffinityRequestControl(boolean isCritical, java.lang.String affinityValue)
Creates a new affinity request control with the specified criticality and the provided affinity value.AffinityRequestControl(Control control)
Creates a new affinity request control that is decoded from the provided generic control.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ASN1OctetString
getAffinityValue()
Retrieves the affinity value for this control.java.lang.String
getControlName()
Retrieves the user-friendly name for this control, if available.void
toString(java.lang.StringBuilder buffer)
Appends a string representation of this LDAP control to the provided buffer.-
Methods inherited from class com.unboundid.ldap.sdk.Control
decode, decode, decodeControls, decodeJSONControl, deregisterDecodeableControl, encode, encodeControls, equals, getOID, getValue, hashCode, hasValue, isCritical, readFrom, registerDecodeableControl, registerDecodeableControl, toJSONControl, toString, writeTo
-
-
-
-
Field Detail
-
AFFINITY_REQUEST_OID
@NotNull public static final java.lang.String AFFINITY_REQUEST_OID
The OID (1.3.6.1.4.1.36733.2.1.5.2) for the affinity request control.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AffinityRequestControl
public AffinityRequestControl(boolean isCritical)
Creates a new affinity request control with the specified criticality and a randomly generated affinity value.- Parameters:
isCritical
- Indicates whether the control should be marked critical.
-
AffinityRequestControl
public AffinityRequestControl(boolean isCritical, @NotNull java.lang.String affinityValue)
Creates a new affinity request control with the specified criticality and the provided affinity value.- Parameters:
isCritical
- Indicates whether the control should be marked critical.affinityValue
- The affinity value to use for the control. It must not benull
.
-
AffinityRequestControl
public AffinityRequestControl(boolean isCritical, @NotNull byte[] affinityValue)
Creates a new affinity request control with the specified criticality and the provided affinity value.- Parameters:
isCritical
- Indicates whether the control should be marked critical.affinityValue
- The affinity value to use for the control. It must not benull
.
-
AffinityRequestControl
public AffinityRequestControl(boolean isCritical, @NotNull ASN1OctetString affinityValue)
Creates a new affinity request control with the specified criticality and the provided affinity value.- Parameters:
isCritical
- Indicates whether the control should be marked critical.affinityValue
- The affinity value to use for the control. It must not benull
.
-
AffinityRequestControl
public AffinityRequestControl(@NotNull Control control) throws LDAPException
Creates a new affinity request control that is decoded from the provided generic control.- Parameters:
control
- The generic control to be decoded as an affinity request control.- Throws:
LDAPException
- If the provided control cannot be decoded as an affinity request control.
-
-
Method Detail
-
getAffinityValue
@NotNull public ASN1OctetString getAffinityValue()
Retrieves the affinity value for this control.- Returns:
- The affinity value for this control.
-
getControlName
@NotNull public java.lang.String getControlName()
Retrieves the user-friendly name for this control, if available. If no user-friendly name has been defined, then the OID will be returned.- Overrides:
getControlName
in classControl
- Returns:
- The user-friendly name for this control, or the OID if no user-friendly name is available.
-
-