edu.vt.middleware.password
Class AbstractSequenceRule

java.lang.Object
  extended by edu.vt.middleware.password.AbstractSequenceRule
All Implemented Interfaces:
Rule
Direct Known Subclasses:
AlphabeticalSequenceRule, NumericalSequenceRule, QwertySequenceRule

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

AbstractSequenceRule contains functionality common to keyboard sequence rules.

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

Field Summary
static int DEFAULT_SEQUENCE_LENGTH
          Default length of keyboard sequence, value is 5.
static int MINIMUM_SEQUENCE_LENGTH
          Minimum length of keyboard sequence, value is 3.
protected  int sequenceLength
          Number of characters in sequence to match.
protected  boolean wrapSequence
          Whether or not to wrap a sequence when searching for matches.
 
Constructor Summary
AbstractSequenceRule()
           
 
Method Summary
protected abstract  char[][] getSequence(int n)
          Get the sequence of character pairs for which to search.
protected abstract  int getSequenceCount()
          Get the number of character sequences used in this implementation.
protected  void setSequenceLength(int sl)
          Sets the sequence length.
 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
 

Field Detail

DEFAULT_SEQUENCE_LENGTH

public static final int DEFAULT_SEQUENCE_LENGTH
Default length of keyboard sequence, value is 5.

See Also:
Constant Field Values

MINIMUM_SEQUENCE_LENGTH

public static final int MINIMUM_SEQUENCE_LENGTH
Minimum length of keyboard sequence, value is 3.

See Also:
Constant Field Values

sequenceLength

protected int sequenceLength
Number of characters in sequence to match.


wrapSequence

protected boolean wrapSequence
Whether or not to wrap a sequence when searching for matches.

Constructor Detail

AbstractSequenceRule

public AbstractSequenceRule()
Method Detail

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

setSequenceLength

protected void setSequenceLength(int sl)
Sets the sequence length.

Parameters:
sl - int sequence length

getSequence

protected abstract char[][] getSequence(int n)
Get the sequence of character pairs for which to search.

Parameters:
n - int provides support for multiple character sequences that are indexed from 0 to n.
Returns:
char[][] character sequence.

getSequenceCount

protected abstract int getSequenceCount()
Get the number of character sequences used in this implementation.

Returns:
int number of character sequences.


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