|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface needs to be implemented by all standard and custom password rule classes.
Method Summary | |
void |
constrain(PasswordGenerator generator)
Method will constrain the character set in the given password generator to values we know are valid. |
java.lang.String |
getParameter()
Gets the constraining parameter set on a rule object |
boolean |
join(Rule rule)
Try to join the specified rule with this one. |
void |
setParameter(java.lang.String parameter)
Sets the constraining parameter on a rule object |
boolean |
validate(java.lang.String password,
ValidationInfo validationInfo)
Method will validate the given password using given validation info. |
boolean |
validateSafe(java.lang.String password,
ValidationInfo validationInfo)
Method will validate the given password using given validation info. |
Method Detail |
public boolean validate(java.lang.String password, ValidationInfo validationInfo) throws InvalidPasswordException
validationInfo
- contains contextual information about the password being validated.password
- Password to validate.InvalidPasswordException
- thrown when password is invalid.public boolean validateSafe(java.lang.String password, ValidationInfo validationInfo)
validationInfo
- contains contextual information about the password being validated.password
- Password to validate.public void constrain(PasswordGenerator generator)
generator
- password generator, whose character set will be constrained.
NOTE: Constraining a generator only offers a hint. Implementor of a Rule class may choose not
to constrain the generator at all, in which case it may take more iterations
for the generator to come up with a candidate password compliant with the rule.
When constraints are not implemented, IterationsExceededException may be
thrown from the generate method of the PasswordGenerator more often.
Skipping a constraint should be tested first by attempting to generate
a large number of passwords without encountering IterationsExceededException.public boolean join(Rule rule) throws IncompatibleRulesException
rule
- The rule to be joined with this one.IncompatibleRulesException
- Thrown when given rule cannot be joined because
it or its parameter is not compatible.public java.lang.String getParameter()
public void setParameter(java.lang.String parameter)
parameter
- String representing the constraining parameter
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |