@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class AssuredReplicationRequestControl extends Control
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.
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), ... }
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. }
AssuredReplicationResponseControl
,
Serialized FormModifier and Type | Field and Description |
---|---|
static java.lang.String |
ASSURED_REPLICATION_REQUEST_OID
The OID (1.3.6.1.4.1.30221.2.5.28) for the assured replication request
control.
|
Constructor and Description |
---|
AssuredReplicationRequestControl(AssuredReplicationLocalLevel minimumLocalLevel,
AssuredReplicationRemoteLevel minimumRemoteLevel,
java.lang.Long timeoutMillis)
Creates a new assured replication request control with the provided
information.
|
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.
|
AssuredReplicationRequestControl(Control c)
Creates a new assured replication request control from the provided generic
control.
|
Modifier and Type | Method and Description |
---|---|
static AssuredReplicationRequestControl |
decodeJSONControl(JSONObject controlObject,
boolean strict)
Attempts to decode the provided object as a JSON representation of an
assured replication request control.
|
java.lang.String |
getControlName()
Retrieves the user-friendly name for this control, if available.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
JSONObject |
toJSONControl()
Retrieves a representation of this assured replication request control as a
JSON object.
|
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this LDAP control to the provided
buffer.
|
decode, decode, decodeControls, decodeJSONControl, deregisterDecodeableControl, encode, encodeControls, equals, getOID, getValue, hashCode, hasValue, isCritical, readFrom, registerDecodeableControl, registerDecodeableControl, toString, writeTo
@NotNull public static final java.lang.String ASSURED_REPLICATION_REQUEST_OID
public AssuredReplicationRequestControl(@Nullable AssuredReplicationLocalLevel minimumLocalLevel, @Nullable AssuredReplicationRemoteLevel minimumRemoteLevel, @Nullable java.lang.Long timeoutMillis)
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.public AssuredReplicationRequestControl(boolean isCritical, @Nullable AssuredReplicationLocalLevel minimumLocalLevel, @Nullable AssuredReplicationLocalLevel maximumLocalLevel, @Nullable AssuredReplicationRemoteLevel minimumRemoteLevel, @Nullable AssuredReplicationRemoteLevel maximumRemoteLevel, @Nullable java.lang.Long timeoutMillis, boolean sendResponseImmediately)
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.public AssuredReplicationRequestControl(@NotNull Control c) throws LDAPException
c
- The generic control to decode as an assured replication request
control. It must not be null
.LDAPException
- If the provided generic control cannot be parsed as
an assured replication request control.@Nullable public AssuredReplicationLocalLevel getMinimumLocalLevel()
null
if the server should determine the
minimum local assurance level for the operation.@Nullable public AssuredReplicationLocalLevel getMaximumLocalLevel()
null
if the server should determine the
maximum local assurance level for the operation.@Nullable public AssuredReplicationRemoteLevel getMinimumRemoteLevel()
null
if the server should determine the
minimum remote assurance level for the operation.@Nullable public AssuredReplicationRemoteLevel getMaximumRemoteLevel()
null
if the server should determine the
maximum remote assurance level for the operation.public boolean sendResponseImmediately()
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.@Nullable public java.lang.Long getTimeoutMillis()
@NotNull public java.lang.String getControlName()
getControlName
in class Control
@NotNull public JSONObject toJSONControl()
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, the oid
field 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 the value-base64
and value-json
fields 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 the value-base64
and
value-json
fields must be present, and if the
value-json
field 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.
toJSONControl
in class Control
@NotNull public static AssuredReplicationRequestControl decodeJSONControl(@NotNull JSONObject controlObject, boolean strict) throws LDAPException
controlObject
- The JSON object to be decoded. It must not be
null
.strict
- Indicates whether to use strict mode when decoding
the provided JSON object. If this is true
,
then this method will throw an exception if the
provided JSON object contains any unrecognized
fields. If this is false
, then unrecognized
fields will be ignored.LDAPException
- If the provided JSON object cannot be parsed as a
valid assured replication request control.