/** * Returns a <code>PasswordWarning</code>, or <code>null</code> if no * warnings were present in the supplied <code>passwordPolicy</code>. * * @param passwordPolicy The PasswordPolicy in use * @return The created PasswordWarning */ protected PasswordWarning success( PasswordPolicy passwordPolicy ) { return passwordPolicy == null ? null : PasswordWarningImpl.newWarning( passwordPolicy ); } }
static PasswordWarning newWarning( PasswordPolicy policy ) { PasswordPolicyResponse response = policy.getResponse(); if ( response != null ) { PasswordWarningImpl policyWarning = new PasswordWarningImpl(); policyWarning.timeBeforeExpiration = response.getTimeBeforeExpiration(); policyWarning.graceAuthNsRemaining = response.getGraceAuthNRemaining(); policyWarning.changeAfterReset = response.getPasswordPolicyError() == PasswordPolicyErrorEnum.CHANGE_AFTER_RESET; if ( policyWarning.timeBeforeExpiration >= 0 || policyWarning.graceAuthNsRemaining >= 0 || policyWarning.changeAfterReset ) { // it actually is a warning! return policyWarning; } } return null; }
static PasswordWarning newWarning( PasswordPolicy policy ) { PasswordPolicyResponse response = policy.getResponse(); if ( response != null ) { PasswordWarningImpl policyWarning = new PasswordWarningImpl(); policyWarning.timeBeforeExpiration = response.getTimeBeforeExpiration(); policyWarning.graceAuthNsRemaining = response.getGraceAuthNRemaining(); policyWarning.changeAfterReset = response.getPasswordPolicyError() == PasswordPolicyErrorEnum.CHANGE_AFTER_RESET; if ( policyWarning.timeBeforeExpiration >= 0 || policyWarning.graceAuthNsRemaining >= 0 || policyWarning.changeAfterReset ) { // it actually is a warning! return policyWarning; } } return null; }
/** * Returns a <code>PasswordWarning</code>, or <code>null</code> if no * warnings were present in the supplied <code>passwordPolicy</code>. * * @param passwordPolicy The PasswordPolicy in use * @return The created PasswordWarning */ protected PasswordWarning success( PasswordPolicy passwordPolicy ) { return passwordPolicy == null ? null : PasswordWarningImpl.newWarning( passwordPolicy ); } }
static PasswordWarning newWarning( PasswordPolicy policy ) { PasswordPolicyResponse response = policy.getResponse(); if ( response != null ) { PasswordWarningImpl policyWarning = new PasswordWarningImpl(); policyWarning.timeBeforeExpiration = response.getTimeBeforeExpiration(); policyWarning.graceAuthNsRemaining = response.getGraceAuthNRemaining(); policyWarning.changeAfterReset = response.getPasswordPolicyError() == PasswordPolicyErrorEnum.CHANGE_AFTER_RESET; if ( policyWarning.timeBeforeExpiration >= 0 || policyWarning.graceAuthNsRemaining >= 0 || policyWarning.changeAfterReset ) { // it actually is a warning! return policyWarning; } } return null; }
/** * Returns a <code>PasswordWarning</code>, or <code>null</code> if no * warnings were present in the supplied <code>passwordPolicy</code>. * * @param passwordPolicy The PasswordPolicy in use * @return The created PasswordWarning */ protected PasswordWarning success( PasswordPolicy passwordPolicy ) { return passwordPolicy == null ? null : PasswordWarningImpl.newWarning( passwordPolicy ); } }