edu.vt.middleware.password
Class UsernameRule

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

public class UsernameRule
extends java.lang.Object
implements Rule

UsernameRule contains methods for determining if a password contains the username associated with that password.

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

Constructor Summary
UsernameRule()
          This creates a new UsernameRule.
UsernameRule(boolean mb, boolean ic)
          This will create a new UsernameRule with the supplied matchBackwards and ignoreCase settings.
 
Method Summary
 boolean isIgnoreCase()
          Get the value of the ignoreCase property.
 boolean isMatchBackwards()
          Get the value of the matchBackwards property.
 void setIgnoreCase(boolean b)
          This causes the verify method to ignore case when searching the for a username.
 void setMatchBackwards(boolean b)
          This causes the verify method to search the password for the username spelled backwards as well as forwards.
 java.lang.String toString()
          This returns a string representation of this object.
 RuleResult validate(PasswordData passwordData)
          This returns whether or not the supplied password data meets the requirements of this rule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UsernameRule

public UsernameRule()
This creates a new UsernameRule.


UsernameRule

public UsernameRule(boolean mb,
                    boolean ic)
This will create a new UsernameRule with the supplied matchBackwards and ignoreCase settings.

Parameters:
mb - boolean whether to match backwards
ic - boolean whether to ignore case
Method Detail

setMatchBackwards

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

Parameters:
b - boolean

isMatchBackwards

public boolean isMatchBackwards()
Get the value of the matchBackwards property.

Returns:
boolean

setIgnoreCase

public void setIgnoreCase(boolean b)
This causes the verify method to ignore case when searching the for a username.

Parameters:
b - boolean

isIgnoreCase

public boolean isIgnoreCase()
Get the value of the ignoreCase property.

Returns:
boolean

validate

public RuleResult validate(PasswordData passwordData)
This returns whether or not the supplied password data meets the requirements of this rule.

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

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.