You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by fe...@apache.org on 2007/11/26 20:44:37 UTC

svn commit: r598395 [2/7] - in /directory/sandbox/felixk: studio-aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/model/ studio-aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/ studio-aciitemedito...

Modified: directory/sandbox/felixk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerConfiguration.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerConfiguration.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerConfiguration.java (original)
+++ directory/sandbox/felixk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerConfiguration.java Mon Nov 26 11:44:28 2007
@@ -35,8 +35,10 @@
     /** The path of the Server Configuration file */
     private String path;
 
+    // LDAP Configuration
+
     /** The port */
-    private int port;
+    private int ldapPort;
 
     /** The principal */
     private String principal;
@@ -44,8 +46,7 @@
     /** The password */
     private String password;
 
-    /** The flag for Allow Anonymous Access */
-    private boolean allowAnonymousAccess;
+    // Limits
 
     /** The Max Time Limit */
     private int maxTimeLimit;
@@ -53,27 +54,77 @@
     /** the Max Size Limit */
     private int maxSizeLimit;
 
-    /** The Synchonization Period */
+    /** The Synchronization Period */
     private long synchronizationPeriod;
 
     /** The Maximum number of Threads */
     private int maxThreads;
 
+    /** The Supported Mechanisms */
+    private List<String> supportedMechanisms;
+
+    // SASL Properties
+
+    /** The SASL Host */
+    private String saslHost;
+
+    /** The SASL Principal */
+    private String saslPrincipal;
+
+    /** The SASL QOP */
+    private List<String> saslQops;
+
+    /** The SASL Realms */
+    private List<String> saslRealms;
+
+    /** The Search Base DN */
+    private String searchBaseDn;
+
+    // Protocols
+
     /** The flag for Enable Access Control */
     private boolean enableAccessControl;
 
     /** The flag for Enable Kerberos */
     private boolean enableKerberos;
 
+    /** The port for Kerberos */
+    private int kerberosPort;
+
     /** The flag for Enable NTP */
-    private boolean enableNTP;
+    private boolean enableNtp;
+
+    /** The port for NTP */
+    private int ntpPort;
+
+    /** The flag for Enable DNS */
+    private boolean enableDns;
+
+    /** The port for DNS */
+    private int dnsPort;
+
+    /** The flag for Enable LDAPS */
+    private boolean enableLdaps;
+
+    /** The port for LDAPS */
+    private int ldapsPort;
 
     /** The flag for Enable Change Password */
     private boolean enableChangePassword;
 
+    /** The port for Change Password */
+    private int changePasswordPort;
+
+    // Options
+
     /** The flag for Denormalize Operational Attributes */
     private boolean denormalizeOpAttr;
 
+    /** The flag for Allow Anonymous Access */
+    private boolean allowAnonymousAccess;
+
+    // Other configuration elements
+
     /** The Binary Attributes */
     private List<String> binaryAttributes;
 
@@ -92,6 +143,9 @@
      */
     public ServerConfiguration()
     {
+        supportedMechanisms = new ArrayList<String>();
+        saslQops = new ArrayList<String>();
+        saslRealms = new ArrayList<String>();
         partitions = new ArrayList<Partition>();
         interceptors = new ArrayList<Interceptor>();
         extendedOperations = new ArrayList<ExtendedOperation>();
@@ -100,183 +154,184 @@
 
 
     /**
-     * Gets the Allow Anonymous flag.
+     * Adds a Binary Attribute.
      *
+     * @param binaryAttribute
+     *      the Partition to add
      * @return
-     *      true if the server configuration allows Anonymous Access
+     *      true (as per the general contract of the Collection.add method).
      */
-    public boolean isAllowAnonymousAccess()
+    public boolean addBinaryAttribute( String binaryAttribute )
     {
-        return allowAnonymousAccess;
+        return binaryAttributes.add( binaryAttribute );
     }
 
 
     /**
-     * Sets the Allow Anonymous flag.
+     * Adds an Extended Operation.
      *
-     * @param allowAnonymousAccess
-     *      the new value
+     * @param extendedOperation
+     *      the Extended Operation to add
+     * @return
+     *      true (as per the general contract of the Collection.add method).
      */
-    public void setAllowAnonymousAccess( boolean allowAnonymousAccess )
+    public boolean addExtendedOperation( ExtendedOperation extendedOperation )
     {
-        this.allowAnonymousAccess = allowAnonymousAccess;
+        return extendedOperations.add( extendedOperation );
     }
 
 
     /**
-     * Gets the Enable Access Control flag.
+     * Adds an Interceptor.
      *
+     * @param interceptor
+     *      the Interceptor to add
      * @return
-     *      true if Access Control is enabled
+     *      true (as per the general contract of the Collection.add method).
      */
-    public boolean isEnableAccessControl()
+    public boolean addInterceptor( Interceptor interceptor )
     {
-        return enableAccessControl;
+        return interceptors.add( interceptor );
     }
 
 
     /**
-     * Sets the Enable Access Control flag.
+     * Adds a Partition.
      *
-     * @param enableAccessControl
-     *      the new value
+     * @param partition
+     *      the Partition to add
+     * @return
+     *      true (as per the general contract of the Collection.add method).
      */
-    public void setEnableAccessControl( boolean enableAccessControl )
+    public boolean addPartition( Partition partition )
     {
-        this.enableAccessControl = enableAccessControl;
+        return partitions.add( partition );
     }
 
 
     /**
-     * Gets the Enable Change Password flag.
+     * Adds a SASL Quality Of Protection.
      *
+     * @param saslQop
+     *      the SASL Quality Of Protection to add
      * @return
-     *      true if Change Password is enabled
+     *      true (as per the general contract of the Collection.add method).
      */
-    public boolean isEnableChangePassword()
+    public boolean addSaslQop( String saslQop )
     {
-        return enableChangePassword;
+        return saslQops.add( saslQop );
     }
 
 
     /**
-     * Sets the Enable Change Password flag.
-     *
-     * @param enableChangePassword
-     *      the new value
-     */
-    public void setEnableChangePassword( boolean enableChangePassword )
+    * Adds a SASL Realm.
+    *
+    * @param qop
+    *      the SASL Realm to add
+    * @return
+    *      true (as per the general contract of the Collection.add method).
+    */
+    public boolean addSaslRealm( String saslRealm )
     {
-        this.enableChangePassword = enableChangePassword;
+        return saslRealms.add( saslRealm );
     }
 
 
     /**
-     * Gets the Enable Kerberos flag.
+     * Adds a Supported Mechanism.
      *
+     * @param supportedMechanism
+     *      the Supported Mechanism to add
      * @return
-     *      true if Kerberos is enabled
+     *      true (as per the general contract of the Collection.add method).
      */
-    public boolean isEnableKerberos()
+    public boolean addSupportedMechanism( String supportedMechanism )
     {
-        return enableKerberos;
+        return supportedMechanisms.add( supportedMechanism );
     }
 
 
     /**
-     * Sets the Enable Kerberos flag.
-     *
-     * @param enableKerberos
-     *      the new value
+     * Removes all Binary Attributes.
      */
-    public void setEnableKerberos( boolean enableKerberos )
+    public void clearBinaryAttributes()
     {
-        this.enableKerberos = enableKerberos;
+        binaryAttributes.clear();
     }
 
 
     /**
-     * Gets the Enable NTP flag.
-     *
-     * @return
-     *      true if NTP is enabled
+     * Removes all ExtendedOperations.
      */
-    public boolean isEnableNTP()
+    public void clearExtendedOperations()
     {
-        return enableNTP;
+        extendedOperations.clear();
     }
 
 
     /**
-     * Sets the Enable NTP flag.
-     *
-     * @param enableNTP
-     *      the new value
+     * Removes all interceptors.
      */
-    public void setEnableNTP( boolean enableNTP )
+    public void clearInterceptors()
     {
-        this.enableNTP = enableNTP;
+        interceptors.clear();
     }
 
 
     /**
-     * Gets the Extended Operations List.
-     *
-     * @return
-     *      the Extended Operations List
+     * Removes all partitions.
      */
-    public List<ExtendedOperation> getExtendedOperations()
+    public void clearPartitions()
     {
-        return extendedOperations;
+        partitions.clear();
     }
 
 
     /**
-     * Sets the Extended Operations List.
+     * Gets the Binary Attributes List.
      *
-     * @param extendedOperations
-     *      the new value
+     * @return
+     *      the Binary Attributes  List
      */
-    public void setExtendedOperations( List<ExtendedOperation> extendedOperations )
+    public List<String> getBinaryAttributes()
     {
-        this.extendedOperations = extendedOperations;
+        return binaryAttributes;
     }
 
 
     /**
-     * Adds ab Extended Operation.
+     * Gets the Change Password port.
      *
-     * @param extendedOperation
-     *      the Extended Operation to add
      * @return
-     *      true (as per the general contract of the Collection.add method).
+     *      the Change Password port
      */
-    public boolean addExtendedOperation( ExtendedOperation extendedOperation )
+    public int getChangePasswordPort()
     {
-        return extendedOperations.add( extendedOperation );
+        return changePasswordPort;
     }
 
 
     /**
-     * Removes an Extended Operation.
+     * Gets the DNS port.
      *
-     * @param extendedOperation
-     *      the Extended Operation to remove
      * @return
-     *      true if this list contained the specified element.
+     *      the DNS port
      */
-    public boolean removeExtendedOperation( ExtendedOperation extendedOperation )
+    public int getDnsPort()
     {
-        return extendedOperations.remove( extendedOperation );
+        return dnsPort;
     }
 
 
     /**
-     * Removes all ExtendedOperations.
+     * Gets the Extended Operations List.
+     *
+     * @return
+     *      the Extended Operations List
      */
-    public void clearExtendedOperations()
+    public List<ExtendedOperation> getExtendedOperations()
     {
-        extendedOperations.clear();
+        return extendedOperations;
     }
 
 
@@ -293,51 +348,26 @@
 
 
     /**
-     * Sets the Interceptors List.
-     *
-     * @param interceptors
-     *      the new value
-     */
-    public void setInterceptors( List<Interceptor> interceptors )
-    {
-        this.interceptors = interceptors;
-    }
-
-
-    /**
-     * Adds an Interceptor.
+     * Gets the Kerberos port.
      *
-     * @param interceptor
-     *      the Interceptor to add
      * @return
-     *      true (as per the general contract of the Collection.add method).
+     *      the Kerberos port
      */
-    public boolean addInterceptor( Interceptor interceptor )
+    public int getKerberosPort()
     {
-        return interceptors.add( interceptor );
+        return kerberosPort;
     }
 
 
     /**
-     * Removes an Interceptor.
+     * Gets the LDAPS port.
      *
-     * @param interceptor
-     *      the Interceptor to remove
      * @return
-     *      true if this list contained the specified element.
-     */
-    public boolean removeInterceptor( Interceptor interceptor )
-    {
-        return interceptors.remove( interceptor );
-    }
-
-
-    /**
-     * Removes all interceptors.
+     *      the LDAPS port
      */
-    public void clearInterceptors()
+    public int getLdapsPort()
     {
-        interceptors.clear();
+        return ldapsPort;
     }
 
 
@@ -354,18 +384,6 @@
 
 
     /**
-     * Sets the Maximum Size Limit.
-     *
-     * @param maxSizeLimit
-     *      the new value
-     */
-    public void setMaxSizeLimit( int maxSizeLimit )
-    {
-        this.maxSizeLimit = maxSizeLimit;
-    }
-
-
-    /**
      * Gets the Maximum number of Threads.
      *
      * @return
@@ -378,18 +396,6 @@
 
 
     /**
-     * Sets the Maximum number of Threads
-     *
-     * @param maxThreads
-     *      the new value
-     */
-    public void setMaxThreads( int maxThreads )
-    {
-        this.maxThreads = maxThreads;
-    }
-
-
-    /**
      * Gets the Maximum Time Limit.
      *
      * @return
@@ -402,14 +408,14 @@
 
 
     /**
-     * Sets the Maximum Time Limit.
+     * Gets the NTP port.
      *
-     * @param maxTimeLimit
-     *      the new value
+     * @return
+     *      the NTP port
      */
-    public void setMaxTimeLimit( int maxTimeLimit )
+    public int getNtpPort()
     {
-        this.maxTimeLimit = maxTimeLimit;
+        return ntpPort;
     }
 
 
@@ -426,233 +432,230 @@
 
 
     /**
-     * Sets the Partitions List.
+     * Gets the password.
      *
-     * @param partitions
-     *      the new value
+     * @return
+     *      the password
      */
-    public void setPartitions( List<Partition> partitions )
+    public String getPassword()
     {
-        this.partitions = partitions;
+        return password;
     }
 
 
     /**
-     * Adds a Partition.
+     * Gets the Path of the file corresponding to the ServerConfiguration.
      *
-     * @param partition
-     *      the Partition to add
      * @return
-     *      true (as per the general contract of the Collection.add method).
+     *      the Path of the corresponding file
      */
-    public boolean addPartition( Partition partition )
+    public String getPath()
     {
-        return partitions.add( partition );
+        return path;
     }
 
 
     /**
-     * Removes a Partition.
+     * Gets the LDAP Port.
      *
-     * @param partition
-     *      the partition to remove
      * @return
-     *      true if this list contained the specified element.
+     *      the LDAP Port
      */
-    public boolean removePartition( Partition partition )
+    public int getLdapPort()
     {
-        return partitions.remove( partition );
+        return ldapPort;
     }
 
 
     /**
-     * Removes all partitions.
+     * Gets the Principal
+     *
+     * @return
+     *      the Principal
      */
-    public void clearPartitions()
+    public String getPrincipal()
     {
-        partitions.clear();
+        return principal;
     }
 
 
     /**
-     * Gets the password.
+     * Gets the SASL Host.
      *
      * @return
-     *      the password
+     *       the SASL Host
      */
-    public String getPassword()
+    public String getSaslHost()
     {
-        return password;
+        return saslHost;
     }
 
 
     /**
-     * Sets the password.
+     * Gets the SASL Principal.
      *
-     * @param password
-     *      the new password
+     * @return
+     *      the SASL Principal
      */
-    public void setPassword( String password )
+    public String getSaslPrincipal()
     {
-        this.password = password;
+        return saslPrincipal;
     }
 
 
     /**
-     * Gets the Path of the file corresponding to the ServerConfiguration.
+     * Gets the SASL Quality Of Protection List
      *
      * @return
-     *      the Path of the corresponding file
+     *      the SASL Quality Of Protection List
      */
-    public String getPath()
+    public List<String> getSaslQops()
     {
-        return path;
+        return saslQops;
     }
 
 
     /**
-     * Sets the Path of the file corresponding to the ServerConfiguration.
+     * Gets the SASL Realms List.
      *
-     * @param path
-     *      the new value
+     * @return
+     *      the SASL Realms List
      */
-    public void setPath( String path )
+    public List<String> getSaslRealms()
     {
-        this.path = path;
+        return saslRealms;
     }
 
 
     /**
-     * Gets the Port.
+     * Gets the Search Base DN.
      *
      * @return
-     *      the Port
+     *      the Search Base DN
      */
-    public int getPort()
+    public String getSearchBaseDn()
     {
-        return port;
+        return searchBaseDn;
     }
 
 
     /**
-     * Sets the Port
-     *
-     * @param port
-     *      the new value
+     * Gets the Supported Mechanisms List.
+     * 
+     * @return
+     *      the Supported Mechanisms List
      */
-    public void setPort( int port )
+    public List<String> getSupportedMechanisms()
     {
-        this.port = port;
+        return supportedMechanisms;
     }
 
 
     /**
-     * Gets the Principal
+     * Gets the Synchronization Period.
      *
      * @return
-     *      the Principal
+     *      the Synchronization Period
      */
-    public String getPrincipal()
+    public long getSynchronizationPeriod()
     {
-        return principal;
+        return synchronizationPeriod;
     }
 
 
     /**
-     * Sets the Principal
+     * Gets the Allow Anonymous flag.
      *
-     * @param principal
-     *      the new value
+     * @return
+     *      true if the server configuration allows Anonymous Access
      */
-    public void setPrincipal( String principal )
+    public boolean isAllowAnonymousAccess()
     {
-        this.principal = principal;
+        return allowAnonymousAccess;
     }
 
 
     /**
-     * Gets the Synchronization Period.
+     * Gets the Denormalize Operational Attributes flag.
      *
      * @return
-     *      the Synchronization Period
+     *      the Denormalize Operational Attributes flag
      */
-    public long getSynchronizationPeriod()
+    public boolean isDenormalizeOpAttr()
     {
-        return synchronizationPeriod;
+        return denormalizeOpAttr;
     }
 
 
     /**
-     * Sets the Synchonization Period.
+     * Gets the Enable Access Control flag.
      *
-     * @param synchronizationPeriod
-     *      the new value
+     * @return
+     *      true if Access Control is enabled
      */
-    public void setSynchronizationPeriod( long synchronizationPeriod )
+    public boolean isEnableAccessControl()
     {
-        this.synchronizationPeriod = synchronizationPeriod;
+        return enableAccessControl;
     }
 
 
     /**
-     * Gets the Denormalize Operational Attributes flag.
+     * Gets the Enable Change Password flag.
      *
      * @return
-     *      the Denormalize Operational Attributes flag
+     *      true if Change Password is enabled
      */
-    public boolean isDenormalizeOpAttr()
+    public boolean isEnableChangePassword()
     {
-        return denormalizeOpAttr;
+        return enableChangePassword;
     }
 
 
     /**
-     * Sets the Denormalize Operational Attributes flag.
+     * Gets the Enable DNS flag.
      *
-     * @param denormalizeOpAttr
-     *      the new Denormalize Operational Attributes flag
+     * @return
+     *      true if DNS is enabled
      */
-    public void setDenormalizeOpAttr( boolean denormalizeOpAttr )
+    public boolean isEnableDns()
     {
-        this.denormalizeOpAttr = denormalizeOpAttr;
+        return enableDns;
     }
 
 
     /**
-     * Gets the Binary Attributes List.
+     * Gets the Enable Kerberos flag.
      *
      * @return
-     *      the Binary Attributes  List
+     *      true if Kerberos is enabled
      */
-    public List<String> getBinaryAttributes()
+    public boolean isEnableKerberos()
     {
-        return binaryAttributes;
+        return enableKerberos;
     }
 
 
     /**
-     * Sets the Binary Attributes  List.
+     * Gets the Enable LDAPS flag.
      *
-     * @param binaryAttributes
-     *      the new value
+     * @return
+     *      true if LDAPS is enabled
      */
-    public void setBinaryAttributes( List<String> binaryAttributes )
+    public boolean isEnableLdaps()
     {
-        this.binaryAttributes = binaryAttributes;
+        return enableLdaps;
     }
 
 
     /**
-     * Adds a Binary Attribute.
+     * Gets the Enable NTP flag.
      *
-     * @param binaryAttribute
-     *      the Partition to add
      * @return
-     *      true (as per the general contract of the Collection.add method).
+     *      true if NTP is enabled
      */
-    public boolean addBinaryAttribute( String binaryAttribute )
+    public boolean isEnableNtp()
     {
-        return binaryAttributes.add( binaryAttribute );
+        return enableNtp;
     }
 
 
@@ -671,10 +674,456 @@
 
 
     /**
-     * Removes all Binary Attributes.
+     * Removes an Extended Operation.
+     *
+     * @param extendedOperation
+     *      the Extended Operation to remove
+     * @return
+     *      true if this list contained the specified element.
      */
-    public void clearBinaryAttributes()
+    public boolean removeExtendedOperation( ExtendedOperation extendedOperation )
     {
-        binaryAttributes.clear();
+        return extendedOperations.remove( extendedOperation );
+    }
+
+
+    /**
+     * Removes an Supported Mechanism.
+     *
+     * @param supportedMechanism
+     *      the Supported Mechanism to remove
+     * @return
+     *      true if this list contained the specified element.
+     */
+    public boolean removeExtendedOperation( String supportedMechanism )
+    {
+        return supportedMechanisms.remove( supportedMechanism );
+    }
+
+
+    /**
+     * Removes an Interceptor.
+     *
+     * @param interceptor
+     *      the Interceptor to remove
+     * @return
+     *      true if this list contained the specified element.
+     */
+    public boolean removeInterceptor( Interceptor interceptor )
+    {
+        return interceptors.remove( interceptor );
+    }
+
+
+    /**
+     * Removes a Partition.
+     *
+     * @param partition
+     *      the partition to remove
+     * @return
+     *      true if this list contained the specified element.
+     */
+    public boolean removePartition( Partition partition )
+    {
+        return partitions.remove( partition );
+    }
+
+
+    /**
+     * Removes a SASL Quality Of Protection.
+     *
+     * @param saslQop
+     *      the SASL Quality Of Protection to remove
+     * @return
+     *      true if this list contained the specified element.
+     */
+    public boolean removeSaslQop( String saslQop )
+    {
+        return saslQops.remove( saslQop );
+    }
+
+
+    /**
+     * Removes a SASL Realm.
+     *
+     * @param saslRealm
+     *      the SASL Realm to remove
+     * @return
+     *      true if this list contained the specified element.
+     */
+    public boolean removeSaslRealm( String saslRealm )
+    {
+        return saslRealms.remove( saslRealm );
+    }
+
+
+    /**
+     * Sets the Allow Anonymous flag.
+     *
+     * @param allowAnonymousAccess
+     *      the new value
+     */
+    public void setAllowAnonymousAccess( boolean allowAnonymousAccess )
+    {
+        this.allowAnonymousAccess = allowAnonymousAccess;
+    }
+
+
+    /**
+     * Sets the Binary Attributes  List.
+     *
+     * @param binaryAttributes
+     *      the new value
+     */
+    public void setBinaryAttributes( List<String> binaryAttributes )
+    {
+        this.binaryAttributes = binaryAttributes;
+    }
+
+
+    /**
+     * Sets the Change Password port.
+     *
+     * @param changePasswordPort
+     *      the Change Password port
+     */
+    public void setChangePasswordPort( int changePasswordPort )
+    {
+        this.changePasswordPort = changePasswordPort;
+    }
+
+
+    /**
+     * Sets the Denormalize Operational Attributes flag.
+     *
+     * @param denormalizeOpAttr
+     *      the new Denormalize Operational Attributes flag
+     */
+    public void setDenormalizeOpAttr( boolean denormalizeOpAttr )
+    {
+        this.denormalizeOpAttr = denormalizeOpAttr;
+    }
+
+
+    /**
+     * Sets the DNS port.
+     *
+     * @param dnsPort
+     *      the DNS port
+     */
+    public void setDnsPort( int dnsPort )
+    {
+        this.dnsPort = dnsPort;
+    }
+
+
+    /**
+     * Sets the Enable Access Control flag.
+     *
+     * @param enableAccessControl
+     *      the new value
+     */
+    public void setEnableAccessControl( boolean enableAccessControl )
+    {
+        this.enableAccessControl = enableAccessControl;
+    }
+
+
+    /**
+     * Sets the Enable Change Password flag.
+     *
+     * @param enableChangePassword
+     *      the new value
+     */
+    public void setEnableChangePassword( boolean enableChangePassword )
+    {
+        this.enableChangePassword = enableChangePassword;
+    }
+
+
+    /**
+     * Sets Enable DNS flag.
+     *
+     * @param enableDns
+     *      the new value
+     */
+    public void setEnableDns( boolean enableDns )
+    {
+        this.enableDns = enableDns;
+    }
+
+
+    /**
+     * Sets the Enable Kerberos flag.
+     *
+     * @param enableKerberos
+     *      the new value
+     */
+    public void setEnableKerberos( boolean enableKerberos )
+    {
+        this.enableKerberos = enableKerberos;
+    }
+
+
+    /**
+     * Sets the Enable LDAPS flag.
+     *
+     * @param enableLdaps
+     *      the new value
+     */
+    public void setEnableLdaps( boolean enableLdaps )
+    {
+        this.enableLdaps = enableLdaps;
+    }
+
+
+    /**
+     * Sets the Enable NTP flag.
+     *
+     * @param enableNtp
+     *      the new value
+     */
+    public void setEnableNtp( boolean enableNtp )
+    {
+        this.enableNtp = enableNtp;
+    }
+
+
+    /**
+     * Sets the Extended Operations List.
+     *
+     * @param extendedOperations
+     *      the new value
+     */
+    public void setExtendedOperations( List<ExtendedOperation> extendedOperations )
+    {
+        this.extendedOperations = extendedOperations;
+    }
+
+
+    /**
+     * Sets the Interceptors List.
+     *
+     * @param interceptors
+     *      the new value
+     */
+    public void setInterceptors( List<Interceptor> interceptors )
+    {
+        this.interceptors = interceptors;
+    }
+
+
+    /**
+     * Sets the Kerberos port.
+     *
+     * @param kerberosPort
+     *      the new value
+     */
+    public void setKerberosPort( int kerberosPort )
+    {
+        this.kerberosPort = kerberosPort;
+    }
+
+
+    /**
+     * Sets The LDAPS port.
+     *
+     * @param ldapsPort
+     */
+    public void setLdapsPort( int ldapsPort )
+    {
+        this.ldapsPort = ldapsPort;
+    }
+
+
+    /**
+     * Sets the Maximum Size Limit.
+     *
+     * @param maxSizeLimit
+     *      the new value
+     */
+    public void setMaxSizeLimit( int maxSizeLimit )
+    {
+        this.maxSizeLimit = maxSizeLimit;
+    }
+
+
+    /**
+     * Sets the Maximum number of Threads
+     *
+     * @param maxThreads
+     *      the new value
+     */
+    public void setMaxThreads( int maxThreads )
+    {
+        this.maxThreads = maxThreads;
+    }
+
+
+    /**
+     * Sets the Maximum Time Limit.
+     *
+     * @param maxTimeLimit
+     *      the new value
+     */
+    public void setMaxTimeLimit( int maxTimeLimit )
+    {
+        this.maxTimeLimit = maxTimeLimit;
+    }
+
+
+    /**
+     * Sets the NTP port.
+     *
+     * @param ntpPort
+     *      the new value
+     */
+    public void setNtpPort( int ntpPort )
+    {
+        this.ntpPort = ntpPort;
+    }
+
+
+    /**
+     * Sets the Partitions List.
+     *
+     * @param partitions
+     *      the new value
+     */
+    public void setPartitions( List<Partition> partitions )
+    {
+        this.partitions = partitions;
+    }
+
+
+    /**
+     * Sets the password.
+     *
+     * @param password
+     *      the new password
+     */
+    public void setPassword( String password )
+    {
+        this.password = password;
+    }
+
+
+    /**
+     * Sets the Path of the file corresponding to the ServerConfiguration.
+     *
+     * @param path
+     *      the new value
+     */
+    public void setPath( String path )
+    {
+        this.path = path;
+    }
+
+
+    /**
+     * Sets the LDAP Port
+     *
+     * @param ldapPort
+     *      the new value
+     */
+    public void setLdapPort( int ldapPort )
+    {
+        this.ldapPort = ldapPort;
+    }
+
+
+    /**
+     * Sets the Principal
+     *
+     * @param principal
+     *      the new value
+     */
+    public void setPrincipal( String principal )
+    {
+        this.principal = principal;
+    }
+
+
+    /**
+     * Sets the SASL Host.
+     *
+     * @param saslHost
+     *      the new value
+     */
+    public void setSaslHost( String saslHost )
+    {
+        this.saslHost = saslHost;
+    }
+
+
+    /**
+     * Sets the SASL Principal.
+     *
+     * @param saslPrincipal
+     *      the new value
+     */
+    public void setSaslPrincipal( String saslPrincipal )
+    {
+        this.saslPrincipal = saslPrincipal;
+    }
+
+
+    /**
+     * Sets the SASL Quality Of Protection List.
+     *
+     * @param saslQops
+     *      the new value
+     */
+    public void setSaslQops( List<String> saslQops )
+    {
+        this.saslQops = saslQops;
+    }
+
+
+    /**
+     * Sets the SASL Realms List.
+     * 
+     * @param saslRealms
+     *      the new value
+     */
+    public void setSaslRealms( List<String> saslRealms )
+    {
+        this.saslRealms = saslRealms;
+    }
+
+
+    /**
+     * Sets the Search Base DN
+     *
+     * @param searchBaseDn
+     *      the new value
+     */
+    public void setSearchBaseDn( String searchBaseDn )
+    {
+        this.searchBaseDn = searchBaseDn;
+    }
+
+
+    /**
+     * Sets the Supported Mechanisms List.
+     *
+     * @param supportedMechanisms
+     *      the new value
+     */
+    public void setSupportedMechanisms( List<String> supportedMechanisms )
+    {
+        this.supportedMechanisms = supportedMechanisms;
+    }
+
+
+    /**
+     * Sets the Synchonization Period.
+     *
+     * @param synchronizationPeriod
+     *      the new value
+     */
+    public void setSynchronizationPeriod( long synchronizationPeriod )
+    {
+        this.synchronizationPeriod = synchronizationPeriod;
     }
 }

Added: directory/sandbox/felixk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerConfigurationContentTypeChecker.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerConfigurationContentTypeChecker.java?rev=598395&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerConfigurationContentTypeChecker.java (added)
+++ directory/sandbox/felixk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerConfigurationContentTypeChecker.java Mon Nov 26 11:44:28 2007
@@ -0,0 +1,143 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.studio.apacheds.configuration.model;
+
+
+import java.io.InputStream;
+import java.io.Reader;
+import java.util.Iterator;
+
+import org.dom4j.Attribute;
+import org.dom4j.Document;
+import org.dom4j.Element;
+import org.dom4j.io.SAXReader;
+
+
+/**
+ * This class represents the Server Configuration Content Type Checker. 
+ * It is used to check if a file correspond to a correct Apache DS 'server.xml' configuration.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class ServerConfigurationContentTypeChecker
+{
+    /**
+     * Checks if the InputStream is valid.
+     *
+     * @param inputStream
+     *      the InputStream
+     * @return
+     *      true if the InputStream is valid, false if not
+     */
+    public static boolean isValid( InputStream inputStream )
+    {
+        try
+        {
+            SAXReader saxReader = new SAXReader();
+
+            return isValid( saxReader.read( inputStream ) );
+        }
+        catch ( Exception e )
+        {
+            return false;
+        }
+    }
+
+
+    /**
+     * Checks if the InputStream is valid.
+     *
+     * @param inputStream
+     *      the InputStream
+     * @return
+     *      true if the InputStream is valid, false if not
+     */
+    public static boolean isValid( Reader reader )
+    {
+        try
+        {
+            SAXReader saxReader = new SAXReader();
+
+            return isValid( saxReader.read( reader ) );
+        }
+        catch ( Exception e )
+        {
+            return false;
+        }
+    }
+
+
+    /**
+     * Checks if the Document is valid.
+     *
+     * @param document
+     *      the Document
+     * @return
+     *      true if the Document is valid, false if not
+     */
+    private static boolean isValid( Document document )
+    {
+        Element configurationBean = getBeanElementById( document, "configuration" );
+        if ( configurationBean == null )
+        {
+            return false;
+        }
+        else
+        {
+            Attribute classAttribute = configurationBean.attribute( "class" );
+            if ( classAttribute == null )
+            {
+                return false;
+            }
+            else
+            {
+                return "org.apache.directory.server.configuration.MutableServerStartupConfiguration"
+                    .equals( classAttribute.getValue() );
+            }
+        }
+    }
+
+
+    /**
+     * Gets the Bean element corresponding to the given ID.
+     *
+     * @param document
+     *      the document to use
+     * @param id
+     *      the id
+     * @return
+     *       the Bean element corresponding to the given ID or null if the bean was not found
+     */
+    private static Element getBeanElementById( Document document, String id )
+    {
+        for ( Iterator<?> i = document.getRootElement().elementIterator( "bean" ); i.hasNext(); )
+        {
+            Element element = ( Element ) i.next();
+            Attribute idAttribute = element.attribute( "id" );
+            if ( idAttribute != null && ( idAttribute.getValue().equals( id ) ) )
+            {
+                return element;
+            }
+        }
+
+        return null;
+    }
+}

Propchange: directory/sandbox/felixk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerConfigurationContentTypeChecker.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: directory/sandbox/felixk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerConfigurationParser.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerConfigurationParser.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerConfigurationParser.java (original)
+++ directory/sandbox/felixk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerConfigurationParser.java Mon Nov 26 11:44:28 2007
@@ -150,6 +150,24 @@
         // Reading the 'Environment' Bean
         readEnvironmentBean( document, serverConfiguration );
 
+        // Reading the 'ChangePasswordConfiguration' Bean
+        readChangePasswordConfigurationBean( document, serverConfiguration );
+
+        // Reading the 'NTPConfiguration' Bean
+        readNTPConfigurationBean( document, serverConfiguration );
+
+        // Reading the 'DNSConfiguration' Bean
+        readDNSConfigurationBean( document, serverConfiguration );
+
+        // Reading the 'KDCConfiguration' Bean
+        readKDCConfigurationBean( document, serverConfiguration );
+
+        // Reading the 'LDAPSConfiguration' Bean
+        readLDAPSConfigurationBean( document, serverConfiguration );
+
+        // Reading the 'LDAPConfiguration' Bean
+        readLDAPConfigurationBean( document, serverConfiguration );
+
         // Reading the 'Configuration' Bean
         readConfigurationBean( document, serverConfiguration );
     }
@@ -186,8 +204,8 @@
         if ( binaryAttributes != null )
         {
             String[] attributes = binaryAttributes.split( " " );
-            
-            for( String attribute : attributes)
+
+            for ( String attribute : attributes )
             {
                 serverConfiguration.addBinaryAttribute( attribute );
             }
@@ -213,7 +231,7 @@
             Element propsElement = propertyElement.element( "props" );
             if ( propsElement != null )
             {
-                for ( Iterator i = propsElement.elementIterator( "prop" ); i.hasNext(); )
+                for ( Iterator<?> i = propsElement.elementIterator( "prop" ); i.hasNext(); )
                 {
                     Element propElement = ( Element ) i.next();
                     Attribute keyAttribute = propElement.attribute( "key" );
@@ -230,49 +248,294 @@
 
 
     /**
-     * Reads the "Configuration" Bean and store its values in the given ServerConfiguration.
+     * Reads the "ChangePasswordConfiguration" Bean and store its values in the given ServerConfiguration.
      *
      * @param document
      *      the document to use
      * @param serverConfiguration
      *      the Server Configuration
-     * @throws NumberFormatException
      * @throws BooleanFormatException 
-     * @throws ServerConfigurationParserException 
+     * @throws NumberFormatException 
      */
-    private void readConfigurationBean( Document document, ServerConfiguration serverConfiguration )
-        throws NumberFormatException, BooleanFormatException, ServerConfigurationParserException
+    private void readChangePasswordConfigurationBean( Document document, ServerConfiguration serverConfiguration )
+        throws BooleanFormatException, NumberFormatException
     {
-        Element configurationBean = getBeanElementById( document, "configuration" );
+        Element changePasswordConfigurationBean = getBeanElementById( document, "changePasswordConfiguration" );
 
-        // LdapPort
-        String ldapPort = readBeanProperty( "ldapPort", configurationBean );
-        if ( ldapPort != null )
+        // Enabled
+        String enabled = readBeanProperty( "enabled", changePasswordConfigurationBean );
+        if ( enabled != null )
         {
-            serverConfiguration.setPort( Integer.parseInt( ldapPort ) );
+            serverConfiguration.setEnableChangePassword( parseBoolean( enabled ) );
         }
 
-        // SynchPeriodMillis
-        String synchPeriodMillis = readBeanProperty( "synchPeriodMillis", configurationBean );
-        if ( synchPeriodMillis != null )
+        // IP Port
+        String ipPort = readBeanProperty( "ipPort", changePasswordConfigurationBean );
+        if ( ipPort != null )
         {
-            serverConfiguration.setSynchronizationPeriod( Long.parseLong( synchPeriodMillis ) );
+            serverConfiguration.setChangePasswordPort( Integer.parseInt( ipPort ) );
+        }
+    }
+
+
+    /**
+     * Reads the "NTPConfiguration" Bean and store its values in the given ServerConfiguration.
+     *
+     * @param document
+     *      the document to use
+     * @param serverConfiguration
+     *      the Server Configuration
+     * @throws BooleanFormatException 
+     * @throws NumberFormatException 
+     */
+    private void readNTPConfigurationBean( Document document, ServerConfiguration serverConfiguration )
+        throws BooleanFormatException, NumberFormatException
+    {
+        Element ntpConfigurationBean = getBeanElementById( document, "ntpConfiguration" );
+
+        // Enabled
+        String enabled = readBeanProperty( "enabled", ntpConfigurationBean );
+        if ( enabled != null )
+        {
+            serverConfiguration.setEnableNtp( parseBoolean( enabled ) );
+        }
+
+        // IP Port
+        String ipPort = readBeanProperty( "ipPort", ntpConfigurationBean );
+        if ( ipPort != null )
+        {
+            serverConfiguration.setNtpPort( Integer.parseInt( ipPort ) );
+        }
+    }
+
+
+    /**
+     * Reads the "DNSConfiguration" Bean and store its values in the given ServerConfiguration.
+     *
+     * @param document
+     *      the document to use
+     * @param serverConfiguration
+     *      the Server Configuration
+     * @throws BooleanFormatException 
+     * @throws NumberFormatException 
+     */
+    private void readDNSConfigurationBean( Document document, ServerConfiguration serverConfiguration )
+        throws BooleanFormatException, NumberFormatException
+    {
+        Element dnsConfigurationBean = getBeanElementById( document, "dnsConfiguration" );
+
+        // Enabled
+        String enabled = readBeanProperty( "enabled", dnsConfigurationBean );
+        if ( enabled != null )
+        {
+            serverConfiguration.setEnableDns( parseBoolean( enabled ) );
+        }
+
+        // IP Port
+        String ipPort = readBeanProperty( "ipPort", dnsConfigurationBean );
+        if ( ipPort != null )
+        {
+            serverConfiguration.setDnsPort( Integer.parseInt( ipPort ) );
+        }
+    }
+
+
+    /**
+     * Reads the "KDCConfiguration" Bean and store its values in the given ServerConfiguration.
+     *
+     * @param document
+     *      the document to use
+     * @param serverConfiguration
+     *      the Server Configuration
+     * @throws BooleanFormatException 
+     * @throws NumberFormatException 
+     */
+    private void readKDCConfigurationBean( Document document, ServerConfiguration serverConfiguration )
+        throws BooleanFormatException, NumberFormatException
+    {
+        Element kdcConfigurationBean = getBeanElementById( document, "kdcConfiguration" );
+
+        // Enabled
+        String enabled = readBeanProperty( "enabled", kdcConfigurationBean );
+        if ( enabled != null )
+        {
+            serverConfiguration.setEnableKerberos( parseBoolean( enabled ) );
+        }
+
+        // IP Port
+        String ipPort = readBeanProperty( "ipPort", kdcConfigurationBean );
+        if ( ipPort != null )
+        {
+            serverConfiguration.setKerberosPort( Integer.parseInt( ipPort ) );
+        }
+    }
+
+
+    /**
+     * Reads the "LDAPSConfiguration" Bean and store its values in the given ServerConfiguration.
+     *
+     * @param document
+     *      the document to use
+     * @param serverConfiguration
+     *      the Server Configuration
+     * @throws BooleanFormatException 
+     * @throws NumberFormatException 
+     */
+    private void readLDAPSConfigurationBean( Document document, ServerConfiguration serverConfiguration )
+        throws BooleanFormatException, NumberFormatException
+    {
+        Element ldapsConfiguration = getBeanElementById( document, "ldapsConfiguration" );
+
+        // Enabled
+        String enabled = readBeanProperty( "enabled", ldapsConfiguration );
+        if ( enabled != null )
+        {
+            serverConfiguration.setEnableLdaps( parseBoolean( enabled ) );
+        }
+
+        // IP Port
+        String ipPort = readBeanProperty( "ipPort", ldapsConfiguration );
+        if ( ipPort != null )
+        {
+            serverConfiguration.setLdapsPort( Integer.parseInt( ipPort ) );
+        }
+    }
+
+
+    /**
+     * Reads the "LDAPConfiguration" Bean and store its values in the given ServerConfiguration.
+     *
+     * @param document
+     *      the document to use
+     * @param serverConfiguration
+     *      the Server Configuration
+     * @throws BooleanFormatException 
+     * @throws NumberFormatException 
+     */
+    private void readLDAPConfigurationBean( Document document, ServerConfiguration serverConfiguration )
+        throws BooleanFormatException, NumberFormatException
+    {
+        Element ldapConfiguration = getBeanElementById( document, "ldapConfiguration" );
+
+        // IP Port
+        String ipPort = readBeanProperty( "ipPort", ldapConfiguration );
+        if ( ipPort != null )
+        {
+            serverConfiguration.setLdapPort( Integer.parseInt( ipPort ) );
+        }
+
+        // AllowAnonymousAccess
+        String allowAnonymousAccess = readBeanProperty( "allowAnonymousAccess", ldapConfiguration );
+        if ( allowAnonymousAccess != null )
+        {
+            serverConfiguration.setAllowAnonymousAccess( parseBoolean( allowAnonymousAccess ) );
+        }
+
+        //  Supported Mechanisms
+        Element supportedMechanismsElement = getBeanPropertyElement( "supportedMechanisms", ldapConfiguration );
+        if ( supportedMechanismsElement != null )
+        {
+            Element listElement = supportedMechanismsElement.element( "list" );
+            if ( listElement != null )
+            {
+                for ( Iterator<?> i = listElement.elementIterator( "value" ); i.hasNext(); )
+                {
+                    serverConfiguration.addSupportedMechanism( ( ( Element ) i.next() ).getTextTrim() );
+                }
+            }
+        }
+
+        // SASL Host
+        String saslHost = readBeanProperty( "saslHost", ldapConfiguration );
+        if ( saslHost != null )
+        {
+            serverConfiguration.setSaslHost( saslHost );
+        }
+
+        // SASL Principal
+        String saslPrincipal = readBeanProperty( "saslPrincipal", ldapConfiguration );
+        if ( saslPrincipal != null )
+        {
+            serverConfiguration.setSaslPrincipal( saslPrincipal );
+        }
+
+        // SASL QOP
+        Element saslQopElement = getBeanPropertyElement( "saslQop", ldapConfiguration );
+        if ( saslQopElement != null )
+        {
+            Element listElement = saslQopElement.element( "list" );
+            if ( listElement != null )
+            {
+                for ( Iterator<?> i = listElement.elementIterator( "value" ); i.hasNext(); )
+                {
+                    serverConfiguration.addSaslQop( ( ( Element ) i.next() ).getTextTrim() );
+                }
+            }
+        }
+
+        // SASL Realms
+        Element saslRealmsElement = getBeanPropertyElement( "saslRealms", ldapConfiguration );
+        if ( saslQopElement != null )
+        {
+            Element listElement = saslRealmsElement.element( "list" );
+            if ( listElement != null )
+            {
+                for ( Iterator<?> i = listElement.elementIterator( "value" ); i.hasNext(); )
+                {
+                    serverConfiguration.addSaslRealm( ( ( Element ) i.next() ).getTextTrim() );
+                }
+            }
+        }
+
+        // Search Base DN
+        String searchBaseDn = readBeanProperty( "searchBaseDn", ldapConfiguration );
+        if ( searchBaseDn != null )
+        {
+            serverConfiguration.setSearchBaseDn( searchBaseDn );
         }
 
         // MaxTimeLimit
-        String maxTimeLimit = readBeanProperty( "maxTimeLimit", configurationBean );
+        String maxTimeLimit = readBeanProperty( "maxTimeLimit", ldapConfiguration );
         if ( maxTimeLimit != null )
         {
             serverConfiguration.setMaxTimeLimit( Integer.parseInt( maxTimeLimit ) );
         }
 
         // MaxSizeLimit
-        String maxSizeLimit = readBeanProperty( "maxSizeLimit", configurationBean );
+        String maxSizeLimit = readBeanProperty( "maxSizeLimit", ldapConfiguration );
         if ( maxSizeLimit != null )
         {
             serverConfiguration.setMaxSizeLimit( Integer.parseInt( maxSizeLimit ) );
         }
 
+        // ExtendedOperations
+        readExtendedOperations( ldapConfiguration, serverConfiguration );
+    }
+
+
+    /**
+     * Reads the "Configuration" Bean and store its values in the given ServerConfiguration.
+     *
+     * @param document
+     *      the document to use
+     * @param serverConfiguration
+     *      the Server Configuration
+     * @throws NumberFormatException
+     * @throws BooleanFormatException 
+     * @throws ServerConfigurationParserException 
+     */
+    private void readConfigurationBean( Document document, ServerConfiguration serverConfiguration )
+        throws NumberFormatException, BooleanFormatException, ServerConfigurationParserException
+    {
+        Element configurationBean = getBeanElementById( document, "configuration" );
+
+        // SynchPeriodMillis
+        String synchPeriodMillis = readBeanProperty( "synchPeriodMillis", configurationBean );
+        if ( synchPeriodMillis != null )
+        {
+            serverConfiguration.setSynchronizationPeriod( Long.parseLong( synchPeriodMillis ) );
+        }
+
         // MaxThreads
         String maxThreads = readBeanProperty( "maxThreads", configurationBean );
         if ( maxThreads != null )
@@ -294,28 +557,7 @@
             serverConfiguration.setEnableAccessControl( parseBoolean( accessControlEnabled ) );
         }
 
-        // EnableNtp
-        String enableNtp = readBeanProperty( "enableNtp", configurationBean );
-        if ( enableNtp != null )
-        {
-            serverConfiguration.setEnableNTP( parseBoolean( enableNtp ) );
-        }
-
-        // EnableKerberos
-        String enableKerberos = readBeanProperty( "enableKerberos", configurationBean );
-        if ( enableKerberos != null )
-        {
-            serverConfiguration.setEnableKerberos( parseBoolean( enableKerberos ) );
-        }
-
-        // EnableChangePassword
-        String enableChangePassword = readBeanProperty( "enableChangePassword", configurationBean );
-        if ( enableChangePassword != null )
-        {
-            serverConfiguration.setEnableChangePassword( parseBoolean( enableChangePassword ) );
-        }
-
-        // EnableChangePassword
+        // EnableDenormalizeOpAttrs
         String denormalizeOpAttrsEnabled = readBeanProperty( "denormalizeOpAttrsEnabled", configurationBean );
         if ( denormalizeOpAttrsEnabled != null )
         {
@@ -343,9 +585,6 @@
 
         // Interceptors
         readInterceptors( configurationBean, serverConfiguration );
-
-        // ExtendedOperations
-        readExtendedOperations( configurationBean, serverConfiguration );
     }
 
 
@@ -368,7 +607,7 @@
             Element setElement = propertyElement.element( "set" );
             if ( setElement != null )
             {
-                for ( Iterator i = setElement.elementIterator( "ref" ); i.hasNext(); )
+                for ( Iterator<?> i = setElement.elementIterator( "ref" ); i.hasNext(); )
                 {
                     Element element = ( Element ) i.next();
                     Attribute beanAttribute = element.attribute( "bean" );
@@ -409,11 +648,11 @@
             Partition partition = new Partition();
             partition.setSystemPartition( isSystemPartition );
 
-            // Name
-            String name = readBeanProperty( "name", partitionBean );
-            if ( name != null )
+            // ID
+            String partitionId = readBeanProperty( "id", partitionBean );
+            if ( partitionId != null )
             {
-                partition.setName( name );
+                partition.setId( partitionId );
             }
 
             // CacheSize
@@ -475,7 +714,7 @@
             Element setElement = propertyElement.element( "set" );
             if ( setElement != null )
             {
-                for ( Iterator i = setElement.elementIterator( "bean" ); i.hasNext(); )
+                for ( Iterator<?> i = setElement.elementIterator( "bean" ); i.hasNext(); )
                 {
                     Element beanElement = ( Element ) i.next();
                     IndexedAttribute ia = readIndexedAttribute( beanElement );
@@ -621,7 +860,7 @@
             Element listElement = propertyElement.element( "list" );
             if ( listElement != null )
             {
-                for ( Iterator i = listElement.elementIterator( "bean" ); i.hasNext(); )
+                for ( Iterator<?> i = listElement.elementIterator( "bean" ); i.hasNext(); )
                 {
                     Interceptor interceptor = readInterceptor( ( Element ) i.next() );
                     if ( interceptor != null )
@@ -650,25 +889,13 @@
                 "org.apache.directory.server.core.configuration.MutableInterceptorConfiguration" ) )
         {
             String name = readBeanProperty( "name", element );
+            String interceptorClassName = readBeanProperty( "interceptorClassName", element );
 
-            for ( Iterator i = element.elementIterator( "property" ); i.hasNext(); )
+            if ( ( name != null ) && ( interceptorClassName != null ) )
             {
-                Element propertyElement = ( Element ) i.next();
-                Attribute nameAttribute = propertyElement.attribute( "name" );
-                if ( nameAttribute != null && ( nameAttribute.getValue().equals( "interceptor" ) ) )
-                {
-                    Element beanElement = propertyElement.element( "bean" );
-                    if ( beanElement != null )
-                    {
-                        Attribute beanClassAttribute = beanElement.attribute( "class" );
-                        if ( beanClassAttribute != null )
-                        {
-                            Interceptor interceptor = new Interceptor( name );
-                            interceptor.setClassType( beanClassAttribute.getValue() );
-                            return interceptor;
-                        }
-                    }
-                }
+                Interceptor interceptor = new Interceptor( name );
+                interceptor.setClassType( interceptorClassName );
+                return interceptor;
             }
         }
 
@@ -692,7 +919,7 @@
             Element listElement = propertyElement.element( "list" );
             if ( listElement != null )
             {
-                for ( Iterator i = listElement.elementIterator( "bean" ); i.hasNext(); )
+                for ( Iterator<?> i = listElement.elementIterator( "bean" ); i.hasNext(); )
                 {
                     ExtendedOperation extendedOperation = readExtendedOperation( ( Element ) i.next() );
                     if ( extendedOperation != null )
@@ -737,7 +964,7 @@
      */
     private Element getBeanElementById( Document document, String id )
     {
-        for ( Iterator i = document.getRootElement().elementIterator( "bean" ); i.hasNext(); )
+        for ( Iterator<?> i = document.getRootElement().elementIterator( "bean" ); i.hasNext(); )
         {
             Element element = ( Element ) i.next();
             Attribute idAttribute = element.attribute( "id" );
@@ -795,7 +1022,7 @@
      */
     private Element getBeanPropertyElement( String property, Element element )
     {
-        for ( Iterator i = element.elementIterator( "property" ); i.hasNext(); )
+        for ( Iterator<?> i = element.elementIterator( "property" ); i.hasNext(); )
         {
             Element propertyElement = ( Element ) i.next();
             Attribute nameAttribute = propertyElement.attribute( "name" );

Modified: directory/sandbox/felixk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerConfigurationWriter.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerConfigurationWriter.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerConfigurationWriter.java (original)
+++ directory/sandbox/felixk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerConfigurationWriter.java Mon Nov 26 11:44:28 2007
@@ -68,6 +68,24 @@
             // Environment Bean
             createEnvironmentBean( root, serverConfiguration );
 
+            // Change Password Configuration Bean
+            createChangePasswordConfigurationBean( root, serverConfiguration );
+
+            // NTP Configuration Bean
+            createNtpConfigurationBean( root, serverConfiguration );
+
+            // DNS Configuration Bean
+            createDnsConfigurationBean( root, serverConfiguration );
+
+            // KDC Configuration Bean
+            createKdcConfigurationBean( root, serverConfiguration );
+
+            // LDAPS Configuration Bean
+            createLdapsConfigurationBean( root, serverConfiguration );
+
+            // LDAP Configuration Bean
+            createLdapConfigurationBean( root, serverConfiguration );
+
             // Configuration Bean
             createConfigurationBean( root, serverConfiguration );
 
@@ -148,6 +166,218 @@
 
 
     /**
+     * Creates the Change Password Configuration Bean.
+     *
+     * @param root
+     *      the root Element
+     * @param serverConfiguration
+     *      the Server Configuration
+     */
+    private void createChangePasswordConfigurationBean( Element root, ServerConfiguration serverConfiguration )
+    {
+        createProtocolConfigurationBean( root, "changePasswordConfiguration",
+            "org.apache.directory.server.changepw.ChangePasswordConfiguration", serverConfiguration
+                .isEnableChangePassword(), serverConfiguration.getChangePasswordPort() );
+    }
+
+
+    /**
+     * Creates the NTP Configuration Bean.
+     *
+     * @param root
+     *      the root Element
+     * @param serverConfiguration
+     *      the Server Configuration
+     */
+    private void createNtpConfigurationBean( Element root, ServerConfiguration serverConfiguration )
+    {
+        createProtocolConfigurationBean( root, "ntpConfiguration", "org.apache.directory.server.ntp.NtpConfiguration",
+            serverConfiguration.isEnableNtp(), serverConfiguration.getNtpPort() );
+    }
+
+
+    /**
+     * Creates the DNS Configuration Bean.
+     *
+     * @param root
+     *      the root Element
+     * @param serverConfiguration
+     *      the Server Configuration
+     */
+    private void createDnsConfigurationBean( Element root, ServerConfiguration serverConfiguration )
+    {
+        createProtocolConfigurationBean( root, "dnsConfiguration", "org.apache.directory.server.dns.DnsConfiguration",
+            serverConfiguration.isEnableDns(), serverConfiguration.getDnsPort() );
+    }
+
+
+    /**
+     * Creates the Kerberos Configuration Bean.
+     *
+     * @param root
+     *      the root Element
+     * @param serverConfiguration
+     *      the Server Configuration
+     */
+    private void createKdcConfigurationBean( Element root, ServerConfiguration serverConfiguration )
+    {
+        createProtocolConfigurationBean( root, "kdcConfiguration", "org.apache.directory.server.kdc.KdcConfiguration",
+            serverConfiguration.isEnableKerberos(), serverConfiguration.getKerberosPort() );
+    }
+
+
+    /**
+     * Creates the LDAPS Configuration Bean.
+     *
+     * @param root
+     *      the root Element
+     * @param serverConfiguration
+     *      the Server Configuration
+     */
+    private void createLdapsConfigurationBean( Element root, ServerConfiguration serverConfiguration )
+    {
+        Element ldapsConfiguration = createProtocolConfigurationBean( root, "ldapsConfiguration",
+            "org.apache.directory.server.ldap.LdapConfiguration", serverConfiguration.isEnableLdaps(),
+            serverConfiguration.getLdapsPort() );
+
+        // Enable LDAPS
+        Element enableLdapsPropertyElement = ldapsConfiguration.addElement( "property" );
+        enableLdapsPropertyElement.addAttribute( "name", "enableLdaps" );
+        enableLdapsPropertyElement.addAttribute( "value", "" + true );
+    }
+
+
+    /**
+     * Creates the LDAP Configuration Bean.
+     *
+     * @param root
+     *      the root Element
+     * @param serverConfiguration
+     *      the Server Configuration
+     */
+    private void createLdapConfigurationBean( Element root, ServerConfiguration serverConfiguration )
+    {
+        Element ldapConfiguration = createProtocolConfigurationBean( root, "ldapConfiguration",
+            "org.apache.directory.server.ldap.LdapConfiguration", true, serverConfiguration.getLdapPort() );
+
+        // AllowAnonymousAccess
+        Element propertyElement = ldapConfiguration.addElement( "property" );
+        propertyElement.addAttribute( "name", "allowAnonymousAccess" );
+        propertyElement.addAttribute( "value", "" + serverConfiguration.isAllowAnonymousAccess() );
+
+        // Supported Mechanisms
+        propertyElement = ldapConfiguration.addElement( "property" );
+        propertyElement.addAttribute( "name", "supportedMechanisms" );
+        if ( serverConfiguration.getSupportedMechanisms().size() > 1 )
+        {
+            Element listElement = propertyElement.addElement( "list" );
+            for ( String supportedMechanism : serverConfiguration.getSupportedMechanisms() )
+            {
+                listElement.addElement( "value" ).setText( supportedMechanism );
+            }
+        }
+
+        // SASL Host
+        propertyElement = ldapConfiguration.addElement( "property" );
+        propertyElement.addAttribute( "name", "saslHost" );
+        propertyElement.addAttribute( "value", serverConfiguration.getSaslHost() );
+
+        // SASL Principal
+        propertyElement = ldapConfiguration.addElement( "property" );
+        propertyElement.addAttribute( "name", "saslPrincipal" );
+        propertyElement.addAttribute( "value", serverConfiguration.getSaslPrincipal() );
+
+        // SASL QOP
+        propertyElement = ldapConfiguration.addElement( "property" );
+        propertyElement.addAttribute( "name", "saslQop" );
+        if ( serverConfiguration.getSaslQops().size() > 1 )
+        {
+            Element listElement = propertyElement.addElement( "list" );
+            for ( String saslQop : serverConfiguration.getSaslQops() )
+            {
+                listElement.addElement( "value" ).setText( saslQop );
+            }
+        }
+
+        // SASL Realms
+        propertyElement = ldapConfiguration.addElement( "property" );
+        propertyElement.addAttribute( "name", "saslRealms" );
+        if ( serverConfiguration.getSaslRealms().size() > 1 )
+        {
+            Element listElement = propertyElement.addElement( "list" );
+            for ( String saslRealm : serverConfiguration.getSaslRealms() )
+            {
+                listElement.addElement( "value" ).setText( saslRealm );
+            }
+        }
+
+        // Search Base DN
+        propertyElement = ldapConfiguration.addElement( "property" );
+        propertyElement.addAttribute( "name", "searchBaseDN" );
+        propertyElement.addAttribute( "value", serverConfiguration.getSearchBaseDn() );
+
+        // MaxTimeLimit
+        propertyElement = ldapConfiguration.addElement( "property" );
+        propertyElement.addAttribute( "name", "maxTimeLimit" );
+        propertyElement.addAttribute( "value", "" + serverConfiguration.getMaxTimeLimit() );
+
+        // MaxSizeLimit
+        propertyElement = ldapConfiguration.addElement( "property" );
+        propertyElement.addAttribute( "name", "maxSizeLimit" );
+        propertyElement.addAttribute( "value", "" + serverConfiguration.getMaxSizeLimit() );
+
+        // ExtendedOperationHandlers
+        propertyElement = ldapConfiguration.addElement( "property" );
+        propertyElement.addAttribute( "name", "extendedOperationHandlers" );
+        if ( serverConfiguration.getExtendedOperations().size() > 1 )
+        {
+            Element listElement = propertyElement.addElement( "list" );
+            for ( ExtendedOperation extendedOperation : serverConfiguration.getExtendedOperations() )
+            {
+                listElement.addElement( "bean" ).addAttribute( "class", extendedOperation.getClassType() );
+            }
+        }
+    }
+
+
+    /**
+     * Creates a Protocol Configuration Bean.
+     *
+     * @param root
+     *      the root Element
+     * @param id
+     *      the id of the Bean
+     * @param className
+     *      the class name of the Bean
+     * @param enabled
+     *      the enabled flag
+     * @param ipPort
+     *      the port
+     * @return
+     *      the corresponding Protocol Configuration Bean
+     */
+    private Element createProtocolConfigurationBean( Element root, String id, String className, boolean enabled,
+        int ipPort )
+    {
+        Element protocolConfigurationBean = root.addElement( "bean" );
+        protocolConfigurationBean.addAttribute( "id", id );
+        protocolConfigurationBean.addAttribute( "class", className );
+
+        // Enabled
+        Element enabledPropertyElement = protocolConfigurationBean.addElement( "property" );
+        enabledPropertyElement.addAttribute( "name", "enabled" );
+        enabledPropertyElement.addAttribute( "value", "" + enabled );
+
+        // IP Port
+        Element ipPortPropertyElement = protocolConfigurationBean.addElement( "property" );
+        ipPortPropertyElement.addAttribute( "name", "ipPort" );
+        ipPortPropertyElement.addAttribute( "value", "" + ipPort );
+
+        return protocolConfigurationBean;
+    }
+
+
+    /**
      * Creates the Configuration Bean.
      *
      * @param root
@@ -165,23 +395,19 @@
         // Working directory
         Element propertyElement = configurationBean.addElement( "property" );
         propertyElement.addAttribute( "name", "workingDirectory" );
-        propertyElement.addAttribute( "value", "example.com" ); // Ask Alex about this value.
+        propertyElement.addAttribute( "value", "example.com" ); // TODO Ask Alex about this value.
+
+        // LDIF Directory
+        // TODO Ask Alex about this value.
+
+        // LDIF Filters
+        // TODO Ask Alex about this value.
 
         // SynchPeriodMillis
         propertyElement = configurationBean.addElement( "property" );
         propertyElement.addAttribute( "name", "synchPeriodMillis" );
         propertyElement.addAttribute( "value", "" + serverConfiguration.getSynchronizationPeriod() );
 
-        // MaxTimeLimit
-        propertyElement = configurationBean.addElement( "property" );
-        propertyElement.addAttribute( "name", "maxTimeLimit" );
-        propertyElement.addAttribute( "value", "" + serverConfiguration.getMaxTimeLimit() );
-
-        // MaxSizeLimit
-        propertyElement = configurationBean.addElement( "property" );
-        propertyElement.addAttribute( "name", "maxSizeLimit" );
-        propertyElement.addAttribute( "value", "" + serverConfiguration.getMaxSizeLimit() );
-
         // MaxThreads
         propertyElement = configurationBean.addElement( "property" );
         propertyElement.addAttribute( "name", "maxThreads" );
@@ -197,30 +423,40 @@
         propertyElement.addAttribute( "name", "accessControlEnabled" );
         propertyElement.addAttribute( "value", "" + serverConfiguration.isEnableAccessControl() );
 
-        // Enable NTP
+        // DenormalizeOpAttrsEnabled
         propertyElement = configurationBean.addElement( "property" );
-        propertyElement.addAttribute( "name", "enableNtp" );
-        propertyElement.addAttribute( "value", "" + serverConfiguration.isEnableNTP() );
+        propertyElement.addAttribute( "name", "denormalizeOpAttrsEnabled" );
+        propertyElement.addAttribute( "value", "" + serverConfiguration.isDenormalizeOpAttr() );
 
-        // EnableKerberos
+        // NTP Configuration Ref
         propertyElement = configurationBean.addElement( "property" );
-        propertyElement.addAttribute( "name", "enableKerberos" );
-        propertyElement.addAttribute( "value", "" + serverConfiguration.isEnableKerberos() );
+        propertyElement.addAttribute( "name", "ntpConfiguration" );
+        propertyElement.addAttribute( "ref", "ntpConfiguration" );
 
-        // EnableChangePassword
+        // DNS Configuration Ref
         propertyElement = configurationBean.addElement( "property" );
-        propertyElement.addAttribute( "name", "enableChangePassword" );
-        propertyElement.addAttribute( "value", "" + serverConfiguration.isEnableChangePassword() );
+        propertyElement.addAttribute( "name", "dnsConfiguration" );
+        propertyElement.addAttribute( "ref", "dnsConfiguration" );
 
-        // DenormalizeOpAttrsEnabled
+        // Change Password Configuration Ref
         propertyElement = configurationBean.addElement( "property" );
-        propertyElement.addAttribute( "name", "denormalizeOpAttrsEnabled" );
-        propertyElement.addAttribute( "value", "" + serverConfiguration.isDenormalizeOpAttr() );
+        propertyElement.addAttribute( "name", "changePasswordConfiguration" );
+        propertyElement.addAttribute( "ref", "changePasswordConfiguration" );
+
+        // KDC Configuration Ref
+        propertyElement = configurationBean.addElement( "property" );
+        propertyElement.addAttribute( "name", "kdcConfiguration" );
+        propertyElement.addAttribute( "ref", "kdcConfiguration" );
 
-        // LdapPort
+        // LDAPS Configuration Ref
         propertyElement = configurationBean.addElement( "property" );
-        propertyElement.addAttribute( "name", "ldapPort" );
-        propertyElement.addAttribute( "value", "" + serverConfiguration.getPort() );
+        propertyElement.addAttribute( "name", "ldapsConfiguration" );
+        propertyElement.addAttribute( "ref", "ldapsConfiguration" );
+
+        // LDAP Configuration Ref
+        propertyElement = configurationBean.addElement( "property" );
+        propertyElement.addAttribute( "name", "ldapConfiguration" );
+        propertyElement.addAttribute( "ref", "ldapConfiguration" );
 
         // SystemPartitionConfiguration
         propertyElement = configurationBean.addElement( "property" );
@@ -244,18 +480,6 @@
             }
         }
 
-        // ExtendedOperationHandlers
-        propertyElement = configurationBean.addElement( "property" );
-        propertyElement.addAttribute( "name", "extendedOperationHandlers" );
-        if ( serverConfiguration.getExtendedOperations().size() > 1 )
-        {
-            Element listElement = propertyElement.addElement( "list" );
-            for ( ExtendedOperation extendedOperation : serverConfiguration.getExtendedOperations() )
-            {
-                listElement.addElement( "bean" ).addAttribute( "class", extendedOperation.getClassType() );
-            }
-        }
-
         // InterceptorConfigurations
         propertyElement = configurationBean.addElement( "property" );
         propertyElement.addAttribute( "name", "interceptorConfigurations" );
@@ -273,9 +497,9 @@
                 interceptorPropertyElement.addAttribute( "value", interceptor.getName() );
 
                 interceptorPropertyElement = interceptorBeanElement.addElement( "property" );
-                interceptorPropertyElement.addAttribute( "name", "interceptor" );
-                interceptorPropertyElement.addElement( "bean" ).addAttribute( "class",
-                    ( interceptor.getClassType() == null ? "" : interceptor.getClassType() ) );
+                interceptorPropertyElement.addAttribute( "name", "interceptorClassName" );
+                interceptorPropertyElement.addAttribute( "value", ( interceptor.getClassType() == null ? ""
+                    : interceptor.getClassType() ) );
             }
         }
 
@@ -348,10 +572,10 @@
         partitionBean.addAttribute( "class",
             "org.apache.directory.server.core.partition.impl.btree.MutableBTreePartitionConfiguration" );
 
-        // Name
+        // ID
         Element propertyElement = partitionBean.addElement( "property" );
-        propertyElement.addAttribute( "name", "name" );
-        propertyElement.addAttribute( "value", partition.getName() );
+        propertyElement.addAttribute( "name", "id" );
+        propertyElement.addAttribute( "value", partition.getId() );
 
         // CacheSize
         propertyElement = partitionBean.addElement( "property" );

Modified: directory/sandbox/felixk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/Connection.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/Connection.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/Connection.java (original)
+++ directory/sandbox/felixk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/Connection.java Mon Nov 26 11:44:28 2007
@@ -21,6 +21,8 @@
 package org.apache.directory.studio.connection.core;
 
 
+import org.apache.directory.shared.ldap.codec.util.LdapURL;
+import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
 import org.apache.directory.studio.connection.core.ConnectionParameter.AuthenticationMethod;
 import org.apache.directory.studio.connection.core.ConnectionParameter.EncryptionMethod;
 import org.apache.directory.studio.connection.core.event.ConnectionEventRegistry;
@@ -193,6 +195,11 @@
     }
 
     
+    /**
+     * Gets the SASL realm.
+     * 
+     * @return the SASL realm
+     */
     public String getSaslRealm ()
     {
     	return connectionParameter.getSaslRealm();
@@ -282,6 +289,11 @@
     }
     
     
+    /**
+     * Sets the SASL realm.
+     * 
+     * @param realm the new SASL realm
+     */
     public void setSaslRealm (String realm)
     {
     	connectionParameter.setSaslRealm(realm);
@@ -292,6 +304,7 @@
     /**
      * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
      */
+    @SuppressWarnings("unchecked")
     public Object getAdapter( Class adapter )
     {
         //        if ( adapter.isAssignableFrom( ISearchPageScoreComputer.class ) )
@@ -304,6 +317,26 @@
         }
 
         return null;
+    }
+
+
+    /**
+     * Gets the LDAP URL.
+     * 
+     * @return the LDAP URL
+     */
+    public LdapURL getUrl()
+    {
+        String s = "ldap://" + getHost() + ":" + getPort();
+        LdapURL url = null;
+        try
+        {
+            url = new LdapURL( s );
+        }
+        catch ( LdapURLEncodingException e )
+        {
+        }
+        return url;
     }
 
 }

Modified: directory/sandbox/felixk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCoreConstants.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCoreConstants.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCoreConstants.java (original)
+++ directory/sandbox/felixk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCoreConstants.java Mon Nov 26 11:44:28 2007
@@ -31,4 +31,8 @@
 
     /** The line separator. */
     public static final String LINE_SEPARATOR = System.getProperty( "line.separator" ); //$NON-NLS-1$
+
+    /** The date format of the modification logger */
+    public static final String DATEFORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS"; //$NON-NLS-1$
+
 }

Modified: directory/sandbox/felixk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCorePlugin.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCorePlugin.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCorePlugin.java (original)
+++ directory/sandbox/felixk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCorePlugin.java Mon Nov 26 11:44:28 2007
@@ -20,9 +20,19 @@
 package org.apache.directory.studio.connection.core;
 
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.directory.studio.connection.core.event.CoreEventRunner;
 import org.apache.directory.studio.connection.core.event.EventRunner;
+import org.apache.directory.studio.connection.core.io.jndi.LdifModificationLogger;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
 import org.osgi.framework.BundleContext;
 
 
@@ -47,9 +57,14 @@
     /** The event runner. */
     private EventRunner eventRunner;
 
-    /** The credential provider */
+    /** The authentication handler */
     private IAuthHandler authHandler;
 
+    /** The referral handler */
+    private IReferralHandler referralHandler;
+
+    /** The JNDI loggers. */
+    private List<IJndiLogger> jndiLoggers;
 
     /**
      * The constructor
@@ -160,10 +175,10 @@
 
 
     /**
-     * Gets the AuthHandler
+     * Gets the authentication handler
      *
      * @return
-     *      the AuthHandler
+     *      the authentication handler
      */
     public IAuthHandler getAuthHandler()
     {
@@ -172,14 +187,95 @@
 
 
     /**
-     * Sets the AuthHandler
+     * Sets the authentication handler
      *
      * @param authHandler
-     *      the authHandler to set
+     *      the authentication handler to set
      */
     public void setAuthHandler( IAuthHandler authHandler )
     {
         this.authHandler = authHandler;
+    }
+
+
+    /**
+     * Gets the referral handler
+     *
+     * @return
+     *      the referral handler
+     */
+    public IReferralHandler getReferralHandler()
+    {
+        return referralHandler;
+    }
+
+
+    /**
+     * Sets the referral handler
+     *
+     * @param referralHandler
+     *      the referral handler to set
+     */
+    public void setReferralHandler( IReferralHandler referralHandler )
+    {
+        this.referralHandler = referralHandler;
+    }
+
+
+    /**
+     * Gets the LDIF modification logger.
+     * 
+     * @return the LDIF modification logger, null if none found.
+     */
+    public LdifModificationLogger getLdifModificationLogger()
+    {
+        List<IJndiLogger> jndiLoggers = getJndiLoggers();
+        for ( IJndiLogger jndiLogger : jndiLoggers )
+        {
+            if(jndiLogger instanceof LdifModificationLogger)
+            {
+                return ( LdifModificationLogger ) jndiLogger;
+            }
+        }
+        return null;
+    }
+    
+    
+    /**
+     * Gets the jndi loggers.
+     * 
+     * @return the JNDI loggers
+     */
+    public List<IJndiLogger> getJndiLoggers()
+    {
+        if(jndiLoggers == null)
+        {
+            jndiLoggers = new ArrayList<IJndiLogger>();
+            
+            IExtensionRegistry registry = Platform.getExtensionRegistry();
+            IExtensionPoint extensionPoint = registry
+                .getExtensionPoint( "org.apache.directory.studio.jndilogger" );
+            IConfigurationElement[] members = extensionPoint.getConfigurationElements();
+            for ( IConfigurationElement member : members )
+            {
+                try
+                {
+                    IJndiLogger logger = ( IJndiLogger ) member.createExecutableExtension( "class" );
+                    logger.setId( member.getAttribute( "id" ) );
+                    logger.setName( member.getAttribute( "name" ) );
+                    logger.setDescription( member.getAttribute( "description" ) );
+                    jndiLoggers.add( logger );
+                }
+                catch ( Exception e )
+                {
+                   getLog().log(
+                        new Status( IStatus.ERROR, ConnectionCorePlugin.PLUGIN_ID, 1,
+                            "Unable to create JNDI logger " + member.getAttribute( "class" ), e ) );
+                }
+            }
+        }
+        
+        return jndiLoggers;
     }
 
 }

Modified: directory/sandbox/felixk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionManager.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionManager.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionManager.java (original)
+++ directory/sandbox/felixk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionManager.java Mon Nov 26 11:44:28 2007
@@ -34,6 +34,7 @@
 import org.apache.directory.studio.connection.core.event.ConnectionUpdateListener;
 import org.apache.directory.studio.connection.core.io.ConnectionIO;
 import org.apache.directory.studio.connection.core.io.ConnectionIOException;
+import org.eclipse.core.runtime.IPath;
 
 
 /**
@@ -57,6 +58,27 @@
         this.connectionList = new HashSet<Connection>();
         loadConnections();
         ConnectionEventRegistry.addConnectionUpdateListener( this, ConnectionCorePlugin.getDefault().getEventRunner() );
+    }
+
+
+    /**
+     * Gets the Modification Log filename for the corresponding connection.
+     *
+     * @param connection
+     *      the connection
+     * @return
+     *      the Modification Log filename
+     */
+    public static final String getModificationLogFileName( Connection connection )
+    {
+        IPath p = ConnectionCorePlugin.getDefault().getStateLocation().append( "logs" ); //$NON-NLS-1$
+        File file = p.toFile();
+        if ( !file.exists() )
+        {
+            file.mkdir();
+        }
+        return p
+            .append( "modifications-" + Utils.getFilenameString( connection.getId() ) + "-%u-%g.ldiflog" ).toOSString(); //$NON-NLS-1$ //$NON-NLS-2$
     }
 
 

Modified: directory/sandbox/felixk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionParameter.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionParameter.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionParameter.java (original)
+++ directory/sandbox/felixk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionParameter.java Mon Nov 26 11:44:28 2007
@@ -105,7 +105,7 @@
     /** The bind password. */
     private String bindPassword;
     
-    /** The SASL realm **/
+    /** The SASL realm. */
     private String saslRealm;
 
     /** The extended properties. */
@@ -132,6 +132,7 @@
      * @param authMethod the authentication method
      * @param bindPrincipal the bind principal
      * @param bindPassword the bind password
+     * @param saslRealm the SASL realm
      * @param extendedProperties the extended properties
      */
     public ConnectionParameter( String name, String host, int port, EncryptionMethod encryptionMethod,
@@ -201,7 +202,8 @@
     
     /**
      * Gets the SASL realm
-     * @return the sasl realm
+     * 
+     * @return the SASL realm
      */
     public String getSaslRealm (){
     	return saslRealm;
@@ -210,7 +212,8 @@
     
     /**
      * Sets the SASL realm
-     * @param saslRealm the sasl realm
+     * 
+     * @param saslRealm the SASL realm
      */
     public void setSaslRealm (String saslRealm){
     	this.saslRealm = saslRealm;