*/
public ValidationStatus validate(PasswordValidationQuerySpecification querySpec)
throws PasswordValidationException
{
if (querySpec==null) {
throw new PasswordValidationException("The query spec is null");
}
List idList=querySpec.getIdentifier();
if (idList==null || idList.size()==0) {
return null;
}
String password = querySpec.getCandidatePassword();
for (int i=0;i<idList.size();i++) {
Identifier id=(Identifier)idList.get(i);
String idType = id.getType();
if (myIdType.equalsIgnoreCase(idType)) {
System.out.println("ID match");
String idValue = id.getValue();
System.out.println("value="+idValue);
if (password.indexOf(idValue)!=-1) {
ValidationStatus vs=new ValidationStatus();
try {
vs.setStatusCode(validationStatusCode);
vs.setExplanation(explanation);
vs.setDescription(description);
} catch (EnterpriseFieldException e) {
e.printStackTrace();
throw new PasswordValidationException(e.getMessage());
}
return vs;
}
}
}