Class TransactionIDRequestControl

  • All Implemented Interfaces:
    java.io.Serializable

    @NotMutable
    @ThreadSafety(level=COMPLETELY_THREADSAFE)
    public final class TransactionIDRequestControl
    extends Control
    This class provides an implementation of a control that can be used to specify an external identifier for a request sent to a ForgeRock Directory Server that will appear in the access log message for the associated operation.
    This request control has an OID of 1.3.6.1.4.1.36733.2.1.5.1, and its value is the string representation of the desired transaction ID. The control is typically not marked critical.

    Example

    The following example demonstrates the use of the transaction ID request control:
     ModifyRequest modifyRequest = new ModifyRequest("dc=example,dc=com",
          new Modification(ModificationType.REPLACE, "attrName", "attrValue"));
     modifyRequest.addControl(new TransactionIDRequestControl("test-txn-id"));
     LDAPResult modifyResult = connection.modify(modifyRequest);
     
    See Also:
    Serialized Form
    • Constructor Detail

      • TransactionIDRequestControl

        public TransactionIDRequestControl​(@NotNull
                                           java.lang.String transactionID)
        Creates a new transaction ID request control with the specified identifier. It will not be marked critical.
        Parameters:
        transactionID - The transaction ID to use for this control. It must not be null.
      • TransactionIDRequestControl

        public TransactionIDRequestControl​(boolean isCritical,
                                           @NotNull
                                           java.lang.String transactionID)
        Creates a new transaction ID request control with the specified identifier and criticality.
        Parameters:
        isCritical - Indicates whether the control should be marked critical.
        transactionID - The transaction ID to use for this control. It must not be null.
      • TransactionIDRequestControl

        public TransactionIDRequestControl​(@NotNull
                                           Control control)
                                    throws LDAPException
        Creates a new transaction ID request control which is decoded from the provided generic control.
        Parameters:
        control - The generic control to be decoded as a transaction ID request control.
        Throws:
        LDAPException - If the provided control cannot be decoded as a transaction ID request control.
    • Method Detail

      • getTransactionID

        @NotNull
        public java.lang.String getTransactionID()
        Retrieves the transaction ID to use for this control.
        Returns:
        The transaction ID to use 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 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.