|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjecteTextReader.authentication.CompoundPolicy
public class CompoundPolicy
This class provides a mechanism by which two or more other PasswordPolicy implementations can be combined using a Boolean AND operation. An object of this class will accept any password that is accepted by all of its component policy implementations.
Two constructors are provided: one that joins together exactly 2 other PasswordPolicy objects, and one that accepts a List of PasswordPolicy objects.
Field Summary | |
---|---|
private java.util.List<PasswordPolicy> |
policies
|
Constructor Summary | |
---|---|
CompoundPolicy(java.util.List<PasswordPolicy> policies)
|
|
CompoundPolicy(PasswordPolicy policy1,
PasswordPolicy policy2)
Constructs a CompoundPolicy that combines two other policy objects. |
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 |
---|
private java.util.List<PasswordPolicy> policies
Constructor Detail |
---|
public CompoundPolicy(PasswordPolicy policy1, PasswordPolicy policy2)
Constructs a CompoundPolicy that combines two other policy objects.
The order that the policies are passed is generally not relevant. The only case in which the order by matter is if one of the policies is more computationally expensive. The first policy passed will be evaluated first if this is of concern to you.
Note that since CompoundPolicy implements PasswordPolicy, either or both of the parameters may themselves be CompoundPolicy objects.
policy1
- the first policy to be evaluatedpolicy2
- the second policy to be evaluatedpublic CompoundPolicy(java.util.List<PasswordPolicy> policies)
Method Detail |
---|
public java.lang.String getDescription()
PasswordPolicy
getDescription
in interface PasswordPolicy
public boolean isValid(java.lang.String password)
PasswordPolicy
isValid
in interface PasswordPolicy
password
- the password to check
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |