directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r660538 - in /directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration: editor/v151/ editor/v152/ model/v151/ model/v152/
Date Tue, 27 May 2008 14:42:07 GMT
Author: pamarcelot
Date: Tue May 27 07:42:05 2008
New Revision: 660538

URL: http://svn.apache.org/viewvc?rev=660538&view=rev
Log:
Added the possiblity to enable/disabled the LDAP protocol for the 1.5.1 and 1.5.2 server configurations.

Modified:
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/GeneralPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/GeneralPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v151/ServerConfigurationV151.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v151/ServerXmlIOV151.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/ServerConfigurationV152.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/ServerXmlIOV152.java

Modified: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/GeneralPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/GeneralPage.java?rev=660538&r1=660537&r2=660538&view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/GeneralPage.java
(original)
+++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/GeneralPage.java
Tue May 27 07:42:05 2008
@@ -576,7 +576,7 @@
         binaryAttributesTableViewer.setInput( binaryAttributes );
 
         // LDAP Protocol
-        enableLdapCheckbox.setSelection( true );
+        enableLdapCheckbox.setSelection( configuration.isEnableLdap() );
         ldapPortText.setEnabled( enableLdapCheckbox.getSelection() );
         ldapPortText.setText( "" + configuration.getLdapPort() );
 
@@ -872,6 +872,7 @@
 
         configuration.setBinaryAttributes( binaryAttributes );
 
+        configuration.setEnableLdap( enableLdapCheckbox.getSelection() );
         configuration.setLdapPort( Integer.parseInt( ldapPortText.getText() ) );
         configuration.setEnableLdaps( enableLdapsCheckbox.getSelection() );
         configuration.setLdapsPort( Integer.parseInt( ldapsPortText.getText() ) );

Modified: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/GeneralPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/GeneralPage.java?rev=660538&r1=660537&r2=660538&view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/GeneralPage.java
(original)
+++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/GeneralPage.java
Tue May 27 07:42:05 2008
@@ -384,7 +384,7 @@
             .getServerConfiguration();
 
         // LDAP Protocol
-        enableLdapCheckbox.setSelection( true );
+        enableLdapCheckbox.setSelection( configuration.isEnableLdap() );
         ldapPortText.setEnabled( enableLdapCheckbox.getSelection() );
         ldapPortText.setText( "" + configuration.getLdapPort() );
 
@@ -542,6 +542,7 @@
         ServerConfigurationV152 configuration = ( ServerConfigurationV152 ) ( ( ServerConfigurationEditor
) getEditor() )
             .getServerConfiguration();
 
+        configuration.setEnableLdap( enableLdapCheckbox.getSelection() );
         configuration.setLdapPort( Integer.parseInt( ldapPortText.getText() ) );
         configuration.setEnableLdaps( enableLdapsCheckbox.getSelection() );
         configuration.setLdapsPort( Integer.parseInt( ldapsPortText.getText() ) );

Modified: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v151/ServerConfigurationV151.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v151/ServerConfigurationV151.java?rev=660538&r1=660537&r2=660538&view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v151/ServerConfigurationV151.java
(original)
+++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v151/ServerConfigurationV151.java
Tue May 27 07:42:05 2008
@@ -38,6 +38,9 @@
 {
     // LDAP Configuration
 
+    /** The flag for Enable LDAP */
+    private boolean enableLdap;
+    
     /** The port */
     private int ldapPort;
 
@@ -627,6 +630,18 @@
 
 
     /**
+     * Gets the Enable LDAP flag.
+     *
+     * @return
+     *      true if LDAP is enabled
+     */
+    public boolean isEnableLdap()
+    {
+        return enableLdap;
+    }
+
+
+    /**
      * Gets the Enable LDAPS flag.
      *
      * @return
@@ -857,6 +872,18 @@
 
 
     /**
+     * Sets the Enable LDAP flag.
+     *
+     * @param enableLdap
+     *      the new value
+     */
+    public void setEnableLdap( boolean enableLdap )
+    {
+        this.enableLdap = enableLdap;
+    }
+
+
+    /**
      * Sets the Enable LDAPS flag.
      *
      * @param enableLdaps

Modified: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v151/ServerXmlIOV151.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v151/ServerXmlIOV151.java?rev=660538&r1=660537&r2=660538&view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v151/ServerXmlIOV151.java
(original)
+++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v151/ServerXmlIOV151.java
Tue May 27 07:42:05 2008
@@ -455,6 +455,17 @@
     {
         Element ldapConfiguration = getBeanElementById( document, "ldapConfiguration" );
 
+        // Enabled
+        String enabled = readBeanProperty( "enabled", ldapConfiguration );
+        if ( enabled != null )
+        {
+            serverConfiguration.setEnableLdap( parseBoolean( enabled ) );
+        }
+        else
+        {
+            serverConfiguration.setEnableLdap( true );
+        }
+
         // IP Port
         String ipPort = readBeanProperty( "ipPort", ldapConfiguration );
         if ( ipPort != null )
@@ -1131,7 +1142,8 @@
     private static void createLdapConfigurationBean( Element root, ServerConfigurationV151
serverConfiguration )
     {
         Element ldapConfiguration = createProtocolConfigurationBean( root, "ldapConfiguration",
-            "org.apache.directory.server.ldap.LdapConfiguration", true, serverConfiguration.getLdapPort()
);
+            "org.apache.directory.server.ldap.LdapConfiguration", serverConfiguration.isEnableLdap(),
+            serverConfiguration.getLdapPort() );
 
         // AllowAnonymousAccess
         Element propertyElement = ldapConfiguration.addElement( "property" );

Modified: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/ServerConfigurationV152.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/ServerConfigurationV152.java?rev=660538&r1=660537&r2=660538&view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/ServerConfigurationV152.java
(original)
+++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/ServerConfigurationV152.java
Tue May 27 07:42:05 2008
@@ -41,6 +41,9 @@
     /** The port */
     private int ldapPort;
 
+    /** The flag for Enable LDAP */
+    private boolean enableLdap;
+
     // Limits
 
     /** The Max Time Limit */
@@ -556,7 +559,18 @@
         return enableKerberos;
     }
 
-
+    /**
+     * Gets the Enable LDAP flag.
+     *
+     * @return
+     *      true if LDAP is enabled
+     */
+    public boolean isEnableLdap()
+    {
+        return enableLdap;
+    }
+    
+    
     /**
      * Gets the Enable LDAPS flag.
      *
@@ -771,6 +785,18 @@
     {
         this.enableLdaps = enableLdaps;
     }
+    
+
+    /**
+     * Sets the Enable LDAP flag.
+     *
+     * @param enableLdap
+     *      the new value
+     */
+    public void setEnableLdap( boolean enableLdap )
+    {
+        this.enableLdap = enableLdap;
+    }
 
 
     /**

Modified: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/ServerXmlIOV152.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/ServerXmlIOV152.java?rev=660538&r1=660537&r2=660538&view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/ServerXmlIOV152.java
(original)
+++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/ServerXmlIOV152.java
Tue May 27 07:42:05 2008
@@ -1044,7 +1044,7 @@
                         if ( enabledAttribute == null )
                         {
                             // By default, the protocol is not enabled
-                            serverConfiguration.setEnableDns( false );
+                            serverConfiguration.setEnableLdaps( false );
                         }
                         else
                         {
@@ -1109,6 +1109,19 @@
                 // Checking if the 'ldapServer' element is the one for LDAP
                 if ( ServerXmlIOV152.ELEMENT_LDAP_SERVER.equalsIgnoreCase( idAttribute.getValue()
) )
                 {
+                    // Getting the 'enabled' attribute
+                    org.dom4j.Attribute enabledAttribute = ldapServerElement
+                        .attribute( ServerXmlIOV152.ATTRIBUTE_ENABLED );
+                    if ( enabledAttribute == null )
+                    {
+                        // By default, the protocol is enabled
+                        serverConfiguration.setEnableLdap( true );
+                    }
+                    else
+                    {
+                        serverConfiguration.setEnableLdap( parseBoolean( enabledAttribute.getValue()
) );
+                    }
+
                     // IpPort
                     org.dom4j.Attribute ipPortAttribute = ldapServerElement
                         .attribute( ServerXmlIOV152.ATTRIBUTE_IP_PORT );
@@ -1968,6 +1981,9 @@
         // Id
         ldapServerElement.addAttribute( ServerXmlIOV152.ATTRIBUTE_ID, ServerXmlIOV152.ELEMENT_LDAP_SERVER
);
 
+        // Enabled
+        ldapServerElement.addAttribute( ServerXmlIOV152.ATTRIBUTE_ENABLED, "" + serverConfiguration.isEnableLdap()
);
+
         // IpPort
         ldapServerElement.addAttribute( ServerXmlIOV152.ATTRIBUTE_IP_PORT, "" + serverConfiguration.getLdapPort()
);
 



Mime
View raw message