com.unboundid.ldap.sdk.extensions
Class EndTransactionExtendedResult

java.lang.Object
  extended by com.unboundid.ldap.sdk.LDAPResult
      extended by com.unboundid.ldap.sdk.ExtendedResult
          extended by com.unboundid.ldap.sdk.extensions.EndTransactionExtendedResult
All Implemented Interfaces:
LDAPResponse, java.io.Serializable

@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class EndTransactionExtendedResult
extends ExtendedResult

This class provides an implementation of the end transaction extended result as defined in RFC 5805. It is able to decode a generic extended result to extract the appropriate response information.

See the documentation for the StartTransactionExtendedRequest class for an example of performing a transaction.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.unboundid.ldap.protocol.LDAPResponse
NO_CONTROLS
 
Constructor Summary
EndTransactionExtendedResult(ExtendedResult extendedResult)
          Creates a new end transaction extended result from the provided extended result.
EndTransactionExtendedResult(int messageID, ResultCode resultCode, java.lang.String diagnosticMessage, java.lang.String matchedDN, java.lang.String[] referralURLs, java.lang.Integer failedOpMessageID, java.util.Map<java.lang.Integer,Control[]> opResponseControls, Control[] responseControls)
          Creates a new end transaction extended result with the provided information.
 
Method Summary
 java.lang.String getExtendedResultName()
          Retrieves the user-friendly name for the extended result, if available.
 int getFailedOpMessageID()
          Retrieves the message ID of the operation that caused the transaction processing to fail, if applicable.
 java.util.Map<java.lang.Integer,Control[]> getOperationResponseControls()
          Retrieves the set of response controls returned by the operations processed as part of the transaction.
 Control[] getOperationResponseControls(int messageID)
          Retrieves the set of response controls returned by the specified operation processed as part of the transaction.
 void toString(java.lang.StringBuilder buffer)
          Appends a string representation of this extended result to the provided buffer.
 
Methods inherited from class com.unboundid.ldap.sdk.ExtendedResult
getOID, getValue, hasValue, toString
 
Methods inherited from class com.unboundid.ldap.sdk.LDAPResult
getDiagnosticMessage, getMatchedDN, getMessageID, getReferralURLs, getResponseControl, getResponseControls, getResultCode, getResultString, hasResponseControl, hasResponseControl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EndTransactionExtendedResult

public EndTransactionExtendedResult(ExtendedResult extendedResult)
                             throws LDAPException
Creates a new end transaction extended result from the provided extended result.

Parameters:
extendedResult - The extended result to be decoded as an end transaction extended result. It must not be null.
Throws:
LDAPException - If a problem occurs while attempting to decode the provided extended result as an end transaction extended result.

EndTransactionExtendedResult

public EndTransactionExtendedResult(int messageID,
                                    ResultCode resultCode,
                                    java.lang.String diagnosticMessage,
                                    java.lang.String matchedDN,
                                    java.lang.String[] referralURLs,
                                    java.lang.Integer failedOpMessageID,
                                    java.util.Map<java.lang.Integer,Control[]> opResponseControls,
                                    Control[] responseControls)
Creates a new end transaction extended result with the provided information.

Parameters:
messageID - The message ID for the LDAP message that is associated with this LDAP result.
resultCode - The result code from the response.
diagnosticMessage - The diagnostic message from the response, if available.
matchedDN - The matched DN from the response, if available.
referralURLs - The set of referral URLs from the response, if available.
failedOpMessageID - The message ID for the operation that failed, or null if there was no failure.
opResponseControls - A map containing the response controls for each operation, indexed by message ID. It may be null if there were no response controls.
responseControls - The set of controls from the response, if available.
Method Detail

getFailedOpMessageID

public int getFailedOpMessageID()
Retrieves the message ID of the operation that caused the transaction processing to fail, if applicable.

Returns:
The message ID of the operation that caused the transaction processing to fail, or -1 if no message ID was included in the end transaction response.

getOperationResponseControls

public java.util.Map<java.lang.Integer,Control[]> getOperationResponseControls()
Retrieves the set of response controls returned by the operations processed as part of the transaction. The value returned will contain a mapping between the message ID of the associated request message and a list of the response controls for that operation.

Returns:
The set of response controls returned by the operations processed as part of the transaction. It may be an empty map if none of the operations had any response controls.

getOperationResponseControls

public Control[] getOperationResponseControls(int messageID)
Retrieves the set of response controls returned by the specified operation processed as part of the transaction.

Parameters:
messageID - The message ID of the operation for which to retrieve the response controls.
Returns:
The response controls for the specified operation, or null if there were no controls returned for the specified operation.

getExtendedResultName

public java.lang.String getExtendedResultName()
Retrieves the user-friendly name for the extended result, if available. If no user-friendly name has been defined, but a response OID is available, then that will be returned. If neither a user-friendly name nor a response OID are available, then null will be returned.

Overrides:
getExtendedResultName in class ExtendedResult
Returns:
The user-friendly name for this extended request, the response OID if a user-friendly name is not available but a response OID is, or null if neither a user-friendly name nor a response OID are available.

toString

public void toString(java.lang.StringBuilder buffer)
Appends a string representation of this extended result to the provided buffer.

Specified by:
toString in interface LDAPResponse
Overrides:
toString in class ExtendedResult
Parameters:
buffer - The buffer to which a string representation of this extended result will be appended.