directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1042745 - in /directory/apacheds/branches/server-config-annotations/server-config: ./ src/main/java/org/apache/directory/server/config/ src/main/java/org/apache/directory/server/config/beans/
Date Mon, 06 Dec 2010 17:47:01 GMT
Author: pamarcelot
Date: Mon Dec  6 17:46:59 2010
New Revision: 1042745

URL: http://svn.apache.org/viewvc?rev=1042745&view=rev
Log:
Added first implementation with 'AttributeType', 'Container' and 'RDN' annotations.

Added:
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/AttributeType.java
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/ConfigWriter.java
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/ConfigurationElement.java
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/Container.java
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/Main.java
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/RDN.java
Modified:
    directory/apacheds/branches/server-config-annotations/server-config/pom.xml
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/AdsBaseBean.java
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ChangeLogBean.java
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ChangePasswordServerBean.java
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/DSBasedServerBean.java
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/DirectoryServiceBean.java
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ExtendedOpHandlerBean.java
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/HttpServerBean.java
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/HttpWebAppBean.java
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/IndexBean.java
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/InterceptorBean.java
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/JdbmIndexBean.java
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/JdbmPartitionBean.java
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/JournalBean.java
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/KdcServerBean.java
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/LdapServerBean.java
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/PartitionBean.java
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/PasswordPolicyBean.java
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ReplConsumerBean.java
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ReplProviderBean.java
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/SaslMechHandlerBean.java
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ServerBean.java
    directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/TransportBean.java

Modified: directory/apacheds/branches/server-config-annotations/server-config/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/pom.xml?rev=1042745&r1=1042744&r2=1042745&view=diff
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/pom.xml (original)
+++ directory/apacheds/branches/server-config-annotations/server-config/pom.xml Mon Dec  6 17:46:59 2010
@@ -43,7 +43,6 @@
     <dependency>
       <groupId>org.apache.directory.server</groupId>
       <artifactId>apacheds-ldif-partition</artifactId>
-      <scope>test</scope>
     </dependency>
     
     <dependency>

Added: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/AttributeType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/AttributeType.java?rev=1042745&view=auto
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/AttributeType.java (added)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/AttributeType.java Mon Dec  6 17:46:59 2010
@@ -0,0 +1,45 @@
+/*
+ *  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.server.config;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+
+
+
+/**
+ * An annotation used to specify the attribute type associated to a
+ * field in a configuration bean.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+@Documented
+@Inherited
+@Retention ( RetentionPolicy.RUNTIME )
+@Target ( { ElementType.FIELD, ElementType.TYPE } )
+public @interface AttributeType
+{
+     String value();
+}

Added: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/ConfigWriter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/ConfigWriter.java?rev=1042745&view=auto
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/ConfigWriter.java (added)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/ConfigWriter.java Mon Dec  6 17:46:59 2010
@@ -0,0 +1,303 @@
+/*
+ *  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.server.config;
+
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.lang.reflect.Member;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.directory.server.config.beans.AdsBaseBean;
+import org.apache.directory.server.config.beans.ConfigBean;
+import org.apache.directory.shared.ldap.entry.DefaultEntryAttribute;
+import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.exception.LdapException;
+import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
+import org.apache.directory.shared.ldap.ldif.LdifEntry;
+import org.apache.directory.shared.ldap.name.DN;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
+
+
+/**
+ * TODO
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class ConfigWriter
+{
+    public static void writeConfiguration( SchemaManager schemaManager, ConfigBean configBean, String file )
+        throws Exception
+    {
+        // The default configuration location is 'ou=config'
+        DN dn = new DN( "ou=config" );
+
+        List<LdifEntry> entries = new ArrayList<LdifEntry>();
+
+        List<AdsBaseBean> directoryServiceBeans = configBean.getDirectoryServiceBeans();
+        for ( AdsBaseBean adsBaseBean : directoryServiceBeans )
+        {
+            addBean( dn, schemaManager, adsBaseBean, entries );
+        }
+
+        System.out.println( entries );
+    }
+
+
+    private static void addBean( DN rootDn, SchemaManager schemaManager, AdsBaseBean bean, List<LdifEntry> entries )
+        throws Exception
+    {
+        // Creating the entry to hold the bean and adding it to the list
+        LdifEntry entry = new LdifEntry();
+        entries.add( entry );
+        entry.setDn( getDn( rootDn, bean ) );
+
+        // Getting the class of the bean
+        Class<?> beanClass = bean.getClass();
+
+        // A flag to know when we reached the 'AdsBaseBean' class when 
+        // looping on the class hierarchy of the bean
+        boolean adsBaseBeanClassFound = false;
+
+        // Looping until the 'AdsBaseBean' class has been found
+        while ( !adsBaseBeanClassFound )
+        {
+            // Checking if we reached the 'AdsBaseBean' class
+            if ( beanClass == AdsBaseBean.class )
+            {
+                adsBaseBeanClassFound = true;
+            }
+
+            // Looping on all fields of the bean
+            Field[] fields = beanClass.getDeclaredFields();
+            for ( Field field : fields )
+            {
+                // Making the field accessible (we get an exception if we don't do that)
+                field.setAccessible( true );
+
+                // Getting the class of the field
+                Class<?> fieldClass = field.getType();
+
+                // Looking for the @AttributeType annotation
+                AttributeType attributeTypeAnnotation = field.getAnnotation( AttributeType.class );
+                if ( attributeTypeAnnotation != null )
+                {
+                    System.out.println( fieldClass.getName() + " " + attributeTypeAnnotation.value() + " "
+                        + field.get( bean ) );
+                    addPrimaryTypeFieldValue( attributeTypeAnnotation.value(), field.get( bean ), entry );
+                    continue;
+                }
+
+                // Looking for the @Container annotation
+                Container containerAnnotation = field.getAnnotation( Container.class );
+                if ( containerAnnotation != null )
+                {
+                    DN containerDN = entry.getDn().add(
+                        new org.apache.directory.shared.ldap.name.RDN( containerAnnotation.value() ) );
+
+                    if ( Collection.class.isAssignableFrom( fieldClass ) )
+                    {
+                        // Looping on the Collection's objects
+                        Collection<Object> collection = ( Collection<Object> ) field.get( bean );
+                        for ( Object object : collection )
+                        {
+                            if ( object instanceof AdsBaseBean )
+                            {
+                                addBean( containerDN, schemaManager, ( AdsBaseBean ) object, entries );
+                            }
+                            else
+                            {
+                                AttributeType attributeType = field.getAnnotation( AttributeType.class );
+                                if ( attributeType != null )
+                                {
+                                    System.out.println( fieldClass.getName() + " " + attributeType.value() + " "
+                                                            + field.get( bean ) );
+                                    addPrimaryTypeFieldValue( attributeType.value(), object, entry );
+                                }
+                            }
+                        }
+                    }
+                    else
+                    {
+                        // TODO throw an error, if we have a container, the type must be a subtype of Collection
+                    }
+
+                }
+
+                //                // Is the field a Collection object
+                //                if ( Collection.class.isAssignableFrom( fieldClass ) )
+                //                {
+                //                    // Looping on the Collection's objects
+                //                    Collection<Object> collection = ( Collection<Object> ) field.get( bean );
+                //                    for ( Object object : collection )
+                //                    {
+                //                        if ( object instanceof AdsBaseBean )
+                //                        {
+                //                            addBean( entry.getDn(), schemaManager, ( AdsBaseBean ) object, entries );
+                //                        }
+                //                        else
+                //                        {
+                //                            AttributeType attributeType = field.getAnnotation( AttributeType.class );
+                //                            if ( attributeType != null )
+                //                            {
+                //                                System.out.println( fieldClass.getName() + " " + attributeType.value() + " "
+                //                                    + field.get( bean ) );
+                //                                addPrimaryTypeFieldValue( attributeType.value(), object, entry );
+                //                            }
+                //                        }
+                //                    }
+                //                }
+                //                else if ( AdsBaseBean.class.isAssignableFrom( fieldClass ) )
+                //                {
+                //                    AdsBaseBean newBean = ( AdsBaseBean ) field.get( bean );
+                //                    if ( newBean != null )
+                //                    {
+                //                        addBean( entry.getDn(), schemaManager, newBean, entries );
+                //                    }
+                //                }
+                //                else
+                //                {
+                //                    AttributeType attributeType = field.getAnnotation( AttributeType.class );
+                //                    if ( attributeType != null )
+                //                    {
+                //                        System.out.println( fieldClass.getName() + " " + attributeType.value() + " "
+                //                            + field.get( bean ) );
+                //                        String attributeTypeId = attributeType.value();
+                //
+                //                        addPrimaryTypeFieldValue( attributeTypeId, field.get( bean ), entry );
+                //
+                //                    }
+                //                }
+            }
+
+            // Moving to the upper class in the class hierarchy
+            beanClass = beanClass.getSuperclass();
+        }
+    }
+
+
+    /**
+     * Gets the DN associated with the configuration bean based on the given base DN.
+     *
+     * @param baseDN
+     *      the base DN
+     * @param bean
+     *      the configuration bean
+     * @return
+     *      the DN associated with the configuration bean based on the given base DN.
+     * @throws LdapInvalidDnException
+     * @throws IllegalArgumentException
+     * @throws IllegalAccessException
+     */
+    private static DN getDn( DN baseDN, AdsBaseBean bean ) throws LdapInvalidDnException, IllegalArgumentException,
+        IllegalAccessException
+    {
+        // Getting the class of the bean
+        Class<?> beanClass = bean.getClass();
+
+        // A flag to know when we reached the 'AdsBaseBean' class when 
+        // looping on the class hierarchy of the bean
+        boolean adsBaseBeanClassFound = false;
+
+        // Looping until the 'AdsBaseBean' class has been found
+        while ( !adsBaseBeanClassFound )
+        {
+            // Checking if we reached the 'AdsBaseBean' class
+            if ( beanClass == AdsBaseBean.class )
+            {
+                adsBaseBeanClassFound = true;
+            }
+
+            // Looping on all fields of the bean
+            Field[] fields = beanClass.getDeclaredFields();
+            for ( Field field : fields )
+            {
+                // Making the field accessible (we get an exception if we don't do that)
+                field.setAccessible( true );
+
+                // Looking for the AttributeType annotation 
+                AttributeType attributeTypeAnnotation = field.getAnnotation( AttributeType.class );
+                if ( attributeTypeAnnotation != null )
+                {
+                    String attributeTypeId = attributeTypeAnnotation.value();
+
+                    // Looking for the RDN annotation         
+                    RDN rdnAnnotation = field.getAnnotation( RDN.class );
+                    if ( rdnAnnotation != null )
+                    {
+                        // Getting the value from the entry
+                        return baseDN.add( new org.apache.directory.shared.ldap.name.RDN(
+                            attributeTypeId, field.get( bean ).toString() ) );
+                    }
+                }
+            }
+
+            // Moving to the upper class in the class hierarchy
+            beanClass = beanClass.getSuperclass();
+        }
+
+        return DN.EMPTY_DN; // TODO Throw an error when we reach that point
+    }
+
+
+    /**
+     * Adds a primary type (String, int, long, boolean, byte[] ) field value to the given entry.
+     *
+     * @param attributeType
+     *      the attribute type
+     * @param value
+     *      the value
+     * @param entry
+     *      the entry
+     * @throws LdapException
+     */
+    private static void addPrimaryTypeFieldValue( String attributeType, Object value, LdifEntry entry )
+        throws LdapException
+    {
+        // We don't store a 'null' value
+        if ( value != null )
+        {
+            // Getting the attribute from the entry
+            EntryAttribute attribute = entry.get( attributeType );
+
+            // If no attribute has been found, we need to create it and add it to the entry
+            if ( attribute == null )
+            {
+                attribute = new DefaultEntryAttribute( attributeType );
+                entry.addAttribute( attribute );
+            }
+
+            // Storing the value to the attribute
+            if ( value instanceof byte[] )
+            {
+                // Value is a byte[]
+                attribute.add( ( byte[] ) value );
+            }
+            else
+            {
+                // Value is another type of object that we store as a String
+                // (There will be an automatic translation for primary types like int, long, boolean, etc.)
+                attribute.add( value.toString() );
+            }
+        }
+    }
+}

Added: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/ConfigurationElement.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/ConfigurationElement.java?rev=1042745&view=auto
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/ConfigurationElement.java (added)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/ConfigurationElement.java Mon Dec  6 17:46:59 2010
@@ -0,0 +1,91 @@
+/*
+ *  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.server.config;
+
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.apache.directory.shared.ldap.name.DN;
+
+
+/**
+ * An annotation used to specify that the qualified field is configuration element.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+@Documented
+@Inherited
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.FIELD)
+public @interface ConfigurationElement
+{
+    /**
+     * Returns the attribute type.
+     *
+     * @return
+     *      the attribute type
+     */
+    String attributeType() default "";
+
+
+    /**
+     * Returns the object class.
+     *
+     * @return
+     *      the object class
+     */
+    String objectClass() default "";
+
+
+    /**
+     * Returns true if of the qualified field (attribute type and value) 
+     * is the RDN of the entry.
+     *
+     * @return
+     *      <code>true</code> if of the qualified field (attribute type and value) 
+     * is the RDN of the entry,
+     *      <code>false</code> if not.
+     */
+    boolean isRDN() default false;
+
+
+    /**
+     * Returns true if the qualified field contains multiple values.
+     *
+     * @return
+     *      <code>true</code> if the qualified field contains multiple values,
+     *      <code>false</code> if not.
+     */
+    boolean isMultiple() default false;
+
+
+    /**
+     * Returns the string value of the DN of the container.
+     *
+     * @return
+     *      the string value of the DN of the container.
+     */
+    String container() default "";
+}

Added: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/Container.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/Container.java?rev=1042745&view=auto
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/Container.java (added)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/Container.java Mon Dec  6 17:46:59 2010
@@ -0,0 +1,45 @@
+/*
+ *  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.server.config;
+
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+
+/**
+ * An annotation used to specify that the qualified field is composite
+ * and the holds the name of the sub-entry containing the values.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+@Documented
+@Inherited
+@Retention(RetentionPolicy.RUNTIME)
+@Target(
+    { ElementType.FIELD, ElementType.TYPE })
+public @interface Container
+{
+    String value();
+}

Added: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/Main.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/Main.java?rev=1042745&view=auto
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/Main.java (added)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/Main.java Mon Dec  6 17:46:59 2010
@@ -0,0 +1,53 @@
+package org.apache.directory.server.config;
+
+
+import java.io.File;
+
+import org.apache.directory.server.config.beans.ConfigBean;
+import org.apache.directory.server.core.partition.ldif.SingleFileLdifPartition;
+import org.apache.directory.shared.ldap.name.DN;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
+import org.apache.directory.shared.ldap.schema.loader.ldif.JarLdifSchemaLoader;
+import org.apache.directory.shared.ldap.schema.manager.impl.DefaultSchemaManager;
+import org.apache.directory.shared.ldap.schema.registries.SchemaLoader;
+
+
+public class Main
+{
+    private Object field;
+
+
+    public static void main( String[] args ) throws Exception
+    {
+        //        Deprecated deprecatedAnnotation = TestClass.class.getAnnotation( Deprecated.class );
+        //        System.out.println( deprecatedAnnotation );
+        //        
+        //        deprecatedAnnotation = Main.class.getAnnotation( Deprecated.class );
+        //        
+        //        Field[] fields = Main.class.getDeclaredFields();
+        //        for ( Field field : fields )
+        //        {
+        //            System.out.println( field );
+        //        }
+
+        SchemaLoader schemaLoader = new JarLdifSchemaLoader();
+        SchemaManager schemaManager = new DefaultSchemaManager( schemaLoader );
+        schemaManager.loadAllEnabled();
+
+        SingleFileLdifPartition configPartition = new SingleFileLdifPartition(
+            "/Users/pajbam/Development/Apache/ApacheDS/apacheds/server-config/src/main/resources/config.ldif" );
+        configPartition.setId( "config" );
+        configPartition.setSuffix( new DN( "ou=config" ) );
+        configPartition.setSchemaManager( schemaManager );
+        configPartition.initialize();
+        
+
+        ConfigPartitionReader cpReader = new ConfigPartitionReader( configPartition, new File(
+            "/Users/pajbam/Development/Apache/ApacheDS/apacheds/server-config/src/main/resources/" ) );
+
+        ConfigBean configBean = cpReader.readConfig( new DN( "ou=config" ) );
+        
+        ConfigWriter.writeConfiguration( schemaManager, configBean, null );
+        
+    }
+}

Added: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/RDN.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/RDN.java?rev=1042745&view=auto
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/RDN.java (added)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/RDN.java Mon Dec  6 17:46:59 2010
@@ -0,0 +1,44 @@
+/*
+ *  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.server.config;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+
+
+
+/**
+ * An annotation used to specify the attribute type to be used as
+ * RDN part for the DN of the bean entry.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+@Documented
+@Inherited
+@Retention ( RetentionPolicy.RUNTIME )
+@Target ( { ElementType.FIELD, ElementType.TYPE } )
+public @interface RDN
+{
+}

Modified: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/AdsBaseBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/AdsBaseBean.java?rev=1042745&r1=1042744&r2=1042745&view=diff
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/AdsBaseBean.java (original)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/AdsBaseBean.java Mon Dec  6 17:46:59 2010
@@ -19,30 +19,37 @@
  */
 package org.apache.directory.server.config.beans;
 
+
+import org.apache.directory.server.config.AttributeType;
+import org.apache.directory.server.config.ConfigurationElement;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.util.StringTools;
 
+
 /**
  * A class used to store the Base ADS configuration. It can't be instanciated
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class AdsBaseBean 
+public abstract class AdsBaseBean
 {
     /** The enabled flag */
+    @AttributeType("ads-enabled")
     private boolean enabled = false;
-    
+
     /** The description */
+    @AttributeType("description")
     private String description;
 
+
     /**
      * Create a new BaseBean instance
      */
     protected AdsBaseBean()
     {
     }
-    
-    
+
+
     /**
      * @return <code>true</code> if the component is enabled
      */
@@ -50,8 +57,8 @@ public abstract class AdsBaseBean 
     {
         return enabled;
     }
-    
-    
+
+
     /**
      * Enable or disable the component
      * @param enabled if <code>true</code>, the component is enabled.
@@ -60,17 +67,17 @@ public abstract class AdsBaseBean 
     {
         this.enabled = enabled;
     }
-    
-    
+
+
     /**
      * @return the description for this component
      */
-    public String getDescription() 
+    public String getDescription()
     {
         return description;
     }
-    
-    
+
+
     /**
      * Sets the component description
      * 
@@ -80,8 +87,8 @@ public abstract class AdsBaseBean 
     {
         this.description = description;
     }
-    
-    
+
+
     /**
      * Formated print of a boolean
      */
@@ -90,7 +97,7 @@ public abstract class AdsBaseBean 
         StringBuilder sb = new StringBuilder();
 
         sb.append( tabs ).append( name ).append( " : " );
-        
+
         if ( value )
         {
             sb.append( "TRUE" );
@@ -99,13 +106,13 @@ public abstract class AdsBaseBean 
         {
             sb.append( "FALSE" );
         }
-        
+
         sb.append( '\n' );
-        
+
         return sb.toString();
     }
-    
-    
+
+
     /**
      * Formated print of a String that can be null
      */
@@ -120,8 +127,8 @@ public abstract class AdsBaseBean 
             return "";
         }
     }
-    
-    
+
+
     /**
      * Formated print of a DN that can be null
      */
@@ -136,7 +143,8 @@ public abstract class AdsBaseBean 
             return "";
         }
     }
-    
+
+
     /**
      * a convenient method to finding if this bean was disabled in the config
      * 
@@ -146,8 +154,8 @@ public abstract class AdsBaseBean 
     {
         return !enabled;
     }
-    
-    
+
+
     /**
      * Formated print of a long
      */
@@ -155,26 +163,26 @@ public abstract class AdsBaseBean 
     {
         return tabs + name + " : " + value + "\n";
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
     public String toString( String tabs )
     {
         StringBuilder sb = new StringBuilder();
-        
+
         sb.append( toString( tabs, "enabled", enabled ) );
-        
+
         if ( !StringTools.isEmpty( description ) )
         {
             sb.append( tabs ).append( "description : '" ).append( description ).append( "'\n" );
         }
-        
+
         return sb.toString();
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */

Modified: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ChangeLogBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ChangeLogBean.java?rev=1042745&r1=1042744&r2=1042745&view=diff
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ChangeLogBean.java (original)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ChangeLogBean.java Mon Dec  6 17:46:59 2010
@@ -19,6 +19,9 @@
  */
 package org.apache.directory.server.config.beans;
 
+import org.apache.directory.server.config.AttributeType;
+import org.apache.directory.server.config.RDN;
+
 
 /**
  * A class used to store the ChangeLog configuration.
@@ -28,9 +31,12 @@ package org.apache.directory.server.conf
 public class ChangeLogBean extends AdsBaseBean
 {
     /** The ChangeLog unique ID */
+    @AttributeType("ads-changeLogId")
+    @RDN
     private String changeLogId;
 
     /** Tells if the ChangeLog is exposed to the users */
+    @AttributeType("ads-changeLogExposed")
     private boolean changeLogExposed;
 
     /**

Modified: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ChangePasswordServerBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ChangePasswordServerBean.java?rev=1042745&r1=1042744&r2=1042745&view=diff
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ChangePasswordServerBean.java (original)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ChangePasswordServerBean.java Mon Dec  6 17:46:59 2010
@@ -22,6 +22,8 @@ package org.apache.directory.server.conf
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.directory.server.config.AttributeType;
+
 
 /**
  * A class used to store the ChangePasswordServer configuration.
@@ -31,27 +33,35 @@ import java.util.List;
 public class ChangePasswordServerBean extends DSBasedServerBean
 {
     /** The allowable clock skew. */
+    @AttributeType("ads-krbAllowableClockSkew")
     private long krbAllowableClockSkew;
     
     /** Whether empty addresses are allowed. */
+    @AttributeType("ads-krbEmptyAddressesAllowed")
     private boolean krbEmptyAddressesAllowed;
     
     /** The encryption types. */
+    @AttributeType("ads-krbEncryptionTypes")
     private List<String> krbEncryptionTypes = new ArrayList<String>();
     
     /** The primary realm. */
+    @AttributeType("ads-krbPrimaryRealm")
     private String krbPrimaryRealm;
     
     /** The policy for category count. */
+    @AttributeType("ads-chgPwdPolicyCategoryCount")
     private int chgPwdPolicyCategoryCount;
     
     /** The policy for password length. */
+    @AttributeType("ads-chgPwdPolicyPasswordLength")
     private int chgPwdPolicyPasswordLength;
     
     /** The policy for token size. */
+    @AttributeType("ads-chgPwdPolicyTokenSize")
     private int chgPwdPolicyTokenSize;
     
     /** The service principal name. */
+    @AttributeType("ads-chgPwdServicePrincipal")
     private String chgPwdServicePrincipal;
 
     /**

Modified: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/DSBasedServerBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/DSBasedServerBean.java?rev=1042745&r1=1042744&r2=1042745&view=diff
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/DSBasedServerBean.java (original)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/DSBasedServerBean.java Mon Dec  6 17:46:59 2010
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.server.config.beans;
 
+import org.apache.directory.server.config.AttributeType;
 import org.apache.directory.shared.ldap.name.DN;
 
 
@@ -35,6 +36,7 @@ public class DSBasedServerBean extends S
      * configuration for catalog entries.  Otherwise it will use this
      * search base as a single point of searching the DIT.
      */
+    @AttributeType("ads-searchBaseDN")
     private DN searchBaseDN;
 
     /**

Modified: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/DirectoryServiceBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/DirectoryServiceBean.java?rev=1042745&r1=1042744&r2=1042745&view=diff
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/DirectoryServiceBean.java (original)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/DirectoryServiceBean.java Mon Dec  6 17:46:59 2010
@@ -23,7 +23,11 @@ package org.apache.directory.server.conf
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.directory.server.core.PasswordPolicyConfiguration;
+import org.apache.directory.server.config.AttributeType;
+import org.apache.directory.server.config.Container;
+import org.apache.directory.server.config.RDN;
+
+
 /**
  * A class used to store the DirectoryService configuration.
  *
@@ -32,30 +36,40 @@ import org.apache.directory.server.core.
 public class DirectoryServiceBean extends AdsBaseBean
 {
     /** The DS instance Id */
+    @AttributeType("ads-directoryServiceId")
+    @RDN
     private String directoryServiceId;
 
     /** The directory instance replication ID */
+    @AttributeType("ads-dsReplicaId")
     private int dsReplicaId;
 
     /** The flag that tells if the AccessControl system is activated */
+    @AttributeType("ads-dsAccessControlEnabled")
     private boolean dsAccessControlEnabled = true;
 
     /** The flag that tells if Anonymous connections are allowed */
+    @AttributeType("ads-dsAllowAnonymousAccess")
     private boolean dsAllowAnonymousAccess = false;
 
     /** The flag that tells if DN must be denormalized */
+    @AttributeType("dsDenormalizeOpAttrsEnabled")
     private boolean dsDenormalizeOpAttrsEnabled = true;
 
     /** The maximum size of an incoming PDU */
+    @AttributeType("ads-dsMaxPDUSize")
     private int dsMaxPDUSize = 2048;
 
     /** The flag that tells if the password should be returned as a normal attribute or not */
+    @AttributeType("ads-dsPasswordHidden")
     private boolean dsPasswordHidden = false;
 
     /** The delay between two flushes on disk */
+    @AttributeType("ads-dsSyncPeriodMillis")
     private long dsSyncPeriodMillis = 15000L;
 
     /** The ldif entries to inject into the server at startup */
+    @AttributeType("dsTestEntries")
     private String dsTestEntries;
 
     /** The ChangeLog component */
@@ -65,17 +79,21 @@ public class DirectoryServiceBean extend
     private JournalBean journal;
 
     /** The servers */
+    @Container( "ou=servers" )
     private List<ServerBean> servers = new ArrayList<ServerBean>();
 
     /** The list of declared interceptors */
+    @Container( "ou=interceptors" )
     private List<InterceptorBean> interceptors = new ArrayList<InterceptorBean>();
 
     /** The set of associated partitions */
+    @Container( "ou=partitions" )
     private List<PartitionBean> partitions = new ArrayList<PartitionBean>();
 
     /** The reference to the Password Policy component */
     private PasswordPolicyBean passwordPolicy;
 
+
     /**
      * Create a new DnsServerBean instance
      */
@@ -364,7 +382,7 @@ public class DirectoryServiceBean extend
         return servers;
     }
 
-    
+
     /**
      * @return The LdapServerBean configuration
      */
@@ -374,14 +392,14 @@ public class DirectoryServiceBean extend
         {
             if ( server instanceof LdapServerBean )
             {
-                return (LdapServerBean)server;
+                return ( LdapServerBean ) server;
             }
         }
-        
+
         return null;
     }
-    
-    
+
+
     /**
      * @return The NtpServerBean configuration
      */
@@ -391,14 +409,14 @@ public class DirectoryServiceBean extend
         {
             if ( server instanceof NtpServerBean )
             {
-                return (NtpServerBean)server;
+                return ( NtpServerBean ) server;
             }
         }
-        
+
         return null;
     }
-    
-    
+
+
     /**
      * @return The DnsServerBean configuration
      */
@@ -408,14 +426,14 @@ public class DirectoryServiceBean extend
         {
             if ( server instanceof DnsServerBean )
             {
-                return (DnsServerBean)server;
+                return ( DnsServerBean ) server;
             }
         }
-        
+
         return null;
     }
-    
-    
+
+
     /**
      * @return The DhcpServerBean configuration
      */
@@ -425,14 +443,14 @@ public class DirectoryServiceBean extend
         {
             if ( server instanceof DhcpServerBean )
             {
-                return (DhcpServerBean)server;
+                return ( DhcpServerBean ) server;
             }
         }
-        
+
         return null;
     }
-    
-    
+
+
     /**
      * @return The HttpServerBean configuration
      */
@@ -442,14 +460,14 @@ public class DirectoryServiceBean extend
         {
             if ( server instanceof HttpServerBean )
             {
-                return (HttpServerBean)server;
+                return ( HttpServerBean ) server;
             }
         }
-        
+
         return null;
     }
-    
-    
+
+
     /**
      * @return The KdcServerBean configuration
      */
@@ -459,14 +477,14 @@ public class DirectoryServiceBean extend
         {
             if ( server instanceof KdcServerBean )
             {
-                return (KdcServerBean)server;
+                return ( KdcServerBean ) server;
             }
         }
-        
+
         return null;
     }
-    
-    
+
+
     /**
      * @return The ChangePasswordServerBean configuration
      */
@@ -476,13 +494,13 @@ public class DirectoryServiceBean extend
         {
             if ( server instanceof ChangePasswordServerBean )
             {
-                return (ChangePasswordServerBean)server;
+                return ( ChangePasswordServerBean ) server;
             }
         }
-        
+
         return null;
     }
-    
+
 
     /**
      * @param servers the servers to set
@@ -504,7 +522,7 @@ public class DirectoryServiceBean extend
         }
     }
 
-    
+
     /**
      * @return the passwordPolicy
      */
@@ -529,10 +547,10 @@ public class DirectoryServiceBean extend
     public String toString()
     {
         StringBuilder sb = new StringBuilder();
-        
+
         sb.append( "DirectoryServiceBean : \n" );
         sb.append( super.toString( "  " ) );
-        
+
         // Dump the must attributes
         sb.append( "  directoryService ID : " ).append( directoryServiceId ).append( '\n' );
         sb.append( "  replica ID : " ).append( dsReplicaId ).append( '\n' );
@@ -543,9 +561,9 @@ public class DirectoryServiceBean extend
         sb.append( "  max PDU size : " ).append( dsMaxPDUSize ).append( '\n' );
         sb.append( "  sync period millisecond : " ).append( dsSyncPeriodMillis ).append( '\n' );
         sb.append( toString( "  ", "test entries", dsTestEntries ) );
-        
+
         sb.append( "  interceptors : \n" );
-        
+
         if ( ( interceptors != null ) && ( interceptors.size() > 0 ) )
         {
             for ( InterceptorBean interceptor : interceptors )
@@ -553,9 +571,9 @@ public class DirectoryServiceBean extend
                 sb.append( interceptor.toString( "    " ) );
             }
         }
-        
+
         sb.append( "  partitions : \n" );
-        
+
         if ( ( partitions != null ) && ( partitions.size() > 0 ) )
         {
             for ( PartitionBean partition : partitions )
@@ -568,19 +586,19 @@ public class DirectoryServiceBean extend
         {
             sb.append( journal.toString( "  " ) );
         }
-        
+
         if ( changeLog != null )
         {
             sb.append( changeLog.toString( "  " ) );
         }
-        
+
         if ( passwordPolicy != null )
         {
             sb.append( passwordPolicy.toString( "  " ) );
         }
-        
+
         sb.append( "  servers : \n" );
-        
+
         if ( ( servers != null ) && ( servers.size() > 0 ) )
         {
             for ( ServerBean server : servers )

Modified: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ExtendedOpHandlerBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ExtendedOpHandlerBean.java?rev=1042745&r1=1042744&r2=1042745&view=diff
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ExtendedOpHandlerBean.java (original)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ExtendedOpHandlerBean.java Mon Dec  6 17:46:59 2010
@@ -19,6 +19,9 @@
  */
 package org.apache.directory.server.config.beans;
 
+import org.apache.directory.server.config.AttributeType;
+import org.apache.directory.server.config.RDN;
+
 
 /**
  * A class used to store the LdapServerExtendedOpHandler configuration.
@@ -28,9 +31,12 @@ package org.apache.directory.server.conf
 public class ExtendedOpHandlerBean extends AdsBaseBean
 {
     /** The Extended Operation ID */
+    @AttributeType("ads-extendedOpId")
+    @RDN
     private String extendedOpId;
     
     /** The Extended Operation FQCN */
+    @AttributeType("extendedOpHandlerClass")
     private String extendedOpHandlerClass;
 
     /**

Modified: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/HttpServerBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/HttpServerBean.java?rev=1042745&r1=1042744&r2=1042745&view=diff
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/HttpServerBean.java (original)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/HttpServerBean.java Mon Dec  6 17:46:59 2010
@@ -22,6 +22,8 @@ package org.apache.directory.server.conf
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.directory.server.config.AttributeType;
+
 
 
 
@@ -33,9 +35,11 @@ import java.util.List;
 public class HttpServerBean extends ServerBean
 {
     /** The configuration file */
+    @AttributeType("ads-httpConfFile")
     private String httpConfFile;
     
     /** The list of supported web apps */
+    @AttributeType("httpWebApps")
     private List<HttpWebAppBean> httpWebApps = new ArrayList<HttpWebAppBean>();
 
     /**

Modified: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/HttpWebAppBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/HttpWebAppBean.java?rev=1042745&r1=1042744&r2=1042745&view=diff
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/HttpWebAppBean.java (original)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/HttpWebAppBean.java Mon Dec  6 17:46:59 2010
@@ -19,6 +19,9 @@
  */
 package org.apache.directory.server.config.beans;
 
+import org.apache.directory.server.config.AttributeType;
+import org.apache.directory.server.config.RDN;
+
 
 /**
  * A class used to store the HttpWebApp configuration.
@@ -28,12 +31,16 @@ package org.apache.directory.server.conf
 public class HttpWebAppBean extends AdsBaseBean
 {
     /** The server identifier */
+    @AttributeType("ads-id")
+    @RDN
     private String id;
     
     /** The context path */
+    @AttributeType("ads-httpAppCtxPath")
     private String httpAppCtxPath;
     
     /** The war file */
+    @AttributeType("ads-httpWarFile")
     private String httpWarFile;
 
     /**

Modified: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/IndexBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/IndexBean.java?rev=1042745&r1=1042744&r2=1042745&view=diff
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/IndexBean.java (original)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/IndexBean.java Mon Dec  6 17:46:59 2010
@@ -19,6 +19,9 @@
  */
 package org.apache.directory.server.config.beans;
 
+import org.apache.directory.server.config.AttributeType;
+import org.apache.directory.server.config.RDN;
+
 /**
  * A class used to store the IndexBean configuration. It can't be instanciated
  *
@@ -27,6 +30,8 @@ package org.apache.directory.server.conf
 public abstract class IndexBean extends AdsBaseBean
 {
     /** The index unique identifier */
+    @AttributeType("ads-indexAttributeId")
+    @RDN
     private String indexAttributeId;
     
     /**

Modified: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/InterceptorBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/InterceptorBean.java?rev=1042745&r1=1042744&r2=1042745&view=diff
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/InterceptorBean.java (original)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/InterceptorBean.java Mon Dec  6 17:46:59 2010
@@ -19,6 +19,9 @@
  */
 package org.apache.directory.server.config.beans;
 
+import org.apache.directory.server.config.AttributeType;
+import org.apache.directory.server.config.RDN;
+
 
 
 /**
@@ -29,12 +32,16 @@ package org.apache.directory.server.conf
 public class InterceptorBean extends AdsBaseBean implements Comparable<InterceptorBean>
 {
     /** The Interceptor ID */
+    @AttributeType("ads-interceptorId")
+    @RDN
     private String interceptorId;
     
     /** The interceptor FQCN */
+    @AttributeType("ads-interceptorClassName")
     private String interceptorClassName;
     
     /** The interceptor position in the chain */
+    @AttributeType("ads-interceptorOrder")
     private int interceptorOrder;
 
 

Modified: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/JdbmIndexBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/JdbmIndexBean.java?rev=1042745&r1=1042744&r2=1042745&view=diff
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/JdbmIndexBean.java (original)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/JdbmIndexBean.java Mon Dec  6 17:46:59 2010
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.server.config.beans;
 
+import org.apache.directory.server.config.AttributeType;
+
 
 /**
  * A class used to store the JdbmIndex configuration.
@@ -40,9 +42,11 @@ public class JdbmIndexBean<K, E> extends
     private int indexNumDupLimit = DEFAULT_DUPLICATE_LIMIT;
     
     /** The index file name */
+    @AttributeType("ads-indexFileName")
     private String indexFileName;
     
     /** The index working directory */
+    @AttributeType("ads-indexWorkingDir")
     private String indexWorkingDir;
 
     /**

Modified: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/JdbmPartitionBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/JdbmPartitionBean.java?rev=1042745&r1=1042744&r2=1042745&view=diff
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/JdbmPartitionBean.java (original)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/JdbmPartitionBean.java Mon Dec  6 17:46:59 2010
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.server.config.beans;
 
+import org.apache.directory.server.config.AttributeType;
 
 
 /**
@@ -29,11 +30,14 @@ package org.apache.directory.server.conf
 public class JdbmPartitionBean extends PartitionBean
 {
     /** The Entry cache size for this partition */
+    @AttributeType("ads-partitionCacheSize")
     private int partitionCacheSize = -1;
 
     /** Tells if the optimizer is enabled or not */
+    @AttributeType("ads-jdbmPartitionOptimizerEnabled")
     private boolean jdbmPartitionOptimizerEnabled = true;
-    
+
+
     /**
      * Create a new JdbmPartitionBean instance
      */
@@ -65,7 +69,7 @@ public class JdbmPartitionBean extends P
         return partitionCacheSize;
     }
 
-    
+
     /**
      * @return <code>true</code> if the optimizer is enabled
      */
@@ -84,24 +88,24 @@ public class JdbmPartitionBean extends P
     {
         this.jdbmPartitionOptimizerEnabled = jdbmPartitionOptimizerEnabled;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
     public String toString( String tabs )
     {
         StringBuilder sb = new StringBuilder();
-        
+
         sb.append( tabs ).append( "JdbmPartitionBean :\n" );
         sb.append( super.toString( tabs ) );
         sb.append( tabs ).append( "  partition cache size : " ).append( partitionCacheSize ).append( '\n' );
         sb.append( toString( tabs, "  jdbm partition optimizer enabled", jdbmPartitionOptimizerEnabled ) );
-        
+
         return sb.toString();
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */

Modified: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/JournalBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/JournalBean.java?rev=1042745&r1=1042744&r2=1042745&view=diff
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/JournalBean.java (original)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/JournalBean.java Mon Dec  6 17:46:59 2010
@@ -19,6 +19,9 @@
  */
 package org.apache.directory.server.config.beans;
 
+import org.apache.directory.server.config.AttributeType;
+import org.apache.directory.server.config.RDN;
+
 /**
  * A class used to store the Journal configuration.
  *
@@ -27,15 +30,20 @@ package org.apache.directory.server.conf
 public class JournalBean extends AdsBaseBean
 {
     /** The journal unique Id */
+    @AttributeType("ads-journalId")
+    @RDN
     private String journalId;
     
     /** The journal file name */
+    @AttributeType("ads-journalFileName")
     private String journalFileName;
     
     /** The journal working directory */
+    @AttributeType("ads-journalWorkingDir")
     private String journalWorkingDir;
     
     /** The journal rotation */
+    @AttributeType("ads-journalRotation")
     private int journalRotation;
 
     /**

Modified: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/KdcServerBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/KdcServerBean.java?rev=1042745&r1=1042744&r2=1042745&view=diff
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/KdcServerBean.java (original)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/KdcServerBean.java Mon Dec  6 17:46:59 2010
@@ -24,6 +24,8 @@ import java.util.List;
 
 import javax.security.auth.kerberos.KerberosPrincipal;
 
+import org.apache.directory.server.config.AttributeType;
+
 /**
  * A class used to store the KdcServer configuration.
  *
@@ -37,9 +39,6 @@ public class KdcServerBean extends DSBas
     /** The default for allowing empty addresses */
     private static final boolean DEFAULT_EMPTY_ADDRESSES_ALLOWED = true;
 
-    /** The allowable clock skew. */
-    private long krbAllowableClockSkew = DEFAULT_ALLOWABLE_CLOCKSKEW;
-
     /** The default for allowing forwardable tickets */
     private static final boolean DEFAULT_TGS_FORWARDABLE_ALLOWED = true;
 
@@ -70,40 +69,56 @@ public class KdcServerBean extends DSBas
     /** The default kdc service principal */
     private static final String DEFAULT_PRINCIPAL = "krbtgt/EXAMPLE.COM@EXAMPLE.COM";
 
+    /** The allowable clock skew. */
+    @AttributeType("ads-krbAllowableClockSkew")
+    private long krbAllowableClockSkew = DEFAULT_ALLOWABLE_CLOCKSKEW;
+
     /** Whether empty addresses are allowed. */
+    @AttributeType("ads-krbEmptyAddressesAllowed")
     private boolean krbEmptyAddressesAllowed = DEFAULT_EMPTY_ADDRESSES_ALLOWED;
 
     /** Whether forwardable addresses are allowed. */
+    @AttributeType("ads-krbForwardableAllowed")
     private boolean krbForwardableAllowed = DEFAULT_TGS_FORWARDABLE_ALLOWED;
 
     /** Whether pre-authentication by encrypted timestamp is required. */
+    @AttributeType("ads-krbPAEncTimestampRequired")
     private boolean krbPAEncTimestampRequired = DEFAULT_PA_ENC_TIMESTAMP_REQUIRED;
 
     /** Whether postdated tickets are allowed. */
+    @AttributeType("ads-krbPostdatedAllowed")
     private boolean krbPostdatedAllowed = DEFAULT_TGS_POSTDATED_ALLOWED;
 
     /** Whether proxiable addresses are allowed. */
+    @AttributeType("ads-krbProxiableAllowed")
     private boolean krbProxiableAllowed = DEFAULT_TGS_PROXIABLE_ALLOWED;
 
     /** Whether renewable tickets are allowed. */
+    @AttributeType("ads-krbRenewableAllowed")
     private boolean krbRenewableAllowed = DEFAULT_TGS_RENEWABLE_ALLOWED;
 
     /** The maximum renewable lifetime. */
+    @AttributeType("ads-krbMaximumRenewableLifetime")
     private long krbMaximumRenewableLifetime = DEFAULT_TGS_MAXIMUM_RENEWABLE_LIFETIME;
 
     /** The maximum ticket lifetime. */
+    @AttributeType("ads-krbMaximumTicketLifetime")
     private long krbMaximumTicketLifetime = DEFAULT_TGS_MAXIMUM_TICKET_LIFETIME;
 
     /** The primary realm */
+    @AttributeType("ads-krbPrimaryRealm")
     private String krbPrimaryRealm = DEFAULT_REALM;
 
     /** Whether to verify the body checksum. */
+    @AttributeType("ads-krbBodyChecksumVerified")
     private boolean krbBodyChecksumVerified = DEFAULT_VERIFY_BODY_CHECKSUM;
 
     /** The encryption types. */
+    @AttributeType("ads-krbEncryptionTypes")
     private List<String> krbEncryptionTypes = new ArrayList<String>();
 
     /** The service principal name. */
+    @AttributeType("ads-krbKdcPrincipal")
     private String krbKdcPrincipal = DEFAULT_PRINCIPAL;
 
     /**

Modified: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/LdapServerBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/LdapServerBean.java?rev=1042745&r1=1042744&r2=1042745&view=diff
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/LdapServerBean.java (original)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/LdapServerBean.java Mon Dec  6 17:46:59 2010
@@ -22,6 +22,8 @@ package org.apache.directory.server.conf
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.directory.server.config.AttributeType;
+
 
 /**
  * A class used to store the LdapServer configuration.
@@ -31,30 +33,39 @@ import java.util.List;
 public class LdapServerBean extends DSBasedServerBean
 {
     /** */
+    @AttributeType("ads-confidentialityRequired")
     private boolean confidentialityRequired;
     
     /** The maximum number of entries returned by the server */
+    @AttributeType("ads-maxSizeLimit")
     private int maxSizeLimit;
     
     /** The maximum time to execute a request on the server */
+    @AttributeType("ads-maxTimeLimit")
     private int maxTimeLimit;
     
     /** The SASL host */
+    @AttributeType("ads-saslHost")
     private String saslHost;
     
     /** The SASL  principal */
+    @AttributeType("ads-saslPrincipal")
     private String saslPrincipal;
     
     /** The SASL realms */
+    @AttributeType("ads-saslRealms")
     private List<String> saslRealms = new ArrayList<String>();
     
     /** The keystore file */
+    @AttributeType("ads-keystoreFile")
     private String keystoreFile;
     
     /** The certificate password */
+    @AttributeType("ads-certificatePassword")
     private String certificatePassword;
     
     /** tells if the replication is enabled */
+    @AttributeType("ads-enableReplProvider")
     private boolean enableReplProvider; 
     
     /** The replication consumer Bean */

Modified: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/PartitionBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/PartitionBean.java?rev=1042745&r1=1042744&r2=1042745&view=diff
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/PartitionBean.java (original)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/PartitionBean.java Mon Dec  6 17:46:59 2010
@@ -22,6 +22,8 @@ package org.apache.directory.server.conf
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.directory.server.config.AttributeType;
+import org.apache.directory.server.config.RDN;
 import org.apache.directory.shared.ldap.name.DN;
 
 /**
@@ -32,19 +34,24 @@ import org.apache.directory.shared.ldap.
 public abstract class PartitionBean extends AdsBaseBean
 {
     /** The Partition identifier */
+    @AttributeType("ads-partitionId")
+    @RDN
     private String partitionId;
     
     /** The Partition suffix */
+    @AttributeType("ads-partitionSuffix")
     private DN partitionSuffix;
     
     /** Tells if the data should be flushed to disk immediately */
+    @AttributeType("ads-partitionSyncOnWrite")
     private boolean partitionSyncOnWrite;
-
-    /** The list of declared indexes */
-    private List<IndexBean> indexes = new ArrayList<IndexBean>();
     
     /** The partition's ContextEntry */
+    @AttributeType("ads-contextEntry")
     private String contextEntry;
+    
+    /** The list of declared indexes */
+    private List<IndexBean> indexes = new ArrayList<IndexBean>();
 
     /**
      * Create a new PartitionBean instance

Modified: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/PasswordPolicyBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/PasswordPolicyBean.java?rev=1042745&r1=1042744&r2=1042745&view=diff
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/PasswordPolicyBean.java (original)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/PasswordPolicyBean.java Mon Dec  6 17:46:59 2010
@@ -21,6 +21,8 @@
 package org.apache.directory.server.config.beans;
 
 
+import org.apache.directory.server.config.AttributeType;
+import org.apache.directory.server.config.RDN;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 
 
@@ -35,17 +37,21 @@ public class PasswordPolicyBean extends 
     /**
      * The PasswordPolicy unique identifier
      */
+    @AttributeType("ads-pwdId")
+    @RDN
     private String pwdId;
     
     /** the name of the attribute to which the password policy is applied. 
      * Currently only "userPassword" attribute is supported
      */
+    @AttributeType("ads-pwdAttribute")
     private String pwdAttribute = SchemaConstants.USER_PASSWORD_AT;
 
     /** 
      * holds the number of seconds that must elapse between modifications to the password. 
      * Default value is 0 
      */
+    @AttributeType("ads-pwdMinAge")
     private int pwdMinAge = 0;
 
     /**
@@ -53,28 +59,33 @@ public class PasswordPolicyBean extends 
      *  Default value is 0, does not expire.  If not 0, the value must be greater than or equal
      *  to the value of the pwdMinAge.
      */
+    @AttributeType("ads-pwdMaxAge")
     private int pwdMaxAge;
 
     /**
      *  specifies the maximum number of used passwords stored in the pwdHistory attribute.
      *  Default value is 0, no password history maintained
      */
+    @AttributeType("ads-pwdInHistory")
     private int pwdInHistory = 0;
 
     /** indicates how the password quality will be verified while being modified or added.
      *  Default value 0, do not check 
      */
+    @AttributeType("ads-pwdCheckQuality")
     private int pwdCheckQuality = 0;
 
     /** this attribute holds the minimum number of characters that must be used in a password. 
      *  Default value 0, no minimum length enforced
      */
+    @AttributeType("ads-pwdMinLength")
     private int pwdMinLength = 0;
 
     /**
      * this attribute holds the maximum number of characters that may be used in a password.
      * Default value 0, no maximum length enforced
      */
+    @AttributeType("ads-pwdMaxLength")
     private int pwdMaxLength = 0;
 
     /**
@@ -82,18 +93,21 @@ public class PasswordPolicyBean extends 
      * messages will be returned to an authenticating user.
      * Default value is 0, never send a warning message.
      */
+    @AttributeType("ads-pwdExpireWarning")
     private int pwdExpireWarning = 0;
 
     /** 
      * the number of times an expired password can be used to authenticate.
      * Default value is 0, do not allow a expired password for authentication.
      */
+    @AttributeType("ads-pwdGraceAuthNLimit")
     private int pwdGraceAuthNLimit = 0;
 
     /** 
      * specifies the number of seconds the grace authentications are valid
      * Default value is 0, no limit.
      */
+    @AttributeType("ads-pwdGraceExpire")
     private int pwdGraceExpire = 0;
 
     /**
@@ -101,6 +115,7 @@ public class PasswordPolicyBean extends 
      * consecutive failed bind attempts. The maximum number of consecutive
      * failed bind attempts is specified in {@link #pwdMaxFailure}
      */
+    @AttributeType("ads-pwdLockout")
     private boolean pwdLockout;
 
     /**
@@ -108,6 +123,7 @@ public class PasswordPolicyBean extends 
      * too many failed bind attempts.
      * Default value is 300 seconds.
      */
+    @AttributeType("ads-pwdLockoutDuration")
     private int pwdLockoutDuration = 300;
 
     /**
@@ -115,12 +131,14 @@ public class PasswordPolicyBean extends 
      * be used to authenticate.
      * Default value is 0, no limit on the number of authentication failures
      */
+    @AttributeType("ads-pwdMaxFailure")
     private int pwdMaxFailure;
 
     /**
      * the number of seconds after which the password failures are purged from the failure counter.
      * Default value is 0, reset all pwdFailureTimes after a successful authentication.
      */
+    @AttributeType("ads-pwdFailureCountInterval")
     private int pwdFailureCountInterval;
 
     /** 
@@ -128,9 +146,11 @@ public class PasswordPolicyBean extends 
      * directory after a password is set or reset by a password administrator.
      * Default value is false, no need to change the password by user.
      */
+    @AttributeType("ads-pwdMustChange")
     private boolean pwdMustChange = false;
 
     /** indicates whether users can change their own passwords. Default value is true, allow change */
+    @AttributeType("ads-pwdAllowUserChange")
     private boolean pwdAllowUserChange = true;
 
     /**
@@ -138,21 +158,25 @@ public class PasswordPolicyBean extends 
      *  new password when being changed.
      *  Default value is false.
      */
+    @AttributeType("ads-pwdSafeModify")
     private boolean pwdSafeModify = false;
 
     /** 
      * the number of seconds to delay responding to the first failed authentication attempt
      * Default value 0, no delay.
      */
+    @AttributeType("ads-pwdMinDelay")
     private int pwdMinDelay = 0;
 
     /** the maximum number of seconds to delay when responding to a failed authentication attempt.*/
+    @AttributeType("ads-pwdMaxDelay")
     private int pwdMaxDelay;
 
     /** 
      * the number of seconds an account may remain unused before it becomes locked
      * Default value is 0, no check for idle time.
      */
+    @AttributeType("ads-pwdMaxIdle")
     private int pwdMaxIdle;
 
     public String getPwdAttribute()

Modified: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ReplConsumerBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ReplConsumerBean.java?rev=1042745&r1=1042744&r2=1042745&view=diff
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ReplConsumerBean.java (original)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ReplConsumerBean.java Mon Dec  6 17:46:59 2010
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.server.config.beans;
 
+import org.apache.directory.server.config.AttributeType;
+import org.apache.directory.server.config.RDN;
 import org.apache.directory.shared.ldap.name.DN;
 
 
@@ -30,36 +32,48 @@ import org.apache.directory.shared.ldap.
 public class ReplConsumerBean extends AdsBaseBean
 {
     /** The consumer id */
+    @AttributeType("ads-replConsumerId")
+    @RDN
     private String replConsumerId;
     
     /** The replication unique ID */
+    @AttributeType("ads-dsReplicaId")
     private String dsReplicaId;
     
     /** The Alias Dereferencing mode */
+    @AttributeType("ads-replAliasDerefMode")
     private String replAliasDerefMode;
     
     /** The Search Base DN */
+    @AttributeType("ads-searchBaseDN")
     private DN searchBaseDN;
     
     /** The last CSN sent */
+    @AttributeType("ads-replLastSentCsn")
     private String replLastSentCsn;
     
     /** The search scope */
+    @AttributeType("ads-replSearchScope")
     private String replSearchScope;
     
     /** The replication search filter */
+    @AttributeType("ads-replSearchFilter")
     private String replSearchFilter;
     
     /** Tells if we should persist */
+    @AttributeType("ads-replRefreshNPersist")
     private boolean replRefreshNPersist;
     
     /** Tells if TLS should be used during replication */
+    @AttributeType("ads-replUseTls")
     private boolean replUseTls;
     
     /** Tells if the certificate validation should be strict or not */
+    @AttributeType("ads-replStrictCertValidation")
     private boolean replStrictCertValidation;
     
     /** The peer certificate */
+    @AttributeType("ads-replPeerCertificate")
     private String replPeerCertificate;
 
     /**

Modified: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ReplProviderBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ReplProviderBean.java?rev=1042745&r1=1042744&r2=1042745&view=diff
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ReplProviderBean.java (original)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ReplProviderBean.java Mon Dec  6 17:46:59 2010
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.server.config.beans;
 
+import org.apache.directory.server.config.AttributeType;
+import org.apache.directory.server.config.RDN;
 import org.apache.directory.shared.ldap.name.DN;
 
 
@@ -30,51 +32,68 @@ import org.apache.directory.shared.ldap.
 public class ReplProviderBean extends AdsBaseBean
 {
     /** The provider id */
+    @AttributeType("ads-replProviderId")
+    @RDN
     private String replProviderId;
     
     /** The replication unique ID */
+    @AttributeType("ads-dsReplicaId")
     private String dsReplicaId;
     
     /** The Search Base DN */
+    @AttributeType("ads-searchBaseDN")
     private DN searchBaseDN;
     
     /** The replication provider host name */
+    @AttributeType("ads-replProvHostName")
     private String replProvHostName;
     
     /** The replication provider port */
+    @AttributeType("ads-replProvPort")
     private String replProvPort;
     
     /** The Alias Dereferencing mode */
+    @AttributeType("ads-replAliasDerefMode")
     private String replAliasDerefMode;
     
     /** The replication provider attribute */
+    @AttributeType("ads-replAttribute")
     private String replAttribute;
     
     /** The refresh interval */
+    @AttributeType("ads-replRefreshInterval")
     private String replRefreshInterval;
     
     /** Tells if we should persist */
+    @AttributeType("ads-replRefreshNPersist")
     private boolean replRefreshNPersist;
     
     /** The search scope */
+    @AttributeType("ads-replSearchScope")
     private String replSearchScope;
     
     /** The replication search filter */
+    @AttributeType("ads-replSearchFilter")
     private String replSearchFilter;
 
     /** The search size limit */
+    @AttributeType("ads-replSearchSizeLimit")
     private int replSearchSizeLimit;
     
     /** The search time limit */
+    @AttributeType("ads-replSearchTimeout")
     private int replSearchTimeout;
     
     /** The replication user DN */
+    @AttributeType("ads-replUserDN")
     private DN replUserDN;
     
     /** The replication user password */
+    @AttributeType("ads-replUserPassword")
     private String replUserPassword;
     
     /** The replication cookie */
+    @AttributeType("ads-replCookie")
     private String replCookie;
 
     /**

Modified: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/SaslMechHandlerBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/SaslMechHandlerBean.java?rev=1042745&r1=1042744&r2=1042745&view=diff
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/SaslMechHandlerBean.java (original)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/SaslMechHandlerBean.java Mon Dec  6 17:46:59 2010
@@ -19,6 +19,9 @@
  */
 package org.apache.directory.server.config.beans;
 
+import org.apache.directory.server.config.AttributeType;
+import org.apache.directory.server.config.RDN;
+
 
 /**
  * A class used to store the SASL mechanism handler configuration.
@@ -28,12 +31,16 @@ package org.apache.directory.server.conf
 public class SaslMechHandlerBean extends AdsBaseBean
 {
     /** The SASL mechanism handler */
+    @AttributeType("ads-saslMechName")
+    @RDN
     private String saslMechName;
     
     /** The SASL mechanism handler FQCN */
+    @AttributeType("ads-saslMechClassName")
     private String saslMechClassName;
     
     /** The NTLM provider */
+    @AttributeType("ads-ntlmMechProvider")
     private String ntlmMechProvider;
 
     /**

Modified: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ServerBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ServerBean.java?rev=1042745&r1=1042744&r2=1042745&view=diff
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ServerBean.java (original)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/ServerBean.java Mon Dec  6 17:46:59 2010
@@ -22,6 +22,9 @@ package org.apache.directory.server.conf
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.directory.server.config.AttributeType;
+import org.apache.directory.server.config.RDN;
+
 /**
  * A class used to store the Server configuration. It can't be instanciated
  *
@@ -30,6 +33,8 @@ import java.util.List;
 public abstract class ServerBean extends AdsBaseBean
 {
     /** The server unique identifier */
+    @AttributeType("ads-serverId")
+    @RDN
     private String serverId;
     
     /** The set of transports to use for this server */

Modified: directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/TransportBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/TransportBean.java?rev=1042745&r1=1042744&r2=1042745&view=diff
==============================================================================
--- directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/TransportBean.java (original)
+++ directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/beans/TransportBean.java Mon Dec  6 17:46:59 2010
@@ -19,6 +19,9 @@
  */
 package org.apache.directory.server.config.beans;
 
+import org.apache.directory.server.config.AttributeType;
+import org.apache.directory.server.config.RDN;
+
 /**
  * A class used to store the Transport configuration.
  *
@@ -33,21 +36,28 @@ public class TransportBean extends AdsBa
     private static final int DEFAULT_NB_THREADS = 3;
 
     /** The unique identifier for this transport */
+    @AttributeType("ads-transportId")
+    @RDN
     private String transportId;
     
     /** The transport address */
+    @AttributeType("ads-transportAddress")
     private String transportAddress;
     
     /** The port number */
+    @AttributeType("ads-systemPort")
     private int systemPort = -1;
     
     /** A flag set if SSL is enabled */
+    @AttributeType("ads-transportEnableSsl")
     private boolean transportEnableSsl = false;
     
     /** The number of threads to use for the IoAcceptor executor */
+    @AttributeType("ads-transportNbThreads")
     private int transportNbThreads = DEFAULT_NB_THREADS;
     
     /** The backlog for the transport services */
+    @AttributeType("ads-transportBackLog")
     private int transportBackLog = DEFAULT_BACKLOG_NB;
     
     /**



Mime
View raw message