com.ibm.passwordrules.standard
Class CaseRestricted

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

public class CaseRestricted
extends LexicalRule

This class implements a built-in rule for restricting the case of a password.

See Also:
Serialized Form

Field Summary
static java.lang.String INCOMPATIBLE_CASE_RESTRICTIONS
          Constant representing a message key in a property file
static java.lang.String LOWER_CASE_VIOLATION
          Constant representing a message key in a property file
static java.lang.String UPPER_CASE_VIOLATION
          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
CaseRestricted(int restriction)
          Constructor accepting case restriction parameter.
 
Method Summary
 void constrain(PasswordGenerator generator)
          Constrain the password generator to allowed values.
 int getRestriction()
          Return the case restriction set of this rule.
 boolean join(Rule rule)
          Try to join the specified rule with this one.
 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

UPPER_CASE_VIOLATION

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

See Also:
Constant Field Values

LOWER_CASE_VIOLATION

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

See Also:
Constant Field Values

INCOMPATIBLE_CASE_RESTRICTIONS

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

See Also:
Constant Field Values
Constructor Detail

CaseRestricted

public CaseRestricted(int restriction)
Constructor accepting case restriction parameter.

Parameters:
restriction - One of the following integer constants: UPPER_CASE_ONLY when only upper case characters should be used. LOWER_CASE_ONLY when only lower case characters should be used
Method Detail

getRestriction

public int getRestriction()
Return the case restriction set of this rule.

Returns:
int value representing one of the following integer constants: UPPER_CASE_ONLY, LOWER_CASE_ONLY

constrain

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

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

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
Try to join the specified rule with this one. The more restrictive rule takes precedence.

Parameters:
rule - The rule to be joined with this one.
Returns:
always return true
Throws:
IncompatibleRulesException - Thrown when given rule cannot be joined because it is not compatible.


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.