com.ibm.passwordrules
Interface PasswordGenerator

All Known Implementing Classes:
StandardGenerator

public interface PasswordGenerator

Interface which needs to be implemented by all custom password generators.

Author:
mbraksator

Field Summary
static int LAST_CHARACTER_INDEX
           
 
Method Summary
 void addChars(char[] list)
          Method called by classes implementing Rule interface to constrain the set of characters to be used by the password generator.
 void allLowerCase()
          Method called by classes implementing Rule interface to constrain the set of characters to be used by the password generator.
 void allUpperCase()
          Method called by classes implementing Rule interface to constrain the set of characters to be used by the password generator.
 java.lang.String generate()
          Method will generate a string containing a password.
 void initialize(java.lang.String parameter)
          Method will be called once immediately after the generator instance is created.
 void removeChars(char[] charList)
          Method called by classes implementing Rule interface to constrain the set of characters to be used by the password generator.
 void setCharListAt(char[] charList, int startIndex, int endIndex)
          Method called by classes implementing Rule interface to constrain the set of characters to be used by the password generator.
 void setLength(int length)
          Method called by classes implementing Rule interface to constrain the set of characters to be used by the password generator.
 

Field Detail

LAST_CHARACTER_INDEX

public static final int LAST_CHARACTER_INDEX
Method Detail

generate

public java.lang.String generate()
Method will generate a string containing a password.
Returns:
password

setLength

public void setLength(int length)
Method called by classes implementing Rule interface to constrain the set of characters to be used by the password generator.
Parameters:
length - minimum requested length of password. If max specified: effective min will be equal to max. If min specified and min < default length of the generator: effective min will be equal to default length.

addChars

public void addChars(char[] list)
Method called by classes implementing Rule interface to constrain the set of characters to be used by the password generator.
Parameters:
list - of characters of which at least one must be included in the generated password.

removeChars

public void removeChars(char[] charList)
Method called by classes implementing Rule interface to constrain the set of characters to be used by the password generator.
Parameters:
list - of characters none of which may be included in the generated password.

allUpperCase

public void allUpperCase()
Method called by classes implementing Rule interface to constrain the set of characters to be used by the password generator. Method will ensure that all characters in the generated password will be upper case.

allLowerCase

public void allLowerCase()
Method called by classes implementing Rule interface to constrain the set of characters to be used by the password generator. Method will ensure that all characters in the generated password will be lower case.

setCharListAt

public void setCharListAt(char[] charList,
                          int startIndex,
                          int endIndex)
Method called by classes implementing Rule interface to constrain the set of characters to be used by the password generator.
Parameters:
charList - list of characters to set
startIndex - start index of the character in the generated password to choose one of the given set of characters from.
endIndex - last index of the character in the generated password to choose one of the given set of characters from.

initialize

public void initialize(java.lang.String parameter)
Method will be called once immediately after the generator instance is created.
Parameters:
parameter - - any text data which might be used in initializing the generator