org.ldaptive.control
Class PasswordPolicyControl

java.lang.Object
  extended by org.ldaptive.control.AbstractControl
      extended by org.ldaptive.control.PasswordPolicyControl
All Implemented Interfaces:
Control, RequestControl, ResponseControl

public class PasswordPolicyControl
extends AbstractControl
implements RequestControl, ResponseControl

Request/response control for password policy. See http://tools.ietf.org/html/draft-behera-ldap-password-policy-10. 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) } OPTIONAL }
 

Version:
$Revision: 2885 $ $Date: 2014-02-05 16:28:49 -0500 (Wed, 05 Feb 2014) $
Author:
Middleware Services

Nested Class Summary
static class PasswordPolicyControl.Error
          Enum for ppolicy errors.
 
Field Summary
static String OID
          OID of this control.
 
Fields inherited from class org.ldaptive.control.AbstractControl
logger
 
Constructor Summary
PasswordPolicyControl()
          Default constructor.
PasswordPolicyControl(boolean critical)
          Creates a new password policy control.
 
Method Summary
 void decode(byte[] berValue)
          Initializes this response control with the supplied BER encoded data.
 byte[] encode()
          Provides the BER encoding of this control.
 PasswordPolicyControl.Error getError()
          Returns the password policy error.
 int getGraceAuthNsRemaining()
          Returns the number of grace authentications remaining.
 int getTimeBeforeExpiration()
          Returns the time before expiration in seconds.
 int hashCode()
          Returns the hash code for this object.
 void setError(PasswordPolicyControl.Error e)
          Sets the password policy error.
 void setGraceAuthNsRemaining(int count)
          Sets the number of grace authentications remaining.
 void setTimeBeforeExpiration(int time)
          Sets the time before expiration in seconds.
 String toString()
          
 
Methods inherited from class org.ldaptive.control.AbstractControl
equals, getCriticality, getOID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ldaptive.control.Control
getCriticality, getOID
 

Field Detail

OID

public static final String OID
OID of this control.

See Also:
Constant Field Values
Constructor Detail

PasswordPolicyControl

public PasswordPolicyControl()
Default constructor.


PasswordPolicyControl

public PasswordPolicyControl(boolean critical)
Creates a new password policy control.

Parameters:
critical - whether this control is critical
Method Detail

getTimeBeforeExpiration

public int getTimeBeforeExpiration()
Returns the time before expiration in seconds.

Returns:
time before expiration

setTimeBeforeExpiration

public void setTimeBeforeExpiration(int time)
Sets the time before expiration in seconds.

Parameters:
time - before expiration

getGraceAuthNsRemaining

public int getGraceAuthNsRemaining()
Returns the number of grace authentications remaining.

Returns:
number of grace authentications remaining

setGraceAuthNsRemaining

public void setGraceAuthNsRemaining(int count)
Sets the number of grace authentications remaining.

Parameters:
count - number of grace authentications remaining

getError

public PasswordPolicyControl.Error getError()
Returns the password policy error.

Returns:
password policy error

setError

public void setError(PasswordPolicyControl.Error e)
Sets the password policy error.

Parameters:
e - password policy error

hashCode

public int hashCode()
Returns the hash code for this object.

Specified by:
hashCode in class AbstractControl
Returns:
hash code

toString

public String toString()

Overrides:
toString in class Object

encode

public byte[] encode()
Provides the BER encoding of this control.

Specified by:
encode in interface RequestControl
Returns:
BER encoded request control

decode

public void decode(byte[] berValue)
Initializes this response control with the supplied BER encoded data.

Specified by:
decode in interface ResponseControl
Parameters:
berValue - BER encoded response control


Copyright © 2003-2015 Virginia Tech. All Rights Reserved.