com.ibm.passwordrules.standard
Class MinLengthConstraint

java.lang.Object
  |
  +--com.ibm.passwordrules.LexicalRule
        |
        +--com.ibm.passwordrules.standard.MinLengthConstraint
All Implemented Interfaces:
java.lang.Cloneable, Rule, java.io.Serializable

public class MinLengthConstraint
extends LexicalRule

This class implements built-in rule for restricting the minimum number of characters in a password.

See Also:
Serialized Form

Field Summary
static java.lang.String TOO_SHORT
          Constant representing a message key in a property file
 
Fields inherited from class com.ibm.passwordrules.LexicalRule
DEFAULT_MAX_SEQUENTIAL_CHARACTERS, LOWER_CASE_ONLY, UPPER_CASE_ONLY
 
Constructor Summary
MinLengthConstraint()
          Default constructor.
MinLengthConstraint(int min)
          Constructor accepting int parameter representing minimum password length.
 
Method Summary
 void constrain(PasswordGenerator generator)
          Constrain the password generator to the allowed values.
 int getMin()
          Return minimum value of the length constraint.
 boolean join(Rule rule)
          Method tries to join the specified rule with one defined by this object.
 boolean validate(java.lang.String password, ValidationInfo validationInfo)
          Validate the given password using the given validation info.
 
Methods inherited from class com.ibm.passwordrules.LexicalRule
getParameter, setParameter, validateSafe
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOO_SHORT

public static final java.lang.String TOO_SHORT
Constant representing a message key in a property file

See Also:
Constant Field Values
Constructor Detail

MinLengthConstraint

public MinLengthConstraint()
Default constructor.


MinLengthConstraint

public MinLengthConstraint(int min)
Constructor accepting int parameter representing minimum password length.

Parameters:
min - int value representing minimum password length.
Method Detail

getMin

public int getMin()
Return minimum value of the length constraint.

Returns:
int representing minimum value of the length constraint.

constrain

public void constrain(PasswordGenerator generator)
Constrain the password generator to the allowed values.

Specified by:
constrain in interface Rule
Overrides:
constrain in class LexicalRule
Parameters:
generator - including a character template to constrain.

validate

public boolean validate(java.lang.String password,
                        ValidationInfo validationInfo)
                 throws InvalidPasswordException
Validate the given password using the given validation info.

Parameters:
validationInfo - contains contextual information about the password being validated.
password - Password to validate.
Returns:
always return true
Throws:
InvalidPasswordException - thrown when password is invalid.

join

public boolean join(Rule rule)
             throws IncompatibleRulesException
Method tries to join the specified rule with one defined by this object. The more restrictive rule takes precedence.

Parameters:
rule - The rule to join
Returns:
True if the rule was successfuly joined, false otherwise.
Throws:
IncompatibleRulesException - thrown when two or more incompatible password rules are used.


IBM Tivoli Identity Manager 4.6
© Copyright International Business Machines Corporation 2005. All rights reserved. US Government Users Restricted Rights Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.