edu.vt.middleware.password
Class CharacterCharacteristicsRule

java.lang.Object
  extended by edu.vt.middleware.password.CharacterCharacteristicsRule
All Implemented Interfaces:
Rule

public class CharacterCharacteristicsRule
extends Object
implements Rule

Rule for determining if a password contains the desired mix of character types. In order to meet the criteria of this rule, passwords must meet any number of supplied character rules.

Version:
$Revision: 1930 $ $Date: 2011-04-28 13:06:17 -0400 (Thu, 28 Apr 2011) $
Author:
Middleware Services

Field Summary
static String ERROR_CODE
          Error code for insufficient number of characteristics.
 
Constructor Summary
CharacterCharacteristicsRule()
           
 
Method Summary
protected  Map<String,?> createRuleResultDetailParameters(int success)
          Creates the parameter data for the rule result detail.
 int getNumberOfCharacteristics()
          Returns the number of characteristics which currently must be satisfied in order for a password to meet the requirements of this rule.
 List<CharacterRule> getRules()
          Returns the character rules used by this rule.
 void setNumberOfCharacteristics(int n)
          Sets the number of characteristics which must be satisfied in order for a password to meet the requirements of this rule.
 void setRules(List<CharacterRule> l)
          Sets the character rules used by this rule.
 String toString()
          Returns a string representation of this object.
 RuleResult validate(PasswordData passwordData)
          Validates the supplied password data per the requirements of this rule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ERROR_CODE

public static final String ERROR_CODE
Error code for insufficient number of characteristics.

See Also:
Constant Field Values
Constructor Detail

CharacterCharacteristicsRule

public CharacterCharacteristicsRule()
Method Detail

getRules

public List<CharacterRule> getRules()
Returns the character rules used by this rule.

Returns:
list of character rules

setRules

public void setRules(List<CharacterRule> l)
Sets the character rules used by this rule.

Parameters:
l - list of rules

setNumberOfCharacteristics

public void setNumberOfCharacteristics(int n)
Sets the number of characteristics which must be satisfied in order for a password to meet the requirements of this rule. The default is one. i.e. you may wish to enforce any three of five supplied character rules.

Parameters:
n - number of characteristics to enforce, where n > 0

getNumberOfCharacteristics

public int getNumberOfCharacteristics()
Returns the number of characteristics which currently must be satisfied in order for a password to meet the requirements of this rule.

Returns:
number of characteristics to enforce

validate

public RuleResult validate(PasswordData passwordData)
Validates the supplied password data per the requirements of this rule.

Specified by:
validate in interface Rule
Parameters:
passwordData - to verify (not null).
Returns:
details on password verification

createRuleResultDetailParameters

protected Map<String,?> createRuleResultDetailParameters(int success)
Creates the parameter data for the rule result detail.

Parameters:
success - number of successful rules
Returns:
map of parameter name to value

toString

public String toString()
Returns a string representation of this object.

Overrides:
toString in class Object
Returns:
string representation


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