Class ReplicatedRequestControl

  • All Implemented Interfaces:
    Control

    public final class ReplicatedRequestControl
    extends Object
    implements Control
    Control that provides some replication context to requests.

    The replication context provides a CSN, an entry UUID and an additional UUID.

    Note: the use of this control was the fastest way to make things work. This should be only a temporary solution until we find a better way to handle this. To get a better idea of the issue:

    • before, we had an operation, which allow to add attachments.
    • now, with a request, there is no easy way to provide additional information.
    The information contained in this control is actually some context, but we cannot use a Context object here because the InternalClientConnection API provides methods without Context and it would be cumbersome to have several method for each operation.
    • Constructor Detail

      • ReplicatedRequestControl

        public ReplicatedRequestControl​(boolean isCritical,
                                        CSN csn,
                                        UUID entryUuid,
                                        UUID parentUuid)
        Constructs a new control.
        Parameters:
        isCritical - Indicates whether support for this control should be considered a critical part of the server processing.
        csn - the non-null CSN.
        entryUuid - the non-null UUID of the entry.
        parentUuid - the parent UUID that may be provided for Add and ModifyDN requests
      • ReplicatedRequestControl

        public ReplicatedRequestControl​(boolean isCritical,
                                        CSN csn,
                                        UUID entryUuid)
        Constructs a new control.
        Parameters:
        isCritical - Indicates whether support for this control should be considered a critical part of the server processing.
        csn - the non-null CSN.
        entryUuid - the non-null UUID of the entry.
    • Method Detail

      • getOid

        public String getOid()
        Description copied from interface: Control
        Returns the numeric OID associated with this control.
        Specified by:
        getOid in interface Control
        Returns:
        The numeric OID associated with this control.
      • toAddContext

        public AddContext toAddContext()
        Convert this control to an AddContext.
        Returns:
        the add context
      • toDeleteContext

        public DeleteContext toDeleteContext()
        Convert this control to a DeleteContext.
        Returns:
        the delete context
      • toModifyContext

        public ModifyContext toModifyContext()
        Convert this control to a ModifyContext.
        Returns:
        the modify context
      • toModifyDNContext

        public ModifyDnContext toModifyDNContext()
        Convert this control to a ModifyDnContext.
        Returns:
        the modify Dn context
      • getValue

        public ByteString getValue()
        Description copied from interface: Control
        Returns the value, if any, associated with this control. Its format is defined by the specification of this control.
        Specified by:
        getValue in interface Control
        Returns:
        The value associated with this control, or null if there is no value.
      • hasValue

        public boolean hasValue()
        Description copied from interface: Control
        Returns true if this control has a value. In some circumstances it may be useful to determine if a control has a value, without actually calculating the value and incurring any performance costs.
        Specified by:
        hasValue in interface Control
        Returns:
        true if this control has a value, or false if there is no value.
      • getCSN

        public CSN getCSN()
        Returns the CSN.
        Returns:
        the non-null CSN
      • getEntryUuid

        public UUID getEntryUuid()
        Returns the entry UUID.
        Returns:
        the non-null entry UUID
      • getParentUuid

        public UUID getParentUuid()
        Returns the additional UUID.
        Returns:
        the additional UUID
      • isCritical

        public boolean isCritical()
        Description copied from interface: Control
        Returns true if it is unacceptable to perform the operation without applying the semantics of this control.

        The criticality field only has meaning in controls attached to request messages (except UnbindRequest). For controls attached to response messages and the UnbindRequest, the criticality field SHOULD be false, and MUST be ignored by the receiving protocol peer. A value of true indicates that it is unacceptable to perform the operation without applying the semantics of the control.

        Specified by:
        isCritical in interface Control
        Returns:
        true if this control must be processed by the Directory Server, or false if it can be ignored.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object