Class AssuredReplicationRequestControl
java.lang.Object
com.unboundid.ldap.sdk.Control
com.unboundid.ldap.sdk.unboundidds.controls.AssuredReplicationRequestControl
- All Implemented Interfaces:
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.
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:
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe OID (1.3.6.1.4.1.30221.2.5.28) for the assured replication request control. -
Constructor Summary
ConstructorsConstructorDescriptionAssuredReplicationRequestControl(boolean isCritical, AssuredReplicationLocalLevel minimumLocalLevel, AssuredReplicationLocalLevel maximumLocalLevel, AssuredReplicationRemoteLevel minimumRemoteLevel, AssuredReplicationRemoteLevel maximumRemoteLevel, Long timeoutMillis, boolean sendResponseImmediately) Creates a new assured replication request control with the provided information.Creates a new assured replication request control from the provided generic control.AssuredReplicationRequestControl(AssuredReplicationLocalLevel minimumLocalLevel, AssuredReplicationRemoteLevel minimumRemoteLevel, Long timeoutMillis) Creates a new assured replication request control with the provided information. -
Method Summary
Modifier and TypeMethodDescriptiondecodeJSONControl(JSONObject controlObject, boolean strict) Attempts to decode the provided object as a JSON representation of an assured replication request control.Retrieves the user-friendly name for this control, if available.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.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.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.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.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.booleanIndicates whether the server that originally received the change should return the operation result immediately, without waiting for the requested assurance processing to complete.Retrieves a representation of this assured replication request control as a JSON object.voidtoString(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, toString, writeTo
-
Field Details
-
ASSURED_REPLICATION_REQUEST_OID
The OID (1.3.6.1.4.1.30221.2.5.28) for the assured replication request control.- See Also:
-
-
Constructor Details
-
AssuredReplicationRequestControl
public AssuredReplicationRequestControl(@Nullable AssuredReplicationLocalLevel minimumLocalLevel, @Nullable AssuredReplicationRemoteLevel minimumRemoteLevel, @Nullable 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 isnull, 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 isnull, 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 isnull, then the server will determine the timeout to use.
-
AssuredReplicationRequestControl
public AssuredReplicationRequestControl(boolean isCritical, @Nullable AssuredReplicationLocalLevel minimumLocalLevel, @Nullable AssuredReplicationLocalLevel maximumLocalLevel, @Nullable AssuredReplicationRemoteLevel minimumRemoteLevel, @Nullable AssuredReplicationRemoteLevel maximumRemoteLevel, @Nullable 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 isnull, 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 isnull, 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 isnull, 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 isnull, 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 isnull, 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
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 benull.- Throws:
LDAPException- If the provided generic control cannot be parsed as an assured replication request control.
-
-
Method Details
-
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
nullif the server should determine the minimum local assurance level for the operation.
-
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
nullif the server should determine the maximum local assurance level for the operation.
-
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
nullif the server should determine the minimum remote assurance level for the operation.
-
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
nullif the server should determine the maximum remote assurance level for the operation.
-
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:
falseif the server should wait to return the operation result until the desired assurance has been attained or a timeout has occurred, ortrueif the server should return the result immediately.
-
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
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:
getControlNamein classControl- Returns:
- The user-friendly name for this control, or the OID if no user-friendly name is available.
-
toJSONControl
Retrieves a representation of this assured replication request control as a JSON object. The JSON object uses the following fields:-
oid-- A mandatory string field whose value is the object identifier for this control. For the assured replication request control, the OID is "1.3.6.1.4.1.30221.2.5.28". -
control-name-- An optional string field whose value is a human-readable name for this control. This field is only intended for descriptive purposes, and when decoding a control, theoidfield should be used to identify the type of control. -
criticality-- A mandatory Boolean field used to indicate whether this control is considered critical. -
value-base64-- An optional string field whose value is a base64-encoded representation of the raw value for this assured replication request control. Exactly one of thevalue-base64andvalue-jsonfields must be present. -
value-json-- An optional JSON object field whose value is a user-friendly representation of the value for this assured replication request control. Exactly one of thevalue-base64andvalue-jsonfields must be present, and if thevalue-jsonfield is used, then it will use the following fields:-
minimum-local-level-- An optional string field whose value is the name of the minimum assurance level desired for replicas in the same location as the target server. The value may be one of "none", "received-any-server", or "processed-all-servers". -
maximum-local-level-- An optional string field whose value is the name of the maximum assurance level desired for replicas in the same location as the target server. The value may be one of "none", "received-any-server", or "processed-all-servers". -
minimum-remote-level-- An optional string field whose value is the name of the minimum assurance level desired for replicas in a different location from the target server. The value may be one of "none", "received-any-remote-location", "received-all-remote-locations", or "processed-all-remote-servers". -
maximum-remote-level-- An optional string field whose value is the name of the maximum assurance level desired for replicas in a different location from the target server. The value may be one of "none", "received-any-remote-location", "received-all-remote-locations", or "processed-all-remote-servers". -
timeout-millis-- An optional integer field whose value is the maximum length of time in milliseconds that the server should wait for assurance to be satisfied. -
send-response-immediately-- A mandatory Boolean field that indicates whether the server should return the response to the client immediately after applying the change locally, even if it has not yet been replicated.
-
- Overrides:
toJSONControlin classControl- Returns:
- A JSON object that contains a representation of this control.
-
-
decodeJSONControl
@NotNull public static AssuredReplicationRequestControl decodeJSONControl(@NotNull JSONObject controlObject, boolean strict) throws LDAPException Attempts to decode the provided object as a JSON representation of an assured replication request control.- Parameters:
controlObject- The JSON object to be decoded. It must not benull.strict- Indicates whether to use strict mode when decoding the provided JSON object. If this istrue, then this method will throw an exception if the provided JSON object contains any unrecognized fields. If this isfalse, then unrecognized fields will be ignored.- Returns:
- The assured replication control that was decoded from the provided JSON object.
- Throws:
LDAPException- If the provided JSON object cannot be parsed as a valid assured replication request control.
-
toString
Appends a string representation of this LDAP control to the provided buffer.
-