Package org.ldaptive.control
Class PasswordPolicyControl
java.lang.Object
org.ldaptive.control.AbstractControl
org.ldaptive.control.AbstractResponseControl
org.ldaptive.control.PasswordPolicyControl
- All Implemented Interfaces:
Control,RequestControl,ResponseControl,Freezable
Request/response control for password policy. See http://tools.ietf.org/html/draft-behera-ldap-password-policy-11.
Control is defined as:
PasswordPolicyResponseValue ::= SEQUENCE {
warning [0] CHOICE {
timeBeforeExpiration [0] INTEGER (0 .. maxInt),
graceAuthNsRemaining [1] INTEGER (0 .. maxInt) } OPTIONAL,
error [1] ENUMERATED {
passwordExpired (0),
accountLocked (1),
changeAfterReset (2),
passwordModNotAllowed (3),
mustSupplyOldPassword (4),
insufficientPasswordQuality (5),
passwordTooShort (6),
passwordTooYoung (7),
passwordInHistory (8),
passwordTooLong (9) } OPTIONAL }
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum for ppolicy errors.private static classParse handler implementation for the error.private static classParse handler implementation for the grace authns remaining.private static classParse handler implementation for the time before expiration.static final classInner class to represent a ppolicy warning.static enumEnum for ppolicy warnings. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate PasswordPolicyControl.ErrorPpolicy error.private static final inthash code seed.static final StringOID of this control.private PasswordPolicyControl.WarningPpolicy warning.Fields inherited from class org.ldaptive.control.AbstractControl
logger -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.PasswordPolicyControl(boolean critical) Creates a new password policy control.Creates a new password policy control.PasswordPolicyControl(PasswordPolicyControl.Error err, boolean critical) Creates a new password policy control.PasswordPolicyControl(PasswordPolicyControl.WarningType type, int value) Creates a new password policy control.PasswordPolicyControl(PasswordPolicyControl.WarningType type, int value, boolean critical) Creates a new password policy control.PasswordPolicyControl(PasswordPolicyControl.WarningType type, int value, PasswordPolicyControl.Error err) Creates a new password policy control.PasswordPolicyControl(PasswordPolicyControl.WarningType type, int value, PasswordPolicyControl.Error err, boolean critical) Creates a new password policy control. -
Method Summary
Modifier and TypeMethodDescriptionvoidInitializes this response control with the supplied BER encoded data.byte[]encode()Provides the BER encoding of this control.booleangetError()Returns the password policy error.Returns the warning.booleanhasError()Returns whether this control has an error set.inthashCode()Returns the hash code for this object.booleanhasValue()Returns whether the control has a value associated with it.booleanReturns whether this control has a warning of the supplied type.toString()Methods inherited from class org.ldaptive.control.AbstractResponseControl
assertMutable, freeze, freezeAndAssertMutable, isFrozenMethods inherited from class org.ldaptive.control.AbstractControl
getCriticality, getOIDMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.ldaptive.control.Control
getCriticality, getOID
-
Field Details
-
OID
OID of this control.- See Also:
-
HASH_CODE_SEED
private static final int HASH_CODE_SEEDhash code seed.- See Also:
-
warning
Ppolicy warning. -
error
Ppolicy error.
-
-
Constructor Details
-
PasswordPolicyControl
public PasswordPolicyControl()Default constructor. -
PasswordPolicyControl
public PasswordPolicyControl(boolean critical) Creates a new password policy control.- Parameters:
critical- whether this control is critical
-
PasswordPolicyControl
Creates a new password policy control.- Parameters:
type- warning typevalue- warning value
-
PasswordPolicyControl
Creates a new password policy control.- Parameters:
err- ppolicy error
-
PasswordPolicyControl
public PasswordPolicyControl(PasswordPolicyControl.WarningType type, int value, PasswordPolicyControl.Error err) Creates a new password policy control.- Parameters:
type- warning typevalue- warning valueerr- ppolicy error
-
PasswordPolicyControl
Creates a new password policy control.- Parameters:
type- warning typevalue- warning valuecritical- whether this control is critical
-
PasswordPolicyControl
Creates a new password policy control.- Parameters:
err- ppolicy errorcritical- whether this control is critical
-
PasswordPolicyControl
public PasswordPolicyControl(PasswordPolicyControl.WarningType type, int value, PasswordPolicyControl.Error err, boolean critical) Creates a new password policy control.- Parameters:
type- warning typevalue- warning valueerr- ppolicy errorcritical- whether this control is critical
-
-
Method Details
-
hasValue
public boolean hasValue()Description copied from interface:RequestControlReturns whether the control has a value associated with it.- Specified by:
hasValuein interfaceRequestControl- Returns:
- whether the control has a value
-
getWarning
Returns the warning.- Returns:
- warning
-
hasWarning
Returns whether this control has a warning of the supplied type.- Parameters:
type- of warning to inspect this control for- Returns:
- whether this control has a warning of the supplied type
-
getError
Returns the password policy error.- Returns:
- password policy error
-
hasError
public boolean hasError()Returns whether this control has an error set.- Returns:
- whether this control has an error set
-
equals
- Overrides:
equalsin classAbstractControl
-
hashCode
public int hashCode()Description copied from class:AbstractControlReturns the hash code for this object.- Specified by:
hashCodein classAbstractControl- Returns:
- hash code
-
toString
- Overrides:
toStringin classAbstractControl
-
encode
public byte[] encode()Description copied from interface:RequestControlProvides the BER encoding of this control.- Specified by:
encodein interfaceRequestControl- Returns:
- BER encoded request control
-
decode
Description copied from interface:ResponseControlInitializes this response control with the supplied BER encoded data.- Specified by:
decodein interfaceResponseControl- Parameters:
encoded- BER encoded response control
-