Package org.apache.directory.studio.apacheds.configuration.model.v151

Examples of org.apache.directory.studio.apacheds.configuration.model.v151.ServerConfigurationV151


        upButton.setEnabled( !selection.isEmpty() );
        downButton.setEnabled( !selection.isEmpty() );
        if ( !selection.isEmpty() )
        {
            Interceptor interceptor = ( Interceptor ) selection.getFirstElement();
            upButton.setEnabled( interceptors.indexOf( interceptor ) != 0 );
            downButton.setEnabled( interceptors.indexOf( interceptor ) != ( interceptors.size() - 1 ) );
        }
    }
View Full Code Here


        addButton.addSelectionListener( new SelectionAdapter()
        {
            public void widgetSelected( SelectionEvent e )
            {
                Interceptor newInterceptor = new Interceptor( getNewName() );
                interceptors.add( newInterceptor );
                viewer.refresh();
                viewer.setSelection( new StructuredSelection( newInterceptor ) );
                setEditorDirty();
            }
        } );

        deleteButton.addSelectionListener( new SelectionAdapter()
        {
            public void widgetSelected( SelectionEvent e )
            {
                StructuredSelection selection = ( StructuredSelection ) viewer.getSelection();
                if ( !selection.isEmpty() )
                {
                    Interceptor interceptor = ( Interceptor ) selection.getFirstElement();

                    interceptors.remove( interceptor );
                    viewer.refresh();
                    setEditorDirty();
                }
            }
        } );

        upButton.addSelectionListener( new SelectionAdapter()
        {
            public void widgetSelected( SelectionEvent e )
            {
                StructuredSelection selection = ( StructuredSelection ) viewer.getSelection();
                if ( !selection.isEmpty() )
                {
                    Interceptor interceptor = ( Interceptor ) selection.getFirstElement();

                    int index = interceptors.indexOf( interceptor );
                    if ( index > 0 )
                    {
                        Interceptor interceptorBefore = interceptors.get( index - 1 );
                        if ( interceptorBefore != null )
                        {
                            interceptors.set( index - 1, interceptor );
                            interceptors.set( index, interceptorBefore );

                            viewer.refresh();
                            setEditorDirty();
                            enableDisableUpDownButtons();
                        }
                    }
                }
            }
        } );

        downButton.addSelectionListener( new SelectionAdapter()
        {
            public void widgetSelected( SelectionEvent e )
            {
                StructuredSelection selection = ( StructuredSelection ) viewer.getSelection();
                if ( !selection.isEmpty() )
                {
                    Interceptor interceptor = ( Interceptor ) selection.getFirstElement();

                    int index = interceptors.indexOf( interceptor );
                    if ( index < ( interceptors.size() - 1 ) )
                    {
                        Interceptor interceptorAfter = interceptors.get( index + 1 );
                        if ( interceptorAfter != null )
                        {
                            interceptors.set( index + 1, interceptor );
                            interceptors.set( index, interceptorAfter );
View Full Code Here

        upButton.setEnabled( !selection.isEmpty() );
        downButton.setEnabled( !selection.isEmpty() );
        if ( !selection.isEmpty() )
        {
            Interceptor interceptor = ( Interceptor ) selection.getFirstElement();
            upButton.setEnabled( interceptors.indexOf( interceptor ) != 0 );
            downButton.setEnabled( interceptors.indexOf( interceptor ) != ( interceptors.size() - 1 ) );
        }
    }
View Full Code Here

                deleteButton.setEnabled( !event.getSelection().isEmpty() );
                StructuredSelection selection = ( StructuredSelection ) viewer.getSelection();
                if ( !selection.isEmpty() )
                {
                    Partition partition = ( Partition ) selection.getFirstElement();
                    if ( partition.isSystemPartition() )
                    {
                        deleteButton.setEnabled( false );
                    }
                }
            }
        } );

        addButton.addSelectionListener( new SelectionAdapter()
        {
            public void widgetSelected( SelectionEvent e )
            {
                Partition newPartition = new Partition( getNewId() );

                // Default values
                newPartition.setCacheSize( 100 );
                newPartition.setEnableOptimizer( true );
                newPartition.setSynchronizationOnWrite( true );
                List<IndexedAttribute> indexedAttributes = new ArrayList<IndexedAttribute>();
                indexedAttributes.add( new IndexedAttribute( "1.3.6.1.4.1.18060.0.4.1.2.1", 100 ) ); //$NON-NLS-1$
                indexedAttributes.add( new IndexedAttribute( "1.3.6.1.4.1.18060.0.4.1.2.2", 100 ) ); //$NON-NLS-1$
                indexedAttributes.add( new IndexedAttribute( "1.3.6.1.4.1.18060.0.4.1.2.3", 100 ) ); //$NON-NLS-1$
                indexedAttributes.add( new IndexedAttribute( "1.3.6.1.4.1.18060.0.4.1.2.4", 100 ) ); //$NON-NLS-1$
                indexedAttributes.add( new IndexedAttribute( "1.3.6.1.4.1.18060.0.4.1.2.5", 10 ) ); //$NON-NLS-1$
                indexedAttributes.add( new IndexedAttribute( "1.3.6.1.4.1.18060.0.4.1.2.6", 10 ) ); //$NON-NLS-1$
                indexedAttributes.add( new IndexedAttribute( "1.3.6.1.4.1.18060.0.4.1.2.7", 10 ) ); //$NON-NLS-1$
                indexedAttributes.add( new IndexedAttribute( "dc", 100 ) ); //$NON-NLS-1$
                indexedAttributes.add( new IndexedAttribute( "ou", 100 ) ); //$NON-NLS-1$
                indexedAttributes.add( new IndexedAttribute( "krb5PrincipalName", 100 ) ); //$NON-NLS-1$
                indexedAttributes.add( new IndexedAttribute( "uid", 100 ) ); //$NON-NLS-1$
                indexedAttributes.add( new IndexedAttribute( "objectClass", 100 ) ); //$NON-NLS-1$
                newPartition.setIndexedAttributes( indexedAttributes );

                partitions.add( newPartition );
                viewer.refresh();
                viewer.setSelection( new StructuredSelection( newPartition ) );
                setEditorDirty();
            }
        } );

        deleteButton.addSelectionListener( new SelectionAdapter()
        {
            public void widgetSelected( SelectionEvent e )
            {
                StructuredSelection selection = ( StructuredSelection ) viewer.getSelection();
                if ( !selection.isEmpty() )
                {
                    Partition partition = ( Partition ) selection.getFirstElement();
                    if ( !partition.isSystemPartition() )
                    {
                        partitions.remove( partition );
                        viewer.refresh();
                        setEditorDirty();
                    }
View Full Code Here

                deleteButton.setEnabled( !event.getSelection().isEmpty() );
                StructuredSelection selection = ( StructuredSelection ) viewer.getSelection();
                if ( !selection.isEmpty() )
                {
                    Partition partition = ( Partition ) selection.getFirstElement();
                    if ( partition.isSystemPartition() )
                    {
                        deleteButton.setEnabled( false );
                    }
                }
            }
        } );

        addButton.addSelectionListener( new SelectionAdapter()
        {
            public void widgetSelected( SelectionEvent e )
            {
                Partition newPartition = new Partition( getNewId() );

                // Default values
                newPartition.setCacheSize( 100 );
                newPartition.setEnableOptimizer( true );
                newPartition.setSynchronizationOnWrite( true );
                List<IndexedAttribute> indexedAttributes = new ArrayList<IndexedAttribute>();
                indexedAttributes.add( new IndexedAttribute( "1.3.6.1.4.1.18060.0.4.1.2.1", 100 ) ); //$NON-NLS-1$
                indexedAttributes.add( new IndexedAttribute( "1.3.6.1.4.1.18060.0.4.1.2.2", 100 ) ); //$NON-NLS-1$
                indexedAttributes.add( new IndexedAttribute( "1.3.6.1.4.1.18060.0.4.1.2.3", 100 ) ); //$NON-NLS-1$
                indexedAttributes.add( new IndexedAttribute( "1.3.6.1.4.1.18060.0.4.1.2.4", 100 ) ); //$NON-NLS-1$
                indexedAttributes.add( new IndexedAttribute( "1.3.6.1.4.1.18060.0.4.1.2.5", 10 ) ); //$NON-NLS-1$
                indexedAttributes.add( new IndexedAttribute( "1.3.6.1.4.1.18060.0.4.1.2.6", 10 ) ); //$NON-NLS-1$
                indexedAttributes.add( new IndexedAttribute( "1.3.6.1.4.1.18060.0.4.1.2.7", 10 ) ); //$NON-NLS-1$
                indexedAttributes.add( new IndexedAttribute( "dc", 100 ) ); //$NON-NLS-1$
                indexedAttributes.add( new IndexedAttribute( "ou", 100 ) ); //$NON-NLS-1$
                indexedAttributes.add( new IndexedAttribute( "krb5PrincipalName", 100 ) ); //$NON-NLS-1$
                indexedAttributes.add( new IndexedAttribute( "uid", 100 ) ); //$NON-NLS-1$
                indexedAttributes.add( new IndexedAttribute( "objectClass", 100 ) ); //$NON-NLS-1$
                newPartition.setIndexedAttributes( indexedAttributes );

                partitions.add( newPartition );
                viewer.refresh();
                viewer.setSelection( new StructuredSelection( newPartition ) );
                setEditorDirty();
            }
        } );

        deleteButton.addSelectionListener( new SelectionAdapter()
        {
            public void widgetSelected( SelectionEvent e )
            {
                StructuredSelection selection = ( StructuredSelection ) viewer.getSelection();
                if ( !selection.isEmpty() )
                {
                    Partition partition = ( Partition ) selection.getFirstElement();
                    if ( !partition.isSystemPartition() )
                    {
                        partitions.remove( partition );
                        viewer.refresh();
                        setEditorDirty();
                    }
View Full Code Here

                deleteButton.setEnabled( !event.getSelection().isEmpty() );
                StructuredSelection selection = ( StructuredSelection ) viewer.getSelection();
                if ( !selection.isEmpty() )
                {
                    Partition partition = ( Partition ) selection.getFirstElement();
                    if ( partition.isSystemPartition() )
                    {
                        deleteButton.setEnabled( false );
                    }
                }
            }
        } );

        addButton.addSelectionListener( new SelectionAdapter()
        {
            public void widgetSelected( SelectionEvent e )
            {
                Partition newPartition = new Partition( getNewId() );
                partitions.add( newPartition );
                viewer.refresh();
                viewer.setSelection( new StructuredSelection( newPartition ) );
                setEditorDirty();
            }
        } );

        deleteButton.addSelectionListener( new SelectionAdapter()
        {
            public void widgetSelected( SelectionEvent e )
            {
                StructuredSelection selection = ( StructuredSelection ) viewer.getSelection();
                if ( !selection.isEmpty() )
                {
                    Partition partition = ( Partition ) selection.getFirstElement();
                    if ( !partition.isSystemPartition() )
                    {
                        partitions.remove( partition );
                        viewer.refresh();
                        setEditorDirty();
                    }
View Full Code Here

    /**
     * Initializes the page with the Editor input.
     */
    private void initFromInput()
    {
        ServerConfigurationV151 configuration = ( ServerConfigurationV151 ) ( ( ServerConfigurationEditor ) getEditor() )
            .getServerConfiguration();

        // Principal
        String principal = configuration.getPrincipal();
        if ( principal != null )
        {
            principalText.setText( principal );
        }

        // Password
        String password = configuration.getPassword();
        if ( password != null )
        {
            passwordText.setText( password );
        }

        // Binary Attributes
        binaryAttributes = configuration.getBinaryAttributes();
        binaryAttributesTableViewer.setInput( binaryAttributes );

        // LDAP Protocol
        enableLdapCheckbox.setSelection( configuration.isEnableLdap() );
        ldapPortText.setEnabled( enableLdapCheckbox.getSelection() );
        ldapPortText.setText( "" + configuration.getLdapPort() );

        // LDAPS Protocol
        enableLdapsCheckbox.setSelection( configuration.isEnableLdaps() );
        ldapsPortText.setEnabled( enableLdapsCheckbox.getSelection() );
        ldapsPortText.setText( "" + configuration.getLdapsPort() );

        // Kerberos Protocol
        enableKerberosCheckbox.setSelection( configuration.isEnableKerberos() );
        kerberosPortText.setEnabled( enableKerberosCheckbox.getSelection() );
        kerberosPortText.setText( "" + configuration.getKerberosPort() );

        // NTP Protocol
        enableNtpCheckbox.setSelection( configuration.isEnableNtp() );
        ntpPortText.setEnabled( enableNtpCheckbox.getSelection() );
        ntpPortText.setText( "" + configuration.getNtpPort() );

        // DNS Protocol
        enableDnsCheckbox.setSelection( configuration.isEnableDns() );
        dnsPortText.setEnabled( enableDnsCheckbox.getSelection() );
        dnsPortText.setText( "" + configuration.getDnsPort() );

        // Change Password Protocol
        enableChangePasswordCheckbox.setSelection( configuration.isEnableChangePassword() );
        changePasswordPortText.setEnabled( enableChangePasswordCheckbox.getSelection() );
        changePasswordPortText.setText( "" + configuration.getChangePasswordPort() );

        // Max Time Limit
        maxTimeLimitText.setText( "" + configuration.getMaxTimeLimit() );

        // Max Size Limit
        maxSizeLimitText.setText( "" + configuration.getMaxSizeLimit() );

        // Synchronization Period
        synchPeriodText.setText( "" + configuration.getSynchronizationPeriod() );

        // Max Threads
        maxThreadsText.setText( "" + configuration.getMaxThreads() );

        supportedMechanismsTableViewer.setCheckedElements( configuration.getSupportedMechanisms().toArray() );

        // Allow Anonymous Access
        allowAnonymousAccessCheckbox.setSelection( configuration.isAllowAnonymousAccess() );

        // Enable Access Control
        enableAccesControlCheckbox.setSelection( configuration.isEnableAccessControl() );

        // Denormalize Op Attr
        denormalizeOpAttrCheckbox.setSelection( configuration.isDenormalizeOpAttr() );
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.directory.studio.apacheds.configuration.editor.SavableWizardPage#save()
     */
    public void save()
    {
        ServerConfigurationV151 configuration = ( ServerConfigurationV151 ) ( ( ServerConfigurationEditor ) getEditor() )
            .getServerConfiguration();

        configuration.setPrincipal( principalText.getText() );
        configuration.setPassword( passwordText.getText() );

        configuration.setBinaryAttributes( binaryAttributes );

        configuration.setEnableLdap( enableLdapCheckbox.getSelection() );
        configuration.setLdapPort( Integer.parseInt( ldapPortText.getText() ) );
        configuration.setEnableLdaps( enableLdapsCheckbox.getSelection() );
        configuration.setLdapsPort( Integer.parseInt( ldapsPortText.getText() ) );
        configuration.setEnableKerberos( enableKerberosCheckbox.getSelection() );
        configuration.setKerberosPort( Integer.parseInt( kerberosPortText.getText() ) );
        configuration.setEnableNtp( enableNtpCheckbox.getSelection() );
        configuration.setNtpPort( Integer.parseInt( ntpPortText.getText() ) );
        configuration.setEnableDns( enableDnsCheckbox.getSelection() );
        configuration.setDnsPort( Integer.parseInt( dnsPortText.getText() ) );
        configuration.setEnableChangePassword( enableChangePasswordCheckbox.getSelection() );
        configuration.setChangePasswordPort( Integer.parseInt( changePasswordPortText.getText() ) );

        configuration.setMaxTimeLimit( Integer.parseInt( maxTimeLimitText.getText() ) );
        configuration.setMaxSizeLimit( Integer.parseInt( maxSizeLimitText.getText() ) );
        configuration.setSynchronizationPeriod( Long.parseLong( synchPeriodText.getText() ) );
        configuration.setMaxThreads( Integer.parseInt( maxThreadsText.getText() ) );

        List<String> supportedMechanismsList = new ArrayList<String>();
        for ( Object supportedMechanism : supportedMechanismsTableViewer.getCheckedElements() )
        {
            supportedMechanismsList.add( ( String ) supportedMechanism );
        }
        configuration.setSupportedMechanisms( supportedMechanismsList );

        configuration.setAllowAnonymousAccess( allowAnonymousAccessCheckbox.getSelection() );
        configuration.setEnableAccessControl( enableAccesControlCheckbox.getSelection() );
        configuration.setDenormalizeOpAttr( denormalizeOpAttrCheckbox.getSelection() );
    }
View Full Code Here

    /**
     * Initializes the page with the Editor input.
     */
    private void initFromInput()
    {
        ServerConfigurationV151 configuration = ( ServerConfigurationV151 ) ( ( ServerConfigurationEditor ) getEditor() )
            .getServerConfiguration();

        // Principal
        String principal = configuration.getPrincipal();
        if ( principal != null )
        {
            principalText.setText( principal );
        }

        // Password
        String password = configuration.getPassword();
        if ( password != null )
        {
            passwordText.setText( password );
        }

        // Binary Attributes
        binaryAttributes = configuration.getBinaryAttributes();
        binaryAttributesTableViewer.setInput( binaryAttributes );

        // LDAP Protocol
        enableLdapCheckbox.setSelection( configuration.isEnableLdap() );
        ldapPortText.setEnabled( enableLdapCheckbox.getSelection() );
        ldapPortText.setText( "" + configuration.getLdapPort() ); //$NON-NLS-1$

        // LDAPS Protocol
        enableLdapsCheckbox.setSelection( configuration.isEnableLdaps() );
        ldapsPortText.setEnabled( enableLdapsCheckbox.getSelection() );
        ldapsPortText.setText( "" + configuration.getLdapsPort() ); //$NON-NLS-1$

        // Kerberos Protocol
        enableKerberosCheckbox.setSelection( configuration.isEnableKerberos() );
        kerberosPortText.setEnabled( enableKerberosCheckbox.getSelection() );
        kerberosPortText.setText( "" + configuration.getKerberosPort() ); //$NON-NLS-1$

        // NTP Protocol
        enableNtpCheckbox.setSelection( configuration.isEnableNtp() );
        ntpPortText.setEnabled( enableNtpCheckbox.getSelection() );
        ntpPortText.setText( "" + configuration.getNtpPort() ); //$NON-NLS-1$

        // DNS Protocol
        enableDnsCheckbox.setSelection( configuration.isEnableDns() );
        dnsPortText.setEnabled( enableDnsCheckbox.getSelection() );
        dnsPortText.setText( "" + configuration.getDnsPort() ); //$NON-NLS-1$

        // Change Password Protocol
        enableChangePasswordCheckbox.setSelection( configuration.isEnableChangePassword() );
        changePasswordPortText.setEnabled( enableChangePasswordCheckbox.getSelection() );
        changePasswordPortText.setText( "" + configuration.getChangePasswordPort() ); //$NON-NLS-1$

        // Max Time Limit
        maxTimeLimitText.setText( "" + configuration.getMaxTimeLimit() ); //$NON-NLS-1$

        // Max Size Limit
        maxSizeLimitText.setText( "" + configuration.getMaxSizeLimit() ); //$NON-NLS-1$

        // Synchronization Period
        synchPeriodText.setText( "" + configuration.getSynchronizationPeriod() ); //$NON-NLS-1$

        // Max Threads
        maxThreadsText.setText( "" + configuration.getMaxThreads() ); //$NON-NLS-1$

        supportedMechanismsTableViewer.setCheckedElements( configuration.getSupportedMechanisms().toArray() );

        // Allow Anonymous Access
        allowAnonymousAccessCheckbox.setSelection( configuration.isAllowAnonymousAccess() );

        // Enable Access Control
        enableAccesControlCheckbox.setSelection( configuration.isEnableAccessControl() );

        // Denormalize Op Attr
        denormalizeOpAttrCheckbox.setSelection( configuration.isDenormalizeOpAttr() );
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void doSave( IProgressMonitor monitor )
    {
        ServerConfigurationV151 configuration = ( ServerConfigurationV151 ) ( ( ServerConfigurationEditor ) getEditor() )
            .getServerConfiguration();

        configuration.setPrincipal( principalText.getText() );
        configuration.setPassword( passwordText.getText() );

        configuration.setBinaryAttributes( binaryAttributes );

        configuration.setEnableLdap( enableLdapCheckbox.getSelection() );
        configuration.setLdapPort( Integer.parseInt( ldapPortText.getText() ) );
        configuration.setEnableLdaps( enableLdapsCheckbox.getSelection() );
        configuration.setLdapsPort( Integer.parseInt( ldapsPortText.getText() ) );
        configuration.setEnableKerberos( enableKerberosCheckbox.getSelection() );
        configuration.setKerberosPort( Integer.parseInt( kerberosPortText.getText() ) );
        configuration.setEnableNtp( enableNtpCheckbox.getSelection() );
        configuration.setNtpPort( Integer.parseInt( ntpPortText.getText() ) );
        configuration.setEnableDns( enableDnsCheckbox.getSelection() );
        configuration.setDnsPort( Integer.parseInt( dnsPortText.getText() ) );
        configuration.setEnableChangePassword( enableChangePasswordCheckbox.getSelection() );
        configuration.setChangePasswordPort( Integer.parseInt( changePasswordPortText.getText() ) );

        configuration.setMaxTimeLimit( Integer.parseInt( maxTimeLimitText.getText() ) );
        configuration.setMaxSizeLimit( Integer.parseInt( maxSizeLimitText.getText() ) );
        configuration.setSynchronizationPeriod( Long.parseLong( synchPeriodText.getText() ) );
        configuration.setMaxThreads( Integer.parseInt( maxThreadsText.getText() ) );

        List<String> supportedMechanismsList = new ArrayList<String>();
        for ( Object supportedMechanism : supportedMechanismsTableViewer.getCheckedElements() )
        {
            supportedMechanismsList.add( ( String ) supportedMechanism );
        }
        configuration.setSupportedMechanisms( supportedMechanismsList );

        configuration.setAllowAnonymousAccess( allowAnonymousAccessCheckbox.getSelection() );
        configuration.setEnableAccessControl( enableAccesControlCheckbox.getSelection() );
        configuration.setDenormalizeOpAttr( denormalizeOpAttrCheckbox.getSelection() );
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.apacheds.configuration.model.v151.ServerConfigurationV151

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.