directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1043878 [1/3] - in /directory/apacheds/trunk/server-config: ./ src/main/java/org/apache/directory/server/config/ src/main/java/org/apache/directory/server/config/beans/ src/main/resources/ src/test/java/org/apache/directory/server/config/
Date Thu, 09 Dec 2010 09:55:56 GMT
Author: pamarcelot
Date: Thu Dec  9 09:55:55 2010
New Revision: 1043878

URL: http://svn.apache.org/viewvc?rev=1043878&view=rev
Log:
Merged 'server-config-annotations' branch (https://svn.apache.org/repos/asf/directory/apacheds/branches/server-config-annotations) back into trunk.

Added:
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigWriter.java
      - copied unchanged from r1043868, directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/ConfigWriter.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigurationElement.java
      - copied unchanged from r1043868, directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/ConfigurationElement.java
    directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ConfigWriterTest.java
      - copied unchanged from r1043868, directory/apacheds/branches/server-config-annotations/server-config/src/test/java/org/apache/directory/server/config/ConfigWriterTest.java
Modified:
    directory/apacheds/trunk/server-config/   (props changed)
    directory/apacheds/trunk/server-config/pom.xml
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java   (contents, props changed)
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/AdsBaseBean.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ChangeLogBean.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ChangePasswordServerBean.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DSBasedServerBean.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DhcpServerBean.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DirectoryServiceBean.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DnsServerBean.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ExtendedOpHandlerBean.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/HttpServerBean.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/HttpWebAppBean.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/IndexBean.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/InterceptorBean.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/JdbmIndexBean.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/JdbmPartitionBean.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/JournalBean.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/KdcServerBean.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/LdapServerBean.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/NtpServerBean.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/PartitionBean.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/PasswordPolicyBean.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ReplConsumerBean.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ReplProviderBean.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/SaslMechHandlerBean.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ServerBean.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/TcpTransportBean.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/TransportBean.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/UdpTransportBean.java
    directory/apacheds/trunk/server-config/src/main/resources/   (props changed)
    directory/apacheds/trunk/server-config/src/main/resources/config.ldif
    directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ConfigPartitionReaderTest.java   (props changed)

Propchange: directory/apacheds/trunk/server-config/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec  9 09:55:55 2010
@@ -2,3 +2,4 @@
 /directory/apacheds/branches/apacheds-config/server-config:1023442-1029077
 /directory/apacheds/branches/apacheds-dnfactory-experiment/server-config:980138-980938
 /directory/apacheds/branches/apacheds-kerberos-codec-2.0/server-config:1040956-1043765
+/directory/apacheds/branches/server-config-annotations/server-config:1042727-1043868

Modified: directory/apacheds/trunk/server-config/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/pom.xml?rev=1043878&r1=1043877&r2=1043878&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/pom.xml (original)
+++ directory/apacheds/trunk/server-config/pom.xml Thu Dec  9 09:55:55 2010
@@ -43,7 +43,6 @@
     <dependency>
       <groupId>org.apache.directory.server</groupId>
       <artifactId>apacheds-ldif-partition</artifactId>
-      <scope>test</scope>
     </dependency>
     
     <dependency>

Modified: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java?rev=1043878&r1=1043877&r2=1043878&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java (original)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java Thu Dec  9 09:55:55 2010
@@ -56,6 +56,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
 import org.apache.directory.shared.ldap.name.DN;
+import org.apache.directory.shared.ldap.name.RDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.ObjectClass;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
@@ -126,7 +127,7 @@ public class ConfigPartitionReader
     private ObjectClass findObjectClass( EntryAttribute objectClass ) throws Exception
     {
         Set<ObjectClass> candidates = new HashSet<ObjectClass>();
-        
+
         try
         {
             // Create the set of candidates
@@ -134,8 +135,8 @@ public class ConfigPartitionReader
             {
                 String ocName = ocValue.getString();
                 String ocOid = schemaManager.getObjectClassRegistry().getOidByName( ocName );
-                ObjectClass oc = (ObjectClass)schemaManager.getObjectClassRegistry().get( ocOid );
-                
+                ObjectClass oc = ( ObjectClass ) schemaManager.getObjectClassRegistry().get( ocOid );
+
                 if ( oc.isStructural() )
                 {
                     candidates.add( oc );
@@ -147,14 +148,14 @@ public class ConfigPartitionReader
             e.printStackTrace();
             throw e;
         }
-        
+
         // Now find the parent OC
         for ( Value<?> ocValue : objectClass )
         {
             String ocName = ocValue.getString();
             String ocOid = schemaManager.getObjectClassRegistry().getOidByName( ocName );
-            ObjectClass oc = (ObjectClass)schemaManager.getObjectClassRegistry().get( ocOid );
-            
+            ObjectClass oc = ( ObjectClass ) schemaManager.getObjectClassRegistry().get( ocOid );
+
             for ( ObjectClass superior : oc.getSuperiors() )
             {
                 if ( oc.isStructural() )
@@ -166,15 +167,16 @@ public class ConfigPartitionReader
                 }
             }
         }
-        
+
         // The remaining OC in the candidates set is the one we are looking for
-        ObjectClass result = candidates.toArray( new ObjectClass[]{} )[0];
-        
+        ObjectClass result = candidates.toArray( new ObjectClass[]
+            {} )[0];
+
         LOG.debug( "The top level object class is {}", result.getName() );
         return result;
     }
-    
-    
+
+
     /** 
      * Create the base Bean from the ObjectClass name. 
      * The bean name is constructed using the OjectClass name, by
@@ -190,20 +192,20 @@ public class ConfigPartitionReader
         // Now, let's instanciate the associated bean. Get rid of the 'ads-' in front of the name,
         // and uppercase the first letter. Finally add "Bean" at the end and add the package.
         //String beanName = this.getClass().getPackage().getName() + "org.apache.directory.server.config.beans." + Character.toUpperCase( objectClassName.charAt( 4 ) ) + objectClassName.substring( 5 ) + "Bean";
-        String beanName = this.getClass().getPackage().getName() + ".beans." + 
-            Character.toUpperCase( objectClassName.charAt( ADS_PREFIX.length() ) ) + 
+        String beanName = this.getClass().getPackage().getName() + ".beans." +
+            Character.toUpperCase( objectClassName.charAt( ADS_PREFIX.length() ) ) +
             objectClassName.substring( ADS_PREFIX.length() + 1 ) + ADS_SUFFIX;
-        
+
         try
         {
             Class<?> clazz = Class.forName( beanName );
             Constructor<?> constructor = clazz.getConstructor();
-            AdsBaseBean bean = (AdsBaseBean)constructor.newInstance();
-            
+            AdsBaseBean bean = ( AdsBaseBean ) constructor.newInstance();
+
             LOG.debug( "Bean {} created for ObjectClass {}", beanName, objectClassName );
-            
+
             return bean;
-        } 
+        }
         catch ( ClassNotFoundException cnfe )
         {
             String message = "Cannot find a Bean class for the ObjectClass name " + objectClassName;
@@ -215,7 +217,7 @@ public class ConfigPartitionReader
             String message = "Cannot access to the class " + beanName;
             LOG.error( message );
             throw new ConfigurationException( message );
-        } 
+        }
         catch ( NoSuchMethodException nsme )
         {
             String message = "Cannot find a constructor for the class " + beanName;
@@ -241,53 +243,55 @@ public class ConfigPartitionReader
             throw new ConfigurationException( message );
         }
     }
-    
+
 
     /**
      * Retrieve the Field associated with an AttributeType name, if any.
      */
-    private static Field getField( Class<?> clazz, String attributeName, Class<?> originalClazz ) throws ConfigurationException 
+    private static Field getField( Class<?> clazz, String attributeName, Class<?> originalClazz )
+        throws ConfigurationException
     {
         // We will check all the fields, as the AT name is case insentitive
         // when the field is case sensitive
         Field[] fields = clazz.getDeclaredFields();
-        
+
         for ( Field field : fields )
         {
             String fieldName = field.getName();
-            
+
             if ( fieldName.equalsIgnoreCase( attributeName ) )
             {
                 return field;
             }
         }
-        
+
         // May be in the paren'ts class ?
         if ( clazz.getSuperclass() != null )
         {
             return getField( clazz.getSuperclass(), attributeName, originalClazz );
         }
-        
+
         String message = "Cannot find a field named " + attributeName + " in class " + originalClazz.getName();
         LOG.error( message );
         throw new ConfigurationException( message );
     }
-    
-    
+
+
     /**
      * Read the single entry value for an AttributeType, and feed the Bean field with this value
      */
-    private void readSingleValueField( AdsBaseBean bean, Field beanField, EntryAttribute fieldAttr, boolean mandatory ) throws ConfigurationException
+    private void readSingleValueField( AdsBaseBean bean, Field beanField, EntryAttribute fieldAttr, boolean mandatory )
+        throws ConfigurationException
     {
         if ( fieldAttr == null )
         {
             return;
         }
-        
+
         Value<?> value = fieldAttr.get();
         String valueStr = value.getString();
         Class<?> type = beanField.getType();
-        
+
         // Process the value accordingly to its type.
         try
         {
@@ -297,11 +301,11 @@ public class ConfigPartitionReader
             }
             else if ( type == int.class )
             {
-                beanField.setInt( bean, Integer.parseInt( valueStr )  );
+                beanField.setInt( bean, Integer.parseInt( valueStr ) );
             }
             else if ( type == long.class )
             {
-                beanField.setLong( bean, Long.parseLong( valueStr )  );
+                beanField.setLong( bean, Long.parseLong( valueStr ) );
             }
             else if ( type == boolean.class )
             {
@@ -316,7 +320,8 @@ public class ConfigPartitionReader
                 }
                 catch ( LdapInvalidDnException lide )
                 {
-                    String message = "The DN '" + valueStr + "' for attribute " + fieldAttr.getId() + " is not a valid DN";
+                    String message = "The DN '" + valueStr + "' for attribute " + fieldAttr.getId()
+                        + " is not a valid DN";
                     LOG.error( message );
                     throw new ConfigurationException( message );
                 }
@@ -324,23 +329,24 @@ public class ConfigPartitionReader
         }
         catch ( IllegalArgumentException iae )
         {
-            String message = "Cannot store '" + valueStr + "' into attribute " + fieldAttr.getId(); ;
+            String message = "Cannot store '" + valueStr + "' into attribute " + fieldAttr.getId();;
             LOG.error( message );
             throw new ConfigurationException( message );
         }
         catch ( IllegalAccessException e )
         {
-            String message = "Cannot store '" + valueStr + "' into attribute " + fieldAttr.getId(); ;
+            String message = "Cannot store '" + valueStr + "' into attribute " + fieldAttr.getId();;
             LOG.error( message );
             throw new ConfigurationException( message );
         }
     }
-    
-    
+
+
     /**
      * Read the multiple entry value for an AttributeType, and feed the Bean field with this value
      */
-    private void readMultiValuedField( AdsBaseBean bean, Field beanField, EntryAttribute fieldAttr, boolean mandatory ) throws ConfigurationException
+    private void readMultiValuedField( AdsBaseBean bean, Field beanField, EntryAttribute fieldAttr, boolean mandatory )
+        throws ConfigurationException
     {
         if ( fieldAttr == null )
         {
@@ -356,7 +362,7 @@ public class ConfigPartitionReader
         for ( Value<?> value : fieldAttr )
         {
             String valueStr = value.getString();
-            
+
             try
             {
                 if ( type == String.class )
@@ -365,11 +371,11 @@ public class ConfigPartitionReader
                 }
                 else if ( type == int.class )
                 {
-                    beanField.setInt( bean, Integer.parseInt( valueStr )  );
+                    beanField.setInt( bean, Integer.parseInt( valueStr ) );
                 }
                 else if ( type == long.class )
                 {
-                    beanField.setLong( bean, Long.parseLong( valueStr )  );
+                    beanField.setLong( bean, Long.parseLong( valueStr ) );
                 }
                 else if ( type == boolean.class )
                 {
@@ -384,7 +390,8 @@ public class ConfigPartitionReader
                     }
                     catch ( LdapInvalidDnException lide )
                     {
-                        String message = "The DN '" + valueStr + "' for attribute " + fieldAttr.getId() + " is not a valid DN";
+                        String message = "The DN '" + valueStr + "' for attribute " + fieldAttr.getId()
+                            + " is not a valid DN";
                         LOG.error( message );
                         throw new ConfigurationException( message );
                     }
@@ -393,52 +400,58 @@ public class ConfigPartitionReader
                 {
                     Type genericFieldType = beanField.getGenericType();
                     Class<?> fieldArgClass = null;
-                        
-                    if ( genericFieldType instanceof ParameterizedType ) 
+
+                    if ( genericFieldType instanceof ParameterizedType )
                     {
-                        ParameterizedType parameterizedType = (ParameterizedType) genericFieldType;
+                        ParameterizedType parameterizedType = ( ParameterizedType ) genericFieldType;
                         Type[] fieldArgTypes = parameterizedType.getActualTypeArguments();
-                        
+
                         for ( Type fieldArgType : fieldArgTypes )
                         {
-                            fieldArgClass = (Class<?>) fieldArgType;
+                            fieldArgClass = ( Class<?> ) fieldArgType;
                         }
                     }
-    
-                    Method method = bean.getClass().getMethod( addMethodName, Array.newInstance( fieldArgClass, 0 ).getClass() );
-    
-                    method.invoke( bean, new Object[]{ new String[]{valueStr} } );
+
+                    Method method = bean.getClass().getMethod( addMethodName,
+                        Array.newInstance( fieldArgClass, 0 ).getClass() );
+
+                    method.invoke( bean, new Object[]
+                        { new String[]
+                            { valueStr } } );
                 }
                 else if ( type == List.class )
                 {
                     Type genericFieldType = beanField.getGenericType();
                     Class<?> fieldArgClass = null;
-                        
-                    if ( genericFieldType instanceof ParameterizedType ) 
+
+                    if ( genericFieldType instanceof ParameterizedType )
                     {
-                        ParameterizedType parameterizedType = (ParameterizedType) genericFieldType;
+                        ParameterizedType parameterizedType = ( ParameterizedType ) genericFieldType;
                         Type[] fieldArgTypes = parameterizedType.getActualTypeArguments();
-                        
+
                         for ( Type fieldArgType : fieldArgTypes )
                         {
-                            fieldArgClass = (Class<?>) fieldArgType;
+                            fieldArgClass = ( Class<?> ) fieldArgType;
                         }
                     }
-                    
-                    Method method = bean.getClass().getMethod( addMethodName, Array.newInstance( fieldArgClass, 0 ).getClass() );
-    
-                    method.invoke( bean, new Object[]{ new String[]{valueStr} } );
+
+                    Method method = bean.getClass().getMethod( addMethodName,
+                        Array.newInstance( fieldArgClass, 0 ).getClass() );
+
+                    method.invoke( bean, new Object[]
+                        { new String[]
+                            { valueStr } } );
                 }
             }
             catch ( IllegalArgumentException iae )
             {
-                String message = "Cannot store '" + valueStr + "' into attribute " + fieldAttr.getId(); ;
+                String message = "Cannot store '" + valueStr + "' into attribute " + fieldAttr.getId();;
                 LOG.error( message );
                 throw new ConfigurationException( message );
             }
             catch ( IllegalAccessException e )
             {
-                String message = "Cannot store '" + valueStr + "' into attribute " + fieldAttr.getId(); ;
+                String message = "Cannot store '" + valueStr + "' into attribute " + fieldAttr.getId();;
                 LOG.error( message );
                 throw new ConfigurationException( message );
             }
@@ -447,7 +460,7 @@ public class ConfigPartitionReader
                 String message = "Cannot access to the class " + bean.getClass().getName();
                 LOG.error( message );
                 throw new ConfigurationException( message );
-            } 
+            }
             catch ( NoSuchMethodException nsme )
             {
                 String message = "Cannot find a method " + addMethodName + " in the class " + bean.getClass().getName();
@@ -467,46 +480,49 @@ public class ConfigPartitionReader
         }
     }
 
-    
+
     /**
      * Read all the required fields (AttributeTypes) for a given Entry.
      */
-    private void readFields( AdsBaseBean bean, Entry entry, Set<AttributeType> attributeTypes, boolean mandatory ) throws NoSuchFieldException, IllegalAccessException, Exception
+    private void readFields( AdsBaseBean bean, Entry entry, Set<AttributeType> attributeTypes, boolean mandatory )
+        throws NoSuchFieldException, IllegalAccessException, Exception
     {
         for ( AttributeType attributeType : attributeTypes )
         {
             String fieldName = attributeType.getName();
             String beanFieldName = fieldName;
-            
+
             // Remove the "ads-" from the beginning of the field name
             if ( fieldName.startsWith( ADS_PREFIX ) )
             {
                 beanFieldName = fieldName.substring( ADS_PREFIX.length() );
             }
-            
+
             // Get the field
             Field beanField = getField( bean.getClass(), beanFieldName, bean.getClass() );
-            
+
             // The field is private, we need to modify it to be able to access it.
             beanField.setAccessible( true );
-            
+
             // Get the entry attribute for this field
             EntryAttribute fieldAttr = entry.get( fieldName );
-            
+
             if ( ( fieldAttr == null ) && ( mandatory ) )
             {
-                String message = "Attribute " + fieldName + " is mandatory and is not present for the Entry " + entry.getDn();
+                String message = "Attribute " + fieldName + " is mandatory and is not present for the Entry "
+                    + entry.getDn();
                 LOG.error( message );
                 throw new ConfigurationException( message );
             }
-            
+
             // Get the associated AttributeType
             AttributeType beanAT = schemaManager.getAttributeType( fieldName );
-            
+
             // Check if this AT has the ads-compositeElement as a superior
             AttributeType superior = beanAT.getSuperior();
-            
-            if ( ( superior != null ) && superior.getOid().equals( ConfigSchemaConstants.ADS_COMPOSITE_ELEMENT_AT.getOid() ) )
+
+            if ( ( superior != null )
+                && superior.getOid().equals( ConfigSchemaConstants.ADS_COMPOSITE_ELEMENT_AT.getOid() ) )
             {
                 // This is a composite element, we have to go one level down to read it.
                 // First, check if it's a SingleValued element
@@ -522,25 +538,27 @@ public class ConfigPartitionReader
                         if ( mandatory )
                         {
                             // This is an error !
-                            String message = "The composite " + beanAT.getName() + " is mandatory, and was not found under the "
+                            String message = "The composite " + beanAT.getName()
+                                + " is mandatory, and was not found under the "
                                 + "configuration entry " + entry.getDn();
                             LOG.error( message );
                             throw new ConfigurationException( message );
                         }
                     }
                     else
-                    { 
+                    {
                         // We must take the first element
                         AdsBaseBean readBean = beans.get( 0 );
-                        
+
                         if ( beans.size() > 1 )
                         {
                             // Not allowed as the AT is singled-valued
-                            String message = "We have more than one entry for " + beanAT.getName() + " under " + entry.getDn();
+                            String message = "We have more than one entry for " + beanAT.getName() + " under "
+                                + entry.getDn();
                             LOG.error( message );
                             throw new ConfigurationException( message );
                         }
-                        
+
                         beanField.set( bean, readBean );
                     }
                 }
@@ -549,33 +567,34 @@ public class ConfigPartitionReader
                     // No : we have to loop recursively on all the elements which are
                     // under the ou=<element-name> branch
                     DN newBase = entry.getDn().add( "ou=" + beanFieldName );
-                    
+
                     // We have to remove the 's' at the end of the field name
                     String attributeName = fieldName.substring( 0, fieldName.length() - 1 );
-                    
+
                     // Sometime, the plural of a noun takes 'es'
                     if ( !schemaManager.getObjectClassRegistry().contains( attributeName ) )
                     {
                         // Try by removing 'es'
                         attributeName = fieldName.substring( 0, fieldName.length() - 2 );
-                        
+
                         if ( !schemaManager.getObjectClassRegistry().contains( attributeName ) )
                         {
                             String message = "Cannot find the ObjectClass named " + attributeName + " in the schema";
-                            LOG.error(  message  );
+                            LOG.error( message );
                             throw new ConfigurationException( message );
                         }
                     }
-                    
+
                     // This is a multi-valued element, it can be a Set or a List
                     Collection<AdsBaseBean> beans = read( newBase, attributeName, SearchScope.ONELEVEL, mandatory );
-                    
+
                     if ( ( beans == null ) || ( beans.size() == 0 ) )
                     {
                         // If the element is mandatory, this is an error
                         if ( mandatory )
                         {
-                            String message = "The composite " + beanAT.getName() + " is mandatory, and was not found under the "
+                            String message = "The composite " + beanAT.getName()
+                                + " is mandatory, and was not found under the "
                                 + "configuration entry " + entry.getDn();
                             LOG.error( message );
                             throw new ConfigurationException( message );
@@ -588,7 +607,8 @@ public class ConfigPartitionReader
                     }
                 }
             }
-            else // A standard AttributeType (ie, boolean, long, int or String)
+            else
+            // A standard AttributeType (ie, boolean, long, int or String)
             {
                 // Process the field accordingly to its cardinality
                 if ( beanAT.isSingleValued() )
@@ -602,58 +622,58 @@ public class ConfigPartitionReader
             }
         }
     }
-    
-    
+
+
     /**
      * Get the list of MUST AttributeTypes for an objectClass
      */
     private Set<AttributeType> getAllMusts( ObjectClass objectClass )
     {
         Set<AttributeType> musts = new HashSet<AttributeType>();
-        
+
         // First, gets the direct MUST
         musts.addAll( objectClass.getMustAttributeTypes() );
-        
+
         // then add all the superiors MUST (recursively)
         List<ObjectClass> superiors = objectClass.getSuperiors();
-        
+
         if ( superiors != null )
         {
             for ( ObjectClass superior : superiors )
             {
-                musts.addAll( getAllMusts( superior) );
+                musts.addAll( getAllMusts( superior ) );
             }
         }
-        
+
         return musts;
     }
-    
-    
+
+
     /**
      * Get the list of MAY AttributeTypes for an objectClass
      */
     private Set<AttributeType> getAllMays( ObjectClass objectClass )
     {
         Set<AttributeType> mays = new HashSet<AttributeType>();
-        
+
         // First, gets the direct MAY
         mays.addAll( objectClass.getMayAttributeTypes() );
-        
+
         // then add all the superiors MAY (recursively)
         List<ObjectClass> superiors = objectClass.getSuperiors();
-        
+
         if ( superiors != null )
         {
             for ( ObjectClass superior : superiors )
             {
-                mays.addAll( getAllMays( superior) );
+                mays.addAll( getAllMays( superior ) );
             }
         }
-        
+
         return mays;
     }
-    
-    
+
+
     /**
      * Helper method to print a list of AT's names.
      */
@@ -663,11 +683,11 @@ public class ConfigPartitionReader
         {
             return "";
         }
-        
+
         StringBuilder sb = new StringBuilder();
         boolean isFirst = true;
         sb.append( '{' );
-        
+
         for ( AttributeType attributeType : attributeTypes )
         {
             if ( isFirst )
@@ -678,24 +698,24 @@ public class ConfigPartitionReader
             {
                 sb.append( ", " );
             }
-            
+
             sb.append( attributeType.getName() );
         }
 
         sb.append( '}' );
 
-        
         return sb.toString();
     }
-    
+
 
     /**
      * Read some configuration element from the DIT using its name 
      */
-    private List<AdsBaseBean> read( DN baseDn, String name, SearchScope scope, boolean mandatory ) throws ConfigurationException
+    private List<AdsBaseBean> read( DN baseDn, String name, SearchScope scope, boolean mandatory )
+        throws ConfigurationException
     {
         LOG.debug( "Reading from '{}', entry {}", baseDn, name );
-        
+
         // Search for the element starting at some point in the DIT
         // Prepare the search request
         AttributeType adsdAt = schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASS_AT );
@@ -703,7 +723,7 @@ public class ConfigPartitionReader
         SearchControls controls = new SearchControls();
         controls.setSearchScope( scope.ordinal() );
         IndexCursor<Long, Entry, Long> cursor = null;
-        
+
         // Create a container for all the read beans
         List<AdsBaseBean> beans = new ArrayList<AdsBaseBean>();
 
@@ -711,14 +731,14 @@ public class ConfigPartitionReader
         {
             // Do the search
             cursor = se.cursor( baseDn, AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls );
-    
+
             // First, check if we have some entries to process.
             if ( !cursor.next() )
             {
                 if ( mandatory )
                 {
                     cursor.close();
-                    
+
                     // the requested element is mandatory so let's throw an exception
                     String message = "No directoryService instance was configured under the DN "
                         + configPartition.getSuffix();
@@ -735,30 +755,30 @@ public class ConfigPartitionReader
             do
             {
                 ForwardIndexEntry<Long, Entry, Long> forwardEntry = ( ForwardIndexEntry<Long, Entry, Long> ) cursor
-                .get();
+                    .get();
 
                 // Now, get the entry
                 Entry entry = configPartition.lookup( forwardEntry.getId() );
                 LOG.debug( "Entry read : {}", entry );
-                
+
                 // Let's instanciate the bean we need. The upper ObjectClass's name
                 // will be used to do that
                 EntryAttribute objectClassAttr = entry.get( SchemaConstants.OBJECT_CLASS_AT );
-                
+
                 ObjectClass objectClass = findObjectClass( objectClassAttr );
                 AdsBaseBean bean = createBean( objectClass );
-                
+
                 // Now, read the AttributeTypes and store the values into the bean fields
                 // The MAY
                 Set<AttributeType> mays = getAllMays( objectClass );
                 LOG.debug( "Fetching the following MAY attributes : {}", dumpATs( mays ) );
                 readFields( bean, entry, mays, OPTIONNAL );
-                
+
                 // The MUST
                 Set<AttributeType> musts = getAllMusts( objectClass );
                 LOG.debug( "Fetching the following MAY attributes : {}", dumpATs( musts ) );
                 readFields( bean, entry, musts, MANDATORY );
-                
+
                 // Done, we can add the bean into the list
                 beans.add( bean );
             }
@@ -791,12 +811,27 @@ public class ConfigPartitionReader
                 }
             }
         }
-        
+
         return beans;
 
     }
-    
-    
+
+
+    /**
+     * Read the configuration from the DIT, returning a bean containing all of it.
+     * <p>
+     * This method implicitly uses <em>"ou=config"</em> as base DN
+     * 
+     * @return The Config bean, containing the whole configuration
+     * @throws ConfigurationException If we had some issue reading the configuration
+     */
+    public ConfigBean readConfig() throws LdapException
+    {
+        // The starting point is the DirectoryService element
+        return readConfig( new DN( new RDN( SchemaConstants.OU_AT, "config" ) ) );
+    }
+
+
     /**
      * Read the configuration from the DIT, returning a bean containing all of it.
      * 
@@ -809,8 +844,8 @@ public class ConfigPartitionReader
         // The starting point is the DirectoryService element
         return readConfig( new DN( baseDn ), ConfigSchemaConstants.ADS_DIRECTORY_SERVICE_OC.getValue() );
     }
-    
-    
+
+
     /**
      * Read the configuration from the DIT, returning a bean containing all of it.
      * 
@@ -823,8 +858,8 @@ public class ConfigPartitionReader
         // The starting point is the DirectoryService element
         return readConfig( baseDn, ConfigSchemaConstants.ADS_DIRECTORY_SERVICE_OC.getValue() );
     }
-    
-    
+
+
     /**
      * Read the configuration from the DIT, returning a bean containing all of it.
      * 
@@ -837,8 +872,8 @@ public class ConfigPartitionReader
     {
         return readConfig( new DN( baseDn ), objectClass );
     }
-    
-    
+
+
     /**
      * Read the configuration from the DIT, returning a bean containing all of it.
      * 
@@ -851,14 +886,14 @@ public class ConfigPartitionReader
     {
         LOG.debug( "Reading configuration for the {} element, from {} ", objectClass, baseDn );
         ConfigBean configBean = new ConfigBean();
-        
+
         if ( baseDn == null )
         {
             baseDn = configPartition.getSuffix();
         }
-        
+
         List<AdsBaseBean> beans = read( baseDn, objectClass, SearchScope.ONELEVEL, MANDATORY );
-        
+
         if ( LOG.isDebugEnabled() )
         {
             if ( ( beans == null ) || ( beans.size() == 0 ) )
@@ -870,9 +905,9 @@ public class ConfigPartitionReader
                 LOG.debug( beans.get( 0 ).toString() );
             }
         }
-        
+
         configBean.setDirectoryServiceBeans( beans );
-                
+
         return configBean;
     }
 }

Propchange: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec  9 09:55:55 2010
@@ -5,4 +5,5 @@
 /directory/apacheds/branches/apacheds-replication/core-annotations/src/main/java/org/apache/directory/server/core/factory/ConfigPartitionReader.java:749790-764110
 /directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/factory/ConfigPartitionReader.java:806623-896441
 /directory/apacheds/branches/apacheds-subtree/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java:965203-965686
+/directory/apacheds/branches/server-config-annotations/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java:1042727-1043868
 /directory/apacheds/branches/xdbm-refactoring/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java:945827-946347

Modified: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/AdsBaseBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/AdsBaseBean.java?rev=1043878&r1=1043877&r2=1043878&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/AdsBaseBean.java (original)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/AdsBaseBean.java Thu Dec  9 09:55:55 2010
@@ -19,30 +19,36 @@
  */
 package org.apache.directory.server.config.beans;
 
+
+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 */
+    @ConfigurationElement(attributeType = "ads-enabled")
     private boolean enabled = false;
-    
+
     /** The description */
+    @ConfigurationElement(attributeType = "description")
     private String description;
 
+
     /**
      * Create a new BaseBean instance
      */
     protected AdsBaseBean()
     {
     }
-    
-    
+
+
     /**
      * @return <code>true</code> if the component is enabled
      */
@@ -50,8 +56,8 @@ public abstract class AdsBaseBean 
     {
         return enabled;
     }
-    
-    
+
+
     /**
      * Enable or disable the component
      * @param enabled if <code>true</code>, the component is enabled.
@@ -60,17 +66,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 +86,8 @@ public abstract class AdsBaseBean 
     {
         this.description = description;
     }
-    
-    
+
+
     /**
      * Formated print of a boolean
      */
@@ -90,7 +96,7 @@ public abstract class AdsBaseBean 
         StringBuilder sb = new StringBuilder();
 
         sb.append( tabs ).append( name ).append( " : " );
-        
+
         if ( value )
         {
             sb.append( "TRUE" );
@@ -99,13 +105,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 +126,8 @@ public abstract class AdsBaseBean 
             return "";
         }
     }
-    
-    
+
+
     /**
      * Formated print of a DN that can be null
      */
@@ -136,7 +142,8 @@ public abstract class AdsBaseBean 
             return "";
         }
     }
-    
+
+
     /**
      * a convenient method to finding if this bean was disabled in the config
      * 
@@ -146,8 +153,8 @@ public abstract class AdsBaseBean 
     {
         return !enabled;
     }
-    
-    
+
+
     /**
      * Formated print of a long
      */
@@ -155,26 +162,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/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ChangeLogBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ChangeLogBean.java?rev=1043878&r1=1043877&r2=1043878&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ChangeLogBean.java (original)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ChangeLogBean.java Thu Dec  9 09:55:55 2010
@@ -20,6 +20,9 @@
 package org.apache.directory.server.config.beans;
 
 
+import org.apache.directory.server.config.ConfigurationElement;
+
+
 /**
  * A class used to store the ChangeLog configuration.
  *
@@ -28,11 +31,14 @@ package org.apache.directory.server.conf
 public class ChangeLogBean extends AdsBaseBean
 {
     /** The ChangeLog unique ID */
+    @ConfigurationElement(attributeType = "ads-changeLogId", isRdn = true)
     private String changeLogId;
 
     /** Tells if the ChangeLog is exposed to the users */
+    @ConfigurationElement(attributeType = "ads-changeLogExposed")
     private boolean changeLogExposed;
 
+
     /**
      * Create a new ChangeLogBean instance
      */
@@ -40,7 +46,7 @@ public class ChangeLogBean extends AdsBa
     {
         // Not exposed by default
         changeLogExposed = false;
-        
+
         // Not enabled by default
         setEnabled( false );
     }
@@ -62,41 +68,41 @@ public class ChangeLogBean extends AdsBa
     {
         this.changeLogId = changeLogId;
     }
-    
-    
+
+
     /**
      * @return <code>true</code> if the ChangeLog is exposed
      */
-    public boolean isChangeLogExposed() 
+    public boolean isChangeLogExposed()
     {
         return changeLogExposed;
     }
 
-    
+
     /**
      * @param exposed Set the exposed flag
      */
-    public void setChangeLogExposed( boolean changeLogExposed ) 
+    public void setChangeLogExposed( boolean changeLogExposed )
     {
         this.changeLogExposed = changeLogExposed;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
     public String toString( String tabs )
     {
         StringBuilder sb = new StringBuilder();
-        
+
         sb.append( tabs ).append( "ChangeLog :\n" );
         sb.append( tabs ).append( "  changeLog id : " ).append( changeLogId ).append( '\n' );
         sb.append( toString( tabs, "  changeLog exposed", changeLogExposed ) );
-        
+
         return sb.toString();
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */

Modified: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ChangePasswordServerBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ChangePasswordServerBean.java?rev=1043878&r1=1043877&r2=1043878&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ChangePasswordServerBean.java (original)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ChangePasswordServerBean.java Thu Dec  9 09:55:55 2010
@@ -19,9 +19,12 @@
  */
 package org.apache.directory.server.config.beans;
 
+
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.directory.server.config.ConfigurationElement;
+
 
 /**
  * A class used to store the ChangePasswordServer configuration.
@@ -31,29 +34,38 @@ import java.util.List;
 public class ChangePasswordServerBean extends DSBasedServerBean
 {
     /** The allowable clock skew. */
+    @ConfigurationElement(attributeType = "ads-krbAllowableClockSkew")
     private long krbAllowableClockSkew;
-    
+
     /** Whether empty addresses are allowed. */
+    @ConfigurationElement(attributeType = "ads-krbEmptyAddressesAllowed")
     private boolean krbEmptyAddressesAllowed;
-    
+
     /** The encryption types. */
+    @ConfigurationElement(attributeType = "ads-krbEncryptionTypes")
     private List<String> krbEncryptionTypes = new ArrayList<String>();
-    
+
     /** The primary realm. */
+    @ConfigurationElement(attributeType = "ads-krbPrimaryRealm")
     private String krbPrimaryRealm;
-    
+
     /** The policy for category count. */
+    @ConfigurationElement(attributeType = "ads-chgPwdPolicyCategoryCount")
     private int chgPwdPolicyCategoryCount;
-    
+
     /** The policy for password length. */
+    @ConfigurationElement(attributeType = "ads-chgPwdPolicyPasswordLength")
     private int chgPwdPolicyPasswordLength;
-    
+
     /** The policy for token size. */
+    @ConfigurationElement(attributeType = "ads-chgPwdPolicyTokenSize")
     private int chgPwdPolicyTokenSize;
-    
+
     /** The service principal name. */
+    @ConfigurationElement(attributeType = "ads-chgPwdServicePrincipal")
     private String chgPwdServicePrincipal;
 
+
     /**
      * Create a new ChangePasswordServer instance
      */
@@ -62,6 +74,7 @@ public class ChangePasswordServerBean ex
         super();
     }
 
+
     /**
      * @return the krbAllowableClockSkew
      */
@@ -70,7 +83,7 @@ public class ChangePasswordServerBean ex
         return krbAllowableClockSkew;
     }
 
-    
+
     /**
      * @param krbAllowableClockSkew the krbAllowableClockSkew to set
      */
@@ -79,7 +92,7 @@ public class ChangePasswordServerBean ex
         this.krbAllowableClockSkew = krbAllowableClockSkew;
     }
 
-    
+
     /**
      * @return the krbEmptyAddressesAllowed
      */
@@ -88,7 +101,7 @@ public class ChangePasswordServerBean ex
         return krbEmptyAddressesAllowed;
     }
 
-    
+
     /**
      * @param krbEmptyAddressesAllowed the krbEmptyAddressesAllowed to set
      */
@@ -97,7 +110,7 @@ public class ChangePasswordServerBean ex
         this.krbEmptyAddressesAllowed = krbEmptyAddressesAllowed;
     }
 
-    
+
     /**
      * @return the krbEncryptionTypes
      */
@@ -106,7 +119,7 @@ public class ChangePasswordServerBean ex
         return krbEncryptionTypes;
     }
 
-    
+
     /**
      * @param krbEncryptionTypes the krbEncryptionTypes to set
      */
@@ -115,7 +128,7 @@ public class ChangePasswordServerBean ex
         this.krbEncryptionTypes = krbEncryptionTypes;
     }
 
-    
+
     /**
      * Initialize the encryptionTypes set
      * 
@@ -123,7 +136,7 @@ public class ChangePasswordServerBean ex
      */
     public void addKrbEncryptionTypes( String... krbEncryptionTypes )
     {
-        for ( String encryptionType:krbEncryptionTypes )
+        for ( String encryptionType : krbEncryptionTypes )
         {
             this.krbEncryptionTypes.add( encryptionType );
         }
@@ -138,7 +151,7 @@ public class ChangePasswordServerBean ex
         return krbPrimaryRealm;
     }
 
-    
+
     /**
      * @param krbPrimaryRealm the krbPrimaryRealm to set
      */
@@ -147,7 +160,7 @@ public class ChangePasswordServerBean ex
         this.krbPrimaryRealm = krbPrimaryRealm;
     }
 
-    
+
     /**
      * @return the chgPwdPolicyCategoryCount
      */
@@ -156,7 +169,7 @@ public class ChangePasswordServerBean ex
         return chgPwdPolicyCategoryCount;
     }
 
-    
+
     /**
      * @param chgPwdPolicyCategoryCount the chgPwdPolicyCategoryCount to set
      */
@@ -165,7 +178,7 @@ public class ChangePasswordServerBean ex
         this.chgPwdPolicyCategoryCount = chgPwdPolicyCategoryCount;
     }
 
-    
+
     /**
      * @return the chgPwdPolicyPasswordLength
      */
@@ -174,7 +187,7 @@ public class ChangePasswordServerBean ex
         return chgPwdPolicyPasswordLength;
     }
 
-    
+
     /**
      * @param chgPwdPolicyPasswordLength the chgPwdPolicyPasswordLength to set
      */
@@ -183,7 +196,7 @@ public class ChangePasswordServerBean ex
         this.chgPwdPolicyPasswordLength = chgPwdPolicyPasswordLength;
     }
 
-    
+
     /**
      * @return the chgPwdPolicyTokenSize
      */
@@ -192,7 +205,7 @@ public class ChangePasswordServerBean ex
         return chgPwdPolicyTokenSize;
     }
 
-    
+
     /**
      * @param chgPwdPolicyTokenSize the chgPwdPolicyTokenSize to set
      */
@@ -201,7 +214,7 @@ public class ChangePasswordServerBean ex
         this.chgPwdPolicyTokenSize = chgPwdPolicyTokenSize;
     }
 
-    
+
     /**
      * @return the chgPwdServicePrincipal
      */
@@ -210,7 +223,7 @@ public class ChangePasswordServerBean ex
         return chgPwdServicePrincipal;
     }
 
-    
+
     /**
      * @param chgPwdServicePrincipal the chgPwdServicePrincipal to set
      */
@@ -218,20 +231,20 @@ public class ChangePasswordServerBean ex
     {
         this.chgPwdServicePrincipal = chgPwdServicePrincipal;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
     public String toString( String tabs )
     {
         StringBuilder sb = new StringBuilder();
-        
+
         sb.append( tabs ).append( "ChangePasswordServer :\n" );
         sb.append( super.toString( tabs + "  " ) );
         sb.append( toString( tabs, "  change password service principal", chgPwdServicePrincipal ) );
         sb.append( toString( tabs, "  KRB primary realm", krbPrimaryRealm ) );
-        
+
         if ( ( krbEncryptionTypes != null ) && ( krbEncryptionTypes.size() != 0 ) )
         {
             sb.append( tabs ).append( "  encryption types : \n" );
@@ -241,7 +254,7 @@ public class ChangePasswordServerBean ex
                 sb.append( tabs ).append( "    encryptionType : " ).append( encryptionType ).append( '\n' );
             }
         }
-        
+
         sb.append( toString( tabs, "  change password policy category count", chgPwdPolicyCategoryCount ) );
         sb.append( toString( tabs, "  change password policy password length", chgPwdPolicyPasswordLength ) );
         sb.append( toString( tabs, "  change password policy token size", chgPwdPolicyTokenSize ) );
@@ -250,8 +263,8 @@ public class ChangePasswordServerBean ex
 
         return sb.toString();
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */

Modified: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DSBasedServerBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DSBasedServerBean.java?rev=1043878&r1=1043877&r2=1043878&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DSBasedServerBean.java (original)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DSBasedServerBean.java Thu Dec  9 09:55:55 2010
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.server.config.beans;
 
+
+import org.apache.directory.server.config.ConfigurationElement;
 import org.apache.directory.shared.ldap.name.DN;
 
 
@@ -35,15 +37,16 @@ public class DSBasedServerBean extends S
      * configuration for catalog entries.  Otherwise it will use this
      * search base as a single point of searching the DIT.
      */
+    @ConfigurationElement(attributeType = "ads-searchBaseDN")
     private DN searchBaseDN;
 
+
     /**
      * Create a new JournalBean instance
      */
     public DSBasedServerBean()
     {
     }
-    
 
 
     /**
@@ -64,22 +67,22 @@ public class DSBasedServerBean extends S
     {
         this.searchBaseDN = searchBaseDn;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
     public String toString( String tabs )
     {
         StringBuilder sb = new StringBuilder();
-        
+
         sb.append( super.toString( tabs ) );
         sb.append( toString( tabs, "searchBaseDN", searchBaseDN ) );
-        
+
         return sb.toString();
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */

Modified: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DhcpServerBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DhcpServerBean.java?rev=1043878&r1=1043877&r2=1043878&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DhcpServerBean.java (original)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DhcpServerBean.java Thu Dec  9 09:55:55 2010
@@ -33,26 +33,26 @@ public class DhcpServerBean extends DSBa
     public DhcpServerBean()
     {
         super();
-        
+
         // Enabled by default
         setEnabled( true );
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
     public String toString( String tabs )
     {
         StringBuilder sb = new StringBuilder();
-        
+
         sb.append( tabs ).append( "DhcpServer :\n" );
         sb.append( super.toString( tabs + "  " ) );
 
         return sb.toString();
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */

Modified: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DirectoryServiceBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DirectoryServiceBean.java?rev=1043878&r1=1043877&r2=1043878&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DirectoryServiceBean.java (original)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DirectoryServiceBean.java Thu Dec  9 09:55:55 2010
@@ -23,7 +23,9 @@ 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.ConfigurationElement;
+
+
 /**
  * A class used to store the DirectoryService configuration.
  *
@@ -32,50 +34,66 @@ import org.apache.directory.server.core.
 public class DirectoryServiceBean extends AdsBaseBean
 {
     /** The DS instance Id */
+    @ConfigurationElement(attributeType = "ads-directoryServiceId", isRdn = true)
     private String directoryServiceId;
 
     /** The directory instance replication ID */
+    @ConfigurationElement(attributeType = "ads-dsReplicaId")
     private int dsReplicaId;
 
     /** The flag that tells if the AccessControl system is activated */
+    @ConfigurationElement(attributeType = "ads-dsAccessControlEnabled")
     private boolean dsAccessControlEnabled = true;
 
     /** The flag that tells if Anonymous connections are allowed */
+    @ConfigurationElement(attributeType = "ads-dsAllowAnonymousAccess")
     private boolean dsAllowAnonymousAccess = false;
 
     /** The flag that tells if DN must be denormalized */
+    @ConfigurationElement(attributeType = "ads-dsDenormalizeOpAttrsEnabled")
     private boolean dsDenormalizeOpAttrsEnabled = true;
 
     /** The maximum size of an incoming PDU */
+    @ConfigurationElement(attributeType = "ads-dsMaxPDUSize")
     private int dsMaxPDUSize = 2048;
 
     /** The flag that tells if the password should be returned as a normal attribute or not */
+    @ConfigurationElement(attributeType = "ads-dsPasswordHidden")
     private boolean dsPasswordHidden = false;
 
     /** The delay between two flushes on disk */
+    @ConfigurationElement(attributeType = "ads-dsSyncPeriodMillis")
     private long dsSyncPeriodMillis = 15000L;
 
     /** The ldif entries to inject into the server at startup */
+    @ConfigurationElement(attributeType = "dsTestEntries")
     private String dsTestEntries;
 
     /** The ChangeLog component */
+    @ConfigurationElement
     private ChangeLogBean changeLog;
 
     /** The journal component */
+    @ConfigurationElement
     private JournalBean journal;
 
     /** The servers */
+    @ConfigurationElement(attributeType = "ads-servers", container = "servers")
     private List<ServerBean> servers = new ArrayList<ServerBean>();
 
     /** The list of declared interceptors */
+    @ConfigurationElement(attributeType = "ads-interceptors", container = "interceptors")
     private List<InterceptorBean> interceptors = new ArrayList<InterceptorBean>();
 
     /** The set of associated partitions */
+    @ConfigurationElement(attributeType = "ads-partitions", container = "partitions")
     private List<PartitionBean> partitions = new ArrayList<PartitionBean>();
 
     /** The reference to the Password Policy component */
+    @ConfigurationElement
     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/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DnsServerBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DnsServerBean.java?rev=1043878&r1=1043877&r2=1043878&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DnsServerBean.java (original)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DnsServerBean.java Thu Dec  9 09:55:55 2010
@@ -33,26 +33,26 @@ public class DnsServerBean extends DSBas
     public DnsServerBean()
     {
         super();
-        
+
         // Enabled by default
         setEnabled( true );
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
     public String toString( String tabs )
     {
         StringBuilder sb = new StringBuilder();
-        
+
         sb.append( tabs ).append( "DnsServer :\n" );
         sb.append( super.toString( tabs + "  " ) );
 
         return sb.toString();
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */

Modified: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ExtendedOpHandlerBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ExtendedOpHandlerBean.java?rev=1043878&r1=1043877&r2=1043878&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ExtendedOpHandlerBean.java (original)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ExtendedOpHandlerBean.java Thu Dec  9 09:55:55 2010
@@ -20,6 +20,9 @@
 package org.apache.directory.server.config.beans;
 
 
+import org.apache.directory.server.config.ConfigurationElement;
+
+
 /**
  * A class used to store the LdapServerExtendedOpHandler configuration.
  *
@@ -28,11 +31,14 @@ package org.apache.directory.server.conf
 public class ExtendedOpHandlerBean extends AdsBaseBean
 {
     /** The Extended Operation ID */
+    @ConfigurationElement(attributeType = "ads-extendedOpId", isRdn = true)
     private String extendedOpId;
-    
+
     /** The Extended Operation FQCN */
+    @ConfigurationElement(attributeType = "ads-extendedOpHandlerClass")
     private String extendedOpHandlerClass;
 
+
     /**
      * Create a new LdapServerExtendedOpHandlerBean instance
      */
@@ -41,7 +47,7 @@ public class ExtendedOpHandlerBean exten
         super();
     }
 
-    
+
     /**
      * @return the extendedOpId
      */
@@ -50,7 +56,7 @@ public class ExtendedOpHandlerBean exten
         return extendedOpId;
     }
 
-    
+
     /**
      * @param extendedOpId the extendedOpId to set
      */
@@ -59,7 +65,7 @@ public class ExtendedOpHandlerBean exten
         this.extendedOpId = extendedOpId;
     }
 
-    
+
     /**
      * @return the ldapServerExtendedOpHandlerClass
      */
@@ -68,7 +74,7 @@ public class ExtendedOpHandlerBean exten
         return extendedOpHandlerClass;
     }
 
-    
+
     /**
      * @param extendedOpHandlerClass the ExtendedOpHandlerClass to set
      */
@@ -76,23 +82,24 @@ public class ExtendedOpHandlerBean exten
     {
         this.extendedOpHandlerClass = extendedOpHandlerClass;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
     public String toString( String tabs )
     {
         StringBuilder sb = new StringBuilder();
-        
+
         sb.append( tabs ).append( "Extended operation handler :\n" );
         sb.append( tabs ).append( "  extended operation ID : " ).append( extendedOpId ).append( '\n' );
-        sb.append( tabs ).append( "  extended operation handler class : " ).append( extendedOpHandlerClass ).append( '\n' );
-        
+        sb.append( tabs ).append( "  extended operation handler class : " ).append( extendedOpHandlerClass )
+            .append( '\n' );
+
         return sb.toString();
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */

Modified: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/HttpServerBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/HttpServerBean.java?rev=1043878&r1=1043877&r2=1043878&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/HttpServerBean.java (original)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/HttpServerBean.java Thu Dec  9 09:55:55 2010
@@ -19,10 +19,11 @@
  */
 package org.apache.directory.server.config.beans;
 
+
 import java.util.ArrayList;
 import java.util.List;
 
-
+import org.apache.directory.server.config.ConfigurationElement;
 
 
 /**
@@ -33,23 +34,26 @@ import java.util.List;
 public class HttpServerBean extends ServerBean
 {
     /** The configuration file */
+    @ConfigurationElement(attributeType = "ads-httpConfFile")
     private String httpConfFile;
-    
+
     /** The list of supported web apps */
+    @ConfigurationElement(attributeType = "ads-httpWebApps", container = "httpWebApps")
     private List<HttpWebAppBean> httpWebApps = new ArrayList<HttpWebAppBean>();
 
+
     /**
      * Create a new HttpServerBean instance
      */
     public HttpServerBean()
     {
         super();
-        
+
         // Enabled by default
         setEnabled( true );
     }
 
-    
+
     /**
      * @return the httpConfFile
      */
@@ -58,7 +62,7 @@ public class HttpServerBean extends Serv
         return httpConfFile;
     }
 
-    
+
     /**
      * @param httpConfFile the httpConfFile to set
      */
@@ -67,7 +71,7 @@ public class HttpServerBean extends Serv
         this.httpConfFile = httpConfFile;
     }
 
-    
+
     /**
      * @return the httpWebApps
      */
@@ -76,7 +80,7 @@ public class HttpServerBean extends Serv
         return httpWebApps;
     }
 
-    
+
     /**
      * @param httpWebApps the httpWebApps to set
      */
@@ -85,34 +89,34 @@ public class HttpServerBean extends Serv
         this.httpWebApps = httpWebApps;
     }
 
-    
+
     /**
      * @param httpWebApps the httpWebApps to add
      */
     public void addHttpWebApps( HttpWebAppBean... httpWebApps )
     {
         for ( HttpWebAppBean httpWebApp : httpWebApps )
-        {   
+        {
             this.httpWebApps.add( httpWebApp );
         }
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
     public String toString( String tabs )
     {
         StringBuilder sb = new StringBuilder();
-        
+
         sb.append( tabs ).append( "HttpServer :\n" );
         sb.append( super.toString( tabs + "  " ) );
-        sb.append(  toString( tabs, "  http configuration file", httpConfFile ) );
-        
+        sb.append( toString( tabs, "  http configuration file", httpConfFile ) );
+
         if ( ( httpWebApps != null ) && ( httpWebApps.size() > 0 ) )
         {
             sb.append( tabs ).append( "  web applications :\n" );
-            
+
             for ( HttpWebAppBean httpWebApp : httpWebApps )
             {
                 sb.append( httpWebApp.toString( tabs + "    " ) );
@@ -121,8 +125,8 @@ public class HttpServerBean extends Serv
 
         return sb.toString();
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */

Modified: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/HttpWebAppBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/HttpWebAppBean.java?rev=1043878&r1=1043877&r2=1043878&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/HttpWebAppBean.java (original)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/HttpWebAppBean.java Thu Dec  9 09:55:55 2010
@@ -20,6 +20,9 @@
 package org.apache.directory.server.config.beans;
 
 
+import org.apache.directory.server.config.ConfigurationElement;
+
+
 /**
  * A class used to store the HttpWebApp configuration.
  *
@@ -28,26 +31,30 @@ package org.apache.directory.server.conf
 public class HttpWebAppBean extends AdsBaseBean
 {
     /** The server identifier */
+    @ConfigurationElement(attributeType = "ads-id", isRdn = true)
     private String id;
-    
+
     /** The context path */
+    @ConfigurationElement(attributeType = "ads-httpAppCtxPath")
     private String httpAppCtxPath;
-    
+
     /** The war file */
+    @ConfigurationElement(attributeType = "ads-httpWarFile")
     private String httpWarFile;
 
+
     /**
      * Create a new HttpWebAppBean instance
      */
     public HttpWebAppBean()
     {
         super();
-        
+
         // Enabled by default
         setEnabled( true );
     }
 
-    
+
     /**
      * @return the id
      */
@@ -56,7 +63,7 @@ public class HttpWebAppBean extends AdsB
         return id;
     }
 
-    
+
     /**
      * @param id the id to set
      */
@@ -65,7 +72,7 @@ public class HttpWebAppBean extends AdsB
         this.id = id;
     }
 
-    
+
     /**
      * @return the httpAppCtxPath
      */
@@ -74,7 +81,7 @@ public class HttpWebAppBean extends AdsB
         return httpAppCtxPath;
     }
 
-    
+
     /**
      * @param httpAppCtxPath the httpAppCtxPath to set
      */
@@ -83,7 +90,7 @@ public class HttpWebAppBean extends AdsB
         this.httpAppCtxPath = httpAppCtxPath;
     }
 
-    
+
     /**
      * @return the httpWarFile
      */
@@ -92,7 +99,7 @@ public class HttpWebAppBean extends AdsB
         return httpWarFile;
     }
 
-    
+
     /**
      * @param httpWarFile the httpWarFile to set
      */
@@ -101,24 +108,24 @@ public class HttpWebAppBean extends AdsB
         this.httpWarFile = httpWarFile;
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
     public String toString( String tabs )
     {
         StringBuilder sb = new StringBuilder();
-        
+
         sb.append( tabs ).append( "HttpWebApp :\n" );
         sb.append( super.toString( tabs + "  " ) );
         sb.append( tabs ).append( "  id : " ).append( id ).append( '\n' );
         sb.append( tabs ).append( "  war file : " ).append( httpWarFile ).append( '\n' );
-        sb.append(  toString( tabs, "  application context path", httpAppCtxPath ) );
+        sb.append( toString( tabs, "  application context path", httpAppCtxPath ) );
 
         return sb.toString();
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */

Modified: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/IndexBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/IndexBean.java?rev=1043878&r1=1043877&r2=1043878&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/IndexBean.java (original)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/IndexBean.java Thu Dec  9 09:55:55 2010
@@ -19,6 +19,10 @@
  */
 package org.apache.directory.server.config.beans;
 
+
+import org.apache.directory.server.config.ConfigurationElement;
+
+
 /**
  * A class used to store the IndexBean configuration. It can't be instanciated
  *
@@ -27,8 +31,10 @@ package org.apache.directory.server.conf
 public abstract class IndexBean extends AdsBaseBean
 {
     /** The index unique identifier */
+    @ConfigurationElement(attributeType = "ads-indexAttributeId", isRdn = true)
     private String indexAttributeId;
-    
+
+
     /**
      * Create a new IndexBean instance
      */
@@ -36,6 +42,7 @@ public abstract class IndexBean extends 
     {
     }
 
+
     /**
      * @return the indexAttributeId
      */
@@ -44,7 +51,7 @@ public abstract class IndexBean extends 
         return indexAttributeId;
     }
 
-    
+
     /**
      * @param indexAttributeId the indexAttributeId to set
      */
@@ -52,22 +59,22 @@ public abstract class IndexBean extends 
     {
         this.indexAttributeId = indexAttributeId;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
     public String toString( String tabs )
     {
         StringBuilder sb = new StringBuilder();
-        
+
         sb.append( super.toString( tabs + "  " ) );
         sb.append( tabs ).append( "  indexed attribute ID : " ).append( indexAttributeId ).append( '\n' );
 
         return sb.toString();
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */

Modified: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/InterceptorBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/InterceptorBean.java?rev=1043878&r1=1043877&r2=1043878&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/InterceptorBean.java (original)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/InterceptorBean.java Thu Dec  9 09:55:55 2010
@@ -20,6 +20,8 @@
 package org.apache.directory.server.config.beans;
 
 
+import org.apache.directory.server.config.ConfigurationElement;
+
 
 /**
  * A class used to store the Interceptors configuration.
@@ -29,12 +31,15 @@ package org.apache.directory.server.conf
 public class InterceptorBean extends AdsBaseBean implements Comparable<InterceptorBean>
 {
     /** The Interceptor ID */
+    @ConfigurationElement(attributeType = "ads-interceptorId", isRdn = true)
     private String interceptorId;
-    
+
     /** The interceptor FQCN */
+    @ConfigurationElement(attributeType = "ads-interceptorClassName")
     private String interceptorClassName;
-    
+
     /** The interceptor position in the chain */
+    @ConfigurationElement(attributeType = "ads-interceptorOrder")
     private int interceptorOrder;
 
 
@@ -70,7 +75,7 @@ public class InterceptorBean extends Ads
     /**
      * @return the id
      */
-    public String getInterceptorId() 
+    public String getInterceptorId()
     {
         return interceptorId;
     }
@@ -79,7 +84,7 @@ public class InterceptorBean extends Ads
     /**
      * @param id the id to set
      */
-    public void setInterceptorId( String id ) 
+    public void setInterceptorId( String id )
     {
         this.interceptorId = id;
     }
@@ -88,7 +93,7 @@ public class InterceptorBean extends Ads
     /**
      * @return the interceptor Order
      */
-    public int getInterceptorOrder() 
+    public int getInterceptorOrder()
     {
         return interceptorOrder;
     }
@@ -97,7 +102,7 @@ public class InterceptorBean extends Ads
     /**
      * @param interceptorOrder the interceptor Order to set
      */
-    public void setInterceptorOrder( int interceptorOrder ) 
+    public void setInterceptorOrder( int interceptorOrder )
     {
         this.interceptorOrder = interceptorOrder;
     }
@@ -119,23 +124,23 @@ public class InterceptorBean extends Ads
     {
         this.interceptorClassName = interceptorClassName;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
     public String toString( String tabs )
     {
         StringBuilder sb = new StringBuilder();
-        
+
         sb.append( tabs ).append( "interceptor[" ).append( interceptorOrder ).append( "] : " ).append( '\n' );
         sb.append( tabs ).append( "  interceptor id : " ).append( interceptorId ).append( '\n' );
-        sb.append( tabs ).append( "  class name : " ).append(  interceptorClassName ).append( '\n' );
-        
+        sb.append( tabs ).append( "  class name : " ).append( interceptorClassName ).append( '\n' );
+
         return sb.toString();
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */

Modified: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/JdbmIndexBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/JdbmIndexBean.java?rev=1043878&r1=1043877&r2=1043878&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/JdbmIndexBean.java (original)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/JdbmIndexBean.java Thu Dec  9 09:55:55 2010
@@ -20,6 +20,9 @@
 package org.apache.directory.server.config.beans;
 
 
+import org.apache.directory.server.config.ConfigurationElement;
+
+
 /**
  * A class used to store the JdbmIndex configuration.
  *
@@ -29,22 +32,27 @@ public class JdbmIndexBean<K, E> extends
 {
     /** The default cache size */
     private static final int DEFAULT_INDEX_CACHE_SIZE = 100;
-    
+
     /** default duplicate limit before duplicate keys switch to using a btree for values */
     private static final int DEFAULT_DUPLICATE_LIMIT = 512;
 
     /** the size (number of index entries) for the cache */
+    @ConfigurationElement(attributeType = "ads-indexCacheSize")
     private int indexCacheSize = DEFAULT_INDEX_CACHE_SIZE;
 
     /** duplicate limit before duplicate keys switch to using a btree for values */
+    @ConfigurationElement(attributeType = "ads-indexNumDupLimit")
     private int indexNumDupLimit = DEFAULT_DUPLICATE_LIMIT;
-    
+
     /** The index file name */
+    @ConfigurationElement(attributeType = "ads-indexFileName")
     private String indexFileName;
-    
+
     /** The index working directory */
+    @ConfigurationElement(attributeType = "ads-indexWorkingDir")
     private String indexWorkingDir;
 
+
     /**
      * Create a new JdbmIndexBean instance
      */
@@ -133,26 +141,26 @@ public class JdbmIndexBean<K, E> extends
     {
         this.indexWorkingDir = indexWorkingDir;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
     public String toString( String tabs )
     {
         StringBuilder sb = new StringBuilder();
-        
+
         sb.append( tabs ).append( "JdbmIndexBean :\n" );
         sb.append( super.toString( tabs ) );
         sb.append( toString( tabs, "  index file name", indexFileName ) );
         sb.append( toString( tabs, "  index working directory", indexWorkingDir ) );
         sb.append( toString( tabs, "  index cache size", indexCacheSize ) );
         sb.append( toString( tabs, "  index num dup limit", indexNumDupLimit ) );
-        
+
         return sb.toString();
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */

Modified: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/JdbmPartitionBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/JdbmPartitionBean.java?rev=1043878&r1=1043877&r2=1043878&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/JdbmPartitionBean.java (original)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/JdbmPartitionBean.java Thu Dec  9 09:55:55 2010
@@ -20,6 +20,8 @@
 package org.apache.directory.server.config.beans;
 
 
+import org.apache.directory.server.config.ConfigurationElement;
+
 
 /**
  * A class used to store the JdbmPartition configuration.
@@ -29,11 +31,14 @@ package org.apache.directory.server.conf
 public class JdbmPartitionBean extends PartitionBean
 {
     /** The Entry cache size for this partition */
+    @ConfigurationElement(attributeType = "ads-partitionCacheSize")
     private int partitionCacheSize = -1;
 
     /** Tells if the optimizer is enabled or not */
+    @ConfigurationElement(attributeType = "ads-jdbmPartitionOptimizerEnabled")
     private boolean jdbmPartitionOptimizerEnabled = true;
-    
+
+
     /**
      * Create a new JdbmPartitionBean instance
      */
@@ -65,7 +70,7 @@ public class JdbmPartitionBean extends P
         return partitionCacheSize;
     }
 
-    
+
     /**
      * @return <code>true</code> if the optimizer is enabled
      */
@@ -84,24 +89,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/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/JournalBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/JournalBean.java?rev=1043878&r1=1043877&r2=1043878&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/JournalBean.java (original)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/JournalBean.java Thu Dec  9 09:55:55 2010
@@ -19,6 +19,10 @@
  */
 package org.apache.directory.server.config.beans;
 
+
+import org.apache.directory.server.config.ConfigurationElement;
+
+
 /**
  * A class used to store the Journal configuration.
  *
@@ -27,17 +31,22 @@ package org.apache.directory.server.conf
 public class JournalBean extends AdsBaseBean
 {
     /** The journal unique Id */
+    @ConfigurationElement(attributeType = "ads-journalId", isRdn = true)
     private String journalId;
-    
+
     /** The journal file name */
+    @ConfigurationElement(attributeType = "ads-journalFileName")
     private String journalFileName;
-    
+
     /** The journal working directory */
+    @ConfigurationElement(attributeType = "ads-journalWorkingDir")
     private String journalWorkingDir;
-    
+
     /** The journal rotation */
+    @ConfigurationElement(attributeType = "ads-journalRotation")
     private int journalRotation;
 
+
     /**
      * Create a new JournalBean instance
      */
@@ -45,7 +54,7 @@ public class JournalBean extends AdsBase
     {
         // Default to infinite
         journalRotation = 0;
-        
+
         // Not enabled by default
         setEnabled( false );
     }
@@ -67,79 +76,79 @@ public class JournalBean extends AdsBase
     {
         this.journalId = journalId;
     }
-    
-    
+
+
     /**
      * @return the fileName
      */
-    public String getJournalFileName() 
+    public String getJournalFileName()
     {
         return journalFileName;
     }
 
-    
+
     /**
      * @param journalFileName the journalFileName to set
      */
-    public void setJournalFileName( String journalFileName ) 
+    public void setJournalFileName( String journalFileName )
     {
         this.journalFileName = journalFileName;
     }
 
-    
+
     /**
      * @return the journal WorkingDir
      */
-    public String getJournalWorkingDir() 
+    public String getJournalWorkingDir()
     {
         return journalWorkingDir;
     }
 
-    
+
     /**
      * @param journalWorkingDir the journal WorkingDir to set
      */
-    public void setJournalWorkingDir( String journalWorkingDir ) 
+    public void setJournalWorkingDir( String journalWorkingDir )
     {
         this.journalWorkingDir = journalWorkingDir;
     }
 
-    
+
     /**
      * @return the journal Rotation
      */
-    public int getJournalRotation() 
+    public int getJournalRotation()
     {
         return journalRotation;
     }
 
-    
+
     /**
      * @param journalRotation the journal Rotation to set
      */
-    public void setJournalRotation( int journalRotation ) 
+    public void setJournalRotation( int journalRotation )
     {
         this.journalRotation = journalRotation;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
     public String toString( String tabs )
     {
         StringBuilder sb = new StringBuilder();
-        
+
         sb.append( tabs ).append( "Journal :\n" );
         sb.append( tabs ).append( "  journal id : " ).append( journalId ).append( '\n' );
         sb.append( tabs ).append( "  journal file name : " ).append( journalFileName ).append( '\n' );
         sb.append( toString( tabs, "  journal working dir", journalWorkingDir ) );
         sb.append( toString( tabs, "  journal rotation", journalRotation ) );
-        
+
         return sb.toString();
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */



Mime
View raw message