/** * {@inheritDoc} */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append( " PasswordPolicyResponse control :\n" ); sb.append( " oid : '" ).append( getOid() ).append( '\n' ); if ( hasResponse() && getResponse().getTimeBeforeExpiration() >= 0 ) { sb.append( " timeBeforeExpiration : '" ).append( getResponse().getTimeBeforeExpiration() ) .append( '\n' ); } else if ( hasResponse() && getResponse().getGraceAuthNRemaining() >= 0 ) { sb.append( " graceAuthNsRemaining : '" ).append( getResponse().getGraceAuthNRemaining() ) .append( '\n' ); } if ( hasResponse() && getResponse().getPasswordPolicyError() != null ) { sb.append( " ppolicyError : '" ).append( getResponse().getPasswordPolicyError().toString() ) .append( '\n' ); } return sb.toString(); }
/** * {@inheritDoc} */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append( " PasswordPolicyResponse control :\n" ); sb.append( " oid : '" ).append( getOid() ).append( '\n' ); if ( hasResponse() && getResponse().getTimeBeforeExpiration() >= 0 ) { sb.append( " timeBeforeExpiration : '" ).append( getResponse().getTimeBeforeExpiration() ) .append( '\n' ); } else if ( hasResponse() && getResponse().getGraceAuthNRemaining() >= 0 ) { sb.append( " graceAuthNsRemaining : '" ).append( getResponse().getGraceAuthNRemaining() ) .append( '\n' ); } if ( hasResponse() && getResponse().getPasswordPolicyError() != null ) { sb.append( " ppolicyError : '" ).append( getResponse().getPasswordPolicyError().toString() ) .append( '\n' ); } return sb.toString(); }
/** * {@inheritDoc} */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append( " PasswordPolicyResponse control :\n" ); sb.append( " oid : '" ).append( getOid() ).append( '\n' ); if ( hasResponse() && getResponse().getTimeBeforeExpiration() >= 0 ) { sb.append( " timeBeforeExpiration : '" ).append( getResponse().getTimeBeforeExpiration() ) .append( '\n' ); } else if ( hasResponse() && getResponse().getGraceAuthNRemaining() >= 0 ) { sb.append( " graceAuthNsRemaining : '" ).append( getResponse().getGraceAuthNRemaining() ) .append( '\n' ); } if ( hasResponse() && getResponse().getPasswordPolicyError() != null ) { sb.append( " ppolicyError : '" ).append( getResponse().getPasswordPolicyError().toString() ) .append( '\n' ); } return sb.toString(); }
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; }
buffer.put( TLV.getBytes( ppolicySeqLength ) ); if ( ( getResponse().getTimeBeforeExpiration() < 0 ) && ( getResponse().getGraceAuthNRemaining() < 0 ) && ( getResponse().getPasswordPolicyError() == null ) ) buffer.put( TLV.getBytes( warningLength ) ); if ( getResponse().getTimeBeforeExpiration() >= 0 ) getResponse().getTimeBeforeExpiration() );
buffer.put( TLV.getBytes( ppolicySeqLength ) ); if ( ( getResponse().getTimeBeforeExpiration() < 0 ) && ( getResponse().getGraceAuthNRemaining() < 0 ) && ( getResponse().getPasswordPolicyError() == null ) ) buffer.put( TLV.getBytes( warningLength ) ); if ( getResponse().getTimeBeforeExpiration() >= 0 ) getResponse().getTimeBeforeExpiration() );
buffer.put( TLV.getBytes( ppolicySeqLength ) ); if ( ( getResponse().getTimeBeforeExpiration() < 0 ) && ( getResponse().getGraceAuthNRemaining() < 0 ) && ( getResponse().getPasswordPolicyError() == null ) ) buffer.put( TLV.getBytes( warningLength ) ); if ( getResponse().getTimeBeforeExpiration() >= 0 ) getResponse().getTimeBeforeExpiration() );
if ( getResponse().getTimeBeforeExpiration() >= 0 ) int timeBeforeExpirationValueLength = BerValue.getNbBytes( getResponse().getTimeBeforeExpiration() ); warningLength = 1 + TLV.getNbBytes( timeBeforeExpirationValueLength ) + timeBeforeExpirationValueLength;
if ( getResponse().getTimeBeforeExpiration() >= 0 ) int timeBeforeExpirationValueLength = BerValue.getNbBytes( getResponse().getTimeBeforeExpiration() ); warningLength = 1 + TLV.getNbBytes( timeBeforeExpirationValueLength ) + timeBeforeExpirationValueLength;
if ( getResponse().getTimeBeforeExpiration() >= 0 ) int timeBeforeExpirationValueLength = BerValue.getNbBytes( getResponse().getTimeBeforeExpiration() ); warningLength = 1 + TLV.getNbBytes( timeBeforeExpirationValueLength ) + timeBeforeExpirationValueLength;
((PasswordPolicyControl) ctl).setTimeBeforeExpiration(ppr.getTimeBeforeExpiration()); ((PasswordPolicyControl) ctl).setGraceAuthNsRemaining(ppr.getGraceAuthNRemaining());
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 ) );