public void validate(String userId, String password1, String password2)
throws PortalException, SystemException {
if (!password1.equals(password2)) {
throw new UserPasswordException(
UserPasswordException.PASSWORDS_DO_NOT_MATCH);
}
else if (!PwdToolkitUtil.validate(password1) ||
!PwdToolkitUtil.validate(password2)) {
throw new UserPasswordException(
UserPasswordException.PASSWORD_INVALID);
}
else if (!PasswordTrackerLocalManagerUtil.isValidPassword(
userId, password1)) {
throw new UserPasswordException(
UserPasswordException.PASSWORD_ALREADY_USED);
}
}