Record Class PasswordModifyExtendedRequest

java.lang.Object
java.lang.Record
org.forgerock.opendj.ldap.messages.PasswordModifyExtendedRequest
Record Components:
userIdentity - the identity of the user whose password is to be modified, or null if the request should be applied to the user currently associated with the session. The returned identity may or may not be a distinguished name.
oldPassword - the current password for the user, or null if the password is not known.
newPassword - the desired password for the user, or null if a new password should be generated.
controls - the List containing the controls.
All Implemented Interfaces:
ExtendedRequest<PasswordModifyExtendedResult>, ProtocolOp, Request

public record PasswordModifyExtendedRequest(ByteString userIdentity, ByteString oldPassword, ByteString newPassword, List<Control> controls) extends Record implements ExtendedRequest<PasswordModifyExtendedResult>
The password modify extended request as defined in RFC 3062. This operation allows directory clients to update user passwords. The user may or may not be associated with a directory entry. The user may or may not be represented as an LDAP DN. The user's password may or may not be stored in the directory. In addition, it includes support for requiring the user's current password as well as for generating a new password if none was provided.
 
 ByteString userIdentity = ...;
 ByteString oldPassword = ...;
 ByteString newPassword = ...;
 Connection connection = ...;

 PasswordModifyExtendedRequest request =
         Requests.newPasswordModifyExtendedRequest(userIdentity, oldPassword, newPassword);

 PasswordModifyExtendedResult result = connection.extendedRequest(request);
 if (result.isSuccess()) {
     // Changed password
 } else {
     // Use result to diagnose error.
 }
 
 
See Also:
  • Field Details

  • Constructor Details

    • PasswordModifyExtendedRequest

      public PasswordModifyExtendedRequest(ByteString userIdentity, ByteString oldPassword, ByteString newPassword, List<Control> controls)
      Create a new PasswordModifyExtendedRequest.
  • Method Details

    • getOid

      public String getOid()
      Description copied from interface: ExtendedRequest
      Returns the numeric OID associated with this extended request.
      Specified by:
      getOid in interface ExtendedRequest<PasswordModifyExtendedResult>
      Returns:
      The numeric OID associated with this extended request.
    • getResultDecoder

      Description copied from interface: ExtendedRequest
      Returns a decoder which can be used to decoded responses to this extended request.
      Specified by:
      getResultDecoder in interface ExtendedRequest<PasswordModifyExtendedResult>
      Returns:
      A decoder which can be used to decoded responses to this extended request.
    • getValue

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

      public boolean hasValue()
      Description copied from interface: ExtendedRequest
      Returns true if this extended request has a value. In some circumstances it may be useful to determine if an extended request has a value, without actually calculating the value and incurring any performance costs.
      Specified by:
      hasValue in interface ExtendedRequest<PasswordModifyExtendedResult>
      Returns:
      true if this extended request 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.
    • userIdentity

      public ByteString userIdentity()
      Returns the value of the userIdentity record component.
      Returns:
      the value of the userIdentity record component
    • oldPassword

      public ByteString oldPassword()
      Returns the value of the oldPassword record component.
      Returns:
      the value of the oldPassword record component
    • newPassword

      public ByteString newPassword()
      Returns the value of the newPassword record component.
      Returns:
      the value of the newPassword 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