com.unboundid.ldap.sdk.unboundidds.controls
Class TransactionSettingsRequestControl

java.lang.Object
  extended by com.unboundid.ldap.sdk.Control
      extended by com.unboundid.ldap.sdk.unboundidds.controls.TransactionSettingsRequestControl
All Implemented Interfaces:
java.io.Serializable

@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class TransactionSettingsRequestControl
extends Control

NOTE: This class is part of the Commercial Edition of the UnboundID LDAP SDK for Java. It is not available for use in applications that include only the Standard Edition of the LDAP SDK, and is not supported for use in conjunction with non-UnboundID products.
This class provides a request control that can be used to specify a number of settings used for any database transaction that may be associated with the associated request. It may be included in an end transaction extended request or an atomic multi-update extended request (it is not supported for use in non-atomic multi-update requests).

This control has an OID of 1.3.6.1.4.1.30221.2.5.38. It may have a criticality of either true (in which case the server will reject the associated operation if this control is not recognized) or false (in which case the server will ignore this control if it is not recognized). It must have a value with the following encoding:
   TransactionSettingsRequestValue ::= SEQUENCE {
        transactionName              [0] OCTET STRING OPTIONAL,
        commitDurability             [1] ENUMERATED {
             nonSynchronous           (0),
             partiallySynchronous     (1),
             fullySynchronous         (2),
             ... } OPTIONAL,
        backendLockBehavior          [2] ENUMERATED {
             doNotAcquire                    (0),
             acquireAfterRetries             (1),
             acquireBeforeRetries            (2),
             acquireBeforeInitialAttempt     (3),
             ... } OPTIONAL,
        backendLockTimeoutMillis     [3] INTEGER OPTIONAL,
        retryAttempts                [4] INTEGER OPTIONAL,
        txnLockTimeout               [5] SEQUENCE {
             minTimeoutMillis     INTEGER,
             maxTimeoutMillis     INTEGER,
             ... } OPTIONAL,
        returnResponseControl        [6] BOOLEAN DEFAULT FALSE,
        ... }
 

See Also:
Serialized Form

Field Summary
static java.lang.String TRANSACTION_SETTINGS_REQUEST_OID
          The OID (1.3.6.1.4.1.30221.2.5.38) for the undelete request control.
 
Constructor Summary
TransactionSettingsRequestControl(boolean isCritical, java.lang.String transactionName, TransactionSettingsCommitDurability commitDurability, TransactionSettingsBackendLockBehavior backendLockBehavior, java.lang.Long backendLockTimeoutMillis, java.lang.Integer retryAttempts, java.lang.Long minTxnLockTimeoutMillis, java.lang.Long maxTxnLockTimeoutMillis)
          Creates a new transaction settings request control with the provided information.
TransactionSettingsRequestControl(boolean isCritical, java.lang.String transactionName, TransactionSettingsCommitDurability commitDurability, TransactionSettingsBackendLockBehavior backendLockBehavior, java.lang.Long backendLockTimeoutMillis, java.lang.Integer retryAttempts, java.lang.Long minTxnLockTimeoutMillis, java.lang.Long maxTxnLockTimeoutMillis, boolean returnResponseControl)
          Creates a new transaction settings request control with the provided information.
TransactionSettingsRequestControl(Control c)
          Creates a new transaction settings request control that is decoded from the provided generic control.
 
Method Summary
 TransactionSettingsBackendLockBehavior getBackendLockBehavior()
          Retrieves the backend lock behavior that should be used for the associated transaction, if specified.
 java.lang.Long getBackendLockTimeoutMillis()
          Retrieves the backend lock timeout (in milliseconds) that should be used for the associated transaction, if specified.
 TransactionSettingsCommitDurability getCommitDurability()
          Retrieves the commit durability that should be used for the associated transaction, if specified.
 java.lang.String getControlName()
          Retrieves the user-friendly name for this control, if available.
 java.lang.Long getMaxTxnLockTimeoutMillis()
          Retrieves the maximum transaction lock timeout (in milliseconds) that should be used for the associated transaction, if specified.
 java.lang.Long getMinTxnLockTimeoutMillis()
          Retrieves the minimum transaction lock timeout (in milliseconds) that should be used for the associated transaction, if specified.
 java.lang.Integer getRetryAttempts()
          Retrieves the maximum number of times that the transaction may be retried if the initial attempt fails due to a lock conflict, if specified.
 java.lang.String getTransactionName()
          Retrieves the name to assign to the associated transaction, if specified.
 boolean returnResponseControl()
          Indicates whether to return a response control with transaction-related information collected over the course of processing the associated operation.
 void toString(java.lang.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, deregisterDecodeableControl, encode, encodeControls, equals, getOID, getValue, hashCode, hasValue, isCritical, readFrom, registerDecodeableControl, toString, writeTo
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TRANSACTION_SETTINGS_REQUEST_OID

public static final java.lang.String TRANSACTION_SETTINGS_REQUEST_OID
The OID (1.3.6.1.4.1.30221.2.5.38) for the undelete request control.

See Also:
Constant Field Values
Constructor Detail

TransactionSettingsRequestControl

public TransactionSettingsRequestControl(boolean isCritical,
                                         java.lang.String transactionName,
                                         TransactionSettingsCommitDurability commitDurability,
                                         TransactionSettingsBackendLockBehavior backendLockBehavior,
                                         java.lang.Long backendLockTimeoutMillis,
                                         java.lang.Integer retryAttempts,
                                         java.lang.Long minTxnLockTimeoutMillis,
                                         java.lang.Long maxTxnLockTimeoutMillis)
Creates a new transaction settings request control with the provided information.

Parameters:
isCritical - Indicates whether the control should be considered critical.
transactionName - The name to use for the transaction. It may be null if no client-specified transaction name is needed. If a transaction name is provided, it will be used purely for informational and/or troubleshooting purposes.
commitDurability - The durability level that should be used when committing the associated transaction. It may be null if the server-default durability level should be used.
backendLockBehavior - The behavior that should be used with regard to acquiring an exclusive lock for processing in the target backend. It may be null if the server-default backend lock behavior should be used.
backendLockTimeoutMillis - The maximum length of time in milliseconds to spend attempting to acquire an exclusive backend lock if it is needed during any part of the processing. A value that of zero indicates that no timeout should be enforced. It may be null if the server will determine the backend lock timeout that should be used.
retryAttempts - The number of times to retry the associated operations in a new transaction if the initial attempt fails. If this is null, then the server will determine the number of retry attempts to make. Note that depending on the backend lock behavior, the server may make one additional retry attempt if necessary after acquiring an exclusive backend lock.
minTxnLockTimeoutMillis - The minimum database lock timeout that should be used for the associated transaction. If this is specified, then the first attempt will use this lock timeout, and subsequent attempts will use a timeout value between this and the maximum database lock timeout (which must also be specified). If this is null, then the server will determine the database lock timeout settings to use.
maxTxnLockTimeoutMillis - The maximum database lock timeout that should be used for the associated transaction. If this is specified, then the minimum database lock timeout must also be specified, and this value must be greater than or equal to the minimum lock timeout. If this is null, then the server will determine the database lock timeout settings to use.

TransactionSettingsRequestControl

public TransactionSettingsRequestControl(boolean isCritical,
                                         java.lang.String transactionName,
                                         TransactionSettingsCommitDurability commitDurability,
                                         TransactionSettingsBackendLockBehavior backendLockBehavior,
                                         java.lang.Long backendLockTimeoutMillis,
                                         java.lang.Integer retryAttempts,
                                         java.lang.Long minTxnLockTimeoutMillis,
                                         java.lang.Long maxTxnLockTimeoutMillis,
                                         boolean returnResponseControl)
Creates a new transaction settings request control with the provided information.

Parameters:
isCritical - Indicates whether the control should be considered critical.
transactionName - The name to use for the transaction. It may be null if no client-specified transaction name is needed. If a transaction name is provided, it will be used purely for informational and/or troubleshooting purposes.
commitDurability - The durability level that should be used when committing the associated transaction. It may be null if the server-default durability level should be used.
backendLockBehavior - The behavior that should be used with regard to acquiring an exclusive lock for processing in the target backend. It may be null if the server-default backend lock behavior should be used.
backendLockTimeoutMillis - The maximum length of time in milliseconds to spend attempting to acquire an exclusive backend lock if it is needed during any part of the processing. A value that of zero indicates that no timeout should be enforced. It may be null if the server will determine the backend lock timeout that should be used.
retryAttempts - The number of times to retry the associated operations in a new transaction if the initial attempt fails. If this is null, then the server will determine the number of retry attempts to make. Note that depending on the backend lock behavior, the server may make one additional retry attempt if necessary after acquiring an exclusive backend lock.
minTxnLockTimeoutMillis - The minimum database lock timeout that should be used for the associated transaction. If this is specified, then the first attempt will use this lock timeout, and subsequent attempts will use a timeout value between this and the maximum database lock timeout (which must also be specified). If this is null, then the server will determine the database lock timeout settings to use.
maxTxnLockTimeoutMillis - The maximum database lock timeout that should be used for the associated transaction. If this is specified, then the minimum database lock timeout must also be specified, and this value must be greater than or equal to the minimum lock timeout. If this is null, then the server will determine the database lock timeout settings to use.
returnResponseControl - Indicates whether to return a response control with transaction-related information collected over the course of processing the associated operation.

TransactionSettingsRequestControl

public TransactionSettingsRequestControl(Control c)
                                  throws LDAPException
Creates a new transaction settings request control that is decoded from the provided generic control.

Parameters:
c - The generic control to decode as a transaction settings request control.
Throws:
LDAPException - If a problem is encountered while attempting to decode the provided control as a transaction settings request control.
Method Detail

getTransactionName

public java.lang.String getTransactionName()
Retrieves the name to assign to the associated transaction, if specified.

Returns:
The name to assign to the associated transaction, or null if none has been specified.

getCommitDurability

public TransactionSettingsCommitDurability getCommitDurability()
Retrieves the commit durability that should be used for the associated transaction, if specified.

Returns:
The commit durability that should be used for the associated transaction, or null if none has been specified and the server should determine the commit durability.

getBackendLockBehavior

public TransactionSettingsBackendLockBehavior getBackendLockBehavior()
Retrieves the backend lock behavior that should be used for the associated transaction, if specified.

Returns:
The backend lock behavior that should be used for the associated transaction, or null if none has been specified and the server should determine the backend lock behavior.

getBackendLockTimeoutMillis

public java.lang.Long getBackendLockTimeoutMillis()
Retrieves the backend lock timeout (in milliseconds) that should be used for the associated transaction, if specified.

Returns:
The backend lock timeout (in milliseconds) that should be used for the associated transaction, or null if none has been specified and the server should determine the backend lock timeout.

getRetryAttempts

public java.lang.Integer getRetryAttempts()
Retrieves the maximum number of times that the transaction may be retried if the initial attempt fails due to a lock conflict, if specified.

Returns:
The maximum number of times that the transaction may be retried if the initial attempt fails due to a lock conflict, or null if none has been specified and the server should determine the number of retry attempts.

getMinTxnLockTimeoutMillis

public java.lang.Long getMinTxnLockTimeoutMillis()
Retrieves the minimum transaction lock timeout (in milliseconds) that should be used for the associated transaction, if specified. This is the timeout value that will be used for the first attempt. Any subsequent attempts will have a lock timeout that is between the minimum and maximum timeout value.

Returns:
The minimum lock timeout (in milliseconds) that should be used for the associated transaction, or null if none has been specified and the server should determine the minimum transaction lock timeout.

getMaxTxnLockTimeoutMillis

public java.lang.Long getMaxTxnLockTimeoutMillis()
Retrieves the maximum transaction lock timeout (in milliseconds) that should be used for the associated transaction, if specified. The timeout to be used for any retries will be between the minimum and maximum lock timeout values.

Returns:
The maximum lock timeout (in milliseconds) that should be used for the associated transaction, or null if none has been specified and the server should determine the maximum transaction lock timeout.

returnResponseControl

public boolean returnResponseControl()
Indicates whether to return a response control with transaction-related information collected over the course of processing the associated operation.

Returns:
true if the server should return a response control with transaction-related information, or false if not.

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.