Class ModifiablePasswordPolicyStateJSONBuilder
- java.lang.Object
-
- com.unboundid.ldap.sdk.unboundidds.ModifiablePasswordPolicyStateJSONBuilder
-
- All Implemented Interfaces:
java.io.Serializable
@Mutable @ThreadSafety(level=NOT_THREADSAFE) public final class ModifiablePasswordPolicyStateJSONBuilder extends java.lang.Object implements java.io.Serializable
This class provides support for generating a JSON object that may be included in a REPLACE modification to the ds-pwp-modifiable-state-json operational attribute to manipulate elements in the user's password policy state.
NOTE: This class, and other classes within the
com.unboundid.ldap.sdk.unboundiddspackage structure, are only supported for use against Ping Identity, UnboundID, and Nokia/Alcatel-Lucent 8661 server products. These classes provide support for proprietary functionality or for external specifications that are not considered stable or mature enough to be guaranteed to work in an interoperable way with other types of LDAP servers.
-
-
Constructor Summary
Constructors Constructor Description ModifiablePasswordPolicyStateJSONBuilder()Creates a new builder instance with none of the fields set.ModifiablePasswordPolicyStateJSONBuilder(ModifiablePasswordPolicyStateJSON state)Creates a new builder instance with values set from the provided modifiable password policy state object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ModifiablePasswordPolicyStateJSONbuild()Creates aModifiablePasswordPolicyStateJSONobject from the contents of this builder.ModifiablePasswordPolicyStateJSONBuilderclearAccountActivationTime()Updates this builder so that any existing account activation time value will be cleared in the user entry.ModifiablePasswordPolicyStateJSONBuilderclearAccountExpirationTime()Updates this builder so that any existing account expiration time value will be cleared in the user entry.ModifiablePasswordPolicyStateJSONBuilderclearPasswordChangedTime()Updates this builder so that any existing password changed time value will be cleared in the user entry.ModifiablePasswordPolicyStateJSONBuilderclearPasswordExpirationWarnedTime()Updates this builder so that any existing password expiration warned time value will be cleared in the user entry.java.lang.LonggetAccountActivationTime()Retrieves a timestamp that indicates the time the user's account became (or will become) active.java.lang.LonggetAccountExpirationTime()Retrieves a timestamp that indicates the time the user's account will (or did) expire.java.lang.BooleangetAccountIsDisabled()Retrieves the value of a flag that indicates whether the user's account has been administratively disabled.java.lang.BooleangetAccountIsFailureLocked()Retrieves the value of a flag that indicates whether the user account is currently locked as a result of too many failed authentication attempts.java.lang.BooleangetMustChangePassword()Retrieves the value of a flag that indicates whether the user must change their password before they will be allowed to perform any other operations in the server.java.lang.LonggetPasswordChangedTime()Retrieves a timestamp that indicates the time the user's password was last changed.java.lang.LonggetPasswordExpirationWarnedTime()Retrieves a timestamp that indicates the time the user was first warned about an upcoming password expiration.ModifiablePasswordPolicyStateJSONBuildersetAccountActivationTime(java.lang.Long accountActivationTime)Updates this builder with a new account activation time.ModifiablePasswordPolicyStateJSONBuildersetAccountActivationTime(java.util.Date accountActivationTime)Updates this builder with a new account activation time.ModifiablePasswordPolicyStateJSONBuildersetAccountExpirationTime(java.lang.Long accountExpirationTime)Updates this builder with a new account expiration time.ModifiablePasswordPolicyStateJSONBuildersetAccountExpirationTime(java.util.Date accountExpirationTime)Updates this builder with a new account expiration time.ModifiablePasswordPolicyStateJSONBuildersetAccountIsDisabled(java.lang.Boolean accountIsDisabled)Updates this builder with a new value for the flag indicating whether the user's account should be considered disabled.ModifiablePasswordPolicyStateJSONBuildersetAccountIsFailureLocked(java.lang.Boolean accountIsFailureLocked)Updates this builder with a new value for the flag indicating whether the user's account should be considered locked as a result of too many failed authentication attempts.ModifiablePasswordPolicyStateJSONBuildersetMustChangePassword(java.lang.Boolean mustChangePassword)Updates this builder with a new value for the flag indicating whether the user must change their password before they will be allowed to perform other operations in the server.ModifiablePasswordPolicyStateJSONBuildersetPasswordChangedTime(java.lang.Long passwordChangedTime)Updates this builder with a new password changed time.ModifiablePasswordPolicyStateJSONBuildersetPasswordChangedTime(java.util.Date passwordChangedTime)Updates this builder with a new password changed time.ModifiablePasswordPolicyStateJSONBuildersetPasswordExpirationWarnedTime(java.lang.Long passwordExpirationWarnedTime)Updates this builder with a new password expiration warned time.ModifiablePasswordPolicyStateJSONBuildersetPasswordExpirationWarnedTime(java.util.Date passwordExpirationWarnedTime)Updates this builder with a new password expiration warned time.JSONObjecttoJSONObject()Retrieves a JSON object with an encoded representation of the modifiable password policy state created from this builder.ModifyRequesttoModifyRequest(java.lang.String userDN)Creates a modify request that may be used to update the specified user with the appropriate password policy state changes from this builder.java.lang.StringtoString()Retrieves a string representation of the password policy state information.
-
-
-
Constructor Detail
-
ModifiablePasswordPolicyStateJSONBuilder
public ModifiablePasswordPolicyStateJSONBuilder()
Creates a new builder instance with none of the fields set.
-
ModifiablePasswordPolicyStateJSONBuilder
public ModifiablePasswordPolicyStateJSONBuilder(@NotNull ModifiablePasswordPolicyStateJSON state)
Creates a new builder instance with values set from the provided modifiable password policy state object.- Parameters:
state- The modifiable password policy state object to use to set the initial values for all of the fields.
-
-
Method Detail
-
getPasswordChangedTime
@Nullable public java.lang.Long getPasswordChangedTime()
Retrieves a timestamp that indicates the time the user's password was last changed.- Returns:
- A non-negative value that represents the password changed time in
number of milliseconds since the epoch (the same format used by
System.currentTimeMillis), a negative value if the field was present with a JSON null value (indicating that the user doesn't have a password changed time), ornullif the field was not included in the JSON object.
-
setPasswordChangedTime
@NotNull public ModifiablePasswordPolicyStateJSONBuilder setPasswordChangedTime(@Nullable java.lang.Long passwordChangedTime)
Updates this builder with a new password changed time.- Parameters:
passwordChangedTime- The new password changed time value to use. It may be a positive value representing the number of milliseconds since the epoch (the same format used bySystem.currentTimeMillis) for the password changed time, a negative value to indicate that any existing password changed time value should be cleared, ornullif the value should not be set in this builder (and therefore omitted from any JSON object orModifiablePasswordPolicyStateJSONthat is created).- Returns:
- This builder object.
-
setPasswordChangedTime
@NotNull public ModifiablePasswordPolicyStateJSONBuilder setPasswordChangedTime(@Nullable java.util.Date passwordChangedTime)
Updates this builder with a new password changed time.- Parameters:
passwordChangedTime- The new password changed time value to use. It may benullif any existing password changed time value should be cleared.- Returns:
- This builder object.
-
clearPasswordChangedTime
@NotNull public ModifiablePasswordPolicyStateJSONBuilder clearPasswordChangedTime()
Updates this builder so that any existing password changed time value will be cleared in the user entry.- Returns:
- This builder object.
-
getAccountIsDisabled
@Nullable public java.lang.Boolean getAccountIsDisabled()
Retrieves the value of a flag that indicates whether the user's account has been administratively disabled.- Returns:
Boolean.TRUEif the account has been administratively disabled,Boolean.FALSEif the account has not been administratively disabled, ornullif this flag was not included in the password policy state JSON object.
-
setAccountIsDisabled
@NotNull public ModifiablePasswordPolicyStateJSONBuilder setAccountIsDisabled(@Nullable java.lang.Boolean accountIsDisabled)
Updates this builder with a new value for the flag indicating whether the user's account should be considered disabled.- Parameters:
accountIsDisabled- The new account is disabled value to use. It may benullif the value should not be set in this builder (and therefore omitted from any JSON object orModifiablePasswordPolicyStateJSONthat is created).- Returns:
- This builder object.
-
getAccountActivationTime
@Nullable public java.lang.Long getAccountActivationTime()
Retrieves a timestamp that indicates the time the user's account became (or will become) active.- Returns:
- A non-negative value that represents the account activation time
in number of milliseconds since the epoch (the same format used by
System.currentTimeMillis), a negative value if the field was present with a JSON null value (indicating that the user doesn't have an account activation time), ornullif the field was not included in the JSON object.
-
setAccountActivationTime
@NotNull public ModifiablePasswordPolicyStateJSONBuilder setAccountActivationTime(@Nullable java.lang.Long accountActivationTime)
Updates this builder with a new account activation time.- Parameters:
accountActivationTime- The new account activation time value to use. It may be a positive value representing the number of milliseconds since the epoch (the same format used bySystem.currentTimeMillis) for the account activation time, a negative value to indicate that any existing account activation time value should be cleared, ornullif the value should not be set in this builder (and therefore omitted from any JSON object orModifiablePasswordPolicyStateJSONthat is created).- Returns:
- This builder object.
-
setAccountActivationTime
@NotNull public ModifiablePasswordPolicyStateJSONBuilder setAccountActivationTime(@Nullable java.util.Date accountActivationTime)
Updates this builder with a new account activation time.- Parameters:
accountActivationTime- The new account activation time value to use. It may benullif any existing account activation time value should be cleared.- Returns:
- This builder object.
-
clearAccountActivationTime
@NotNull public ModifiablePasswordPolicyStateJSONBuilder clearAccountActivationTime()
Updates this builder so that any existing account activation time value will be cleared in the user entry.- Returns:
- This builder object.
-
getAccountExpirationTime
@Nullable public java.lang.Long getAccountExpirationTime()
Retrieves a timestamp that indicates the time the user's account will (or did) expire.- Returns:
- A non-negative value that represents the account expiration time
in number of milliseconds since the epoch (the same format used by
System.currentTimeMillis), a negative value if the field was present with a JSON null value (indicating that the user doesn't have an account expiration time), ornullif the field was not included in the JSON object.
-
setAccountExpirationTime
@NotNull public ModifiablePasswordPolicyStateJSONBuilder setAccountExpirationTime(@Nullable java.lang.Long accountExpirationTime)
Updates this builder with a new account expiration time.- Parameters:
accountExpirationTime- The new account expiration time value to use. It may be a positive value representing the number of milliseconds since the epoch (the same format used bySystem.currentTimeMillis) for the account expiration time, a negative value to indicate that any existing account expiration time value should be cleared, ornullif the value should not be set in this builder (and therefore omitted from any JSON object orModifiablePasswordPolicyStateJSONthat is created).- Returns:
- This builder object.
-
setAccountExpirationTime
@NotNull public ModifiablePasswordPolicyStateJSONBuilder setAccountExpirationTime(@Nullable java.util.Date accountExpirationTime)
Updates this builder with a new account expiration time.- Parameters:
accountExpirationTime- The new account expiration time value to use. It may benullif any existing account expiration time value should be cleared.- Returns:
- This builder object.
-
clearAccountExpirationTime
@NotNull public ModifiablePasswordPolicyStateJSONBuilder clearAccountExpirationTime()
Updates this builder so that any existing account expiration time value will be cleared in the user entry.- Returns:
- This builder object.
-
getAccountIsFailureLocked
@Nullable public java.lang.Boolean getAccountIsFailureLocked()
Retrieves the value of a flag that indicates whether the user account is currently locked as a result of too many failed authentication attempts.- Returns:
Boolean.TRUEif the user account is locked as a result of too many failed authentication attempts,Boolean.FALSEif the user account is not locked because of too many failed authentication attempts, ornullif this flag was not included in the password policy state JSON object.
-
setAccountIsFailureLocked
@NotNull public ModifiablePasswordPolicyStateJSONBuilder setAccountIsFailureLocked(@Nullable java.lang.Boolean accountIsFailureLocked)
Updates this builder with a new value for the flag indicating whether the user's account should be considered locked as a result of too many failed authentication attempts. Note that the server may reject an attempt to set the value toBoolean.TRUEif failure lockout is not enabled in the server.- Parameters:
accountIsFailureLocked- The new account is failure-locked value to use. It may benullif the value should not be set in this builder (and therefore omitted from any JSON object orModifiablePasswordPolicyStateJSONthat is created).- Returns:
- This builder object.
-
getPasswordExpirationWarnedTime
@Nullable public java.lang.Long getPasswordExpirationWarnedTime()
Retrieves a timestamp that indicates the time the user was first warned about an upcoming password expiration.- Returns:
- A non-negative value that represents the password expiration
warned time in number of milliseconds since the epoch (the same
format used by
System.currentTimeMillis), a negative value if the field was present with a JSON null value (indicating that the user doesn't have an password expiration warned time), ornullif the field was not included in the JSON object.
-
setPasswordExpirationWarnedTime
@NotNull public ModifiablePasswordPolicyStateJSONBuilder setPasswordExpirationWarnedTime(@Nullable java.lang.Long passwordExpirationWarnedTime)
Updates this builder with a new password expiration warned time.- Parameters:
passwordExpirationWarnedTime- The new password expiration warned time value to use. It may be a positive value representing the number of milliseconds since the epoch (the same format used bySystem.currentTimeMillis) for the password expiration warned time, a negative value to indicate that any existing password expiration warned time value should be cleared, ornullif the value should not be set in this builder (and therefore omitted from any JSON object orModifiablePasswordPolicyStateJSONthat is created).- Returns:
- This builder object.
-
setPasswordExpirationWarnedTime
@NotNull public ModifiablePasswordPolicyStateJSONBuilder setPasswordExpirationWarnedTime(@Nullable java.util.Date passwordExpirationWarnedTime)
Updates this builder with a new password expiration warned time.- Parameters:
passwordExpirationWarnedTime- The new password expiration warned time value to use. It may benullif any existing password expiration warned time value should be cleared.- Returns:
- This builder object.
-
clearPasswordExpirationWarnedTime
@NotNull public ModifiablePasswordPolicyStateJSONBuilder clearPasswordExpirationWarnedTime()
Updates this builder so that any existing password expiration warned time value will be cleared in the user entry.- Returns:
- This builder object.
-
getMustChangePassword
@Nullable public java.lang.Boolean getMustChangePassword()
Retrieves the value of a flag that indicates whether the user must change their password before they will be allowed to perform any other operations in the server.- Returns:
Boolean.TRUEif the user must change their password before they will be allowed to perform any other operations in the server,Boolean.FALSEif the user is not required to change their password, ornullif this flag was not included in the password policy state JSON object.
-
setMustChangePassword
@NotNull public ModifiablePasswordPolicyStateJSONBuilder setMustChangePassword(@Nullable java.lang.Boolean mustChangePassword)
Updates this builder with a new value for the flag indicating whether the user must change their password before they will be allowed to perform other operations in the server.- Parameters:
mustChangePassword- The new must change password value to use. It may benullif the value should not be set in this builder (and therefore omitted from any JSON object orModifiablePasswordPolicyStateJSONthat is created).- Returns:
- This builder object.
-
toJSONObject
@NotNull public JSONObject toJSONObject()
Retrieves a JSON object with an encoded representation of the modifiable password policy state created from this builder.- Returns:
- A JSON object with an encoded representation of the modifiable password policy state created from this builder.
-
build
@NotNull public ModifiablePasswordPolicyStateJSON build()
Creates aModifiablePasswordPolicyStateJSONobject from the contents of this builder.- Returns:
- The
ModifiablePasswordPolicyStateJSONobject created from the contents of this builder.
-
toModifyRequest
@NotNull public ModifyRequest toModifyRequest(@NotNull java.lang.String userDN)
Creates a modify request that may be used to update the specified user with the appropriate password policy state changes from this builder.- Parameters:
userDN- The DN of the user whose password policy state should be updated.- Returns:
- A modify request that may be used to update the specified user with the appropriate password policy state changes from this builder.
-
-