Class AssuredReplicationRequestControl

  • All Implemented Interfaces:
    java.io.Serializable

    @NotMutable
    @ThreadSafety(level=COMPLETELY_THREADSAFE)
    public final class AssuredReplicationRequestControl
    extends Control
    This class provides an implementation of an LDAP control that can be included in add, bind, modify, modify DN, and certain extended requests to indicate the level of replication assurance desired for the associated operation.
    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.

    The OID for this control is 1.3.6.1.4.1.30221.2.5.28, and it may have a criticality of either TRUE or FALSE. It must have a value with the following encoding:
       AssuredReplicationRequest ::= SEQUENCE {
            minimumLocalLevel           [0] LocalLevel OPTIONAL,
            maximumLocalLevel           [1] LocalLevel OPTIONAL,
            minimumRemoteLevel          [2] RemoteLevel OPTIONAL,
            maximumRemoteLevel          [3] RemoteLevel OPTIONAL,
            timeoutMillis               [4] INTEGER (1 .. 2147483647) OPTIONAL,
            sendResponseImmediately     [5] BOOLEAN DEFAULT FALSE,
            ... }
    
       LocalLevel ::= ENUMERATED {
            none                    (0),
            receivedAnyServer       (1),
            processedAllServers     (2),
            ... }
    
       RemoteLevel ::= ENUMERATED {
            none                           (0),
            receivedAnyRemoteLocation      (1),
            receivedAllRemoteLocations     (2),
            processedAllRemoteServers      (3),
            ... }
     


    Example

    The following example demonstrates the use of the assured replication request control in conjunction with a delete operation to request that the server not return the delete result to the client until the delete has been applied to all available servers in the local data center and has also been replicated to at least one remote data center:
     DeleteRequest deleteRequest = new DeleteRequest(
          "uid=test.user,ou=People,dc=example,dc=com");
     deleteRequest.addControl(new AssuredReplicationRequestControl(
          AssuredReplicationLocalLevel.PROCESSED_ALL_SERVERS,
          AssuredReplicationRemoteLevel.RECEIVED_ANY_REMOTE_LOCATION,
          5000L));
      LDAPResult deleteResult = connection.delete(deleteRequest);
    
     if (deleteResult.getResultCode() == ResultCode.SUCCESS)
     {
       AssuredReplicationResponseControl assuredReplicationResponse =
            AssuredReplicationResponseControl.get(deleteResult);
       if (assuredReplicationResponse == null)
       {
         // The entry was deleted, but its replication could not be confirmed in
         // either the local or remote data centers.
       }
       else
       {
         if (assuredReplicationResponse.localAssuranceSatisfied())
         {
           if (assuredReplicationResponse.remoteAssuranceSatisfied())
           {
             // The entry was deleted.  The delete has been applied across all
             // available local servers, and has been replicated to at least one
             // remote data center.
           }
           else
           {
             // The entry was deleted.  The delete has been applied across all
             // available local servers, but cannot be confirmed to have yet
             // been replicated to any remote data centers.
           }
         }
         else if (assuredReplicationResponse.remoteAssuranceSatisfied())
         {
           // The entry was deleted.  The delete has been confirmed to have been
           // replicated to at least one remote data center, but cannot be
           // confirmed to have yet been applied to all available local servers.
         }
         else
         {
           // The entry was deleted, but its replication could not be confirmed
           // to either local servers or remote data centers.
         }
       }
     }
     else
     {
       // The entry could not be deleted.
     }
     
    See Also:
    AssuredReplicationResponseControl, Serialized Form
    • Constructor Detail

      • AssuredReplicationRequestControl

        public AssuredReplicationRequestControl​(AssuredReplicationLocalLevel minimumLocalLevel,
                                                AssuredReplicationRemoteLevel minimumRemoteLevel,
                                                java.lang.Long timeoutMillis)
        Creates a new assured replication request control with the provided information. It will not be critical.
        Parameters:
        minimumLocalLevel - The minimum replication assurance level desired for servers in the same location as the server receiving the change. This may be overridden by the server if the associated operation matches an assured replication criteria with a higher local assurance level. If this is null, then the server will determine minimum local assurance level for the operation.
        minimumRemoteLevel - The minimum replication assurance level desired for servers in different locations from the server receiving the change. This may be overridden by the server if the associated operation matches an assured replication criteria with a higher remote assurance level. If this is null, then the server will determine the remote assurance level for the operation.
        timeoutMillis - The maximum length of time in milliseconds to wait for the desired assurance to be satisfied. If this is null, then the server will determine the timeout to use.
      • AssuredReplicationRequestControl

        public AssuredReplicationRequestControl​(boolean isCritical,
                                                AssuredReplicationLocalLevel minimumLocalLevel,
                                                AssuredReplicationLocalLevel maximumLocalLevel,
                                                AssuredReplicationRemoteLevel minimumRemoteLevel,
                                                AssuredReplicationRemoteLevel maximumRemoteLevel,
                                                java.lang.Long timeoutMillis,
                                                boolean sendResponseImmediately)
        Creates a new assured replication request control with the provided information.
        Parameters:
        isCritical - Indicates whether the control should be marked critical.
        minimumLocalLevel - The minimum replication assurance level desired for servers in the same location as the server receiving the change. This may be overridden by the server if the associated operation matches an assured replication criteria with a higher local assurance level. If this is null, then the server will determine the minimum local assurance level for the operation.
        maximumLocalLevel - The maximum replication assurance level desired for servers in the same location as the server receiving the change. This may override the server configuration if the operation matches an assured replication criteria that would have otherwise used a higher local assurance level. If this is null, then the server will determine the maximum local assurance level for the operation.
        minimumRemoteLevel - The minimum replication assurance level desired for servers in different locations from the server receiving the change. This may be overridden by the server if the associated operation matches an assured replication criteria with a higher remote assurance level. If this is null, then the server will determine the minimum remote assurance level for the operation.
        maximumRemoteLevel - The maximum replication assurance level desired for servers in different locations from the server receiving the change. This may override the server configuration if the operation matches an assured replication criteria that would have otherwise used a higher remote assurance level. If this is null, then the server will determine the maximum remote assurance level for the operation.
        timeoutMillis - The maximum length of time in milliseconds to wait for the desired assurance to be satisfied. If this is null, then the server will determine the timeout to use.
        sendResponseImmediately - Indicates whether the server should send the response to the client immediately after the change has been applied to the server receiving the change, without waiting for the desired assurance to be satisfied.
      • AssuredReplicationRequestControl

        public AssuredReplicationRequestControl​(Control c)
                                         throws LDAPException
        Creates a new assured replication request control from the provided generic control.
        Parameters:
        c - The generic control to decode as an assured replication request control. It must not be null.
        Throws:
        LDAPException - If the provided generic control cannot be parsed as an assured replication request control.
    • Method Detail

      • getMinimumLocalLevel

        public AssuredReplicationLocalLevel getMinimumLocalLevel()
        Retrieves the minimum desired replication level of assurance for local servers (i.e., servers in the same location as the server that originally received the change), if defined. This may be overridden by the server if the associated operation matches an assured replication criteria with a higher local assurance level.
        Returns:
        The minimum desired replication level of assurance for local servers, or null if the server should determine the minimum local assurance level for the operation.
      • getMaximumLocalLevel

        public AssuredReplicationLocalLevel getMaximumLocalLevel()
        Retrieves the maximum desired replication level of assurance for local servers (i.e., servers in the same location as the server that originally received the change), if defined. This may override the server configuration if the operation matches an assured replication criteria that would have otherwise used a higher local assurance level.
        Returns:
        The maximum desired replication level of assurance for local servers, or null if the server should determine the maximum local assurance level for the operation.
      • getMinimumRemoteLevel

        public AssuredReplicationRemoteLevel getMinimumRemoteLevel()
        Retrieves the minimum desired replication level of assurance for remote servers (i.e., servers in locations different from the server that originally received the change), if defined. This may be overridden by the server if the associated operation matches an assured replication criteria with a higher remote assurance level.
        Returns:
        The minimum desired replication level of assurance for remote servers, or null if the server should determine the minimum remote assurance level for the operation.
      • getMaximumRemoteLevel

        public AssuredReplicationRemoteLevel getMaximumRemoteLevel()
        Retrieves the maximum desired replication level of assurance for remote servers (i.e., servers in locations different from the server that originally received the change), if defined. This may override the server configuration if the operation matches an assured replication criteria that would have otherwise used a higher remote assurance level.
        Returns:
        The maximum desired replication level of assurance for remote servers, or null if the server should determine the maximum remote assurance level for the operation.
      • sendResponseImmediately

        public boolean sendResponseImmediately()
        Indicates whether the server that originally received the change should return the operation result immediately, without waiting for the requested assurance processing to complete.
        Returns:
        false if the server should wait to return the operation result until the desired assurance has been attained or a timeout has occurred, or true if the server should return the result immediately.
      • getTimeoutMillis

        public java.lang.Long getTimeoutMillis()
        Retrieves the maximum length of time in milliseconds that the operation response should be delayed while waiting for the desired level of assurance to be attained.
        Returns:
        The maximum length of time in milliseconds that the operation response should be delayed while waiting for the desired level of assurance to be attained.
      • getControlName

        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​(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.