public void commit()

in plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/PasswordPolicyDetailsPage.java [759:981]


    public void commit( boolean onSave )
    {
        if ( passwordPolicy != null )
        {
            // Enabled
            passwordPolicy.setEnabled( enabledCheckbox.getSelection() );

            // ID
            passwordPolicy.setPwdId( ServerConfigurationEditorUtils.checkEmptyString( idText.getText() ) );

            // Description
            passwordPolicy
                .setDescription( ServerConfigurationEditorUtils.checkEmptyString( descriptionText.getText() ) );

            // Check Quality
            passwordPolicy.setPwdCheckQuality( getPwdCheckQuality() );

            // Validator
            passwordPolicy
                .setPwdValidator( ServerConfigurationEditorUtils.checkEmptyString( validatorText.getText() ) );

            // Mininum Length
            if ( minimumLengthCheckbox.getSelection() )
            {
                try
                {
                    passwordPolicy.setPwdMinLength( Integer.parseInt( minimumLengthText.getText() ) );
                }
                catch ( NumberFormatException e )
                {
                    passwordPolicy.setPwdMinLength( 0 );
                }
            }
            else
            {
                passwordPolicy.setPwdMinLength( 0 );
            }

            // Maximum Length
            if ( maximumLengthCheckbox.getSelection() )
            {
                try
                {
                    passwordPolicy.setPwdMaxLength( Integer.parseInt( maximumLengthText.getText() ) );
                }
                catch ( NumberFormatException e )
                {
                    passwordPolicy.setPwdMaxLength( 0 );
                }
            }
            else
            {
                passwordPolicy.setPwdMaxLength( 0 );
            }

            // Minimum Age
            try
            {
                passwordPolicy.setPwdMinAge( Integer.parseInt( minimumAgeText.getText() ) );
            }
            catch ( NumberFormatException e )
            {
                passwordPolicy.setPwdMinAge( 0 );
            }

            // Maximum Age
            try
            {
                passwordPolicy.setPwdMaxAge( Integer.parseInt( maximumAgeText.getText() ) );
            }
            catch ( NumberFormatException e )
            {
                passwordPolicy.setPwdMaxAge( 0 );
            }

            // Expire Warning
            if ( expireWarningCheckbox.getSelection() )
            {
                try
                {
                    passwordPolicy.setPwdExpireWarning( Integer.parseInt( expireWarningText.getText() ) );
                }
                catch ( NumberFormatException e )
                {
                    passwordPolicy.setPwdExpireWarning( 0 );
                }
            }
            else
            {
                passwordPolicy.setPwdExpireWarning( 0 );
            }

            // Grace Authentication Limit
            if ( graceAuthenticationLimitCheckbox.getSelection() )
            {
                try
                {
                    passwordPolicy.setPwdGraceAuthNLimit( Integer.parseInt( graceAuthenticationLimitText.getText() ) );
                }
                catch ( NumberFormatException e )
                {
                    passwordPolicy.setPwdGraceAuthNLimit( 0 );
                }
            }
            else
            {
                passwordPolicy.setPwdGraceAuthNLimit( 0 );
            }

            // Grace Expire
            if ( graceExpireCheckbox.getSelection() )
            {
                try
                {
                    passwordPolicy.setPwdGraceExpire( Integer.parseInt( graceExpireText.getText() ) );
                }
                catch ( NumberFormatException e )
                {
                    passwordPolicy.setPwdGraceExpire( 0 );
                }
            }
            else
            {
                passwordPolicy.setPwdGraceExpire( 0 );
            }

            // Must Change
            passwordPolicy.setPwdMustChange( mustChangeCheckbox.getSelection() );

            // Allow User Change
            passwordPolicy.setPwdAllowUserChange( allowUserChangeCheckbox.getSelection() );

            // Safe Modify
            passwordPolicy.setPwdSafeModify( safeModifyCheckbox.getSelection() );

            // Lockout
            passwordPolicy.setPwdLockout( lockoutCheckbox.getSelection() );

            // Lockout Duration
            try
            {
                passwordPolicy.setPwdLockoutDuration( Integer.parseInt( lockoutDurationText.getText() ) );
            }
            catch ( NumberFormatException e )
            {
                passwordPolicy.setPwdLockoutDuration( 0 );
            }

            // Max Failure
            try
            {
                passwordPolicy.setPwdMaxFailure( Integer.parseInt( maxFailureText.getText() ) );
            }
            catch ( NumberFormatException e )
            {
                passwordPolicy.setPwdMaxFailure( 0 );
            }

            // Failure Count Interval
            try
            {
                passwordPolicy.setPwdFailureCountInterval( Integer.parseInt( failureCountIntervalText.getText() ) );
            }
            catch ( NumberFormatException e )
            {
                passwordPolicy.setPwdFailureCountInterval( 0 );
            }

            // Max Idle
            if ( maxIdleCheckbox.getSelection() )
            {
                try
                {
                    passwordPolicy.setPwdMaxIdle( Integer.parseInt( maxIdleText.getText() ) );
                }
                catch ( NumberFormatException e )
                {
                    passwordPolicy.setPwdMaxIdle( 0 );
                }
            }
            else
            {
                passwordPolicy.setPwdMaxIdle( 0 );
            }

            // In History
            if ( inHistoryCheckbox.getSelection() )
            {
                try
                {
                    passwordPolicy.setPwdInHistory( Integer.parseInt( inHistoryText.getText() ) );
                }
                catch ( NumberFormatException e )
                {
                    passwordPolicy.setPwdInHistory( 0 );
                }
            }
            else
            {
                passwordPolicy.setPwdInHistory( 0 );
            }

            // Minimum Delay
            try
            {
                passwordPolicy.setPwdMinDelay( Integer.parseInt( minimumDelayText.getText() ) );
            }
            catch ( NumberFormatException e )
            {
                passwordPolicy.setPwdMinDelay( 0 );
            }

            // Maximum Delay
            try
            {
                passwordPolicy.setPwdMaxDelay( Integer.parseInt( maximumDelayText.getText() ) );
            }
            catch ( NumberFormatException e )
            {
                passwordPolicy.setPwdMaxDelay( 0 );
            }
        }
    }