/** * * {@inheritDoc} */ @Override public PasswordPolicyResponse getResponse() { return getDecorated().getResponse(); } }
/** * * {@inheritDoc} */ @Override public PasswordPolicyResponse getResponse() { return getDecorated().getResponse(); } }
/** * * {@inheritDoc} */ @Override public PasswordPolicyResponse getResponse() { return getDecorated().getResponse(); } }
/** * Returns an exception to be thrown in the case of a non SUCCESS * <code>resultCode</code>. * * @param resultResponse The result response * @param passwordPolicy The password policy in use * @param resultCode The result * @return The created PasswordException */ protected PasswordException fail( ResultResponse resultResponse, PasswordPolicy passwordPolicy, ResultCodeEnum resultCode ) { PasswordException exception = new PasswordException(); exception.setResultCode( resultCode ); if ( passwordPolicy != null && passwordPolicy.getResponse() != null && passwordPolicy.getResponse().getPasswordPolicyError() != null ) { exception.setPasswordPolicyError( passwordPolicy.getResponse().getPasswordPolicyError() ); } return exception; }
/** * Returns an exception to be thrown in the case of a non SUCCESS * <code>resultCode</code>. * * @param resultResponse The result response * @param passwordPolicy The password policy in use * @param resultCode The result * @return The created PasswordException */ protected PasswordException fail( ResultResponse resultResponse, PasswordPolicy passwordPolicy, ResultCodeEnum resultCode ) { PasswordException exception = new PasswordException(); exception.setResultCode( resultCode ); if ( passwordPolicy != null && passwordPolicy.getResponse() != null && passwordPolicy.getResponse().getPasswordPolicyError() != null ) { exception.setPasswordPolicyError( passwordPolicy.getResponse().getPasswordPolicyError() ); } return exception; }
/** * Returns an exception to be thrown in the case of a non SUCCESS * <code>resultCode</code>. * * @param resultResponse The result response * @param passwordPolicy The password policy in use * @param resultCode The result * @return The created PasswordException */ protected PasswordException fail( ResultResponse resultResponse, PasswordPolicy passwordPolicy, ResultCodeEnum resultCode ) { PasswordException exception = new PasswordException(); exception.setResultCode( resultCode ); if ( passwordPolicy != null && passwordPolicy.getResponse() != null && passwordPolicy.getResponse().getPasswordPolicyError() != null ) { exception.setPasswordPolicyError( passwordPolicy.getResponse().getPasswordPolicyError() ); } return exception; }
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; }
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; }
if ( respCtrl.getResponse() != null ) if ( respCtrl.getResponse().getTimeBeforeExpiration() > 0 ) pwMsg.setExpirationSeconds( respCtrl.getResponse().getTimeBeforeExpiration() ); pwMsg.setWarning( new ObjectFactory().createWarning( GlobalPwMsgIds .PASSWORD_EXPIRATION_WARNING, "PASSWORD WILL EXPIRE", Warning.Type.PASSWORD ) ); if ( respCtrl.getResponse().getGraceAuthNRemaining() > 0 ) pwMsg.setGraceLogins( respCtrl.getResponse().getGraceAuthNRemaining() ); pwMsg.setWarning( new ObjectFactory().createWarning( GlobalPwMsgIds.PASSWORD_GRACE_WARNING, "PASSWORD IN GRACE", Warning.Type.PASSWORD ) ); if ( respCtrl.getResponse().getPasswordPolicyError() != null ) switch ( respCtrl.getResponse().getPasswordPolicyError() )
ctl = new PasswordPolicyControl(c.isCritical()); final PasswordPolicyResponse ppr = c.getResponse(); ((PasswordPolicyControl) ctl).setTimeBeforeExpiration(ppr.getTimeBeforeExpiration()); ((PasswordPolicyControl) ctl).setGraceAuthNsRemaining(ppr.getGraceAuthNRemaining());