eTextReader.authentication
Class MinimumLengthPolicy

java.lang.Object
  extended by eTextReader.authentication.MinimumLengthPolicy
All Implemented Interfaces:
PasswordPolicy

public class MinimumLengthPolicy
extends java.lang.Object
implements PasswordPolicy

This class implements a password policy that requires a minimum length password to be supplied. It does not enforce any other requirements on the contents of the password

Author:
mcfall

Field Summary
private  int minimumLength
           
 
Constructor Summary
MinimumLengthPolicy(int minimumLength)
          Constructs a MinimumLengthPolicy object that requires passwords to be at least minimumLength characters long
 
Method Summary
 java.lang.String getDescription()
          Retrieves a human-readable description of the rules this policy enforces
 boolean isValid(java.lang.String password)
          Determines whether or not the given password is valid under this policy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

minimumLength

private int minimumLength
Constructor Detail

MinimumLengthPolicy

public MinimumLengthPolicy(int minimumLength)
Constructs a MinimumLengthPolicy object that requires passwords to be at least minimumLength characters long

Parameters:
minimumLength - the minimum length of an acceptable password; value must be > 0 or an illegal argument exception will be thrown
Method Detail

getDescription

public java.lang.String getDescription()
Description copied from interface: PasswordPolicy
Retrieves a human-readable description of the rules this policy enforces

Specified by:
getDescription in interface PasswordPolicy
Returns:
a string describing the policy rules

isValid

public boolean isValid(java.lang.String password)
Description copied from interface: PasswordPolicy
Determines whether or not the given password is valid under this policy

Specified by:
isValid in interface PasswordPolicy
Parameters:
password - the password to check
Returns:
true if the given password is valid, false otherwise