Record Class WhoAmIExtendedResult

java.lang.Object
java.lang.Record
org.forgerock.opendj.ldap.messages.WhoAmIExtendedResult
Record Components:
resultCode - The result code.
matchedDn - The matched DN associated, which may be empty or null indicating that none was provided. The returned matched DN will be empty if none was provided (never null).
diagnosticMessage - The diagnostic message, which may be empty or null. The returned diagnostic message will be LocalizableMessage.EMPTY if none was provided (never null).
referralUris - The optional referrals are present in a WhoAmIExtendedResult if the result code is set to ResultCode.REFERRAL, and they are absent with all other result codes.
authorizationId - The authorization ID of the user, that usually has the form "dn:" immediately followed by the distinguished name of the user, or "u:" followed by a user ID string, but other forms are permitted. The authorization ID may be null or empty if this result does not contain an authorization ID.
controls - the List containing the controls.
cause - The throwable cause, which may be null indicating that none was provided.
All Implemented Interfaces:
ExtendedResult, ProtocolOp, Response, Result

public record WhoAmIExtendedResult(ResultCode resultCode, String matchedDn, LocalizableMessage diagnosticMessage, List<String> referralUris, String authorizationId, List<Control> controls, Throwable cause) extends Record implements ExtendedResult
The who am I extended result as defined in RFC 4532. The result includes the primary authorization identity, in its primary form, that the server has associated with the user or application entity, but only if the who am I extended request succeeded.

The authorization identity is specified using an authorization ID, or authzId, as defined in RFC 4513 section 5.2.1.8.

The following example demonstrates use of the Who Am I? request and response.

 Connection connection = ...;
 String name = ...;
 char[] password = ...;

 Result result = connection.bind(name, password);
 if (result.isSuccess()) {
     WhoAmIExtendedRequest request = Requests.newWhoAmIExtendedRequest();
     WhoAmIExtendedResult extResult = connection.extendedRequest(request);

     if (extResult.isSuccess()) {
         // Authz ID: "  + extResult.getAuthorizationID());
     }
 }
 
See Also:
  • Constructor Details

  • Method Details

    • oid

      public String oid()
      Description copied from interface: ExtendedResult
      Returns the numeric OID, if any, associated with this extended result.
      Specified by:
      oid in interface ExtendedResult
      Returns:
      The numeric OID associated with this extended result, or null if there is no OID.
    • value

      public ByteString value()
      Description copied from interface: ExtendedResult
      Returns the value, if any, associated with this extended result. Its format is defined by the specification of this extended result.
      Specified by:
      value in interface ExtendedResult
      Returns:
      The value associated with this extended result, or null if there is no value.
    • hasValue

      public boolean hasValue()
      Description copied from interface: ExtendedResult
      Returns true if this extended result has a value. In some circumstances it may be useful to determine if an extended result has a value, without actually calculating the value and incurring any performance costs.
      Specified by:
      hasValue in interface ExtendedResult
      Returns:
      true if this extended result has a value, or false if there is no value.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • resultCode

      public ResultCode resultCode()
      Returns the value of the resultCode record component.
      Specified by:
      resultCode in interface Result
      Returns:
      the value of the resultCode record component
    • matchedDn

      public String matchedDn()
      Returns the value of the matchedDn record component.
      Specified by:
      matchedDn in interface Result
      Returns:
      the value of the matchedDn record component
    • diagnosticMessage

      public LocalizableMessage diagnosticMessage()
      Returns the value of the diagnosticMessage record component.
      Specified by:
      diagnosticMessage in interface Result
      Returns:
      the value of the diagnosticMessage record component
    • referralUris

      public List<String> referralUris()
      Returns the value of the referralUris record component.
      Specified by:
      referralUris in interface Result
      Returns:
      the value of the referralUris record component
    • authorizationId

      public String authorizationId()
      Returns the value of the authorizationId record component.
      Returns:
      the value of the authorizationId record component
    • controls

      public List<Control> controls()
      Returns the value of the controls record component.
      Specified by:
      controls in interface ProtocolOp
      Returns:
      the value of the controls record component
    • cause

      public Throwable cause()
      Returns the value of the cause record component.
      Specified by:
      cause in interface Result
      Returns:
      the value of the cause record component