public interface PasswordModifyExtendedRequest extends ExtendedRequest<PasswordModifyExtendedResult>
String userIdentity = ...; // For example, u:<uid> or dn:<DN>
char[] oldPassword = ...;
char[] newPassword = ...;
Connection connection = ...;
PasswordModifyExtendedRequest request =
Requests.newPasswordModifyExtendedRequest()
.setUserIdentity(userIdentity)
.setOldPassword(oldPassword)
.setNewPassword(newPassword);
PasswordModifyExtendedResult result = connection.extendedRequest(request);
if (result.isSuccess()) {
// Changed password
} else {
// Use result to diagnose error.
}
Request.RequestType
Modifier and Type | Field and Description |
---|---|
static ExtendedRequestDecoder<PasswordModifyExtendedRequest,PasswordModifyExtendedResult> |
DECODER
A decoder which can be used to decode password modify extended operation
requests.
|
static String |
OID
The OID for the password modify extended operation request.
|
Modifier and Type | Method and Description |
---|---|
PasswordModifyExtendedRequest |
addControl(Control control)
Adds the provided control to this protocol-op.
|
PasswordModifyExtendedRequest |
addControls(Iterable<? extends Control> controls)
Adds the provided controls to this protocol-op.
|
<C extends Control> |
getControl(ControlDecoder<C> decoder,
DecodeOptions options)
Decodes and returns the first control in this protocol-op having an OID
corresponding to the provided control decoder.
|
List<Control> |
getControls()
Returns a
List containing the controls included with this
protocol-op. |
byte[] |
getNewPassword()
Returns the desired password for the user, or
null if a new
password should be generated. |
String |
getOid()
Returns the numeric OID associated with this extended request.
|
byte[] |
getOldPassword()
Returns the current password for the user, if known.
|
ExtendedResultDecoder<PasswordModifyExtendedResult> |
getResultDecoder()
Returns a decoder which can be used to decoded responses to this extended
request.
|
ByteString |
getUserIdentity()
Returns 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. |
String |
getUserIdentityAsString()
Returns the identity of the user whose password is to be modified decoded
as a UTF-8 string, or
null if the request should be applied to
the user currently associated with the session. |
ByteString |
getValue()
Returns the value, if any, associated with this extended request.
|
boolean |
hasValue()
Returns
true if this extended request has a value. |
PasswordModifyExtendedRequest |
setNewPassword(byte[] newPassword)
Sets the desired password for the user.
|
PasswordModifyExtendedRequest |
setNewPassword(char[] newPassword)
Sets the desired password for the user.
|
PasswordModifyExtendedRequest |
setOldPassword(byte[] oldPassword)
Sets the current password for the user.
|
PasswordModifyExtendedRequest |
setOldPassword(char[] oldPassword)
Sets the current password for the user.
|
PasswordModifyExtendedRequest |
setUserIdentity(Object userIdentity)
Sets the identity of the user whose password is to be modified.
|
containsControl, getControl
static final ExtendedRequestDecoder<PasswordModifyExtendedRequest,PasswordModifyExtendedResult> DECODER
static final String OID
PasswordModifyExtendedRequest addControl(Control control)
ProtocolOp
addControl
in interface ExtendedRequest<PasswordModifyExtendedResult>
addControl
in interface ProtocolOp
addControl
in interface Request
control
- The control to be added to this protocol-op.PasswordModifyExtendedRequest addControls(Iterable<? extends Control> controls)
ProtocolOp
addControls
in interface ExtendedRequest<PasswordModifyExtendedResult>
addControls
in interface ProtocolOp
addControls
in interface Request
controls
- The controls to be added to this protocol-op.<C extends Control> C getControl(ControlDecoder<C> decoder, DecodeOptions options) throws DecodeException
ProtocolOp
getControl
in interface ExtendedRequest<PasswordModifyExtendedResult>
getControl
in interface ProtocolOp
C
- The type of control to be decoded and returned.decoder
- The control decoder.options
- The set of decode options which should be used when decoding
the control.null
if the control is not
included with this protocol-op.DecodeException
- 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).List<Control> getControls()
ProtocolOp
List
containing the controls included with this
protocol-op. The returned List
may be modified if permitted by this
protocol-op.getControls
in interface ExtendedRequest<PasswordModifyExtendedResult>
getControls
in interface ProtocolOp
List
containing the controls.byte[] getNewPassword()
null
if a new
password should be generated.null
if a new
password should be generated.String getOid()
ExtendedRequest
getOid
in interface ExtendedRequest<PasswordModifyExtendedResult>
byte[] getOldPassword()
null
if the
password is not known.ExtendedResultDecoder<PasswordModifyExtendedResult> getResultDecoder()
ExtendedRequest
getResultDecoder
in interface ExtendedRequest<PasswordModifyExtendedResult>
ByteString getUserIdentity()
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.null
if the request should be applied to the user
currently associated with the session.String getUserIdentityAsString()
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.null
if the request should be
applied to the user currently associated with the session.ByteString getValue()
ExtendedRequest
getValue
in interface ExtendedRequest<PasswordModifyExtendedResult>
null
if there is no value.boolean hasValue()
ExtendedRequest
true
if this extended request has a value. In some
circumstances it may be useful to determine if a extended request has a
value, without actually calculating the value and incurring any
performance costs.hasValue
in interface ExtendedRequest<PasswordModifyExtendedResult>
true
if this extended request has a value, or
false
if there is no value.PasswordModifyExtendedRequest setNewPassword(byte[] newPassword)
newPassword
- The desired password for the user, or null
if a new
password should be generated.UnsupportedOperationException
- If this password modify extended request does not permit the
new password to be set.PasswordModifyExtendedRequest setNewPassword(char[] newPassword)
newPassword
- The desired password for the user, or null
if a new
password should be generated.UnsupportedOperationException
- If this password modify extended request does not permit the
new password to be set.PasswordModifyExtendedRequest setOldPassword(byte[] oldPassword)
oldPassword
- The current password for the user, or null
if the
password is not known.UnsupportedOperationException
- If this password modify extended request does not permit the
old password to be set.PasswordModifyExtendedRequest setOldPassword(char[] oldPassword)
oldPassword
- The current password for the user, or null
if the
password is not known.UnsupportedOperationException
- If this password modify extended request does not permit the
old password to be set.PasswordModifyExtendedRequest setUserIdentity(Object userIdentity)
If userIdentity
is not an instance of ByteString
then it
will be converted using the ByteString.valueOfObject(Object)
method.
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.UnsupportedOperationException
- If this password modify extended request does not permit the
user identity to be set.Copyright 2010-2022 ForgeRock AS.