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

Examples of org.apache.directory.studio.apacheds.configuration.model.v155.ServerConfigurationV155


    /**
     * Initializes the page with the Editor input.
     */
    private void initFromInput()
    {
        ServerConfigurationV155 configuration = ( ServerConfigurationV155 ) ( ( 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


    /* (non-Javadoc)
     * @see org.apache.directory.studio.apacheds.configuration.editor.SavableWizardPage#save()
     */
    public void save()
    {
        ServerConfigurationV155 configuration = ( ServerConfigurationV155 ) ( ( 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

            ServerConfigurationV156 serverConfiguration156 = ( ServerConfigurationV156 ) serverConfiguration;
            return ( serverConfiguration156.isEnableLdap() ) || ( serverConfiguration156.isEnableLdaps() );
        }
        else if ( serverConfiguration instanceof ServerConfigurationV155 )
        {
            ServerConfigurationV155 serverConfiguration155 = ( ServerConfigurationV155 ) serverConfiguration;
            return ( serverConfiguration155.isEnableLdap() ) || ( serverConfiguration155.isEnableLdaps() );
        }
        else if ( serverConfiguration instanceof ServerConfigurationV154 )
        {
            ServerConfigurationV154 serverConfiguration154 = ( ServerConfigurationV154 ) serverConfiguration;
            return ( serverConfiguration154.isEnableLdap() ) || ( serverConfiguration154.isEnableLdaps() );
View Full Code Here

                connectionParameter.setPort( serverConfigurationV156.getLdapsPort() );
            }
        }
        else if ( serverConfiguration instanceof ServerConfigurationV155 )
        {
            ServerConfigurationV155 serverConfiguration155 = ( ServerConfigurationV155 ) serverConfiguration;
            if ( serverConfiguration155.isEnableLdap() )
            {
                connectionParameter.setEncryptionMethod( EncryptionMethod.NONE );
                connectionParameter.setPort( serverConfiguration155.getLdapPort() );
            }
            else if ( serverConfiguration155.isEnableLdaps() )
            {
                connectionParameter.setEncryptionMethod( EncryptionMethod.LDAPS );
                connectionParameter.setPort( serverConfiguration155.getLdapsPort() );
            }
        }
        else if ( serverConfiguration instanceof ServerConfigurationV154 )
        {
            ServerConfigurationV154 serverConfiguration154 = ( ServerConfigurationV154 ) serverConfiguration;
View Full Code Here

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

        // 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$

        // 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 )
    {
        ServerConfigurationV155 configuration = ( ServerConfigurationV155 ) ( ( ServerConfigurationEditor ) getEditor() )
            .getServerConfiguration();

        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() ) );

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

     * @throws IOException
     * @throws ServerXmlIOException
     */
    private int getTestingPort( LdapServer server ) throws ServerXmlIOException, IOException
    {
        ServerConfigurationV155 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

     */
    public String[] checkPortsBeforeServerStart( LdapServer server ) throws Exception
    {
        List<String> alreadyInUseProtocolPortsList = new ArrayList<String>();

        ServerConfigurationV155 configuration = getServerConfiguration( server );

        // LDAP
        if ( configuration.isEnableLdap() )
        {
            if ( !AvailablePortFinder.available( configuration.getLdapPort() ) )
            {
                alreadyInUseProtocolPortsList
                    .add( NLS.bind(
                        Messages.getString( "ApacheDS155LdapServerAdapter.LDAPPort" ), new Object[] { configuration.getLdapPort() } ) ); //$NON-NLS-1$
            }
        }

        // LDAPS
        if ( configuration.isEnableLdaps() )
        {
            if ( !AvailablePortFinder.available( configuration.getLdapsPort() ) )
            {
                alreadyInUseProtocolPortsList
                    .add( NLS.bind(
                        Messages.getString( "ApacheDS155LdapServerAdapter.LDAPSPort" ), new Object[] { configuration.getLdapsPort() } ) ); //$NON-NLS-1$
            }
        }

        // Kerberos
        if ( configuration.isEnableKerberos() )
        {
            if ( !AvailablePortFinder.available( configuration.getKerberosPort() ) )
            {
                alreadyInUseProtocolPortsList
                    .add( NLS
                        .bind(
                            Messages.getString( "ApacheDS155LdapServerAdapter.KerberosPort" ), new Object[] { configuration.getKerberosPort() } ) ); //$NON-NLS-1$
            }
        }

        // DNS
        if ( configuration.isEnableDns() )
        {
            if ( !AvailablePortFinder.available( configuration.getDnsPort() ) )
            {
                alreadyInUseProtocolPortsList
                    .add( NLS.bind(
                        Messages.getString( "ApacheDS155LdapServerAdapter.DNSPort" ), new Object[] { configuration.getDnsPort() } ) ); //$NON-NLS-1$
            }
        }

        // NTP
        if ( configuration.isEnableNtp() )
        {
            if ( !AvailablePortFinder.available( configuration.getNtpPort() ) )
            {
                alreadyInUseProtocolPortsList.add( NLS.bind(
                    Messages.getString( "ApacheDS155LdapServerAdapter.NTPPort" ), new Object[] //$NON-NLS-1$
                    { configuration.getNtpPort() } ) );
            }
        }

        // Change Password
        if ( configuration.isEnableChangePassword() )
        {
            if ( !AvailablePortFinder.available( configuration.getChangePasswordPort() ) )
            {
                alreadyInUseProtocolPortsList
                    .add( NLS
                        .bind(
                            Messages.getString( "ApacheDS155LdapServerAdapter.ChangePasswordPort" ), new Object[] { configuration.getChangePasswordPort() } ) ); //$NON-NLS-1$
            }
        }

        return alreadyInUseProtocolPortsList.toArray( new String[0] );
    }
View Full Code Here

    /**
     * Initializes the page with the Editor input.
     */
    private void initFromInput()
    {
        ServerConfigurationV155 configuration = ( ServerConfigurationV155 ) ( ( 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 )
    {
        ServerConfigurationV155 configuration = ( ServerConfigurationV155 ) ( ( 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.v155.ServerConfigurationV155

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.