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

Examples of org.apache.directory.studio.apacheds.configuration.model.v157.ServerXmlIOV157


            public void widgetSelected( SelectionEvent e )
            {
                ExtendedOperationDialog dialog = new ExtendedOperationDialog( extendedOperations );
                if ( Dialog.OK == dialog.open() )
                {
                    ExtendedOperationEnum newExtendedOperation = dialog.getExtendedOperation();
                    extendedOperations.add( newExtendedOperation );
                    viewer.refresh();
                    viewer.setSelection( new StructuredSelection( newExtendedOperation ) );
                    setEditorDirty();
                }
            }
        } );

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

                    extendedOperations.remove( extendedOperation );
                    viewer.refresh();
                    setEditorDirty();
                }
View Full Code Here


                // 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 ) );
View Full Code Here

    private void editSelectedIndexedAttribute()
    {
        StructuredSelection selection = ( StructuredSelection ) indexedAttributesTableViewer.getSelection();
        if ( !selection.isEmpty() )
        {
            IndexedAttribute indexedAttribute = ( IndexedAttribute ) selection.getFirstElement();

            IndexedAttributeDialog dialog = new IndexedAttributeDialog( indexedAttribute );
            if ( Dialog.OK == dialog.open() && dialog.isDirty() )
            {
                indexedAttributesTableViewer.refresh();
View Full Code Here

            public void widgetSelected( SelectionEvent e )
            {
                InterceptorDialog dialog = new InterceptorDialog( interceptors );
                if ( Dialog.OK == dialog.open() )
                {
                    InterceptorEnum newInterceptor = dialog.getInterceptor();
                    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() )
                {
                    InterceptorEnum interceptor = ( InterceptorEnum ) 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() )
                {
                    InterceptorEnum interceptor = ( InterceptorEnum ) selection.getFirstElement();

                    int index = interceptors.indexOf( interceptor );
                    if ( index > 0 )
                    {
                        InterceptorEnum 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() )
                {
                    InterceptorEnum interceptor = ( InterceptorEnum ) selection.getFirstElement();

                    int index = interceptors.indexOf( interceptor );
                    if ( index < ( interceptors.size() - 1 ) )
                    {
                        InterceptorEnum 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() )
        {
            InterceptorEnum interceptor = ( InterceptorEnum ) 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

                    reportErrorReadingServerConfiguration( view, message );
                    return;
                }

                // Parsing the 'server.xml' file
                ServerConfigurationV157 serverConfiguration = null;
                try
                {
                    serverConfiguration = ApacheDS157LdapServerAdapter.getServerConfiguration( server );
                }
                catch ( Exception e )
                {
                    String message = Messages.getString( "CreateConnectionAction.UnableReadServerConfiguration" ) //$NON-NLS-1$
                        + "\n\n" //$NON-NLS-1$
                        + Messages.getString( "CreateConnectionAction.FollowingErrorOccurred" ) + e.getMessage(); //$NON-NLS-1$

                    reportErrorReadingServerConfiguration( view, message );
                    return;
                }

                // Checking if we could read the 'server.xml' file
                if ( serverConfiguration == null )
                {
                    reportErrorReadingServerConfiguration( view,
                        Messages.getString( "CreateConnectionAction.UnableReadServerConfiguration" ) ); //$NON-NLS-1$
                    return;
                }

                // Checking is LDAP and/or LDAPS is/are enabled
                if ( ( serverConfiguration.isEnableLdap() ) || ( serverConfiguration.isEnableLdaps() ) )
                {
                    // Creating the connection using the helper class
                    createConnection( server, serverConfiguration );
                }
                else
View Full Code Here

     * @throws IOException
     * @throws ServerXmlIOException
     */
    private int getTestingPort( LdapServer server ) throws ServerXmlIOException, IOException
    {
        ServerConfigurationV157 configuration = getServerConfiguration( server );

        // LDAP
        if ( configuration.isEnableLdap() )
        {
            return configuration.getLdapPort();
        }
        // LDAPS
        else if ( configuration.isEnableLdaps() )
        {
            return configuration.getLdapsPort();
        }
        // Kerberos
        else if ( configuration.isEnableKerberos() )
        {
            return configuration.getKerberosPort();
        }
        // DNS
        else if ( configuration.isEnableDns() )
        {
            return configuration.getDnsPort();
        }
        // NTP
        else if ( configuration.isEnableNtp() )
        {
            return configuration.getNtpPort();
        }
        // ChangePassword
        else if ( configuration.isEnableChangePassword() )
        {
            return configuration.getChangePasswordPort();
        }
        else
        {
            return 0;
        }
View Full Code Here

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

        // Supported Authentication Mechanisms
        supportedMechanismsTableViewer.setCheckedElements( configuration.getSupportedMechanisms().toArray() );

        // SASL Host
        saslHostText.setText( configuration.getSaslHost() );

        // SASL Principal
        saslPrincipalText.setText( configuration.getSaslPrincipal() );

        // Search Base Dn
        searchBaseDnText.setText( configuration.getSearchBaseDn() );

        // SASL Realms
        saslRealms.addAll( configuration.getSaslRealms() );
        saslRealmsTableViewer.setInput( saslRealms );
    }
View Full Code Here

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

        // Supported Authentication Mechanisms
        if ( ( supportedMechanismsTableViewer != null ) && ( supportedMechanismsTableViewer.getTable() != null )
            && ( !supportedMechanismsTableViewer.getTable().isDisposed() ) )
        {
            List<SupportedMechanismEnum> supportedMechanismsList = new ArrayList<SupportedMechanismEnum>();
            for ( Object supportedMechanism : supportedMechanismsTableViewer.getCheckedElements() )
            {
                supportedMechanismsList.add( ( SupportedMechanismEnum ) supportedMechanism );
            }
            configuration.setSupportedMechanisms( supportedMechanismsList );
        }

        // SASL Host
        if ( ( saslHostText != null ) && ( !saslHostText.isDisposed() ) )
        {
            configuration.setSaslHost( saslHostText.getText() );
        }

        // SASL Principal
        if ( ( saslPrincipalText != null ) && ( !saslPrincipalText.isDisposed() ) )
        {
            configuration.setSaslPrincipal( saslPrincipalText.getText() );
        }

        // Search Base Dn
        if ( ( searchBaseDnText != null ) && ( !searchBaseDnText.isDisposed() ) )
        {
            configuration.setSearchBaseDn( searchBaseDnText.getText() );
        }

        // SASL Realms
        if ( ( saslRealmsTableViewer != null ) && ( saslRealmsTableViewer.getTable() != null )
            && ( !saslRealmsTableViewer.getTable().isDisposed() ) )
        {
            configuration.setSaslRealms( saslRealms );
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.apacheds.configuration.model.v157.ServerXmlIOV157

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.