|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | 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)
Constrain the character set in the given password generator to values allowed by the generator. |
java.lang.String |
getParameter()
Get the parameter set on a custom rule object. |
boolean |
join(Rule rule)
Try to join the specified rule with this one. |
void |
setParameter(java.lang.String parameter)
Set the parameter on a custom rule object. |
boolean |
validate(java.lang.String password,
ValidationInfo validationInfo)
Validate the given password using the given validation info. |
boolean |
validateSafe(java.lang.String password,
ValidationInfo validationInfo)
Validate the given password using given validation info. |
Method Detail |
public boolean validate(java.lang.String password, ValidationInfo validationInfo) throws InvalidPasswordException
password
- Password to validate.validationInfo
- contains contextual information about the password being validated.
InvalidPasswordException
- thrown when password is invalid.public boolean validateSafe(java.lang.String password, ValidationInfo validationInfo)
password
- Password to validate.validationInfo
- contains contextual information about the password being validated.
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 more often
from the generate method of the PasswordGenerator.
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 if the specified rule and
this one cannot be combined because they are mutually exclusive, i.e.
a password cannot satisfy both the rules at the same time. Example if
the given rule specifies that the max length of password should be 5,
and if this rule specifies that the minimum length of password should
be 6, then this function may throw IncompatibleRulesException.public java.lang.String getParameter()
public void setParameter(java.lang.String parameter)
parameter
- String representing the parameter
It may be null if the parameter is not required. Parameter value is rule specific and
its format may differ from one rule implementation to other.
It is up to the rule implementation class to be able to interpret the parameter's meaning.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |