Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Unified Directory
11g Release 2 (11.1.2.2.0)

E38583-02


oracle.oud.responses
Interface Result

All Known Subinterfaces:
ExtendedResult

public interface Result

A Result is used to indicate the status of an operation performed by the server. A Result is comprised of several fields:


Method Summary
 Result addControl(Control control)
          Adds the provided control to this response.
 Result addReferralURI(java.lang.String uri)
          Adds the provided referral URI to this result.
 java.lang.Throwable getCause()
          Returns the throwable cause associated with this result if available.
<C extends Control>
C
getControl(ControlDecoder<C> decoder)
          Decodes and returns the first control in this response having an OID corresponding to the provided control decoder.
 java.util.List<Control> getControls()
          Returns a List containing the controls included with this response.
 java.lang.String getDiagnosticMessage()
          Returns the diagnostic message associated with this result.
 DN getMatchedDN()
          Returns the matched DN associated with this result.
 java.util.List<java.lang.String> getReferralURIs()
          Returns a List containing the referral URIs included with this result.
 ResultCode getResultCode()
          Returns the result code associated with this result.
 boolean isReferral()
          Indicates whether or not a referral needs to be chased in order to complete the operation.
 boolean isSuccess()
          Indicates whether or not the request succeeded or not.
 Result removeControl(Control control)
          Removes the provided control from this response.
 Result setCause(java.lang.Throwable cause)
          Sets the throwable cause associated with this result if available.
 Result setDiagnosticMessage(java.lang.String message)
          Sets the diagnostic message associated with this result.
 Result setMatchedDN(DN dn)
          Sets the matched DN associated with this result.
 Result setResultCode(ResultCode resultCode)
          Sets the result code associated with this result.

 

Method Detail

addControl

Result addControl(Control control)
                  throws java.lang.UnsupportedOperationException,
                         java.lang.NullPointerException
Adds the provided control to this response.
Parameters:
control - The control to be added.
Returns:
This response.
Throws:
java.lang.UnsupportedOperationException - If this response does not permit controls to be added.
java.lang.NullPointerException - If control was null.

removeControl

Result removeControl(Control control)
                     throws java.lang.UnsupportedOperationException,
                            java.lang.NullPointerException
Removes the provided control from this response.
Parameters:
control - The control to be removed from this response.
Returns:
This response.
Throws:
java.lang.UnsupportedOperationException - If this response does not permit controls to be removed.
java.lang.NullPointerException - If control was null.

addReferralURI

Result addReferralURI(java.lang.String uri)
                      throws java.lang.UnsupportedOperationException,
                             java.lang.NullPointerException
Adds the provided referral URI to this result.
Parameters:
uri - The referral URI to be added.
Returns:
This result.
Throws:
java.lang.UnsupportedOperationException - If this result does not permit referrals to be added.
java.lang.NullPointerException - If uri was null.

getCause

java.lang.Throwable getCause()
Returns the throwable cause associated with this result if available. A cause may be provided in cases where a result indicates a failure due to a client-side error.
Returns:
The throwable cause, or null if none was provided.

getDiagnosticMessage

java.lang.String getDiagnosticMessage()
Returns the diagnostic message associated with this result.
Returns:
The diagnostic message, which may be empty if none was provided (never null).

getMatchedDN

DN getMatchedDN()
Returns the matched DN associated with this result.
Returns:
The matched DN, which may be empty if none was provided (never null).

getReferralURIs

java.util.List<java.lang.String> getReferralURIs()
Returns a List containing the referral URIs included with this result. The returned List may be modified if permitted by this result.
Returns:
A List containing the referral URIs.

getResultCode

ResultCode getResultCode()
Returns the result code associated with this result.
Returns:
The result code.

isReferral

boolean isReferral()
Indicates whether or not a referral needs to be chased in order to complete the operation.

Specifically, this method returns true if the result code is equal to ResultCode.REFERRAL.

Returns:
true if a referral needs to be chased, otherwise false.

isSuccess

boolean isSuccess()
Indicates whether or not the request succeeded or not. This method will return {code true} for all non-error responses.
Returns:
true if the request succeeded, otherwise false.

setCause

Result setCause(java.lang.Throwable cause)
                throws java.lang.UnsupportedOperationException
Sets the throwable cause associated with this result if available. A cause may be provided in cases where a result indicates a failure due to a client-side error.
Parameters:
cause - The throwable cause, which may be null indicating that none was provided.
Returns:
This result.
Throws:
java.lang.UnsupportedOperationException - If this result does not permit the cause to be set.

setDiagnosticMessage

Result setDiagnosticMessage(java.lang.String message)
                            throws java.lang.UnsupportedOperationException
Sets the diagnostic message associated with this result.
Parameters:
message - The diagnostic message, which may be empty or null indicating that none was provided.
Returns:
This result.
Throws:
java.lang.UnsupportedOperationException - If this result does not permit the diagnostic message to be set.

setMatchedDN

Result setMatchedDN(DN dn)
                    throws java.lang.UnsupportedOperationException
Sets the matched DN associated with this result.
Parameters:
dn - The matched DN associated, which may be empty or null indicating that none was provided.
Returns:
This result.
Throws:
java.lang.UnsupportedOperationException - If this result does not permit the matched DN to be set.

setResultCode

Result setResultCode(ResultCode resultCode)
                     throws java.lang.UnsupportedOperationException,
                            java.lang.NullPointerException
Sets the result code associated with this result.
Parameters:
resultCode - The result code.
Returns:
This result.
Throws:
java.lang.UnsupportedOperationException - If this result does not permit the result code to be set.
java.lang.NullPointerException - If resultCode was null.

getControl

<C extends Control> C getControl(ControlDecoder<C> decoder)
                             throws java.lang.NullPointerException,
                                    PluginException
Decodes and returns the first control in this response having an OID corresponding to the provided control decoder.
Type Parameters:
C - The type of control to be decoded and returned.
Parameters:
decoder - The control decoder.
Returns:
The decoded control, or null if the control is not included with this response.
Throws:
PluginException - If the control could not be decoded because it was malformed in some way (e.g. the control value was missing, or its content could not be decoded).
java.lang.NullPointerException - If decoder or options was null.

getControls

java.util.List<Control> getControls()
Returns a List containing the controls included with this response. The returned List may be modified if permitted by this response.
Returns:
A List containing the controls.

Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Unified Directory
11g Release 2 (11.1.2.2.0)

E38583-02


Copyright © 2013, Oracle and/or its affiliates. All rights reserved.