You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2015/01/20 18:50:43 UTC

svn commit: r1653313 [1/2] - in /directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2: actions/ dialogs/ editor/ jobs/

Author: elecharny
Date: Tue Jan 20 17:50:42 2015
New Revision: 1653313

URL: http://svn.apache.org/r1653313
Log:
Lots of cleanup :
o Log addition
o Javadoc  addition and cleanup
o Code formatting
o Fixed the NPE we got while opening the Apache DS 2.0 config (the LDAP partition was not correctly initialized, the CacheService was null)

Added feature :
o Added the support of SASL realms

Missing parts :
o Correct support of enabled protocols and ciphers.

Modified:
    directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorExportConfigurationAction.java
    directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorImportConfigurationAction.java
    directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/OpenConfigurationAction.java
    directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/dialogs/AttributeDialog.java
    directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/dialogs/AttributeValueDialog.java
    directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/dialogs/JdbmIndexDialog.java
    directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/dialogs/MavibotIndexDialog.java
    directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/LdapLdapsServersPage.java
    directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/OverviewPage.java
    directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java
    directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages.properties
    directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages_de.properties
    directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages_fr.properties
    directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/jobs/EntryBasedConfigurationPartition.java
    directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/jobs/LoadConfigurationRunnable.java
    directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/jobs/PartitionsDiffComputer.java
    directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/jobs/PartitionsDiffException.java
    directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/jobs/SaveConfigurationRunnable.java
    directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/jobs/messages.properties

Modified: directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorExportConfigurationAction.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorExportConfigurationAction.java?rev=1653313&r1=1653312&r2=1653313&view=diff
==============================================================================
--- directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorExportConfigurationAction.java (original)
+++ directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorExportConfigurationAction.java Tue Jan 20 17:50:42 2015
@@ -26,6 +26,7 @@ import org.apache.directory.studio.apach
 import org.apache.directory.studio.apacheds.configuration.v2.editor.ServerConfigurationEditor;
 import org.apache.directory.studio.apacheds.configuration.v2.editor.ServerConfigurationEditorUtils;
 import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.resource.ImageDescriptor;
@@ -33,7 +34,7 @@ import org.eclipse.osgi.util.NLS;
 
 
 /**
- * This class implements the create connection action for an ApacheDS 1.5.7 server.
+ * This class implements the create connection action for an ApacheDS 2.0 server.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -86,6 +87,9 @@ public class EditorExportConfigurationAc
         }
         catch ( Exception e )
         {
+            ApacheDS2ConfigurationPlugin.getDefault().getLog().log( 
+                new Status( Status.ERROR, "org.apache.directory.studio.apacheds.configuration.v2", 
+                    e.getMessage() ) );
             MessageDialog
                 .openError( editor.getSite().getShell(),
                     Messages.getString( "EditorExportConfigurationAction.ErrorExportingConfigurationFile" ), //$NON-NLS-1$

Modified: directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorImportConfigurationAction.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorImportConfigurationAction.java?rev=1653313&r1=1653312&r2=1653313&view=diff
==============================================================================
--- directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorImportConfigurationAction.java (original)
+++ directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorImportConfigurationAction.java Tue Jan 20 17:50:42 2015
@@ -49,7 +49,7 @@ import org.eclipse.ui.model.WorkbenchLab
 
 
 /**
- * This class implements the create connection action for an ApacheDS 1.5.7 server.
+ * This class implements the create connection action for an ApacheDS 2.0 server.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -65,8 +65,7 @@ public class EditorImportConfigurationAc
     /**
      * Creates a new instance of EditorImportConfigurationAction.
      *
-     * @param editor
-     *      the associated editor
+     * @param editor the associated editor
      */
     public EditorImportConfigurationAction( ServerConfigurationEditor editor )
     {
@@ -120,14 +119,17 @@ public class EditorImportConfigurationAc
 
             // detect IDE or RCP:
             boolean isIDE = CommonUIUtils.isIDEEnvironment();
+            
             if ( isIDE )
             {
                 // Opening a dialog for file selection
                 ElementTreeSelectionDialog dialog = createWorkspaceFileSelectionDialog();
+                
                 if ( dialog.open() == Dialog.OK )
                 {
                     // Getting the input stream for the selected file
                     Object firstResult = dialog.getFirstResult();
+                    
                     if ( ( firstResult != null ) && ( firstResult instanceof IFile ) )
                     {
                         inputStream = ( ( IFile ) firstResult ).getContents();
@@ -146,6 +148,7 @@ public class EditorImportConfigurationAc
                 dialog.setText( DIALOG_TITLE );
                 dialog.setFilterPath( System.getProperty( "user.home" ) ); //$NON-NLS-1$
                 String filePath = dialog.open();
+                
                 if ( filePath == null )
                 {
                     // Cancel button has been clicked
@@ -154,6 +157,7 @@ public class EditorImportConfigurationAc
 
                 // Checking the file
                 File file = new File( filePath );
+                
                 if ( !file.exists() || !file.isFile() || !file.canRead() )
                 {
                     // This is not a valid file
@@ -189,6 +193,10 @@ public class EditorImportConfigurationAc
         }
         catch ( Exception e )
         {
+            ApacheDS2ConfigurationPlugin.getDefault().getLog().log( 
+                new Status( Status.ERROR, "org.apache.directory.studio.apacheds.configuration.v2", 
+                    e.getMessage() ) );
+
             MessageDialog
                 .openError(
                     editor.getSite().getShell(),
@@ -204,8 +212,7 @@ public class EditorImportConfigurationAc
     /**
      * Creates a {@link Dialog} to select a single file in the workspace.
      *
-     * @return
-     *      a {@link Dialog} to select a single file in the workspace
+     * @return a {@link Dialog} to select a single file in the workspace
      */
     private ElementTreeSelectionDialog createWorkspaceFileSelectionDialog()
     {
@@ -226,7 +233,6 @@ public class EditorImportConfigurationAc
             private Status notValidated = new Status( IStatus.ERROR, ApacheDS2ConfigurationPluginConstants.PLUGIN_ID,
                 IStatus.ERROR, "", null ); //$NON-NLS-1$
 
-
             public IStatus validate( Object[] selection )
             {
                 if ( selection != null )

Modified: directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/OpenConfigurationAction.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/OpenConfigurationAction.java?rev=1653313&r1=1653312&r2=1653313&view=diff
==============================================================================
--- directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/OpenConfigurationAction.java (original)
+++ directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/OpenConfigurationAction.java Tue Jan 20 17:50:42 2015
@@ -21,9 +21,11 @@
 package org.apache.directory.studio.apacheds.configuration.v2.actions;
 
 
+import org.apache.directory.studio.apacheds.configuration.v2.ApacheDS2ConfigurationPlugin;
 import org.apache.directory.studio.apacheds.configuration.v2.editor.ConnectionServerConfigurationInput;
 import org.apache.directory.studio.apacheds.configuration.v2.editor.ServerConfigurationEditor;
 import org.apache.directory.studio.connection.core.Connection;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.StructuredSelection;
@@ -55,6 +57,7 @@ public class OpenConfigurationAction imp
             try
             {
                 IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+                
                 try
                 {
                     page.openEditor( new ConnectionServerConfigurationInput( selectedConnection ),
@@ -62,14 +65,16 @@ public class OpenConfigurationAction imp
                 }
                 catch ( PartInitException e )
                 {
-                    // TODO Auto-generated catch block
-                    e.printStackTrace();
+                    ApacheDS2ConfigurationPlugin.getDefault().getLog().log( 
+                        new Status( Status.ERROR, "org.apache.directory.studio.apacheds.configuration.v2", 
+                            e.getMessage() ) );
                 }
             }
             catch ( Exception e )
             {
-                // TODO Auto-generated catch block
-                e.printStackTrace();
+                ApacheDS2ConfigurationPlugin.getDefault().getLog().log( 
+                    new Status( Status.ERROR, "org.apache.directory.studio.apacheds.configuration.v2", 
+                        e.getMessage() ) );
             }
         }
     }
@@ -81,6 +86,7 @@ public class OpenConfigurationAction imp
     public void selectionChanged( IAction action, ISelection selection )
     {
         StructuredSelection structuredSelection = ( StructuredSelection ) selection;
+        
         if ( ( structuredSelection.size() == 1 ) && ( structuredSelection.getFirstElement() instanceof Connection ) )
         {
             selectedConnection = ( Connection ) structuredSelection.getFirstElement();

Modified: directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/dialogs/AttributeDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/dialogs/AttributeDialog.java?rev=1653313&r1=1653312&r2=1653313&view=diff
==============================================================================
--- directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/dialogs/AttributeDialog.java (original)
+++ directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/dialogs/AttributeDialog.java Tue Jan 20 17:50:42 2015
@@ -110,10 +110,12 @@ public class AttributeDialog extends Dia
         Composite c = BaseWidgetUtils.createColumnContainer( composite, 2, 1 );
         BaseWidgetUtils.createLabel( c, Messages.getString( "AttributeDialog.AttributeTypeOrOID" ), 1 ); //$NON-NLS-1$
         typeOrOidCombo = BaseWidgetUtils.createCombo( c, attributeTypesAndOids, -1, 1 );
+        
         if ( attribute != null )
         {
             typeOrOidCombo.setText( attribute );
         }
+        
         typeOrOidCombo.addModifyListener( new ModifyListener()
         {
             public void modifyText( ModifyEvent e )

Modified: directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/dialogs/AttributeValueDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/dialogs/AttributeValueDialog.java?rev=1653313&r1=1653312&r2=1653313&view=diff
==============================================================================
--- directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/dialogs/AttributeValueDialog.java (original)
+++ directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/dialogs/AttributeValueDialog.java Tue Jan 20 17:50:42 2015
@@ -74,6 +74,13 @@ public class AttributeValueDialog extend
 
 
     /**
+     * This create a dialog like :
+     * 
+     * <pre>
+     *   +------------------------------------------------+
+     *   | Attribute: [           ]  Value: [           ] |
+     *   +------------------------------------------------+
+     * </pre>
      * {@inheritDoc}
      */
     protected Control createDialogArea( Composite parent )
@@ -153,8 +160,7 @@ public class AttributeValueDialog extend
     /**
      * Gets the Attribute Value Object.
      *
-     * @return
-     *      the Attribute Value Object
+     * @return the Attribute Value Object
      */
     public AttributeValueObject getAttributeValueObject()
     {
@@ -165,8 +171,7 @@ public class AttributeValueDialog extend
     /**
      * Returns the dirty flag of the dialog.
      *
-     * @return
-     *      the dirty flag of the dialog
+     * @return the dirty flag of the dialog
      */
     public boolean isDirty()
     {

Modified: directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/dialogs/JdbmIndexDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/dialogs/JdbmIndexDialog.java?rev=1653313&r1=1653312&r2=1653313&view=diff
==============================================================================
--- directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/dialogs/JdbmIndexDialog.java (original)
+++ directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/dialogs/JdbmIndexDialog.java Tue Jan 20 17:50:42 2015
@@ -76,6 +76,13 @@ public class JdbmIndexDialog extends Dia
 
 
     /**
+     * This create a dialog like :
+     * 
+     * <pre>
+     *   +-----------------------------------------------------+
+     *   | Attribute ID: [           ]  Cache Size: [        ] |
+     *   +-----------------------------------------------------+
+     * </pre>
      * {@inheritDoc}
      */
     protected Control createDialogArea( Composite parent )
@@ -99,12 +106,14 @@ public class JdbmIndexDialog extends Dia
         {
             public void verifyText( VerifyEvent e )
             {
+                // The cache size must be a numeric
                 if ( !e.text.matches( "[0-9]*" ) ) //$NON-NLS-1$
                 {
                     e.doit = false;
                 }
             }
         } );
+        
         cacheSizeText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
 
         initFromInput();
@@ -154,6 +163,7 @@ public class JdbmIndexDialog extends Dia
     protected void okPressed()
     {
         index.setIndexAttributeId( attributeIdText.getText() );
+        
         try
         {
             index.setIndexCacheSize( Integer.parseInt( cacheSizeText.getText() ) );
@@ -170,8 +180,7 @@ public class JdbmIndexDialog extends Dia
     /**
      * Gets the Indexed Attribute.
      *
-     * @return
-     *      the Indexed Attribute
+     * @return the Indexed Attribute
      */
     public JdbmIndexBean getIndex()
     {
@@ -182,8 +191,7 @@ public class JdbmIndexDialog extends Dia
     /**
      * Returns the dirty flag of the dialog.
      *
-     * @return
-     *      the dirty flag of the dialog
+     * @return the dirty flag of the dialog
      */
     public boolean isDirty()
     {

Modified: directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/dialogs/MavibotIndexDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/dialogs/MavibotIndexDialog.java?rev=1653313&r1=1653312&r2=1653313&view=diff
==============================================================================
--- directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/dialogs/MavibotIndexDialog.java (original)
+++ directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/dialogs/MavibotIndexDialog.java Tue Jan 20 17:50:42 2015
@@ -73,6 +73,13 @@ public class MavibotIndexDialog extends
 
 
     /**
+     * This create a dialog like :
+     * 
+     * <pre>
+     *   +------------------------------+
+     *   | Attribute ID: [           ]  |
+     *   +------------------------------+
+     * </pre>
      * {@inheritDoc}
      */
     protected Control createDialogArea( Composite parent )
@@ -134,8 +141,7 @@ public class MavibotIndexDialog extends
     /**
      * Gets the Indexed Attribute.
      *
-     * @return
-     *      the Indexed Attribute
+     * @return the Indexed Attribute
      */
     public MavibotIndexBean getIndex()
     {

Modified: directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/LdapLdapsServersPage.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/LdapLdapsServersPage.java?rev=1653313&r1=1653312&r2=1653313&view=diff
==============================================================================
--- directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/LdapLdapsServersPage.java (original)
+++ directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/LdapLdapsServersPage.java Tue Jan 20 17:50:42 2015
@@ -21,6 +21,7 @@ package org.apache.directory.studio.apac
 
 
 import java.io.File;
+import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.directory.api.ldap.model.constants.LdapSecurityConstants;
@@ -70,63 +71,61 @@ import org.eclipse.ui.forms.widgets.Tabl
  * <pre>
  * +-------------------------------------------------------------------------------+
  * | +------------------------------------+ +------------------------------------+ |
- * | | .--------------------------------. | | +--------------------------------+ | |
- * | | |V LDAP Transport                | | | |                                | | |
- * | | +--------------------------------| | | |    Kerberos Server             | | |
- * | | | [X] Enabled                    | | | |                                | | |
- * | | |  Address  : [////////////////] | | | |                                | | |
- * | | |  Port     : [/////////]        | | | |                                | | |
- * | | |  nbThreads: [/////////]        | | | |                                | | |
- * | | |  backLog  : [/////////]        | | | |                                | | |
+ * | | .--------------------------------. | | .--------------------------------. | |
+ * | | |V LDAP/LDAPS servers            | | | |V Supported Authn Mechanisms    | | |
  * | | +--------------------------------+ | | +--------------------------------+ | |
+ * | | | [X] Enabled LDAP Server        | | | | [X] Simple      [X] GSSAPI     | | |
+ * | | |  Address  : [////////////////] | | | | [X] CRAM-MD5    [X] Digest-MD5 | | |
+ * | | |  Port     : [/////////]        | | | | [X] NTLM                       | | |
+ * | | |  nbThreads: [/////////]        | | | |   Provider : [///////////////] | | |
+ * | | |  backLog  : [/////////]        | | | | [X] GSS_SPNEGO                 | | |
+ * | | | [X] Enabled LDAPS Server       | | | |   Provider : [///////////////] | | |
+ * | | |  Address  : [////////////////] | | | | [X] Delegated                  | | |
+ * | | |  Port     : [/////////]        | | | |   Host    : [////////////////] | | |
+ * | | |  nbThreads: [/////////]        | | | |   Port    : [/////]            | | |
+ * | | |  backLog  : [/////////]        | | | |   Ssl     : [X]                | | |
+ * | | +--------------------------------+ | | |   Base DN : [////////////////] | | |
  * | | .--------------------------------. | | +--------------------------------+ | |
- * | | |V LDAPS Transport               | | | |                                | | |
- * | | +--------------------------------| | | |    Kerberos Server             | | |
- * | | | [X] Enabled                    | | | |                                | | |
- * | | |  Address  : [////////////////] | | | |                                | | |
- * | | |  Port     : [/////////]        | | | |                                | | |
- * | | |  nbThreads: [/////////]        | | | |                                | | |
- * | | |  backLog  : [/////////]        | | | |                                | | |
- * | | +--------------------------------| | | |    Kerberos Server             | | |
- * | | .--------------------------------. | | +--------------------------------+ | |
- * | | |  Server limits                 | | | |                                | | |
- * | | +--------------------------------| | | |    Kerberos Server             | | |
- * | | |    Max time limit : [////////] | | | |    Options                     | | |
- * | | |    Max size limit : [////////] | | | |    Options                     | | |
- * | | +--------------------------------+ | | +--------------------------------+ | |
- * | | .--------------------------------. | | +--------------------------------+ | |
- * | | |  SSL/TLS keystore              | | | |                                | | |
- * | | +--------------------------------| | | |    Kerberos Server             | | |
- * | | |  keystore : [////////] (browse)| | | |    Options                     | | |
- * | | |  password : [////////////////] | | | |    Options                     | | |
- * | | |             [X] Show password  | | | |    Options                     | | |
- * | | +--------------------------------+ | | +--------------------------------+ | |
- * | | .--------------------------------. | | +--------------------------------+ | |
- * | | |V Advanced SSL Settings         | | | |                                | | |
- * | | +--------------------------------| | | |    Kerberos Server             | | |
- * | | |  [X] Require Client Auth       | | | |                                | | |
- * | | |    [X] Request Client Auth     | | | |                                | | |
- * | | |  Ciphers suite :               | | | |                                | | |
- * | | |   +-----------------+          | | | |                                | | |
- * | | |   |                 | (add)    | | | |                                | | |
- * | | |   |                 | (edit)   | | | |                                | | |
- * | | |   |                 | (delete) | | | |                                | | |
- * | | |   +-----------------+          | | | |                                | | |
- * | | |  Enabled protocols :           | | | |                                | | |
- * | | |   +-----------------+          | | | |                                | | |
- * | | |   |                 | (add)    | | | |                                | | |
- * | | |   |                 | (edit)   | | | |                                | | |
- * | | |   |                 | (delete) | | | |                                | | |
- * | | |   +-----------------+          | | | |                                | | |
- * | | +--------------------------------+ | | +--------------------------------+ | |
- * | | .--------------------------------. | | +--------------------------------+ | |
- * | | |V Advanced                      | | | |                                | | |
- * | | +--------------------------------| | | |    Kerberos Server             | | |
- * | | | [X] Enable TLS                 | | | |                                | | |
- * | | | [X] Enable ServerSide PWD hash | | | |                                | | |
- * | | |      hashing method {========} | | | |                                | | |
- * | | | Replication pinger sleep [XXX] | | | |                                | | |
+ * | | |V Server limits                 | | | .--------------------------------. | |
+ * | | +--------------------------------+ | | |V SASL Settings                 | | |
+ * | | |    Max time limit : [////////] | | | +--------------------------------+ | |
+ * | | |    Max size limit : [////////] | | | | SASL Host      : [///////////] | | |
+ * | | |    Max PDU size   : [////////] | | | | SASL Principal : [///////////] | | |
+ * | | +--------------------------------+ | | | Search Base DN : [///////////] | | |
+ * | | .--------------------------------. | | | SASL realms    :               | | |
+ * | | |V SSL/Start TLS keystore        | | | |   +-----------------+          | | |
+ * | | +--------------------------------+ | | |   |                 | (add)    | | |
+ * | | |  keystore : [////////] (browse)| | | |   |                 | (edit)   | | |
+ * | | |  password : [////////////////] | | | |   |                 | (delete) | | |
+ * | | |             [X] Show password  | | | |   +-----------------+          | | |
  * | | +--------------------------------+ | | +--------------------------------+ | |
+ * | | .--------------------------------. | |                                    | |
+ * | | |V SSL Advanced Settings         | | |                                    | |
+ * | | +--------------------------------+ | |                                    | |
+ * | | |  [X] Require Client Auth       | | |                                    | |
+ * | | |    [X] Request Client Auth     | | |                                    | |
+ * | | |  Ciphers suite :               | | |                                    | |
+ * | | |   +-----------------+          | | |                                    | |
+ * | | |   |                 | (add)    | | |                                    | |
+ * | | |   |                 | (edit)   | | |                                    | |
+ * | | |   |                 | (delete) | | |                                    | |
+ * | | |   +-----------------+          | | |                                    | |
+ * | | |  Enabled protocols :           | | |                                    | |
+ * | | |   +-----------------+          | | |                                    | |
+ * | | |   |                 | (add)    | | |                                    | |
+ * | | |   |                 | (edit)   | | |                                    | |
+ * | | |   |                 | (delete) | | |                                    | |
+ * | | |   +-----------------+          | | |                                    | |
+ * | | +--------------------------------+ | |                                    | |
+ * | | .--------------------------------. | |                                    | |
+ * | | |V Advanced                      | | |                                    | |
+ * | | +--------------------------------+ | |                                    | |
+ * | | | [X] Enable TLS                 | | |                                    | |
+ * | | | [X] Enable ServerSide PWD hash | | |                                    | |
+ * | | |      hashing method {========} | | |                                    | |
+ * | | | Replication pinger sleep [XXX] | | |                                    | |
+ * | | | Disk sync delay [XXX]          | | |                                    | |
+ * | | +--------------------------------+ | |                                    | |
  * | +------------------------------------+ +------------------------------------+ |
  * +-------------------------------------------------------------------------------+
  * </pre>
@@ -213,7 +212,7 @@ public class LdapLdapsServersPage extend
     private Text maxSizeLimitText;
     private Text maxPduSizeText;
     
-    
+    /** The supported authentication controls */
     private Button authMechSimpleCheckbox;
     private Button authMechCramMd5Checkbox;
     private Button authMechDigestMd5Checkbox;
@@ -222,9 +221,17 @@ public class LdapLdapsServersPage extend
     private Text authMechNtlmText;
     private Button authMechGssSpnegoCheckbox;
     private Text authMechGssSpnegoText;
+
+    /** The SASL controls */
     private Text saslHostText;
     private Text saslPrincipalText;
     private Text saslSearchBaseDnText;
+    private TableViewer saslRealmsTableViewer;
+    private Button addSaslRealmsButton;
+    private Button editSaslRealmsButton;
+    private Button deleteSaslRealmsButton;
+    
+    /** The Advanced controls */
     private Button enableTlsCheckbox;
     private Button enableServerSidePasswordHashingCheckbox;
     private ComboViewer hashingMethodComboViewer;
@@ -403,8 +410,7 @@ public class LdapLdapsServersPage extend
     {
         public void modifyText( ModifyEvent e )
         {
-            LdapLdapsServersPage.getLdapsServerTransportBean( getDirectoryServiceBean() ).setTransportAddress( 
-                ldapsAddressText.getText() );
+            getLdapsServerTransportBean().setTransportAddress( ldapsAddressText.getText() );
         }
     };
 
@@ -462,9 +468,20 @@ public class LdapLdapsServersPage extend
             boolean enabled = needClientAuthCheckbox.getSelection();
 
             // Inject the flag in the config
-            //getLdapServerTransportBean().setWantClientAuth( enabled );
-            //getLdapServerTransportBean().setNeedClientAuth( enabled );
+            TransportBean ldapTransport = getLdapServerTransportBean();
+            
+            if ( ldapTransport!= null )
+            {
+                ldapTransport.setWantClientAuth( enabled );
+            }
             
+            TransportBean ldapsTransport = getLdapsServerTransportBean();
+            
+            if ( ldapsTransport!= null )
+            {
+                ldapsTransport.setWantClientAuth( enabled );
+            }
+
             // Turn on/off the NeedClientAuth
             if ( enabled )
             {
@@ -493,16 +510,31 @@ public class LdapLdapsServersPage extend
         {
             boolean enabled = wantClientAuthCheckbox.getSelection();
 
-            // Inject the flag in the config
-            //getLdapServerTransportBean().setWantClientAuth( enabled );
+            // Inject the flag in the config - for all the transports, as
+            // it may be for SSL or startTLS - 
+            TransportBean ldapTransport =  getLdapServerTransportBean();
+            
+            if ( ldapTransport != null )
+            {
+                ldapTransport.setWantClientAuth( enabled );
+            }
+
+            TransportBean ldapsTransport =  getLdapsServerTransportBean();
             
+            if ( ldapsTransport != null )
+            {
+                ldapsTransport.setWantClientAuth( enabled );
+            }
+
             // Keep a track of the WantClientAuth flag
             wantClientAuthStatus = enabled;
         }
     };
 
-    
 
+    /**
+     * The SASL Host modify listener
+     */
     private ModifyListener saslHostTextListener = new ModifyListener()
     {
         public void modifyText( ModifyEvent e )
@@ -510,6 +542,11 @@ public class LdapLdapsServersPage extend
             getLdapServerBean().setLdapServerSaslHost( saslHostText.getText() );
         }
     };
+    
+    
+    /**
+     * The SASL principal modify listener
+     */
     private ModifyListener saslPrincipalTextListener = new ModifyListener()
     {
         public void modifyText( ModifyEvent e )
@@ -517,6 +554,11 @@ public class LdapLdapsServersPage extend
             getLdapServerBean().setLdapServerSaslPrincipal( saslPrincipalText.getText() );
         }
     };
+
+    
+    /**
+     * The SASL search Base DN modify listener
+     */
     private ModifyListener saslSearchBaseDnTextListener = new ModifyListener()
     {
         public void modifyText( ModifyEvent e )
@@ -534,6 +576,97 @@ public class LdapLdapsServersPage extend
             }
         }
     };
+    
+    
+    /**
+     * SASL realms Table change
+     */
+    private ISelectionChangedListener saslRealmsTableViewerSelectionChangedListener = new ISelectionChangedListener()
+    {
+        public void selectionChanged( SelectionChangedEvent event )
+        {
+            StructuredSelection selection = ( StructuredSelection ) saslRealmsTableViewer.getSelection();
+
+            editSaslRealmsButton.setEnabled( !selection.isEmpty() );
+            deleteSaslRealmsButton.setEnabled( !selection.isEmpty() );
+        }
+    };
+    
+    
+    /**
+     * SaslRealms Table double-click
+     */
+    private IDoubleClickListener saslRealmsTableViewerDoubleClickListener = new IDoubleClickListener()
+    {
+        public void doubleClick( DoubleClickEvent event )
+        {
+            editSaslRealmsAction();
+        }
+    };
+    
+
+    /**
+     * Add SASL realms button
+     */
+    private SelectionListener addSaslRealmsButtonListener = new SelectionAdapter()
+    {
+        public void widgetSelected( SelectionEvent e )
+        {
+            InputDialog dialog = new InputDialog( editSaslRealmsButton.getShell(),
+                Messages.getString( "LdapLdapsServersPage.Add" ), //$NON-NLS-1$
+                Messages.getString( "LdapLdapsServersPage.SaslRealms" ), //$NON-NLS-1$
+                null, null );
+
+            if ( dialog.open() == InputDialog.OK )
+            {
+                String newSaslRealms = dialog.getValue();
+
+                getLdapServerBean().addSaslRealms( newSaslRealms );
+
+                saslRealmsTableViewer.refresh();
+                saslRealmsTableViewer.setSelection( new StructuredSelection( newSaslRealms ) );
+
+                setEditorDirty();
+            }
+        }
+    };
+    
+    
+    /**
+     * Edit SASL realms button
+     */
+    private SelectionListener editSaslRealmsButtonListener = new SelectionAdapter()
+    {
+        public void widgetSelected( SelectionEvent e )
+        {
+            editSaslRealmsAction();
+        }
+    };
+    
+    
+    /**
+     * Delete SASL realms button
+     */
+    private SelectionListener deleteSaslRealmsButtonListener = new SelectionAdapter()
+    {
+        public void widgetSelected( SelectionEvent e )
+        {
+            String selectedSaslRealms = getSelectedSaslRealms();
+
+            if ( selectedSaslRealms != null )
+            {
+                getLdapServerBean().getLdapServerSaslRealms().remove( selectedSaslRealms );
+                saslRealmsTableViewer.refresh();
+
+                setEditorDirty();
+            }
+        }
+    };
+
+    
+    /**
+     * The AuthMech Simple checkbox listener
+     */
     private SelectionAdapter authMechSimpleCheckboxListener = new SelectionAdapter()
     {
         public void widgetSelected( SelectionEvent e )
@@ -541,6 +674,11 @@ public class LdapLdapsServersPage extend
             setEnableSupportedAuthenticationMechanism( SASL_MECHANISMS_SIMPLE, authMechSimpleCheckbox.getSelection() );
         };
     };
+    
+    
+    /**
+     * The AuthMech GSSAPI checkbox listener
+     */
     private SelectionAdapter authMechGssapiCheckboxListener = new SelectionAdapter()
     {
         public void widgetSelected( SelectionEvent e )
@@ -549,6 +687,11 @@ public class LdapLdapsServersPage extend
                 authMechGssapiCheckbox.getSelection() );
         };
     };
+
+    
+    /**
+     * The AuthMech CRAM-MD5 checkbox listener
+     */
     private SelectionAdapter authMechCramMd5CheckboxListener = new SelectionAdapter()
     {
         public void widgetSelected( SelectionEvent e )
@@ -557,6 +700,11 @@ public class LdapLdapsServersPage extend
                 authMechCramMd5Checkbox.getSelection() );
         };
     };
+    
+    
+    /**
+     * The AuthMech Digest MD5 checkbox listener
+     */
     private SelectionAdapter authMechDigestMd5CheckboxListener = new SelectionAdapter()
     {
         public void widgetSelected( SelectionEvent e )
@@ -565,6 +713,11 @@ public class LdapLdapsServersPage extend
                 authMechDigestMd5Checkbox.getSelection() );
         };
     };
+    
+    
+    /**
+     * The AuthMech GSS-SPNEGO checkbox listener
+     */
     private SelectionAdapter authMechGssSpnegoCheckboxListener = new SelectionAdapter()
     {
         public void widgetSelected( SelectionEvent e )
@@ -574,6 +727,11 @@ public class LdapLdapsServersPage extend
             setEnabled( authMechGssSpnegoText, authMechGssSpnegoCheckbox.getSelection() );
         };
     };
+
+    
+    /**
+     * The AuthMech GSS-SPNEGO text listener
+     */
     private ModifyListener authMechGssSpnegoTextListener = new ModifyListener()
     {
         public void modifyText( ModifyEvent e )
@@ -582,6 +740,11 @@ public class LdapLdapsServersPage extend
                 authMechGssSpnegoText.getText() );
         }
     };
+    
+    
+    /**
+     * The AuthMech NTLM checkbox listener
+     */
     private SelectionAdapter authMechNtlmCheckboxListener = new SelectionAdapter()
     {
         public void widgetSelected( SelectionEvent e )
@@ -591,6 +754,11 @@ public class LdapLdapsServersPage extend
             setEnabled( authMechNtlmText, authMechNtlmCheckbox.getSelection() );
         };
     };
+    
+    
+    /**
+     * The AuthMech NTLM  text listener
+     */
     private ModifyListener authMechNtlmTextListener = new ModifyListener()
     {
         public void modifyText( ModifyEvent e )
@@ -637,6 +805,9 @@ public class LdapLdapsServersPage extend
     };
     
     
+    /**
+     * Tells if TLS is enabled
+     */
     private SelectionAdapter enableTlsCheckboxListener = new SelectionAdapter()
     {
         public void widgetSelected( SelectionEvent e )
@@ -644,6 +815,11 @@ public class LdapLdapsServersPage extend
             setEnableTls( enableTlsCheckbox.getSelection() );
         }
     };
+    
+    
+    /**
+     * Tell the server to hash the passwords
+     */
     private SelectionAdapter enableServerSidePasswordHashingCheckboxListener = new SelectionAdapter()
     {
         public void widgetSelected( SelectionEvent e )
@@ -660,6 +836,11 @@ public class LdapLdapsServersPage extend
             setEnabled( hashingMethodComboViewer.getCombo(), enableServerSidePasswordHashingCheckbox.getSelection() );
         }
     };
+    
+    
+    /**
+     * The list of method to use to hash the passwords
+     */
     private ISelectionChangedListener hashingMethodComboViewerListener = new ISelectionChangedListener()
     {
         public void selectionChanged( SelectionChangedEvent event )
@@ -667,22 +848,32 @@ public class LdapLdapsServersPage extend
             updateHashingMethod();
         }
     };
+    
+    
+    /**
+     * The keyStore file listener
+     */
     private ModifyListener keystoreFileTextListener = new ModifyListener()
     {
         public void modifyText( ModifyEvent e )
         {
             String keystoreFile = keystoreFileText.getText();
 
-            if ( !"".equals( keystoreFile ) ) //$NON-NLS-1$
+            if ( ( keystoreFile == null ) || ( keystoreFile.length() == 0 ) )
             {
-                getLdapServerBean().setLdapServerKeystoreFile( keystoreFile );
+                getLdapServerBean().setLdapServerKeystoreFile( null );
             }
             else
             {
-                getLdapServerBean().setLdapServerKeystoreFile( null );
+                getLdapServerBean().setLdapServerKeystoreFile( keystoreFile );
             }
         }
     };
+    
+    
+    /**
+     * Let the user browse the disk to find the keystore file
+     */
     private SelectionListener keystoreFileBrowseButtonSelectionListener = new SelectionAdapter()
     {
         public void widgetSelected( SelectionEvent event )
@@ -690,6 +881,7 @@ public class LdapLdapsServersPage extend
             FileDialog fileDialog = new FileDialog( keystoreFileBrowseButton.getShell(), SWT.OPEN );
 
             File file = new File( keystoreFileText.getText() );
+            
             if ( file.isFile() )
             {
                 fileDialog.setFilterPath( file.getParent() );
@@ -705,6 +897,7 @@ public class LdapLdapsServersPage extend
             }
 
             String returnedFileName = fileDialog.open();
+            
             if ( returnedFileName != null )
             {
                 keystoreFileText.setText( returnedFileName );
@@ -712,22 +905,32 @@ public class LdapLdapsServersPage extend
             }
         }
     };
+    
+    
+    /**
+     * The keystore password listener
+     */
     private ModifyListener keystorePasswordTextListener = new ModifyListener()
     {
         public void modifyText( ModifyEvent e )
         {
             String keystorePassword = keystorePasswordText.getText();
 
-            if ( !"".equals( keystorePassword ) ) //$NON-NLS-1$
+            if ( ( keystorePassword == null ) || ( keystorePassword.length() == 0 ) )
             {
-                getLdapServerBean().setLdapServerCertificatePassword( keystorePassword );
+                getLdapServerBean().setLdapServerCertificatePassword( null );
             }
             else
             {
-                getLdapServerBean().setLdapServerCertificatePassword( null );
+                getLdapServerBean().setLdapServerCertificatePassword( keystorePassword );
             }
         }
     };
+    
+    
+    /**
+     * The keystore password checkbox listener
+     */
     private SelectionListener showPasswordCheckboxSelectionListener = new SelectionAdapter()
     {
         public void widgetSelected( SelectionEvent e )
@@ -845,6 +1048,8 @@ public class LdapLdapsServersPage extend
     };
     
     
+    
+    
     /**
      * Enabled Protocols Table double-click
      */
@@ -856,6 +1061,8 @@ public class LdapLdapsServersPage extend
         }
     };
     
+    
+    
 
     /**
      * Add Enabled Protocols button
@@ -873,7 +1080,21 @@ public class LdapLdapsServersPage extend
             {
                 String newEnabledProtocol = dialog.getValue();
 
-                //getLdapServerTransportBean().addEnabledProtocols( newEnabledProtocol );
+                // Add the enabled protocols to LDAP and LDAPS transports. LDAP because
+                // it may be used for startTLS operation
+                TransportBean ldapTransport =  getLdapServerTransportBean();
+                
+                if ( ldapTransport != null )
+                {
+                    ldapTransport.addEnabledProtocols( newEnabledProtocol );
+                }
+
+                TransportBean ldapsTransport =  getLdapsServerTransportBean();
+                
+                if ( ldapsTransport != null )
+                {
+                    ldapsTransport.addEnabledProtocols( newEnabledProtocol );
+                }
 
                 enabledProtocolsTableViewer.refresh();
                 enabledProtocolsTableViewer.setSelection( new StructuredSelection( newEnabledProtocol ) );
@@ -907,7 +1128,20 @@ public class LdapLdapsServersPage extend
 
             if ( selectedEnabledProtocols != null )
             {
-                //getLdapsServerTransportBean().getEnabledProtocols().remove( selectedEnabledProtocols );
+                TransportBean ldapTransport =  getLdapServerTransportBean();
+                
+                if ( ldapTransport != null )
+                {
+                    ldapTransport.getEnabledProtocols().remove( selectedEnabledProtocols );
+                }
+
+                TransportBean ldapsTransport =  getLdapsServerTransportBean();
+                
+                if ( ldapsTransport != null )
+                {
+                    ldapsTransport.getEnabledProtocols().remove( selectedEnabledProtocols );
+                }
+
                 enabledProtocolsTableViewer.refresh();
 
                 setEditorDirty();
@@ -916,6 +1150,9 @@ public class LdapLdapsServersPage extend
     };
 
     
+    /**
+     * The replication ping Sleep modify listener
+     */
     private ModifyListener replicationPingerSleepTextListener = new ModifyListener()
     {
         public void modifyText( ModifyEvent e )
@@ -923,6 +1160,11 @@ public class LdapLdapsServersPage extend
             getLdapServerBean().setReplPingerSleep( Integer.parseInt( replicationPingerSleepText.getText() ) );
         }
     };
+    
+    
+    /**
+     * The disk synchronization delay modify listener
+     */
     private ModifyListener diskSynchronizationDelayTextListener = new ModifyListener()
     {
         public void modifyText( ModifyEvent e )
@@ -935,8 +1177,7 @@ public class LdapLdapsServersPage extend
     /**
      * Creates a new instance of GeneralPage.
      *
-     * @param editor
-     *      the associated editor
+     * @param editor the associated editor
      */
     public LdapLdapsServersPage( ServerConfigurationEditor editor )
     {
@@ -1392,36 +1633,65 @@ public class LdapLdapsServersPage extend
     private void createSaslSettingsSection( FormToolkit toolkit, Composite parent )
     {
         // Creation of the section
-        Section section = toolkit.createSection( parent, Section.TITLE_BAR );
+        Section section = toolkit.createSection( parent, Section.TITLE_BAR | Section.TWISTIE | Section.COMPACT );
         section.setText( Messages.getString( "LdapLdapsServersPage.SaslSettings" ) ); //$NON-NLS-1$
         section.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
         Composite composite = toolkit.createComposite( section );
         toolkit.paintBordersFor( composite );
-        GridLayout glayout = new GridLayout( 2, false );
+        GridLayout glayout = new GridLayout( 3, false );
         composite.setLayout( glayout );
         section.setClient( composite );
 
         // SASL Host Text
         toolkit.createLabel( composite, Messages.getString( "LdapLdapsServersPage.SaslHost" ) ); //$NON-NLS-1$
         saslHostText = toolkit.createText( composite, "" ); //$NON-NLS-1$
-        setGridDataWithDefaultWidth( saslHostText, new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        setGridDataWithDefaultWidth( saslHostText, new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ) );
         Label defaultSaslHostLabel = createDefaultValueLabel( toolkit, composite, "ldap.example.com" ); //$NON-NLS-1$
-        defaultSaslHostLabel.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ) );
+        defaultSaslHostLabel.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 3, 1 ) );
 
         // SASL Principal Text
         toolkit.createLabel( composite, Messages.getString( "LdapLdapsServersPage.SaslPrincipal" ) ); //$NON-NLS-1$
         saslPrincipalText = toolkit.createText( composite, "" ); //$NON-NLS-1$
-        setGridDataWithDefaultWidth( saslPrincipalText, new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        setGridDataWithDefaultWidth( saslPrincipalText, new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ) );
         Label defaultSaslPrincipalLabel = createDefaultValueLabel( toolkit, composite,
             "ldap/ldap.example.com@EXAMPLE.COM" ); //$NON-NLS-1$
-        defaultSaslPrincipalLabel.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ) );
+        defaultSaslPrincipalLabel.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 3, 1 ) );
 
         // Search Base Dn Text
         toolkit.createLabel( composite, Messages.getString( "LdapLdapsServersPage.SearchBaseDn" ) ); //$NON-NLS-1$
         saslSearchBaseDnText = toolkit.createText( composite, "" ); //$NON-NLS-1$
-        setGridDataWithDefaultWidth( saslSearchBaseDnText, new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        setGridDataWithDefaultWidth( saslSearchBaseDnText, new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ) );
         Label defaultSaslSearchBaseDnLabel = createDefaultValueLabel( toolkit, composite, "ou=users,dc=example,dc=com" ); //$NON-NLS-1$
-        defaultSaslSearchBaseDnLabel.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ) );
+        defaultSaslSearchBaseDnLabel.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 3, 1 ) );
+
+        // SASL Realms label 
+        Label saslRealmsLabel = toolkit.createLabel( composite, Messages.getString( "LdapLdapsServersPage.SaslRealms" ), SWT.WRAP  ); //$NON-NLS-1$
+        setBold( saslRealmsLabel );
+        saslRealmsLabel.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, glayout.numColumns, 1 ) );
+
+        // SASL realms Table Viewer
+        saslRealmsTableViewer = new TableViewer( composite );
+        saslRealmsTableViewer.setContentProvider( new ArrayContentProvider() );
+        GridData saslRealmsTableViewerGridData = new GridData( SWT.FILL, SWT.CENTER, true, false, 2, 3 );
+        saslRealmsTableViewerGridData.heightHint = 60;
+        saslRealmsTableViewer.getControl().setLayoutData( saslRealmsTableViewerGridData );
+
+        // Add SASL realms Button
+        addSaslRealmsButton = toolkit.createButton( composite,
+            Messages.getString( "LdapLdapsServersPage.Add" ), SWT.PUSH ); //$NON-NLS-1$
+        addSaslRealmsButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING, false, false, 1, 1 ) );
+
+        // Edit SASL realms Button
+        editSaslRealmsButton = toolkit.createButton( composite,
+            Messages.getString( "LdapLdapsServersPage.Edit" ), SWT.PUSH ); //$NON-NLS-1$
+        editSaslRealmsButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING, false, false, 1, 1 ) );
+        editSaslRealmsButton.setEnabled( false );
+
+        // Delete SASL realms Button
+        deleteSaslRealmsButton = toolkit.createButton( composite,
+            Messages.getString( "LdapLdapsServersPage.Delete" ), SWT.PUSH ); //$NON-NLS-1$
+        deleteSaslRealmsButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING, false, false, 1, 1 ) );
+        deleteSaslRealmsButton.setEnabled( false );
     }
 
 
@@ -1537,6 +1807,13 @@ public class LdapLdapsServersPage extend
         addDirtyListener( saslSearchBaseDnText );
         addModifyListener( saslSearchBaseDnText, saslSearchBaseDnTextListener );
 
+        // SASL Realms Table Viewer
+        addSelectionChangedListener( saslRealmsTableViewer, saslRealmsTableViewerSelectionChangedListener );
+        addDoubleClickListener( saslRealmsTableViewer, saslRealmsTableViewerDoubleClickListener );
+        addSelectionListener( editSaslRealmsButton, editSaslRealmsButtonListener );
+        addSelectionListener( addSaslRealmsButton, addSaslRealmsButtonListener );
+        addSelectionListener( deleteSaslRealmsButton, deleteSaslRealmsButtonListener );
+
         // Max Time Limit Text
         addDirtyListener( maxTimeLimitText );
         addModifyListener( maxTimeLimitText, maxTimeLimitTextListener );
@@ -1565,26 +1842,18 @@ public class LdapLdapsServersPage extend
         addSelectionChangedListener( ciphersSuiteTableViewer, ciphersSuiteTableViewerSelectionChangedListener );
         addDoubleClickListener( ciphersSuiteTableViewer, ciphersSuiteTableViewerDoubleClickListener );
 
-        // Advanced SSL Cipher Suite
+        // Advanced SSL Cipher Suite add/edit/delete buttons listeners
         addSelectionListener( addCiphersSuiteButton, addCiphersSuiteButtonListener );
-
-        // Advanced SSL Cipher Suite
         addSelectionListener( editCiphersSuiteButton, editCiphersSuiteButtonListener );
-
-        // Advanced SSL Cipher Suite
         addSelectionListener( deleteCiphersSuiteButton, deleteCiphersSuiteButtonListener );
 
         // Advanced SSL Enabled Protocols
         addSelectionChangedListener( enabledProtocolsTableViewer, enabledProtocolsTableViewerSelectionChangedListener );
         addDoubleClickListener( enabledProtocolsTableViewer, enabledProtocolsTableViewerDoubleClickListener );
 
-        // Advanced SSL Enabled Protocols
+        // Advanced SSL Enabled Protocols add/edit/delete buttons
         addSelectionListener( addEnabledProtocolsButton, addEnabledProtocolsButtonListener );
-
-        // Advanced SSL Enabled Protocols
         addSelectionListener( editEnabledProtocolsButton, editEnabledProtocolsButtonListener );
-
-        // Delete SSL/Start TLS Cipher Suite
         addSelectionListener( deleteEnabledProtocolsButton, deleteEnabledProtocolsButtonListener );
 
         // Replication Pinger Sleep
@@ -1709,7 +1978,16 @@ public class LdapLdapsServersPage extend
         // SASL Seach Base Dn Text
         removeDirtyListener( saslSearchBaseDnText );
         removeModifyListener( saslSearchBaseDnText, saslSearchBaseDnTextListener );
-
+        
+        // SASL Realms
+        removeSelectionChangedListener( saslRealmsTableViewer, saslRealmsTableViewerSelectionChangedListener );
+        removeDoubleClickListener( saslRealmsTableViewer, saslRealmsTableViewerDoubleClickListener );
+        
+        // SASL Realms add/edit/delete buttons
+        removeSelectionListener( addSaslRealmsButton, addSaslRealmsButtonListener );
+        removeSelectionListener( editSaslRealmsButton, editSaslRealmsButtonListener );
+        removeSelectionListener( deleteSaslRealmsButton, deleteSaslRealmsButtonListener );
+        
         // Max Time Limit Text
         removeDirtyListener( maxTimeLimitText );
         removeModifyListener( maxTimeLimitText, maxTimeLimitTextListener );
@@ -1735,26 +2013,18 @@ public class LdapLdapsServersPage extend
         removeSelectionChangedListener( ciphersSuiteTableViewer, ciphersSuiteTableViewerSelectionChangedListener );
         removeDoubleClickListener( ciphersSuiteTableViewer, ciphersSuiteTableViewerDoubleClickListener );
 
-        // Advanced SSL Cipher Suite
+        // Advanced SSL Cipher Suite add/edit/delete buttons
         removeSelectionListener( addCiphersSuiteButton, addCiphersSuiteButtonListener );
-
-        // Advanced SSL Cipher Suite
         removeSelectionListener( editCiphersSuiteButton, editCiphersSuiteButtonListener );
-
-        // Advanced SSL Cipher Suite
         removeSelectionListener( deleteCiphersSuiteButton, deleteCiphersSuiteButtonListener );
 
         // Advanced SSL Enabled Protocols
         removeSelectionChangedListener( enabledProtocolsTableViewer, enabledProtocolsTableViewerSelectionChangedListener );
         removeDoubleClickListener( enabledProtocolsTableViewer, enabledProtocolsTableViewerDoubleClickListener );
 
-        // Advanced SSL Enabled Protocols
+        // Advanced SSL Enabled Protocols add/edit/delete buttons removal
         removeSelectionListener( addEnabledProtocolsButton, addEnabledProtocolsButtonListener );
-
-        // Advanced SSL Enabled Protocols
         removeSelectionListener( editEnabledProtocolsButton, editEnabledProtocolsButtonListener );
-
-        // Advanced SSL Enabled Protocols
         removeSelectionListener( deleteEnabledProtocolsButton, deleteEnabledProtocolsButtonListener );
 
         // Replication Pinger Sleep
@@ -1817,6 +2087,8 @@ public class LdapLdapsServersPage extend
             setText( saslHostText, ldapServerBean.getLdapServerSaslHost() );
             setText( saslPrincipalText, ldapServerBean.getLdapServerSaslPrincipal() );
             setText( saslSearchBaseDnText, ldapServerBean.getSearchBaseDn().toString() );
+            saslRealmsTableViewer.setInput( ldapServerBean.getLdapServerSaslRealms() );
+            saslRealmsTableViewer.refresh();
 
             // Keystore Properties
             setText( keystoreFileText, ldapServerBean.getLdapServerKeystoreFile() );
@@ -1825,6 +2097,7 @@ public class LdapLdapsServersPage extend
             // Supported Auth Mechanisms
             List<SaslMechHandlerBean> saslMechHandlers = ldapServerBean.getSaslMechHandlers();
             uncheckAllSupportedAuthenticationMechanisms();
+            
             for ( SaslMechHandlerBean saslMechHandler : saslMechHandlers )
             {
                 if ( SASL_MECHANISMS_SIMPLE.equalsIgnoreCase( saslMechHandler.getSaslMechName() ) )
@@ -1877,6 +2150,7 @@ public class LdapLdapsServersPage extend
             else
             {
                 LdapSecurityConstants hashingMethod = getHashingMethodFromInterceptor( hashingMethodInterceptor );
+                
                 if ( hashingMethod != null )
                 {
                     // Setting selection for the hashing method
@@ -1899,6 +2173,23 @@ public class LdapLdapsServersPage extend
             ciphersSuiteTableViewer.setInput( ldapServerBean.getEnabledCipherSuites() );
             ciphersSuiteTableViewer.refresh();
 
+            // SSL/Start TLS Enabled Protocols
+            List<String> transports = new ArrayList<String>();
+            
+            for ( TransportBean transportBean : ldapServerBean.getTransports() )
+            {
+                if ( transportBean.getEnabledProtocols() != null )
+                {
+                    for ( String enableProtocol : transportBean.getEnabledProtocols() )
+                    {
+                        transports.add( enableProtocol );
+                    }
+                }
+            }
+            
+            enabledProtocolsTableViewer.setInput( transports );
+            enabledProtocolsTableViewer.refresh();
+
             // Replication Pinger Sleep
             setText( replicationPingerSleepText, Integer.toString( ldapServerBean.getReplPingerSleep() ) );
 
@@ -1911,7 +2202,7 @@ public class LdapLdapsServersPage extend
 
 
     /**
-     * Unchecks all supported authentication mechanisns checkboxes.
+     * Unchecks all supported authentication mechanisms checkboxes.
      */
     private void uncheckAllSupportedAuthenticationMechanisms()
     {
@@ -1935,6 +2226,7 @@ public class LdapLdapsServersPage extend
     private void setEnableSupportedAuthenticationMechanism( String mechanismName, boolean enabled )
     {
         List<SaslMechHandlerBean> saslMechHandlers = getLdapServerBean().getSaslMechHandlers();
+        
         for ( SaslMechHandlerBean saslMechHandler : saslMechHandlers )
         {
             if ( mechanismName.equalsIgnoreCase( saslMechHandler.getSaslMechName() ) )
@@ -1955,6 +2247,7 @@ public class LdapLdapsServersPage extend
     private void setNtlmMechProviderSupportedAuthenticationMechanism( String mechanismName, String ntlmMechProvider )
     {
         List<SaslMechHandlerBean> saslMechHandlers = getLdapServerBean().getSaslMechHandlers();
+        
         for ( SaslMechHandlerBean saslMechHandler : saslMechHandlers )
         {
             if ( mechanismName.equalsIgnoreCase( saslMechHandler.getSaslMechName() ) )
@@ -1969,8 +2262,7 @@ public class LdapLdapsServersPage extend
     /**
      * Gets the LDAP Server bean.
      *
-     * @return
-     *      the LDAP Server bean
+     * @return the LDAP Server bean
      */
     private LdapServerBean getLdapServerBean()
     {
@@ -2370,24 +2662,34 @@ public class LdapLdapsServersPage extend
         {
             case HASH_METHOD_MD5:
                 return HASHING_PASSWORD_INTERCEPTOR_FQCN_MD5;
+                
             case HASH_METHOD_SMD5:
                 return HASHING_PASSWORD_INTERCEPTOR_FQCN_SMD5;
+                
             case HASH_METHOD_CRYPT:
                 return HASHING_PASSWORD_INTERCEPTOR_FQCN_CRYPT;
+                
             case HASH_METHOD_SHA256:
                 return HASHING_PASSWORD_INTERCEPTOR_FQCN_SHA256;
+                
             case HASH_METHOD_SSHA256:
                 return HASHING_PASSWORD_INTERCEPTOR_FQCN_SSHA256;
+                
             case HASH_METHOD_SHA384:
                 return HASHING_PASSWORD_INTERCEPTOR_FQCN_SHA384;
+                
             case HASH_METHOD_SSHA384:
                 return HASHING_PASSWORD_INTERCEPTOR_FQCN_SSHA384;
+                
             case HASH_METHOD_SHA512:
                 return HASHING_PASSWORD_INTERCEPTOR_FQCN_SHA512;
+                
             case HASH_METHOD_SSHA512:
                 return HASHING_PASSWORD_INTERCEPTOR_FQCN_SSHA512;
+                
             case HASH_METHOD_SHA:
                 return HASHING_PASSWORD_INTERCEPTOR_FQCN_SHA;
+                
             case HASH_METHOD_SSHA:
             default:
                 return HASHING_PASSWORD_INTERCEPTOR_FQCN_SSHA;
@@ -2499,14 +2801,60 @@ public class LdapLdapsServersPage extend
             {
                 String newEnabledProtocols = dialog.getValue();
 
-                //getLdapServerTransportBean().getEnabledProtocols().remove( selectedEnabledProtocols );
-                //getLdapServerTransportBean().addEnabledProtocols( newEnabledProtocols );
-
                 enabledProtocolsTableViewer.refresh();
                 enabledProtocolsTableViewer.setSelection( new StructuredSelection( newEnabledProtocols ) );
 
                 setEditorDirty();
             }
+        }
+    }
+
+
+    /**
+     * Gets the first SASL realms Table 
+     *
+     * @return the first Enabled Protocols Table
+     */
+    private String getSelectedSaslRealms()
+    {
+        StructuredSelection selection = ( StructuredSelection ) saslRealmsTableViewer.getSelection();
+
+        if ( !selection.isEmpty() )
+        {
+            return ( String ) selection.getFirstElement();
+        }
+
+        return null;
+    }
+
+
+    /**
+     * This method is called when the edit Sasl realms button is clicked,
+     * or when the table viewer is double clicked.
+     */
+    private void editSaslRealmsAction()
+    {
+        String selectedSaslRealms = getSelectedSaslRealms();
+
+        if ( selectedSaslRealms != null )
+        {
+            InputDialog dialog = new InputDialog( editSaslRealmsButton.getShell(),
+                Messages.getString( "LdapLdapsServersPage.Edit" ), //$NON-NLS-1$
+                Messages.getString( "LdapLdapsServersPage.SaslRealms" ), //$NON-NLS-1$
+                selectedSaslRealms, null );
+
+            if ( dialog.open() == InputDialog.OK )
+            {
+                String newSaslRealms = dialog.getValue();
+
+                getLdapServerBean().getLdapServerSaslRealms().remove( selectedSaslRealms );
+                getLdapServerBean().addSaslRealms( newSaslRealms );
+
+                saslRealmsTableViewer.refresh();
+                saslRealmsTableViewer.setSelection( new StructuredSelection( newSaslRealms ) );
+
+                setEditorDirty();
+            }
         }
     }
 }

Modified: directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/OverviewPage.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/OverviewPage.java?rev=1653313&r1=1653312&r2=1653313&view=diff
==============================================================================
--- directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/OverviewPage.java (original)
+++ directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/OverviewPage.java Tue Jan 20 17:50:42 2015
@@ -73,7 +73,7 @@ import org.eclipse.ui.forms.widgets.Tabl
  * | | +--------------------------------| | | +--------------------------------+ | |
  * | | | +----------------------------+ | | | | [X] Allow anonymous access     | | |
  * | | | | Partition 1                | | | | | [X] Enable Access Control      | | |
- * | | | | Partition 2                | | | | |                                | | |
+ * | | | | Partition 2                | | | | | [X] Password Hidden            | | |
  * | | | | ...                        | | | | |                                | | |
  * | | | +----------------------------+ | | | |                                | | |
  * | | | <advanced partitionsS config>  | | | |                                | | |
@@ -119,6 +119,7 @@ public class OverviewPage extends Server
     /** The LDAP Options controls */
     private Button allowAnonymousAccessCheckbox;
     private Button enableAccessControlCheckbox;
+    private Button enableHiddenPasswordCheckbox;
 
     // UI Control Listeners
     /**
@@ -326,6 +327,18 @@ public class OverviewPage extends Server
             getDirectoryServiceBean().setDsAccessControlEnabled( enableAccessControlCheckbox.getSelection() );
         }
     };
+    
+    
+    /**
+     * The HiddenPassword checkbox listener
+     */
+    private SelectionAdapter enableHiddenPasswordCheckboxListener = new SelectionAdapter()
+    {
+        public void widgetSelected( SelectionEvent e )
+        {
+            getDirectoryServiceBean().setDsPasswordHidden( enableHiddenPasswordCheckbox.getSelection() );
+        }
+    };
 
 
     /**
@@ -584,6 +597,11 @@ public class OverviewPage extends Server
         enableAccessControlCheckbox = toolkit.createButton( composite,
             Messages.getString( "OverviewPage.EnableAccessControl" ), SWT.CHECK ); //$NON-NLS-1$
         enableAccessControlCheckbox.setLayoutData( new GridData( SWT.NONE, SWT.NONE, true, false ) );
+
+        // Enable Hidden Password Checkbox
+        enableHiddenPasswordCheckbox = toolkit.createButton( composite,
+            Messages.getString( "OverviewPage.EnableHiddenPassword" ), SWT.CHECK ); //$NON-NLS-1$
+        enableHiddenPasswordCheckbox.setLayoutData( new GridData( SWT.NONE, SWT.NONE, true, false ) );
     }
 
 
@@ -631,6 +649,10 @@ public class OverviewPage extends Server
         // Enable Access Control Checkbox
         addDirtyListener( enableAccessControlCheckbox );
         addSelectionListener( enableAccessControlCheckbox, enableAccessControlCheckboxListener );
+
+        // Enable Hidden Password Checkbox
+        addDirtyListener( enableHiddenPasswordCheckbox );
+        addSelectionListener( enableHiddenPasswordCheckbox, enableHiddenPasswordCheckboxListener );
     }
 
 
@@ -678,6 +700,10 @@ public class OverviewPage extends Server
         // Enable Access Control Checkbox
         removeDirtyListener( enableAccessControlCheckbox );
         removeSelectionListener( enableAccessControlCheckbox, enableAccessControlCheckboxListener );
+
+        // Enable Hidden Password Checkbox
+        removeDirtyListener( enableHiddenPasswordCheckbox );
+        removeSelectionListener( enableHiddenPasswordCheckbox, enableHiddenPasswordCheckboxListener );
     }
 
 
@@ -737,6 +763,7 @@ public class OverviewPage extends Server
             // Options
             allowAnonymousAccessCheckbox.setSelection( directoryServiceBean.isDsAllowAnonymousAccess() );
             enableAccessControlCheckbox.setSelection( directoryServiceBean.isDsAccessControlEnabled() );
+            enableHiddenPasswordCheckbox.setSelection( directoryServiceBean.isDsPasswordHidden() );
 
             addListeners();
         }

Modified: directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java?rev=1653313&r1=1653312&r2=1653313&view=diff
==============================================================================
--- directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java (original)
+++ directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java Tue Jan 20 17:50:42 2015
@@ -21,7 +21,6 @@ package org.apache.directory.studio.apac
 
 
 import java.lang.reflect.InvocationTargetException;
-import java.util.Enumeration;
 
 import org.apache.directory.server.config.ConfigWriter;
 import org.apache.directory.server.config.beans.ConfigBean;
@@ -44,7 +43,16 @@ import org.eclipse.ui.forms.editor.FormE
 
 
 /**
- * This class implements the Server Configuration Editor.
+ * This class implements the Server Configuration Editor. This editor expose
+ * 6 pages into a form with 6 tags :
+ * <ul>
+ * <li>Overview : the basic configuration</li>
+ * <li>LDAP/LDAPS : the configuration for the LDAP/S server</li>
+ * <li>Kerberos : the configuration for the Kerberos server</li>
+ * <li>Partitions : The partitions configuration</li>
+ * <li>PasswordPolicy : The password policy configuration</li>
+ * <li>Replication : The replicationconfiguration</li>
+ * </ul> 
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -59,7 +67,7 @@ public class ServerConfigurationEditor e
     /** The configuration bean */
     private ConfigBean configBean;
 
-    // The pages
+    /** The pages */
     private LoadingPage loadingPage;
     private OverviewPage overviewPage;
     private LdapLdapsServersPage ldapLdapsServersPage;
@@ -212,8 +220,7 @@ public class ServerConfigurationEditor e
     /**
      * Performs the "Save as..." action.
      *
-     * @param monitor
-     *      the monitor to use
+     * @param monitor the monitor to use
      * @throws Exception
      */
     public boolean doSaveAs( IProgressMonitor monitor ) throws Exception
@@ -285,8 +292,7 @@ public class ServerConfigurationEditor e
     /**
      * Sets the 'dirty' flag.
      *
-     * @param dirty
-     *      the 'dirty' flag
+     * @param dirty the 'dirty' flag
      */
     public void setDirty( boolean dirty )
     {
@@ -305,8 +311,7 @@ public class ServerConfigurationEditor e
     /**
      * Gets the configuration bean.
      *
-     * @return
-     *      the configuration bean
+     * @return the configuration bean
      */
     public ConfigBean getConfigBean()
     {
@@ -317,8 +322,7 @@ public class ServerConfigurationEditor e
     /**
      * Sets the configuration.
      *
-     * @param configBean
-     *      the configuration bean
+     * @param configBean the configuration bean
      */
     public void setConfiguration( ConfigBean configBean )
     {
@@ -329,8 +333,7 @@ public class ServerConfigurationEditor e
     /**
      * Resets the configuration and refresh the UI.
      *
-     * @param configBean
-     *      the configuration bean
+     * @param configBean the configuration bean
      */
     public void resetConfiguration( ConfigBean configBean )
     {
@@ -351,8 +354,7 @@ public class ServerConfigurationEditor e
      * This method is called by the job responsible for loading the 
      * configuration when it has been fully and correctly loaded.
      *
-     * @param configBean
-     *      the loaded configuration bean
+     * @param configBean the loaded configuration bean
      */
     public void configurationLoaded( ConfigBean configBean )
     {
@@ -366,8 +368,7 @@ public class ServerConfigurationEditor e
      * This method is called by the job responsible for loading the
      * configuration when it failed to load it.
      *
-     * @param exception
-     *      the exception
+     * @param exception the exception
      */
     public void configurationLoadFailed( Exception exception )
     {
@@ -446,21 +447,18 @@ public class ServerConfigurationEditor e
     /**
      * Set a particular page as active if it is found in the pages vector.
      *
-     * @param pageClass
-     *      the class of the page
+     * @param pageClass the class of the page
      */
-    @SuppressWarnings("rawtypes")
     public void showPage( Class<?> pageClass )
     {
         if ( pageClass != null )
         {
-            Enumeration enumeration = pages.elements();
-            while ( enumeration.hasMoreElements() )
+            for ( Object page : pages )
             {
-                Object page = enumeration.nextElement();
                 if ( pageClass.isInstance( page ) )
                 {
                     setActivePage( pages.indexOf( page ) );
+                    
                     return;
                 }
             }
@@ -471,8 +469,7 @@ public class ServerConfigurationEditor e
     /**
      * Gets the configuration writer.
      *
-     * @return
-     *      the configuration writer
+     * @return the configuration writer
      * @throws Exception
      */
     public ConfigWriter getConfigWriter() throws Exception

Modified: directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages.properties
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages.properties?rev=1653313&r1=1653312&r2=1653313&view=diff
==============================================================================
--- directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages.properties (original)
+++ directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages.properties Tue Jan 20 17:50:42 2015
@@ -71,6 +71,7 @@ LdapLdapsServersPage.Port=Port:
 LdapLdapsServersPage.Provider=Provider:
 LdapLdapsServersPage.SaslHost=SASL Host:
 LdapLdapsServersPage.SaslPrincipal=SASL Principal:
+LdapLdapsServersPage.SaslRealms=SASL Realms:
 LdapLdapsServersPage.SaslSettings=SASL Settings
 LdapLdapsServersPage.SearchBaseDn=Search Base Dn:
 LdapLdapsServersPage.ShowPassword=Show password
@@ -91,6 +92,7 @@ OverviewPage.AdvancedOptionsConfiguratio
 OverviewPage.AdvancedPartitionsConfiguration=Advanced Partitions configuration...
 OverviewPage.AllowAnonymousAccess=Allow Anonymous Access
 OverviewPage.EnableAccessControl=Enable Access Control
+OverviewPage.EnableHiddenPassword=Enable Hidden Password
 OverviewPage.EnableKerberosChangePasswordServer=Enable Kerberos Change Password Server
 OverviewPage.EnableKerberosServer=Enable Kerberos Server
 OverviewPage.EnableLdapServer=Enable LDAP Server

Modified: directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages_de.properties
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages_de.properties?rev=1653313&r1=1653312&r2=1653313&view=diff
==============================================================================
--- directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages_de.properties (original)
+++ directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages_de.properties Tue Jan 20 17:50:42 2015
@@ -71,6 +71,7 @@ LdapLdapsServersPage.Port=Port:
 LdapLdapsServersPage.Provider=Provider:
 LdapLdapsServersPage.SaslHost=SASL Host:
 LdapLdapsServersPage.SaslPrincipal=SASL Principal:
+LdapLdapsServersPage.SaslRealms=SASL Realms:
 LdapLdapsServersPage.SaslSettings=SASL Einstellungen
 LdapLdapsServersPage.SearchBaseDn=Suchbasis DN:
 LdapLdapsServersPage.ShowPassword=Passwort anzeigen
@@ -91,6 +92,7 @@ OverviewPage.AdvancedOptionsConfiguratio
 OverviewPage.AdvancedPartitionsConfiguration=Erweiterte Partitionseinstellungen...
 OverviewPage.AllowAnonymousAccess=Anonymen Zugriff erlauben
 OverviewPage.EnableAccessControl=Zugriffskontrolle aktivieren
+OverviewPage.EnableHiddenPassword=(EN)Enable Hidden Password
 OverviewPage.EnableKerberosChangePasswordServer=Kerberos Change Password Server aktivieren
 OverviewPage.EnableKerberosServer=Kerberos Server aktivieren
 OverviewPage.EnableLdapServer=LDAP Server aktivieren

Modified: directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages_fr.properties
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages_fr.properties?rev=1653313&r1=1653312&r2=1653313&view=diff
==============================================================================
--- directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages_fr.properties (original)
+++ directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages_fr.properties Tue Jan 20 17:50:42 2015
@@ -71,6 +71,7 @@ LdapLdapsServersPage.Port=Port:
 LdapLdapsServersPage.Provider=Fournisseur:
 LdapLdapsServersPage.SaslHost=Hôte SASL:
 LdapLdapsServersPage.SaslPrincipal=SASL Principal:
+LdapLdapsServersPage.SaslRealms=SASL Realms:
 LdapLdapsServersPage.SaslSettings=Réglages SASL
 LdapLdapsServersPage.SearchBaseDn=Search Base Dn:
 LdapLdapsServersPage.ShowPassword=Show password
@@ -91,6 +92,7 @@ OverviewPage.AdvancedOptionsConfiguratio
 OverviewPage.AdvancedPartitionsConfiguration=Configuration avancée des partitions...
 OverviewPage.AllowAnonymousAccess=Autoriser l'accès anonyme
 OverviewPage.EnableAccessControl=Activer le contrôle d'accès
+OverviewPage.EnableHiddenPassword=Masquer les mots de passe
 OverviewPage.EnableKerberosChangePasswordServer=Activer le serveur Kerberos Change Password
 OverviewPage.EnableKerberosServer=Activer le serveur Kerberos
 OverviewPage.EnableLdapServer=Activer le serveur LDAP

Modified: directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/jobs/EntryBasedConfigurationPartition.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/jobs/EntryBasedConfigurationPartition.java?rev=1653313&r1=1653312&r2=1653313&view=diff
==============================================================================
--- directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/jobs/EntryBasedConfigurationPartition.java (original)
+++ directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/jobs/EntryBasedConfigurationPartition.java Tue Jan 20 17:50:42 2015
@@ -29,6 +29,7 @@ import org.apache.directory.api.ldap.mod
 import org.apache.directory.api.ldap.model.exception.LdapException;
 import org.apache.directory.api.ldap.model.name.Dn;
 import org.apache.directory.api.ldap.model.schema.SchemaManager;
+import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.api.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.partition.ldif.AbstractLdifPartition;
 
@@ -43,10 +44,8 @@ public class EntryBasedConfigurationPart
     /**
      * Creates a new instance of ReadOnlyConfigurationPartition.
      *
-     * @param inputStream
-     *      the input stream
-     * @param schemaManager
-     *      the schema manager
+     * @param inputStream the input stream
+     * @param schemaManager the schema manager
      */
     public EntryBasedConfigurationPartition( SchemaManager schemaManager )
     {
@@ -60,7 +59,7 @@ public class EntryBasedConfigurationPart
     protected void doInit() throws InvalidNameException, Exception
     {
         setId( "config" ); //$NON-NLS-1$
-        setSuffixDn( new Dn( "ou=config" ) ); //$NON-NLS-1$
+        setSuffixDn( new Dn( ServerDNConstants.CONFIG_DN ) ); //$NON-NLS-1$
 
         super.doInit();
     }
@@ -69,8 +68,7 @@ public class EntryBasedConfigurationPart
     /**
      * Adds the given entry.
      *
-     * @param entry
-     *      the entry
+     * @param entry the entry
      * @throws Exception
      */
     public void addEntry( Entry entry ) throws Exception

Modified: directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/jobs/LoadConfigurationRunnable.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/jobs/LoadConfigurationRunnable.java?rev=1653313&r1=1653312&r2=1653313&view=diff
==============================================================================
--- directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/jobs/LoadConfigurationRunnable.java (original)
+++ directory/studio/branches/studio-tycho/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/jobs/LoadConfigurationRunnable.java Tue Jan 20 17:50:42 2015
@@ -60,6 +60,7 @@ import org.apache.directory.studio.ldapb
 import org.apache.directory.studio.ldapbrowser.core.jobs.SearchRunnable;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.IEditorInput;
@@ -141,11 +142,16 @@ public class LoadConfigurationRunnable i
         }
         catch ( Exception e )
         {
+            ApacheDS2ConfigurationPlugin.getDefault().getLog().log( 
+                new Status( Status.ERROR, "org.apache.directory.studio.apacheds.configuration.v2", 
+                    e.getMessage() ) );
+
             // Reporting the error to the monitor
             monitor.reportError( e );
 
             // Reporting the error to the editor
             final Exception exception = e;
+            
             Display.getDefault().asyncExec( new Runnable()
             {
                 public void run()
@@ -204,6 +210,7 @@ public class LoadConfigurationRunnable i
         {
             // We use the tooltip to get the full path of the file
             InputStream is = new FileInputStream( new File( input.getToolTipText() ) );
+            
             return readConfiguration( is );
         }
 
@@ -318,6 +325,9 @@ public class LoadConfigurationRunnable i
             // Verifying we found the 'ou=config' base entry
             if ( configEntry == null )
             {
+                ApacheDS2ConfigurationPlugin.getDefault().getLog().log( 
+                    new Status( Status.ERROR, "org.apache.directory.studio.apacheds.configuration.v2", 
+                        Messages.getString( "LoadConfigurationRunnable.UnableToFindConfigBaseEntry" ) ) );
                 throw new LdapNoSuchObjectException(
                     Messages.getString( "LoadConfigurationRunnable.UnableToFindConfigBaseEntry" ) ); //$NON-NLS-1$
             }