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

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


                    reportErrorReadingServerConfiguration( view, message );
                    return;
                }

                // Parsing the 'server.xml' file
                ServerConfigurationV155 serverConfiguration = null;
                try
                {
                    serverConfiguration = ApacheDS155LdapServerAdapter.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


            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

     * @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

                    reportErrorReadingServerConfiguration( view, message );
                    return;
                }

                // Parsing the 'server.xml' file
                ServerConfigurationV155 serverConfiguration = null;
                try
                {
                    serverConfiguration = ApacheDS155LdapServerAdapter.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

            // Setting the ServerXmlIO class
            switch ( serverConfiguration.getVersion() )
            {
                case VERSION_1_5_5:
                    serverXmlIO = new ServerXmlIOV155();
                    break;
                case VERSION_1_5_4:
                    serverXmlIO = new ServerXmlIOV154();
                    break;
                case VERSION_1_5_3:
View Full Code Here

            ServerConfiguration serverConfiguration = null;
            ServerXmlIO serverXmlIO = null;
            switch ( page.getTargetVersion() )
            {
                case VERSION_1_5_5:
                    serverXmlIO = new ServerXmlIOV155();
                    serverConfiguration = serverXmlIO.parse( ApacheDSConfigurationPlugin.class
                        .getResourceAsStream( "default-server-1.5.5.xml" ) ); //$NON-NLS-1$
                    break;
                case VERSION_1_5_4:
                    serverXmlIO = new ServerXmlIOV154();
                    serverConfiguration = serverXmlIO.parse( ApacheDSConfigurationPlugin.class
                        .getResourceAsStream( "default-server-1.5.4.xml" ) ); //$NON-NLS-1$
                    break;
                case VERSION_1_5_3:
                    serverXmlIO = new ServerXmlIOV153();
                    serverConfiguration = serverXmlIO.parse( ApacheDSConfigurationPlugin.class
                        .getResourceAsStream( "default-server-1.5.3.xml" ) ); //$NON-NLS-1$
                    break;
                case VERSION_1_5_2:
                    serverXmlIO = new ServerXmlIOV152();
                    serverConfiguration = serverXmlIO.parse( ApacheDSConfigurationPlugin.class
                        .getResourceAsStream( "default-server-1.5.2.xml" ) ); //$NON-NLS-1$
                    break;
                case VERSION_1_5_1:
                    serverXmlIO = new ServerXmlIOV151();
                    serverConfiguration = serverXmlIO.parse( ApacheDSConfigurationPlugin.class
                        .getResourceAsStream( "default-server-1.5.1.xml" ) ); //$NON-NLS-1$
                    break;
                case VERSION_1_5_0:
                    serverXmlIO = new ServerXmlIOV150();
                    serverConfiguration = serverXmlIO.parse( ApacheDSConfigurationPlugin.class
                        .getResourceAsStream( "default-server-1.5.0.xml" ) ); //$NON-NLS-1$
                    break;
                default:
                    serverXmlIO = new ServerXmlIOV155();
                    serverConfiguration = serverXmlIO.parse( ApacheDSConfigurationPlugin.class
                        .getResourceAsStream( "default-server-1.5.5.xml" ) ); //$NON-NLS-1$
                    break;
            }
View Full Code Here

        // Parsing and returning the server configuration
        switch ( server.getVersion() )
        {
            case VERSION_1_5_5:
                ServerXmlIOV155 serverXmlIOV155 = new ServerXmlIOV155();
                return serverXmlIOV155.parse( fis );
            case VERSION_1_5_4:
                ServerXmlIOV154 serverXmlIOV154 = new ServerXmlIOV154();
                return serverXmlIOV154.parse( fis );
            case VERSION_1_5_3:
                ServerXmlIOV153 serverXmlIOV153 = new ServerXmlIOV153();
View Full Code Here

        {
            case VERSION_1_5_6:
                ServerXmlIOV156 serverXmlIOV156 = new ServerXmlIOV156();
                return serverXmlIOV156.parse( fis );
            case VERSION_1_5_5:
                ServerXmlIOV155 serverXmlIOV155 = new ServerXmlIOV155();
                return serverXmlIOV155.parse( fis );
            case VERSION_1_5_4:
                ServerXmlIOV154 serverXmlIOV154 = new ServerXmlIOV154();
                return serverXmlIOV154.parse( fis );
            case VERSION_1_5_3:
                ServerXmlIOV153 serverXmlIOV153 = new ServerXmlIOV153();
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.