edu.vt.middleware.password
Class AbstractDictionaryRule

java.lang.Object
  extended by edu.vt.middleware.password.AbstractDictionaryRule
All Implemented Interfaces:
Rule
Direct Known Subclasses:
DictionaryRule, DictionarySubstringRule

public abstract class AbstractDictionaryRule
extends java.lang.Object
implements Rule

AbstractPasswordDictionaryRule provides common implementation for password dictionary rules.

Version:
$Revision: 1841 $ $Date: 2011-02-25 14:05:47 -0500 (Fri, 25 Feb 2011) $
Author:
Middleware Services

Field Summary
protected  edu.vt.middleware.dictionary.Dictionary dictionary
          dictionary of words.
protected  boolean matchBackwards
          whether to search for dictionary words backwards.
 
Constructor Summary
AbstractDictionaryRule()
           
 
Method Summary
protected abstract  java.lang.String doWordSearch(java.lang.String text)
          Searches the dictionary with the supplied text.
 edu.vt.middleware.dictionary.Dictionary getDictionary()
          This will return the Dictionary used to search for passwords.
 boolean isMatchBackwards()
          Return true if the verify method will search the password for dictionary words spelled backwards as well as forwards.
 void setDictionary(edu.vt.middleware.dictionary.Dictionary dict)
          This will set the Dictionary used to search for passwords.
 void setMatchBackwards(boolean b)
          This causes the verify method to search the password for dictionary words spelled backwards as well as forwards.
 java.lang.String toString()
          This returns a string representation of this object.
 DictionaryRuleResult validate(PasswordData passwordData)
          See Rule.validate(PasswordData).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dictionary

protected edu.vt.middleware.dictionary.Dictionary dictionary
dictionary of words.


matchBackwards

protected boolean matchBackwards
whether to search for dictionary words backwards.

Constructor Detail

AbstractDictionaryRule

public AbstractDictionaryRule()
Method Detail

setDictionary

public void setDictionary(edu.vt.middleware.dictionary.Dictionary dict)
This will set the Dictionary used to search for passwords.

Parameters:
dict - Dictionary to use for searching

getDictionary

public edu.vt.middleware.dictionary.Dictionary getDictionary()
This will return the Dictionary used to search for passwords.

Returns:
Dictionary

setMatchBackwards

public void setMatchBackwards(boolean b)
This causes the verify method to search the password for dictionary words spelled backwards as well as forwards.

Parameters:
b - boolean

isMatchBackwards

public boolean isMatchBackwards()
Return true if the verify method will search the password for dictionary words spelled backwards as well as forwards.

Returns:
boolean

validate

public DictionaryRuleResult validate(PasswordData passwordData)
See Rule.validate(PasswordData).

Specified by:
validate in interface Rule
Parameters:
passwordData - PasswordData to verify (not null).
Returns:
DictionaryRuleResult - details on password verification
Throws:
java.lang.NullPointerException - if the password data is null.

doWordSearch

protected abstract java.lang.String doWordSearch(java.lang.String text)
Searches the dictionary with the supplied text.

Parameters:
text - to search dictionary with
Returns:
String matching word

toString

public java.lang.String toString()
This returns a string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
String


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