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

Provide common implementation for keyboard sequence rules.

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

Field Summary
static int DEFAULT_SEQUENCE_LENGTH
          Default length of keyboard sequence, value is 5.
static java.lang.String ERROR_CODE
          Error code for sequence validation failures.
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)
          Returns the sequence of character pairs for which to search.
protected abstract  int getSequenceCount()
          Returns the number of character sequences used in this implementation.
protected  void setSequenceLength(int sl)
          Sets the sequence length.
 java.lang.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 java.lang.String ERROR_CODE
Error code for sequence validation failures.

See Also:
Constant Field Values

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)
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

toString

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

Overrides:
toString in class java.lang.Object
Returns:
string representation

setSequenceLength

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

Parameters:
sl - sequence length

getSequence

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

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

getSequenceCount

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

Returns:
number of character sequences.


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