/** * Creates a new instance of PasswordPolicyDecorator. * * @param codec The LDAP Service to use * @param hasResponse The hasResponse flag */ public PasswordPolicyDecorator( LdapApiService codec, boolean hasResponse ) { super( codec, new PasswordPolicyImpl( hasResponse ) ); }
/** * {@inheritDoc} */ @Override protected void setIntegerValue( int value, Asn1Container container ) { PasswordPolicyContainer ppolicyContainer = ( PasswordPolicyContainer ) container; PasswordPolicyErrorEnum error = PasswordPolicyErrorEnum.get( value ); ppolicyContainer.getPasswordPolicyResponseControl().getResponse().setPasswordPolicyError( error ); ppolicyContainer.setGrammarEndAllowed( true ); } }
/** * Creates a new instance of a PasswordPolicy request Control without any * response data associated with it. * * @param hasResponse A flag set to <tt>true</tt> if the control should have a response */ public PasswordPolicyImpl( boolean hasResponse ) { if ( hasResponse ) { response = new PasswordPolicyResponseImpl(); } else { response = 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; }
/** * * {@inheritDoc} */ @Override public PasswordPolicyResponse getResponse() { return getDecorated().getResponse(); } }
/** * * {@inheritDoc} */ @Override public boolean hasResponse() { return getDecorated().hasResponse(); }
/** * * {@inheritDoc} */ @Override public PasswordPolicyResponse setResponse( boolean hasResponse ) { return getDecorated().setResponse( hasResponse ); }
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; }
/** * {@inheritDoc} */ @Override protected void setIntegerValue( int value, Asn1Container container ) { PasswordPolicyContainer ppolicyContainer = ( PasswordPolicyContainer ) container; PasswordPolicyErrorEnum error = PasswordPolicyErrorEnum.get( value ); ppolicyContainer.getPasswordPolicyResponseControl().getResponse().setPasswordPolicyError( error ); ppolicyContainer.setGrammarEndAllowed( true ); } }
/** * * {@inheritDoc} */ @Override public PasswordPolicyResponse getResponse() { return getDecorated().getResponse(); } }
/** * * {@inheritDoc} */ @Override public void setResponse( PasswordPolicyResponse response ) { getDecorated().setResponse( response ); }
/** * Creates a new instance of PasswordPolicyDecorator. * * @param codec The LDAP Service to use * @param hasResponse The hasResponse flag */ public PasswordPolicyDecorator( LdapApiService codec, boolean hasResponse ) { super( codec, new PasswordPolicyImpl( hasResponse ) ); }
/** * Creates a new instance of a PasswordPolicy request Control without any * response data associated with it. * * @param hasResponse A flag set to <tt>true</tt> if the control should have a response */ public PasswordPolicyImpl( boolean hasResponse ) { if ( hasResponse ) { response = new PasswordPolicyResponseImpl(); } else { response = null; } }
/** * {@inheritDoc} */ @Override protected void setIntegerValue( int value, Asn1Container container ) { PasswordPolicyContainer ppolicyContainer = ( PasswordPolicyContainer ) container; PasswordPolicyErrorEnum error = PasswordPolicyErrorEnum.get( value ); ppolicyContainer.getPasswordPolicyResponseControl().getResponse().setPasswordPolicyError( error ); ppolicyContainer.setGrammarEndAllowed( true ); } }
/** * * {@inheritDoc} */ @Override public PasswordPolicyResponse setResponse( boolean hasResponse ) { return getDecorated().setResponse( hasResponse ); }
/** * Creates a new instance of PasswordPolicyDecorator. * * @param codec The LDAP Service to use */ public PasswordPolicyDecorator( LdapApiService codec ) { super( codec, new PasswordPolicyImpl() ); }
/** * Creates a new instance of a PasswordPolicy request Control without any * response data associated with it. * * @param hasResponse A flag set to <tt>true</tt> if the control should have a response */ public PasswordPolicyImpl( boolean hasResponse ) { if ( hasResponse ) { response = new PasswordPolicyResponseImpl(); } else { response = null; } }
/** * Creates a new instance of PasswordPolicyDecorator. * * @param codec The LDAP Service to use * @param hasResponse The hasResponse flag */ public PasswordPolicyDecorator( LdapApiService codec, boolean hasResponse ) { super( codec, new PasswordPolicyImpl( hasResponse ) ); }
/** * Creates a new instance of PasswordPolicyDecorator. * * @param codec The LDAP Service to use */ public PasswordPolicyDecorator( LdapApiService codec ) { super( codec, new PasswordPolicyImpl() ); }
/** * Creates a new instance of PasswordPolicyDecorator. * * @param codec The LDAP Service to use */ public PasswordPolicyDecorator( LdapApiService codec ) { super( codec, new PasswordPolicyImpl() ); }