Class 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
    • 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 be null.
      • 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 be null.
      • 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 be null.
      • 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

      • 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 class Control
        Returns:
        The user-friendly name for this control, or the OID if no user-friendly name is available.
      • toString

        public void toString​(@NotNull
                             java.lang.StringBuilder buffer)
        Appends a string representation of this LDAP control to the provided buffer.
        Overrides:
        toString in class Control
        Parameters:
        buffer - The buffer to which to append the string representation of this buffer.