directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1175817 - in /directory/studio/trunk/plugins/ldapservers.apacheds.v200: ./ src/main/java/org/apache/directory/studio/ldapservers/apacheds/v200/
Date Mon, 26 Sep 2011 12:15:21 GMT
Author: pamarcelot
Date: Mon Sep 26 12:15:20 2011
New Revision: 1175817

URL: http://svn.apache.org/viewvc?rev=1175817&view=rev
Log:
Fixed the start of the connection startup listener watchdog.
Fixed the creation of associated connection from the ApacheDS server configuration.

Modified:
    directory/studio/trunk/plugins/ldapservers.apacheds.v200/pom.xml
    directory/studio/trunk/plugins/ldapservers.apacheds.v200/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v200/ApacheDS200LdapServerAdapter.java
    directory/studio/trunk/plugins/ldapservers.apacheds.v200/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v200/CreateConnectionAction.java
    directory/studio/trunk/plugins/ldapservers.apacheds.v200/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v200/messages.properties
    directory/studio/trunk/plugins/ldapservers.apacheds.v200/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v200/messages_de.properties
    directory/studio/trunk/plugins/ldapservers.apacheds.v200/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v200/messages_fr.properties

Modified: directory/studio/trunk/plugins/ldapservers.apacheds.v200/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers.apacheds.v200/pom.xml?rev=1175817&r1=1175816&r2=1175817&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers.apacheds.v200/pom.xml (original)
+++ directory/studio/trunk/plugins/ldapservers.apacheds.v200/pom.xml Mon Sep 26 12:15:20 2011
@@ -114,12 +114,14 @@
             <Bundle-Localization>plugin</Bundle-Localization>
             <Eclipse-LazyStart>true</Eclipse-LazyStart>
             <Bundle-Activator>org.apache.directory.studio.ldapservers.apacheds.v200.ApacheDS200Plugin</Bundle-Activator>
-            <Require-Bundle>org.apache.directory.studio.apacheds.configuration,
+            <Require-Bundle>org.apache.directory.server.config;bundle-version="${org.apache.directory.server.validversion}",
+ org.apache.directory.server.xdbm.partition;bundle-version="${org.apache.directory.server.validversion}",
+ org.apache.directory.shared.ldap.model;bundle-version="${org.apache.directory.shared.validversion}",
+ org.apache.directory.studio.apacheds.configuration.v2,
  org.apache.directory.studio.common.core,
  org.apache.directory.studio.common.ui,
  org.apache.directory.studio.connection.core,
  org.apache.directory.studio.ldapservers,
- org.dom4j.dom4j;bundle-version="${org.dom4j.version}",
  org.eclipse.core.runtime,
  org.eclipse.core.resources,
  org.eclipse.debug.core,
@@ -181,17 +183,29 @@
   </build>
 
   <dependencies>
+  	<!-- Apache Directory Shared dependencies -->
+    <dependency>
+      <groupId>org.apache.directory.shared</groupId>
+      <artifactId>shared-ldap-model</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    
     <!-- Apache Directory Studio library plugins dependencies -->
     <dependency>
       <groupId>org.apache.directory.studio</groupId>
-      <artifactId>org.dom4j.dom4j</artifactId>
+      <artifactId>org.apache.directory.server.config</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.studio</groupId>
+      <artifactId>org.apache.directory.server.xdbm.partition</artifactId>
       <scope>provided</scope>
     </dependency>
     
   	<!-- Apache Directory Studio plugins dependencies -->
     <dependency>
       <groupId>org.apache.directory.studio</groupId>
-      <artifactId>apacheds.configuration</artifactId>
+      <artifactId>apacheds.configuration.v2</artifactId>
       <scope>provided</scope>
     </dependency>
     <dependency>

Modified: directory/studio/trunk/plugins/ldapservers.apacheds.v200/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v200/ApacheDS200LdapServerAdapter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers.apacheds.v200/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v200/ApacheDS200LdapServerAdapter.java?rev=1175817&r1=1175816&r2=1175817&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers.apacheds.v200/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v200/ApacheDS200LdapServerAdapter.java
(original)
+++ directory/studio/trunk/plugins/ldapservers.apacheds.v200/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v200/ApacheDS200LdapServerAdapter.java
Mon Sep 26 12:15:20 2011
@@ -24,15 +24,20 @@ package org.apache.directory.studio.ldap
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
-import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.directory.studio.apacheds.configuration.editor.ServerConfigurationEditor;
-import org.apache.directory.studio.apacheds.configuration.model.ServerXmlIOException;
-import org.apache.directory.studio.apacheds.configuration.model.v157.ServerConfigurationV157;
-import org.apache.directory.studio.apacheds.configuration.model.v157.ServerXmlIOV157;
+import org.apache.directory.server.config.beans.ChangePasswordServerBean;
+import org.apache.directory.server.config.beans.ConfigBean;
+import org.apache.directory.server.config.beans.DirectoryServiceBean;
+import org.apache.directory.server.config.beans.DnsServerBean;
+import org.apache.directory.server.config.beans.KdcServerBean;
+import org.apache.directory.server.config.beans.LdapServerBean;
+import org.apache.directory.server.config.beans.NtpServerBean;
+import org.apache.directory.server.config.beans.TransportBean;
+import org.apache.directory.studio.apacheds.configuration.v2.editor.ServerConfigurationEditor;
+import org.apache.directory.studio.apacheds.configuration.v2.jobs.LoadConfigurationRunnable;
 import org.apache.directory.studio.common.core.jobs.StudioProgressMonitor;
 import org.apache.directory.studio.common.ui.filesystem.PathEditorInput;
 import org.apache.directory.studio.ldapservers.LdapServersManager;
@@ -95,7 +100,7 @@ public class ApacheDS200LdapServerAdapte
         // Creating server folder structure
         monitor.subTask( "creating server folder structure" );
         File serverFolder = LdapServersManager.getServerFolder( server ).toFile();
-        File confFolder = new File( serverFolder, "conf" );
+        File confFolder = new File( serverFolder, CONF );
         confFolder.mkdir();
         File ldifFolder = new File( serverFolder, "ldif" );
         ldifFolder.mkdir();
@@ -140,7 +145,7 @@ public class ApacheDS200LdapServerAdapte
                 try
                 {
                     PathEditorInput input = new PathEditorInput( LdapServersManager.getServerFolder(
server )
-                        .append( "conf" ).append( "server.xml" ) ); //$NON-NLS-1$ //$NON-NLS-2$
+                        .append( CONF ).append( CONFIG_LDIF ) );
                     PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
                         .openEditor( input, ServerConfigurationEditor.ID );
                 }
@@ -168,7 +173,7 @@ public class ApacheDS200LdapServerAdapte
         LdapServersUtils.startTerminateListenerThread( server, launch );
 
         // Running the startup listener watchdog
-//        LdapServersUtils.runStartupListenerWatchdog( server, getTestingPort( server ) );
+        LdapServersUtils.runStartupListenerWatchdog( server, getTestingPort( server ) );
     }
 
 
@@ -189,8 +194,9 @@ public class ApacheDS200LdapServerAdapte
         // Creating a new editable launch configuration
         ILaunchConfigurationType type = DebugPlugin.getDefault().getLaunchManager()
             .getLaunchConfigurationType( IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION
);
-        ILaunchConfigurationWorkingCopy workingCopy = type.newInstance( null, NLS.bind( "Starting
{0}", new String[]
-            { server.getName() } ) );
+        ILaunchConfigurationWorkingCopy workingCopy = type.newInstance( null,
+            NLS.bind( Messages.getString( "ApacheDS200LdapServerAdapter.Starting" ), new
String[] //$NON-NLS-1$
+                { server.getName() } ) );
 
         // Setting the JRE container path attribute
         workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH,
vmInstall
@@ -227,7 +233,7 @@ public class ApacheDS200LdapServerAdapte
         // Creating the VM arguments string
         StringBuffer vmArguments = new StringBuffer();
         vmArguments.append( "-Dlog4j.configuration=file:\"" //$NON-NLS-1$
-            + serverFolderPath.append( "conf" ).append( "log4j.properties" ).toOSString()
+ "\"" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+            + serverFolderPath.append( CONF ).append( LOG4J_PROPERTIES ).toOSString() + "\""
); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
         vmArguments.append( " " ); //$NON-NLS-1$
         vmArguments.append( "-Dapacheds.var.dir=\"" + serverFolderPath.toOSString() + "\""
); //$NON-NLS-1$ //$NON-NLS-2$
         vmArguments.append( " " ); //$NON-NLS-1$
@@ -313,17 +319,16 @@ public class ApacheDS200LdapServerAdapte
     *      the server
     * @return
     *      the associated server configuration
+     * @throws Exception 
     * @throws ServerXmlIOException 
     * @throws FileNotFoundException 
     */
-    public static ServerConfigurationV157 getServerConfiguration( LdapServer server ) throws
ServerXmlIOException,
-        FileNotFoundException
+    public static ConfigBean getServerConfiguration( LdapServer server ) throws Exception
     {
-        InputStream fis = new FileInputStream( LdapServersManager.getServerFolder( server
).append( "conf" )
-            .append( "server.xml" ).toFile() );
+        InputStream fis = new FileInputStream( LdapServersManager.getServerFolder( server
).append( CONF )
+            .append( CONFIG_LDIF ).toFile() );
 
-        ServerXmlIOV157 serverXmlIOV157 = new ServerXmlIOV157();
-        return ( ServerConfigurationV157 ) serverXmlIOV157.parse( fis );
+        return LoadConfigurationRunnable.readConfiguration( fis );
     }
 
 
@@ -334,46 +339,432 @@ public class ApacheDS200LdapServerAdapte
      *      the 1.5.6 server configuration
      * @return
      *      the testing port
-     * @throws IOException 
+     * @throws Exception 
      * @throws ServerXmlIOException 
      */
-    private int getTestingPort( LdapServer server ) throws ServerXmlIOException, IOException
+    private int getTestingPort( LdapServer server ) throws Exception
     {
-        ServerConfigurationV157 configuration = getServerConfiguration( server );
+        ConfigBean configuration = getServerConfiguration( server );
 
         // LDAP
-        if ( configuration.isEnableLdap() )
+        if ( isEnableLdap( configuration ) )
         {
-            return configuration.getLdapPort();
+            return getLdapPort( configuration );
         }
         // LDAPS
-        else if ( configuration.isEnableLdaps() )
+        else if ( isEnableLdaps( configuration ) )
         {
-            return configuration.getLdapsPort();
+            return getLdapsPort( configuration );
         }
         // Kerberos
-        else if ( configuration.isEnableKerberos() )
+        else if ( isEnableKerberos( configuration ) )
         {
-            return configuration.getKerberosPort();
+            return getKerberosPort( configuration );
         }
         // DNS
-        else if ( configuration.isEnableDns() )
+        else if ( isEnableDns( configuration ) )
         {
-            return configuration.getDnsPort();
+            return getDnsPort( configuration );
         }
         // NTP
-        else if ( configuration.isEnableNtp() )
+        else if ( isEnableNtp( configuration ) )
         {
-            return configuration.getNtpPort();
+            return getNtpPort( configuration );
         }
         // ChangePassword
-        else if ( configuration.isEnableChangePassword() )
+        else if ( isEnableChangePassword( configuration ) )
         {
-            return configuration.getChangePasswordPort();
+            return getChangePasswordPort( configuration );
         }
         else
         {
             return 0;
         }
     }
+
+
+    /**
+     * Indicates if the LDAP Server is enabled.
+     *
+     * @param configuration the configuration
+     * @return <code>true</code> if the LDAP Server is enabled,
+     *         <code>false</code> if not.
+     */
+    public static boolean isEnableLdap( ConfigBean configuration )
+    {
+        TransportBean ldapServerTransportBean = getLdapServerTransportBean( configuration
);
+
+        if ( ldapServerTransportBean != null )
+        {
+            return ldapServerTransportBean.isEnabled();
+        }
+
+        return false;
+    }
+
+
+    /**
+     * Indicates if the LDAPS Server is enabled.
+     *
+     * @param configuration the configuration
+     * @return <code>true</code> if the LDAPS Server is enabled,
+     *         <code>false</code> if not.
+     */
+    public static boolean isEnableLdaps( ConfigBean configuration )
+    {
+        TransportBean ldapsServerTransportBean = getLdapsServerTransportBean( configuration
);
+
+        if ( ldapsServerTransportBean != null )
+        {
+            return ldapsServerTransportBean.isEnabled();
+        }
+
+        return false;
+    }
+
+
+    /**
+     * Gets the LDAP Server transport bean.
+     *
+     * @param configuration the configuration
+     * @return the LDAP Server transport bean.
+     */
+    private static TransportBean getLdapServerTransportBean( ConfigBean configuration )
+    {
+        return getLdapServerTransportBean( configuration, "ldap" );
+    }
+
+
+    /**
+     * Gets the LDAPS Server transport bean.
+     *
+     * @param configuration the configuration
+     * @return the LDAPS Server transport bean.
+     */
+    private static TransportBean getLdapsServerTransportBean( ConfigBean configuration )
+    {
+        return getLdapServerTransportBean( configuration, "ldaps" );
+    }
+
+
+    /**
+     * Gets the corresponding LDAP Server transport bean.
+     *
+     * @param configuration the configuration
+     * @param id the id
+     * @return the corresponding LDAP Server transport bean.
+     */
+    private static TransportBean getLdapServerTransportBean( ConfigBean configuration, String
id )
+    {
+        DirectoryServiceBean directoryServiceBean = configuration.getDirectoryServiceBean();
+
+        if ( directoryServiceBean != null )
+        {
+            LdapServerBean ldapServerBean = directoryServiceBean.getLdapServerBean();
+
+            if ( ldapServerBean != null )
+            {
+                // Looking for the transport in the list
+                TransportBean[] ldapServerTransportBeans = ldapServerBean.getTransports();
+                if ( ldapServerTransportBeans != null )
+                {
+                    for ( TransportBean ldapServerTransportBean : ldapServerTransportBeans
)
+                    {
+                        if ( id.equals( ldapServerTransportBean.getTransportId() ) )
+                        {
+                            return ldapServerTransportBean;
+                        }
+                    }
+                }
+            }
+        }
+
+        return null;
+    }
+
+
+    /**
+     * Indicates if the Kerberos Server is enabled.
+     *
+     * @param configuration the configuration
+     * @return <code>true</code> if the Kerberos Server is enabled,
+     *         <code>false</code> if not.
+     */
+    public static boolean isEnableKerberos( ConfigBean configuration )
+    {
+        DirectoryServiceBean directoryServiceBean = configuration.getDirectoryServiceBean();
+
+        if ( directoryServiceBean != null )
+        {
+            KdcServerBean kdcServerBean = directoryServiceBean.getKdcServerBean();
+
+            if ( kdcServerBean != null )
+            {
+                kdcServerBean.isEnabled();
+            }
+        }
+
+        return false;
+    }
+
+
+    /**
+     * Indicates if the DNS Server is enabled.
+     *
+     * @param configuration the configuration
+     * @return <code>true</code> if the DNS Server is enabled,
+     *         <code>false</code> if not.
+     */
+    public static boolean isEnableDns( ConfigBean configuration )
+    {
+        DirectoryServiceBean directoryServiceBean = configuration.getDirectoryServiceBean();
+
+        if ( directoryServiceBean != null )
+        {
+            DnsServerBean dnsServerBean = directoryServiceBean.getDnsServerBean();
+
+            if ( dnsServerBean != null )
+            {
+                dnsServerBean.isEnabled();
+            }
+        }
+
+        return false;
+    }
+
+
+    /**
+     * Indicates if the NTP Server is enabled.
+     *
+     * @param configuration the configuration
+     * @return <code>true</code> if the NTP Server is enabled,
+     *         <code>false</code> if not.
+     */
+    public static boolean isEnableNtp( ConfigBean configuration )
+    {
+        DirectoryServiceBean directoryServiceBean = configuration.getDirectoryServiceBean();
+
+        if ( directoryServiceBean != null )
+        {
+            NtpServerBean ntpServerBean = directoryServiceBean.getNtpServerBean();
+
+            if ( ntpServerBean != null )
+            {
+                ntpServerBean.isEnabled();
+            }
+        }
+
+        return false;
+    }
+
+
+    /**
+     * Indicates if the Change Password Server is enabled.
+     *
+     * @param configuration the configuration
+     * @return <code>true</code> if the Change Password Server is enabled,
+     *         <code>false</code> if not.
+     */
+    public static boolean isEnableChangePassword( ConfigBean configuration )
+    {
+        DirectoryServiceBean directoryServiceBean = configuration.getDirectoryServiceBean();
+
+        if ( directoryServiceBean != null )
+        {
+            ChangePasswordServerBean changePasswordServerBean = directoryServiceBean.getChangePasswordServerBean();
+
+            if ( changePasswordServerBean != null )
+            {
+                changePasswordServerBean.isEnabled();
+            }
+        }
+
+        return false;
+    }
+
+
+    /**
+     * Gets the LDAP port.
+     *
+     * @param configuration the configuration
+     * @return the LDAP port
+     */
+    public static int getLdapPort( ConfigBean configuration )
+    {
+        TransportBean ldapServerTransportBean = getLdapServerTransportBean( configuration
);
+
+        if ( ldapServerTransportBean != null )
+        {
+            return ldapServerTransportBean.getSystemPort();
+        }
+
+        return 0;
+    }
+
+
+    /**
+     * Gets the LDAPS port.
+     *
+     * @param configuration the configuration
+     * @return the LDAPS port
+     */
+    public static int getLdapsPort( ConfigBean configuration )
+    {
+        TransportBean ldapsServerTransportBean = getLdapsServerTransportBean( configuration
);
+
+        if ( ldapsServerTransportBean != null )
+        {
+            return ldapsServerTransportBean.getSystemPort();
+        }
+
+        return 0;
+    }
+
+
+    /**
+     * Gets the Kerberos port.
+     *
+     * @param configuration the configuration
+     * @return the Kerberos port
+     */
+    public static int getKerberosPort( ConfigBean configuration )
+    {
+        DirectoryServiceBean directoryServiceBean = configuration.getDirectoryServiceBean();
+
+        if ( directoryServiceBean != null )
+        {
+            KdcServerBean kdcServerBean = directoryServiceBean.getKdcServerBean();
+
+            if ( kdcServerBean != null )
+            {
+                // Looking for the transport in the list
+                TransportBean[] kdcServerTransportBeans = kdcServerBean.getTransports();
+
+                if ( kdcServerTransportBeans != null )
+                {
+                    for ( TransportBean kdcServerTransportBean : kdcServerTransportBeans
)
+                    {
+                        if ( ( "tcp".equals( kdcServerTransportBean.getTransportId() ) )
+                            || ( "udp".equals( kdcServerTransportBean.getTransportId() )
) )
+                        {
+                            return kdcServerTransportBean.getSystemPort();
+                        }
+                    }
+                }
+            }
+        }
+
+        return 0;
+    }
+
+
+    /**
+     * Gets the DNS port.
+     *
+     * @param configuration the configuration
+     * @return the DNS port
+     */
+    public static int getDnsPort( ConfigBean configuration )
+    {
+        DirectoryServiceBean directoryServiceBean = configuration.getDirectoryServiceBean();
+
+        if ( directoryServiceBean != null )
+        {
+            DnsServerBean dnsServerBean = directoryServiceBean.getDnsServerBean();
+
+            if ( dnsServerBean != null )
+            {
+                // Looking for the transport in the list
+                TransportBean[] dnsServerTransportBeans = dnsServerBean.getTransports();
+
+                if ( dnsServerTransportBeans != null )
+                {
+                    for ( TransportBean dnsServerTransportBean : dnsServerTransportBeans
)
+                    {
+                        if ( ( "tcp".equals( dnsServerTransportBean.getTransportId() ) )
+                            || ( "udp".equals( dnsServerTransportBean.getTransportId() )
) )
+                        {
+                            return dnsServerTransportBean.getSystemPort();
+                        }
+                    }
+                }
+            }
+        }
+
+        return 0;
+    }
+
+
+    /**
+     * Gets the NTP port.
+     *
+     * @param configuration the configuration
+     * @return the NTP port
+     */
+    public static int getNtpPort( ConfigBean configuration )
+    {
+        DirectoryServiceBean directoryServiceBean = configuration.getDirectoryServiceBean();
+
+        if ( directoryServiceBean != null )
+        {
+            NtpServerBean ntpServerBean = directoryServiceBean.getNtpServerBean();
+
+            if ( ntpServerBean != null )
+            {
+                // Looking for the transport in the list
+                TransportBean[] ntpServerTransportBeans = ntpServerBean.getTransports();
+
+                if ( ntpServerTransportBeans != null )
+                {
+                    for ( TransportBean ntpServerTransportBean : ntpServerTransportBeans
)
+                    {
+                        if ( ( "tcp".equals( ntpServerTransportBean.getTransportId() ) )
+                            || ( "udp".equals( ntpServerTransportBean.getTransportId() )
) )
+                        {
+                            return ntpServerTransportBean.getSystemPort();
+                        }
+                    }
+                }
+            }
+        }
+
+        return 0;
+    }
+
+
+    /**
+     * Gets the Change Password port.
+     *
+     * @param configuration the configuration
+     * @return the Change Password port
+     */
+    public static int getChangePasswordPort( ConfigBean configuration )
+    {
+        DirectoryServiceBean directoryServiceBean = configuration.getDirectoryServiceBean();
+
+        if ( directoryServiceBean != null )
+        {
+            ChangePasswordServerBean changePasswordServerBean = directoryServiceBean.getChangePasswordServerBean();
+
+            if ( changePasswordServerBean != null )
+            {
+                // Looking for the transport in the list
+                TransportBean[] changePasswordServerTransportBeans = changePasswordServerBean.getTransports();
+
+                if ( changePasswordServerTransportBeans != null )
+                {
+                    for ( TransportBean changePasswordServerTransportBean : changePasswordServerTransportBeans
)
+                    {
+                        if ( ( "tcp".equals( changePasswordServerTransportBean.getTransportId()
) )
+                            || ( "udp".equals( changePasswordServerTransportBean.getTransportId()
) ) )
+                        {
+                            return changePasswordServerTransportBean.getSystemPort();
+                        }
+                    }
+                }
+            }
+        }
+
+        return 0;
+    }
 }

Modified: directory/studio/trunk/plugins/ldapservers.apacheds.v200/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v200/CreateConnectionAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers.apacheds.v200/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v200/CreateConnectionAction.java?rev=1175817&r1=1175816&r2=1175817&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers.apacheds.v200/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v200/CreateConnectionAction.java
(original)
+++ directory/studio/trunk/plugins/ldapservers.apacheds.v200/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v200/CreateConnectionAction.java
Mon Sep 26 12:15:20 2011
@@ -21,7 +21,7 @@
 package org.apache.directory.studio.ldapservers.apacheds.v200;
 
 
-import org.apache.directory.studio.apacheds.configuration.model.v157.ServerConfigurationV157;
+import org.apache.directory.server.config.beans.ConfigBean;
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.ConnectionParameter;
 import org.apache.directory.studio.connection.core.ConnectionParameter.AuthenticationMethod;
@@ -66,23 +66,23 @@ public class CreateConnectionAction impl
                 // Getting the server
                 LdapServer server = ( LdapServer ) selection.getFirstElement();
 
-                // Checking that the server is really an ApacheDS 1.5.7 server
+                // Checking that the server is really an ApacheDS 2.0.0 server
                 // TODO
                 if ( !EXTENSION_ID.equalsIgnoreCase( server.getLdapServerAdapterExtension().getId()
) )
                 {
                     String message = Messages.getString( "CreateConnectionAction.UnableReadServerConfiguration"
) //$NON-NLS-1$
                         + "\n\n" // TODO
-                        + Messages.getString( "CreateConnectionAction.NotA157Server" ); //$NON-NLS-1$
+                        + Messages.getString( "CreateConnectionAction.NotA200Server" ); //$NON-NLS-1$
 
                     reportErrorReadingServerConfiguration( view, message );
                     return;
                 }
 
-                // Parsing the 'server.xml' file
-                ServerConfigurationV157 serverConfiguration = null;
+                // Parsing the 'config.ldif' file
+                ConfigBean configuration = null;
                 try
                 {
-                    serverConfiguration = ApacheDS200LdapServerAdapter.getServerConfiguration(
server );
+                    configuration = ApacheDS200LdapServerAdapter.getServerConfiguration(
server );
                 }
                 catch ( Exception e )
                 {
@@ -95,7 +95,7 @@ public class CreateConnectionAction impl
                 }
 
                 // Checking if we could read the 'server.xml' file
-                if ( serverConfiguration == null )
+                if ( configuration == null )
                 {
                     reportErrorReadingServerConfiguration( view,
                         Messages.getString( "CreateConnectionAction.UnableReadServerConfiguration"
) ); //$NON-NLS-1$
@@ -103,10 +103,10 @@ public class CreateConnectionAction impl
                 }
 
                 // Checking is LDAP and/or LDAPS is/are enabled
-                if ( ( serverConfiguration.isEnableLdap() ) || ( serverConfiguration.isEnableLdaps()
) )
+                if ( ( ApacheDS200LdapServerAdapter.isEnableLdap( configuration ) ) || (
ApacheDS200LdapServerAdapter.isEnableLdaps( configuration ) ) )
                 {
                     // Creating the connection using the helper class
-                    createConnection( server, serverConfiguration );
+                    createConnection( server, configuration );
                 }
                 else
                 {
@@ -145,7 +145,7 @@ public class CreateConnectionAction impl
     /**
      * Creates the connection
      */
-    private void createConnection( LdapServer server, ServerConfigurationV157 configuration
)
+    private void createConnection( LdapServer server, ConfigBean configuration )
     {
         // Creating the connection parameter object
         ConnectionParameter connectionParameter = new ConnectionParameter();
@@ -154,15 +154,15 @@ public class CreateConnectionAction impl
         connectionParameter.setAuthMethod( AuthenticationMethod.SIMPLE );
 
         // LDAP or LDAPS?
-        if ( configuration.isEnableLdap() )
+        if ( ApacheDS200LdapServerAdapter.isEnableLdap( configuration ) )
         {
             connectionParameter.setEncryptionMethod( EncryptionMethod.NONE );
-            connectionParameter.setPort( configuration.getLdapPort() );
+            connectionParameter.setPort( ApacheDS200LdapServerAdapter.getLdapPort( configuration
) );
         }
-        else if ( configuration.isEnableLdaps() )
+        else if ( ApacheDS200LdapServerAdapter.isEnableLdaps( configuration ) )
         {
             connectionParameter.setEncryptionMethod( EncryptionMethod.LDAPS );
-            connectionParameter.setPort( configuration.getLdapsPort() );
+            connectionParameter.setPort( ApacheDS200LdapServerAdapter.getLdapsPort( configuration
) );
         }
 
         // Bind password
@@ -176,7 +176,7 @@ public class CreateConnectionAction impl
 
         // Name
         connectionParameter.setName( server.getName() );
-        
+
         // Network Provider
         connectionParameter.setNetworkProvider( NetworkProvider.JNDI );
 
@@ -185,6 +185,7 @@ public class CreateConnectionAction impl
     }
 
 
+
     /**
      * {@inheritDoc}
      */

Modified: directory/studio/trunk/plugins/ldapservers.apacheds.v200/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v200/messages.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers.apacheds.v200/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v200/messages.properties?rev=1175817&r1=1175816&r2=1175817&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers.apacheds.v200/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v200/messages.properties
(original)
+++ directory/studio/trunk/plugins/ldapservers.apacheds.v200/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v200/messages.properties
Mon Sep 26 12:15:20 2011
@@ -17,8 +17,10 @@
 
 ApacheDS200Plugin.UnableGetPluginProperties=Unable to get the plugin properties.
 
+ApacheDS200LdapServerAdapter.Starting=Starting "{0}"...
+
 CreateConnectionAction.FollowingErrorOccurred=The following error occurred\: 
 CreateConnectionAction.LDAPAndLDAPSDisabled=LDAP and LDAPS protocols are disabled. A connection
cannot be created.
-CreateConnectionAction.NotA157Server=This server is not an ApacheDS 2.0.0 server.
+CreateConnectionAction.NotA200Server=This server is not an ApacheDS 2.0.0 server.
 CreateConnectionAction.UnableCreateConnection=Unable to create a connection
 CreateConnectionAction.UnableReadServerConfiguration=Unable to read the server configuration.

Modified: directory/studio/trunk/plugins/ldapservers.apacheds.v200/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v200/messages_de.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers.apacheds.v200/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v200/messages_de.properties?rev=1175817&r1=1175816&r2=1175817&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers.apacheds.v200/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v200/messages_de.properties
(original)
+++ directory/studio/trunk/plugins/ldapservers.apacheds.v200/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v200/messages_de.properties
Mon Sep 26 12:15:20 2011
@@ -17,8 +17,10 @@
 
 ApacheDS200Plugin.UnableGetPluginProperties=Die Plugin Eigenschaften k\u00F6nnen nicht geladen
werden.
 
+ApacheDS200LdapServerAdapter.Starting=Startend "{0}"...
+
 CreateConnectionAction.FollowingErrorOccurred=Es ist folgender Fehler aufgetreten\: 
 CreateConnectionAction.LDAPAndLDAPSDisabled=Die Protokolle LDAP und LDAPS sind gesperrt.
Es kann keine Verbindung erstellt werden.
-CreateConnectionAction.NotA157Server=TODO:This server is not an ApacheDS 2.0.0 server.
+CreateConnectionAction.NotA200Server=TODO:This server is not an ApacheDS 2.0.0 server.
 CreateConnectionAction.UnableCreateConnection=Unf\u00E4hig eine Verbindung zu erstellen
 CreateConnectionAction.UnableReadServerConfiguration=Unf\u00E4hig die Server Konfiguration
zu lesen.

Modified: directory/studio/trunk/plugins/ldapservers.apacheds.v200/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v200/messages_fr.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers.apacheds.v200/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v200/messages_fr.properties?rev=1175817&r1=1175816&r2=1175817&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers.apacheds.v200/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v200/messages_fr.properties
(original)
+++ directory/studio/trunk/plugins/ldapservers.apacheds.v200/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v200/messages_fr.properties
Mon Sep 26 12:15:20 2011
@@ -17,8 +17,10 @@
 
 ApacheDS200Plugin.UnableGetPluginProperties=Impossible de r\u00E9cup\u00E9rer les propri\u00E9t\u00E9s
de ce plugin
 
+ApacheDS200LdapServerAdapter.Starting=D\u00E9marrage du serveur "{0}"...
+
 CreateConnectionAction.FollowingErrorOccurred= L'erreur suivante est survenue \:
 CreateConnectionAction.LDAPAndLDAPSDisabled=Les protocoles LDAP et LDAPS sont d\u00E9sactiv\u00E9s.
Il n'est pas possible de cr\u00E9er une connexion. 
-CreateConnectionAction.NotA157Server=Ce serveur n'est pas un serveur ApacheDS 2.0.0.
+CreateConnectionAction.NotA200Server=Ce serveur n'est pas un serveur ApacheDS 2.0.0.
 CreateConnectionAction.UnableCreateConnection=Impossible de cr\u00E9er une connexion.
 CreateConnectionAction.UnableReadServerConfiguration=Impossible de lire la configuration
du serveur.



Mime
View raw message