directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r896579 [7/14] - in /directory/shared/trunk: ./ ldap/ ldap/src/main/antlr/ ldap/src/main/java/org/apache/directory/shared/ldap/ ldap/src/main/java/org/apache/directory/shared/ldap/codec/ ldap/src/main/java/org/apache/directory/shared/ldap/c...
Date Wed, 06 Jan 2010 17:52:31 GMT
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/UUIDComparator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/UUIDComparator.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/UUIDComparator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/UUIDComparator.java Wed Jan  6 17:52:15 2010
@@ -20,7 +20,10 @@
 package org.apache.directory.shared.ldap.schema.comparators;
 
 
-import java.util.Comparator;
+import org.apache.directory.shared.ldap.schema.LdapComparator;
+import org.apache.directory.shared.ldap.util.StringTools;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -29,17 +32,32 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class UUIDComparator implements Comparator<byte[]>
+public class UUIDComparator extends LdapComparator<byte[]>
 {
-    /** A static instance of this comparator */
-    public static final Comparator<byte[]> INSTANCE = new UUIDComparator();
-    
+    /** A logger for this class */
+    private static final Logger LOG = LoggerFactory.getLogger( UUIDComparator.class );
+
+    /** The serialVersionUID */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * The UUIDComparator constructor. Its OID is the UUIDMatch matching
+     * rule OID.
+     */
+    public UUIDComparator( String oid )
+    {
+        super( oid );
+    }
+
     
     /**
      * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
      */
     public int compare( byte[] uuid1, byte[] uuid2 )
     {
+        LOG.debug( "comparing UUID objects '{}' with '{}'", 
+            StringTools.dumpBytes( uuid1 ), StringTools.dumpBytes( uuid2 ) );
+
         // -------------------------------------------------------------------
         // Handle some basis cases
         // -------------------------------------------------------------------

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/BooleanNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/BooleanNormalizer.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/BooleanNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/BooleanNormalizer.java Wed Jan  6 17:52:15 2010
@@ -22,6 +22,7 @@
 
 import javax.naming.NamingException;
 
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
 import org.apache.directory.shared.ldap.schema.Normalizer;
@@ -34,10 +35,18 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class BooleanNormalizer implements Normalizer
+public class BooleanNormalizer extends Normalizer
 {
-    // The serial UID
-    private static final long serialVersionUID = 1L;
+    /** The serial UID */
+    public static final long serialVersionUID = 1L;
+
+    /**
+     * Creates a new instance of BooleanNormalizer.
+     */
+    public BooleanNormalizer()
+    {
+        super( SchemaConstants.BOOLEAN_MATCH_MR_OID );
+    }
 
 
     /**

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingNormalizer.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingNormalizer.java Wed Jan  6 17:52:15 2010
@@ -24,6 +24,8 @@
 
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.schema.Normalizer;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
+import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.SynchronizedLRUMap;
 
 
@@ -33,9 +35,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class CachingNormalizer implements Normalizer
+public class CachingNormalizer extends Normalizer
 {
-    private static final long serialVersionUID = 1L;
+    /** The serial UID */
+    public static final long serialVersionUID = 1L;
 
     /** Cache maximum size default */
     public static final int CACHE_MAX = 250;
@@ -53,8 +56,9 @@
 
     /**
      * Creates a CachingNormalizer that decorates another normalizer using a
-     * default cache size.
+     * default cache size.  This Normalizer delegates 
      * 
+     * @param oid The MR OID to use with this Normalizer
      * @param normalizer the underlying Normalizer being decorated
      */
     public CachingNormalizer( Normalizer normalizer )
@@ -72,12 +76,37 @@
      */
     public CachingNormalizer( Normalizer normalizer, int cacheSz )
     {
+        super( normalizer.getOid() );
         this.normalizer = normalizer;
         cache = new SynchronizedLRUMap( cacheSz );
     }
 
 
     /**
+     * Overrides default behavior by returning the OID of the wrapped 
+     * Normalizer.
+     */
+    @Override
+    public String getOid()
+    {
+        return normalizer.getOid();
+    }
+
+
+    /**
+     * Overrides default behavior by setting the OID of the wrapped Normalizer.
+     * 
+     * @param oid the object identifier to set
+     */
+    @Override
+    public void setOid( String oid )
+    {
+        super.setOid( oid );
+        normalizer.setOid( oid );
+    }
+
+
+    /**
      * {@inheritDoc}
      */
     public Value<?> normalize( Value<?> value ) throws NamingException
@@ -87,7 +116,7 @@
             return null;
         }
 
-        Value<?> result =(Value<?>)cache.get( value );
+        Value<?> result = ( Value<?> ) cache.get( value );
 
         if ( result != null )
         {
@@ -110,7 +139,7 @@
             return null;
         }
 
-        String normalized =(String)cache.get( value );
+        String normalized = ( String ) cache.get( value );
 
         if ( normalized != null )
         {
@@ -121,4 +150,24 @@
         cache.put( value, normalized );
         return normalized;
     }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setRegistries( Registries registries )
+    {
+        normalizer.setRegistries( registries );
+    }
+
+
+    /**
+     * Sets the SchemaManager
+     * 
+     * @param schemaManager The SchemaManager
+     */
+    public void setSchemaManager( SchemaManager schemaManager )
+    {
+        normalizer.setSchemaManager( schemaManager );
+    }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/DeepTrimNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/DeepTrimNormalizer.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/DeepTrimNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/DeepTrimNormalizer.java Wed Jan  6 17:52:15 2010
@@ -28,8 +28,6 @@
 import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
 import org.apache.directory.shared.ldap.schema.Normalizer;
 import org.apache.directory.shared.ldap.schema.PrepareString;
-import org.apache.directory.shared.ldap.schema.PrepareString.StringType;
-import org.apache.directory.shared.ldap.util.StringTools;
 
 
 /**
@@ -40,10 +38,32 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class DeepTrimNormalizer implements Normalizer
+public class DeepTrimNormalizer extends Normalizer
 {
-    // The serial UID
-   private static final long serialVersionUID = 1L;
+    /** The serial UID */
+    public static final long serialVersionUID = 1L;
+
+    
+    /**
+     * Creates a new instance of DeepTrimNormalizer with OID known.
+     * 
+     * @param oid The MR OID to use with this Normalizer
+     */
+    public DeepTrimNormalizer( String oid )
+    {
+        super( oid );
+    }
+
+
+    /**
+     * Creates a new instance of DeepTrimNormalizer when the Normalizer must be
+     * instantiated before setting the OID.
+     */
+    public DeepTrimNormalizer()
+    {
+    }
+
+
 
    /**
     * {@inheritDoc}

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/DeepTrimToLowerNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/DeepTrimToLowerNormalizer.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/DeepTrimToLowerNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/DeepTrimToLowerNormalizer.java Wed Jan  6 17:52:15 2010
@@ -39,10 +39,30 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class DeepTrimToLowerNormalizer implements Normalizer
+public class DeepTrimToLowerNormalizer extends Normalizer
 {
-    // The serial UID
-    private static final long serialVersionUID = 1L;
+    /** The serial UID */
+    public static final long serialVersionUID = 1L;
+
+    /**
+     * Creates a new instance of DeepTrimToLowerNormalizer.
+     * 
+     * @param oid The MR OID to use with this Normalizer
+     */
+    public DeepTrimToLowerNormalizer( String oid )
+    {
+        super( oid );
+    }
+
+
+    /**
+     * Creates a new instance of DeepTrimToLowerNormalizer where the OID is
+     * set after instantiation.
+     */
+    public DeepTrimToLowerNormalizer()
+    {
+    }
+
 
     /**
      * {@inheritDoc}

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/GeneralizedTimeNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/GeneralizedTimeNormalizer.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/GeneralizedTimeNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/GeneralizedTimeNormalizer.java Wed Jan  6 17:52:15 2010
@@ -24,12 +24,11 @@
 
 import javax.naming.NamingException;
 
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
 import org.apache.directory.shared.ldap.schema.Normalizer;
 import org.apache.directory.shared.ldap.schema.PrepareString;
-import org.apache.directory.shared.ldap.schema.PrepareString.StringType;
-import org.apache.directory.shared.ldap.util.StringTools;
 
 
 /**
@@ -43,10 +42,19 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 491034 $
  */
-public class GeneralizedTimeNormalizer implements Normalizer
+public class GeneralizedTimeNormalizer extends Normalizer
 {
-    // The serial UID
-   static final long serialVersionUID = 1L;
+    /** The serial UID */
+    public static final long serialVersionUID = 1L;
+
+    /**
+     * Creates a new instance of GeneralizedTimeNormalizer.
+     */
+    public GeneralizedTimeNormalizer()
+    {
+        super( SchemaConstants.GENERALIZED_TIME_MATCH_MR_OID );
+    }
+
 
    /**
     * {@inheritDoc}

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NoOpNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NoOpNormalizer.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NoOpNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NoOpNormalizer.java Wed Jan  6 17:52:15 2010
@@ -20,8 +20,6 @@
 package org.apache.directory.shared.ldap.schema.normalizers;
 
 
-import java.io.Serializable;
-
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.schema.Normalizer;
 
@@ -32,14 +30,32 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class NoOpNormalizer implements Normalizer, Serializable
+public class NoOpNormalizer extends Normalizer
 {
-    // The serial UID
-    static final long serialVersionUID = -7817763636668562489L;
+    /** The serial UID */
+    public static final long serialVersionUID = 1L;
+
+
+    /**
+     * Creates a new instance of NoOpNormalizer.
+     * 
+     * @param oid The MR OID to use with this Normalizer
+     */
+    public NoOpNormalizer( String oid )
+    {
+        super( oid );
+    }
+
     
-    /** A static instance of this normalizer */
-    public static final NoOpNormalizer INSTANCE = new NoOpNormalizer();
+    /**
+     * Default constructor for NoOpNormalizer used when we must set the OID
+     * after instantiating the Normalizer.
+     */
+    public NoOpNormalizer()
+    {
+    }
 
+    
     /**
      * Returns the value argument as-is without alterations all the time.
      * 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NumericNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NumericNormalizer.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NumericNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NumericNormalizer.java Wed Jan  6 17:52:15 2010
@@ -24,6 +24,7 @@
 
 import javax.naming.NamingException;
 
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
 import org.apache.directory.shared.ldap.schema.Normalizer;
@@ -35,10 +36,18 @@
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class NumericNormalizer implements Normalizer
+public class NumericNormalizer extends Normalizer
 {
-    // The serial UID
-   static final long serialVersionUID = 1L;
+    /** The serial UID */
+    public static final long serialVersionUID = 1L;
+
+    /**
+     * Creates a new instance of NumericNormalizer.
+     */
+    public NumericNormalizer()
+    {
+        super( SchemaConstants.NUMERIC_STRING_MATCH_MR_OID );
+    }
 
    
    /**

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/ObjectIdentifierNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/ObjectIdentifierNormalizer.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/ObjectIdentifierNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/ObjectIdentifierNormalizer.java Wed Jan  6 17:52:15 2010
@@ -22,6 +22,7 @@
 
 import javax.naming.NamingException;
 
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
 import org.apache.directory.shared.ldap.schema.Normalizer;
@@ -33,10 +34,19 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class ObjectIdentifierNormalizer implements Normalizer
+public class ObjectIdentifierNormalizer extends Normalizer
 {
-    // The serial UID
-    private static final long serialVersionUID = 1L;
+    /** The serial UID */
+    public static final long serialVersionUID = 1L;
+
+    /**
+     * Creates a new instance of ObjectIdentifierNormalizer.
+     */
+    public ObjectIdentifierNormalizer()
+    {
+        super( SchemaConstants.OBJECT_IDENTIFIER_MATCH_MR_OID );
+    }
+
 
     /**
      * {@inheritDoc}

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/OidNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/OidNormalizer.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/OidNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/OidNormalizer.java Wed Jan  6 17:52:15 2010
@@ -83,6 +83,22 @@
     {
         return attributeTypeOid;
     }
+    
+    
+    /**
+     * Copy an OidNormalizer(). The contained Normalizer will be cloned too.
+     * 
+     * @return A deep clone of the current OidNormalizer
+     */
+    public OidNormalizer copy() throws CloneNotSupportedException
+    {
+        OidNormalizer copy = new OidNormalizer( attributeTypeOid, normalizer );
+
+        // Copy the SchemaObject common data
+        copy.copy();
+        
+        return copy;
+    }
 
 
     /**

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/RegexNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/RegexNormalizer.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/RegexNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/RegexNormalizer.java Wed Jan  6 17:52:15 2010
@@ -34,11 +34,11 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class RegexNormalizer implements Normalizer
+public class RegexNormalizer extends Normalizer
 {
-    // The serial UID
-    private static final long serialVersionUID = 1L;
-    
+    /** The serial UID */
+    public static final long serialVersionUID = 1L;
+
     /** the perl 5 regex engine */
     private final Pattern[] regexes;
 
@@ -49,11 +49,12 @@
     /**
      * Creates a Perl5 regular expression based normalizer.
      * 
-     * @param regexes
-     *            the set of regular expressions used to transform values
+     * @param oid The MR OID to use for this Normalizer
+     * @param regexes the set of regular expressions used to transform values
      */
-    public RegexNormalizer( Pattern[] regexes )
+    public RegexNormalizer( String oid, Pattern[] regexes )
     {
+        super( oid );
         if ( regexes != null )
         {
             this.regexes = new Pattern[ regexes.length ];

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/TelephoneNumberNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/TelephoneNumberNormalizer.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/TelephoneNumberNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/TelephoneNumberNormalizer.java Wed Jan  6 17:52:15 2010
@@ -24,6 +24,7 @@
 
 import javax.naming.NamingException;
 
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
 import org.apache.directory.shared.ldap.schema.Normalizer;
@@ -35,10 +36,20 @@
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class TelephoneNumberNormalizer implements Normalizer
+public class TelephoneNumberNormalizer extends Normalizer
 {
-    // The serial UID
-   static final long serialVersionUID = 1L;
+    /** The serial UID */
+    public static final long serialVersionUID = 1L;
+
+    /**
+     * Creates a new instance of TelephoneNumberNormalizer.
+     */
+    public TelephoneNumberNormalizer()
+    {
+        super( SchemaConstants.TELEPHONE_NUMBER_MATCH_MR_OID );
+    }
+
+
 
    /**
     * {@inheritDoc}

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/AbstractSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/AbstractSchemaParser.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/AbstractSchemaParser.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/AbstractSchemaParser.java Wed Jan  6 17:52:15 2010
@@ -22,6 +22,11 @@
 
 import java.io.StringReader;
 import java.text.ParseException;
+import java.util.List;
+
+import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
+import org.apache.directory.shared.ldap.schema.SchemaObject;
+import org.apache.directory.shared.ldap.util.StringTools;
 
 
 
@@ -101,6 +106,42 @@
     }
 
 
-    public abstract AbstractSchemaDescription parse( String schemaDescription ) throws ParseException;
-
+    /**
+     * Parse a SchemaObject description and returns back an instance of SchemaObject.
+     * 
+     * @param schemaDescription The SchemaObject description
+     * @return A SchemaObject instance
+     * @throws ParseException If the parsing failed
+     */
+    public abstract SchemaObject parse( String schemaDescription ) throws ParseException;
+    
+    
+    /**
+     * Update the schemaName for this SchemaObject, accordingly to the X-SCHEMA parameter. If
+     * not present, default to 'other'
+     */
+    protected void setSchemaName( SchemaObject schemaObject )
+    {
+        
+        // Update the Schema if we have the X-SCHEMA extension
+        List<String> schemaExtension = schemaObject.getExtensions().get( MetaSchemaConstants.X_SCHEMA );
+        
+        if ( schemaExtension != null )
+        {
+            String schemaName = schemaExtension.get( 0 );
+            
+            if ( StringTools.isEmpty( schemaName ) )
+            {
+                schemaObject.setSchemaName( MetaSchemaConstants.SCHEMA_OTHER );
+            }
+            else
+            {
+                schemaObject.setSchemaName( schemaName );
+            }
+        }
+        else
+        {
+            schemaObject.setSchemaName( MetaSchemaConstants.SCHEMA_OTHER );
+        }
+    }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/AttributeTypeDescriptionSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/AttributeTypeDescriptionSchemaParser.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/AttributeTypeDescriptionSchemaParser.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/AttributeTypeDescriptionSchemaParser.java Wed Jan  6 17:52:15 2010
@@ -22,6 +22,9 @@
 
 import java.text.ParseException;
 
+import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import antlr.RecognitionException;
 import antlr.TokenStreamException;
@@ -36,6 +39,8 @@
  */
 public class AttributeTypeDescriptionSchemaParser extends AbstractSchemaParser
 {
+    /** The LoggerFactory used by this class */
+    protected static final Logger LOG = LoggerFactory.getLogger( AttributeTypeDescriptionSchemaParser.class );
 
     /**
      * Creates a schema parser instance.
@@ -78,12 +83,15 @@
      * @return the parsed AttributeTypeDescription bean
      * @throws ParseException if there are any recognition errors (bad syntax)
      */
-    public synchronized AttributeTypeDescription parseAttributeTypeDescription( String attributeTypeDescription )
+    public synchronized AttributeType parseAttributeTypeDescription( String attributeTypeDescription )
         throws ParseException
     {
 
+        LOG.debug( "Parsing an AttributeType : {}", attributeTypeDescription );
+
         if ( attributeTypeDescription == null )
         {
+            LOG.error( "Cannot parse a null AttributeType" );
             throw new ParseException( "Null", 0 );
         }
 
@@ -91,36 +99,47 @@
 
         try
         {
-            AttributeTypeDescription atd = parser.attributeTypeDescription();
-            return atd;
+            AttributeType attributeType = parser.attributeTypeDescription();
+            
+            // Update the schemaName
+            setSchemaName( attributeType );
+
+            return attributeType;
         }
         catch ( RecognitionException re )
         {
-            String msg = "Parser failure on attribute type description:\n\t" + attributeTypeDescription;
-            msg += "\nAntlr message: " + re.getMessage();
-            msg += "\nAntlr column: " + re.getColumn();
+            String msg = "Parser failure on attribute type description:\n\t" + attributeTypeDescription +
+                "\nAntlr message: " + re.getMessage() +
+                "\nAntlr column: " + re.getColumn();
+            LOG.error( msg );
             throw new ParseException( msg, re.getColumn() );
         }
         catch ( TokenStreamRecognitionException tsre )
         {
-            String msg = "Parser failure on attribute type description:\n\t" + attributeTypeDescription;
-            msg += "\nAntlr message: " + tsre.getMessage();
+            String msg = "Parser failure on attribute type description:\n\t" + attributeTypeDescription +
+                "\nAntlr message: " + tsre.getMessage();
+            LOG.error( msg );
             throw new ParseException( msg, 0 );
         }
         catch ( TokenStreamException tse )
         {
-            String msg = "Parser failure on attribute type description:\n\t" + attributeTypeDescription;
-            msg += "\nAntlr message: " + tse.getMessage();
+            String msg = "Parser failure on attribute type description:\n\t" + attributeTypeDescription +
+                "\nAntlr message: " + tse.getMessage();
+            LOG.error( msg );
             throw new ParseException( msg, 0 );
         }
 
     }
 
 
-    public AbstractSchemaDescription parse( String schemaDescription ) throws ParseException
+    /**
+     * Parses a AttributeType description
+     * 
+     * @param The AttributeType description to parse
+     * @return An instance of AttributeType
+     */
+    public AttributeType parse( String schemaDescription ) throws ParseException
     {
         return parseAttributeTypeDescription( schemaDescription );
     }
-
-
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/DITContentRuleDescriptionSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/DITContentRuleDescriptionSchemaParser.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/DITContentRuleDescriptionSchemaParser.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/DITContentRuleDescriptionSchemaParser.java Wed Jan  6 17:52:15 2010
@@ -22,6 +22,9 @@
 
 import java.text.ParseException;
 
+import org.apache.directory.shared.ldap.schema.DITContentRule;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import antlr.RecognitionException;
 import antlr.TokenStreamException;
@@ -35,6 +38,8 @@
  */
 public class DITContentRuleDescriptionSchemaParser extends AbstractSchemaParser
 {
+    /** The LoggerFactory used by this class */
+    protected static final Logger LOG = LoggerFactory.getLogger( DITContentRuleDescriptionSchemaParser.class );
 
     /**
      * Creates a schema parser instance.
@@ -64,12 +69,14 @@
      * @return the parsed DITContentRuleDescription bean
      * @throws ParseException if there are any recognition errors (bad syntax)
      */
-    public synchronized DITContentRuleDescription parseDITContentRuleDescription( String ditContentRuleDescription )
+    public synchronized DITContentRule parseDITContentRuleDescription( String ditContentRuleDescription )
         throws ParseException
     {
+        LOG.debug( "Parsing a DITContentRule : {}", ditContentRuleDescription );
 
         if ( ditContentRuleDescription == null )
         {
+            LOG.error( "Cannot parse a null DITContentRule" );
             throw new ParseException( "Null", 0 );
         }
 
@@ -77,29 +84,40 @@
 
         try
         {
-            DITContentRuleDescription dcrd = parser.ditContentRuleDescription();
-            return dcrd;
+            DITContentRule ditContentRule = parser.ditContentRuleDescription();
+            
+            // Update the schemaName
+            setSchemaName( ditContentRule );
+
+            return ditContentRule;
         }
         catch ( RecognitionException re )
         {
-            String msg = "Parser failure on DIT content rule description:\n\t" + ditContentRuleDescription;
-            msg += "\nAntlr message: " + re.getMessage();
-            msg += "\nAntlr column: " + re.getColumn();
+            String msg = "Parser failure on DIT content rule description:\n\t" + ditContentRuleDescription +
+                "\nAntlr message: " + re.getMessage() +
+                "\nAntlr column: " + re.getColumn();
+            LOG.error( msg );
             throw new ParseException( msg, re.getColumn() );
         }
         catch ( TokenStreamException tse )
         {
-            String msg = "Parser failure on DIT content rule description:\n\t" + ditContentRuleDescription;
-            msg += "\nAntlr message: " + tse.getMessage();
+            String msg = "Parser failure on DIT content rule description:\n\t" + ditContentRuleDescription +
+                "\nAntlr message: " + tse.getMessage();
+            LOG.error( msg );
             throw new ParseException( msg, 0 );
         }
 
     }
 
 
-    public AbstractSchemaDescription parse( String schemaDescription ) throws ParseException
+    /**
+     * Parses a DITContentRule description
+     * 
+     * @param The DITContentRule description to parse
+     * @return An instance of DITContentRule
+     */
+    public DITContentRule parse( String schemaDescription ) throws ParseException
     {
         return parseDITContentRuleDescription( schemaDescription );
     }
-
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/DITStructureRuleDescriptionSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/DITStructureRuleDescriptionSchemaParser.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/DITStructureRuleDescriptionSchemaParser.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/DITStructureRuleDescriptionSchemaParser.java Wed Jan  6 17:52:15 2010
@@ -22,6 +22,9 @@
 
 import java.text.ParseException;
 
+import org.apache.directory.shared.ldap.schema.DITStructureRule;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import antlr.RecognitionException;
 import antlr.TokenStreamException;
@@ -35,12 +38,16 @@
  */
 public class DITStructureRuleDescriptionSchemaParser extends AbstractSchemaParser
 {
+    /** The LoggerFactory used by this class */
+    protected static final Logger LOG = LoggerFactory.getLogger( DITStructureRuleDescriptionSchemaParser.class );
+
 
     /**
      * Creates a schema parser instance.
      */
     public DITStructureRuleDescriptionSchemaParser()
     {
+        super();
     }
 
 
@@ -66,12 +73,14 @@
      * @return the parsed DITStructureRuleDescription bean
      * @throws ParseException if there are any recognition errors (bad syntax)
      */
-    public synchronized DITStructureRuleDescription parseDITStructureRuleDescription( String ditStructureRuleDescription )
+    public synchronized DITStructureRule parseDITStructureRuleDescription( String ditStructureRuleDescription )
         throws ParseException
     {
+        LOG.debug( "Parsing a DITStructureRule : {}", ditStructureRuleDescription );
 
         if ( ditStructureRuleDescription == null )
         {
+            LOG.error( "Cannot parse a null DITStructureRule description" );
             throw new ParseException( "Null", 0 );
         }
 
@@ -79,29 +88,40 @@
 
         try
         {
-            DITStructureRuleDescription dsrd = parser.ditStructureRuleDescription();
-            return dsrd;
+            DITStructureRule ditStructureRule = parser.ditStructureRuleDescription();
+
+            // Update the schemaName
+            setSchemaName( ditStructureRule );
+
+            return ditStructureRule;
         }
         catch ( RecognitionException re )
         {
-            String msg = "Parser failure on DIT structure rule description:\n\t" + ditStructureRuleDescription;
-            msg += "\nAntlr message: " + re.getMessage();
-            msg += "\nAntlr column: " + re.getColumn();
+            String msg = "Parser failure on DIT structure rule description:\n\t" + ditStructureRuleDescription +
+                "\nAntlr message: " + re.getMessage() +
+                "\nAntlr column: " + re.getColumn();
+            LOG.error( msg );
             throw new ParseException( msg, re.getColumn() );
         }
         catch ( TokenStreamException tse )
         {
-            String msg = "Parser failure on DIT structure rule description:\n\t" + ditStructureRuleDescription;
-            msg += "\nAntlr message: " + tse.getMessage();
+            String msg = "Parser failure on DIT structure rule description:\n\t" + ditStructureRuleDescription +
+                "\nAntlr message: " + tse.getMessage();
+            LOG.error( msg );
             throw new ParseException( msg, 0 );
         }
 
     }
 
 
-    public AbstractSchemaDescription parse( String schemaDescription ) throws ParseException
+    /**
+     * Parses a DITStructureRule description
+     * 
+     * @param The DITStructureRule description to parse
+     * @return An instance of DITStructureRule
+     */
+    public DITStructureRule parse( String schemaDescription ) throws ParseException
     {
         return parseDITStructureRuleDescription( schemaDescription );
     }
-
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapSyntaxDescriptionSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapSyntaxDescriptionSchemaParser.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapSyntaxDescriptionSchemaParser.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapSyntaxDescriptionSchemaParser.java Wed Jan  6 17:52:15 2010
@@ -22,6 +22,9 @@
 
 import java.text.ParseException;
 
+import org.apache.directory.shared.ldap.schema.LdapSyntax;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import antlr.RecognitionException;
 import antlr.TokenStreamException;
@@ -35,6 +38,8 @@
  */
 public class LdapSyntaxDescriptionSchemaParser extends AbstractSchemaParser
 {
+    /** The LoggerFactory used by this class */
+    protected static final Logger LOG = LoggerFactory.getLogger( LdapSyntaxDescriptionSchemaParser.class );
 
     /**
      * Creates a schema parser instance.
@@ -54,16 +59,18 @@
      *    extensions WSP RPAREN      ; extensions
      * </pre>
      * 
-     * @param ldapSyntaxDescription the LDAP syntay description to be parsed
-     * @return the parsed LdapSyntaxDescription bean
+     * @param ldapSyntaxDescription the LDAP syntax description to be parsed
+     * @return the parsed LdapSyntax bean
      * @throws ParseException if there are any recognition errors (bad syntax)
      */
-    public synchronized LdapSyntaxDescription parseLdapSyntaxDescription( String ldapSyntaxDescription )
+    public synchronized LdapSyntax parseLdapSyntaxDescription( String ldapSyntaxDescription )
         throws ParseException
     {
+        LOG.debug( "Parsing a LdapSyntax : {}", ldapSyntaxDescription );
 
         if ( ldapSyntaxDescription == null )
         {
+            LOG.error( "Cannot parse a null LdapSyntax" );
             throw new ParseException( "Null", 0 );
         }
 
@@ -71,29 +78,40 @@
 
         try
         {
-            LdapSyntaxDescription lsd = parser.ldapSyntaxDescription();
-            return lsd;
+            LdapSyntax ldapSyntax = parser.ldapSyntaxDescription();
+            ldapSyntax.setSpecification( ldapSyntaxDescription );
+
+            // Update the schemaName
+            setSchemaName( ldapSyntax );
+                
+            return ldapSyntax;
         }
         catch ( RecognitionException re )
         {
-            String msg = "Parser failure on LDAP syntay description:\n\t" + ldapSyntaxDescription;
-            msg += "\nAntlr message: " + re.getMessage();
-            msg += "\nAntlr column: " + re.getColumn();
+            String msg = "Parser failure on LDAP syntay description:\n\t" + ldapSyntaxDescription +
+                "\nAntlr message: " + re.getMessage() +
+                "\nAntlr column: " + re.getColumn();
+            LOG.error( msg );
             throw new ParseException( msg, re.getColumn() );
         }
         catch ( TokenStreamException tse )
         {
-            String msg = "Parser failure on LDAP syntay description:\n\t" + ldapSyntaxDescription;
-            msg += "\nAntlr message: " + tse.getMessage();
+            String msg = "Parser failure on LDAP syntay description:\n\t" + ldapSyntaxDescription +
+                "\nAntlr message: " + tse.getMessage();
+            LOG.error(  msg  );
             throw new ParseException( msg, 0 );
         }
-
     }
 
 
-    public AbstractSchemaDescription parse( String schemaDescription ) throws ParseException
+    /**
+     * Parses a LdapSyntax description
+     * 
+     * @param The LdapSyntax description to parse
+     * @return An instance of LdapSyntax
+     */
+    public LdapSyntax parse( String schemaDescription ) throws ParseException
     {
         return parseLdapSyntaxDescription( schemaDescription );
     }
-
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleDescriptionSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleDescriptionSchemaParser.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleDescriptionSchemaParser.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleDescriptionSchemaParser.java Wed Jan  6 17:52:15 2010
@@ -22,6 +22,9 @@
 
 import java.text.ParseException;
 
+import org.apache.directory.shared.ldap.schema.MatchingRule;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import antlr.RecognitionException;
 import antlr.TokenStreamException;
@@ -35,6 +38,8 @@
  */
 public class MatchingRuleDescriptionSchemaParser extends AbstractSchemaParser
 {
+    /** The LoggerFactory used by this class */
+    protected static final Logger LOG = LoggerFactory.getLogger( MatchingRuleDescriptionSchemaParser.class );
 
     /**
      * Creates a schema parser instance.
@@ -64,12 +69,14 @@
      * @return the parsed MatchingRuleDescription bean
      * @throws ParseException if there are any recognition errors (bad syntax)
      */
-    public synchronized MatchingRuleDescription parseMatchingRuleDescription( String matchingRuleDescription )
+    public synchronized MatchingRule parseMatchingRuleDescription( String matchingRuleDescription )
         throws ParseException
     {
+        LOG.debug( "Parsing a MatchingRule : {}", matchingRuleDescription );
 
         if ( matchingRuleDescription == null )
         {
+            LOG.error( "Cannot parse a null MatchingRule" );
             throw new ParseException( "Null", 0 );
         }
 
@@ -77,29 +84,39 @@
 
         try
         {
-            MatchingRuleDescription mrd = parser.matchingRuleDescription();
-            return mrd;
+            MatchingRule matchingRule = parser.matchingRuleDescription();
+            
+            // Update the schemaName
+            setSchemaName( matchingRule );
+
+            return matchingRule;
         }
         catch ( RecognitionException re )
         {
-            String msg = "Parser failure on matching rule description:\n\t" + matchingRuleDescription;
-            msg += "\nAntlr message: " + re.getMessage();
-            msg += "\nAntlr column: " + re.getColumn();
+            String msg = "Parser failure on matching rule description:\n\t" + matchingRuleDescription +
+                "\nAntlr message: " + re.getMessage() +
+                "\nAntlr column: " + re.getColumn();
+            LOG.error( msg );
             throw new ParseException( msg, re.getColumn() );
         }
         catch ( TokenStreamException tse )
         {
-            String msg = "Parser failure on matching rule description:\n\t" + matchingRuleDescription;
-            msg += "\nAntlr message: " + tse.getMessage();
+            String msg = "Parser failure on matching rule description:\n\t" + matchingRuleDescription +
+                "\nAntlr message: " + tse.getMessage();
+            LOG.error( msg );
             throw new ParseException( msg, 0 );
         }
-
     }
 
 
-    public AbstractSchemaDescription parse( String schemaDescription ) throws ParseException
+    /**
+     * Parses a MatchingRule description
+     * 
+     * @param The MatchingRule description to parse
+     * @return An instance of MatchingRule
+     */
+    public MatchingRule parse( String schemaDescription ) throws ParseException
     {
         return parseMatchingRuleDescription( schemaDescription );
     }
-
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleUseDescriptionSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleUseDescriptionSchemaParser.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleUseDescriptionSchemaParser.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleUseDescriptionSchemaParser.java Wed Jan  6 17:52:15 2010
@@ -22,6 +22,9 @@
 
 import java.text.ParseException;
 
+import org.apache.directory.shared.ldap.schema.MatchingRuleUse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import antlr.RecognitionException;
 import antlr.TokenStreamException;
@@ -35,6 +38,9 @@
  */
 public class MatchingRuleUseDescriptionSchemaParser extends AbstractSchemaParser
 {
+    /** The LoggerFactory used by this class */
+    protected static final Logger LOG = LoggerFactory.getLogger( MatchingRuleUseDescriptionSchemaParser.class );
+
 
     /**
      * Creates a schema parser instance.
@@ -64,12 +70,14 @@
      * @return the parsed MatchingRuleUseDescription bean
      * @throws ParseException if there are any recognition errors (bad syntax)
      */
-    public synchronized MatchingRuleUseDescription parseMatchingRuleUseDescription( String matchingRuleUseDescription )
+    public synchronized MatchingRuleUse parseMatchingRuleUseDescription( String matchingRuleUseDescription )
         throws ParseException
     {
+        LOG.debug( "Parsing a MatchingRuleUse : {}", matchingRuleUseDescription );
 
         if ( matchingRuleUseDescription == null )
         {
+            LOG.error( "Cannot parse a null MatchingRuleUse" );
             throw new ParseException( "Null", 0 );
         }
 
@@ -77,29 +85,40 @@
 
         try
         {
-            MatchingRuleUseDescription mrud = parser.matchingRuleUseDescription();
-            return mrud;
+            MatchingRuleUse matchingRuleUse = parser.matchingRuleUseDescription();
+            
+            // Update the schemaName
+            setSchemaName( matchingRuleUse );
+
+            return matchingRuleUse;
         }
         catch ( RecognitionException re )
         {
-            String msg = "Parser failure on matching rule description:\n\t" + matchingRuleUseDescription;
-            msg += "\nAntlr message: " + re.getMessage();
-            msg += "\nAntlr column: " + re.getColumn();
+            String msg = "Parser failure on matching rule description:\n\t" + matchingRuleUseDescription +
+                "\nAntlr message: " + re.getMessage() +
+                "\nAntlr column: " + re.getColumn();
+            LOG.error( msg );
             throw new ParseException( msg, re.getColumn() );
         }
         catch ( TokenStreamException tse )
         {
-            String msg = "Parser failure on matching rule description:\n\t" + matchingRuleUseDescription;
-            msg += "\nAntlr message: " + tse.getMessage();
+            String msg = "Parser failure on matching rule description:\n\t" + matchingRuleUseDescription +
+                "\nAntlr message: " + tse.getMessage();
+            LOG.error( msg );
             throw new ParseException( msg, 0 );
         }
 
     }
 
 
-    public AbstractSchemaDescription parse( String schemaDescription ) throws ParseException
+    /**
+     * Parses a MatchingRuleUse description
+     * 
+     * @param The MatchingRuleUse description to parse
+     * @return An instance of MatchingRuleUse
+     */
+    public MatchingRuleUse parse( String schemaDescription ) throws ParseException
     {
         return parseMatchingRuleUseDescription( schemaDescription );
     }
-
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/NameFormDescriptionSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/NameFormDescriptionSchemaParser.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/NameFormDescriptionSchemaParser.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/NameFormDescriptionSchemaParser.java Wed Jan  6 17:52:15 2010
@@ -22,19 +22,24 @@
 
 import java.text.ParseException;
 
+import org.apache.directory.shared.ldap.schema.NameForm;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import antlr.RecognitionException;
 import antlr.TokenStreamException;
 
 
 /**
- * A parser for RFC 4512 name form descriptons
+ * A parser for RFC 4512 name form descriptions
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
 public class NameFormDescriptionSchemaParser extends AbstractSchemaParser
 {
+    /** The LoggerFactory used by this class */
+    protected static final Logger LOG = LoggerFactory.getLogger( NameFormDescriptionSchemaParser.class );
 
     /**
      * Creates a schema parser instance.
@@ -60,15 +65,17 @@
      * </pre>
      * 
      * @param nameFormDescription the name form description to be parsed
-     * @return the parsed NameFormDescription bean
+     * @return the parsed NameForm bean
      * @throws ParseException if there are any recognition errors (bad syntax)
      */
-    public synchronized NameFormDescription parseNameFormDescription( String nameFormDescription )
+    public synchronized NameForm parseNameFormDescription( String nameFormDescription)
         throws ParseException
     {
+        LOG.debug( "Parsing a NameForm : {}", nameFormDescription );
 
         if ( nameFormDescription == null )
         {
+            LOG.error( "Cannot parse a null NameForm" );
             throw new ParseException( "Null", 0 );
         }
 
@@ -76,29 +83,39 @@
 
         try
         {
-            NameFormDescription nfd = parser.nameFormDescription();
-            return nfd;
+            NameForm nameForm = parser.nameFormDescription();
+            
+            // Update the schemaName
+            setSchemaName( nameForm );
+
+            return nameForm;
         }
         catch ( RecognitionException re )
         {
-            String msg = "Parser failure on name form description:\n\t" + nameFormDescription;
-            msg += "\nAntlr message: " + re.getMessage();
-            msg += "\nAntlr column: " + re.getColumn();
+            String msg = "Parser failure on name form description:\n\t" + nameFormDescription +
+                "\nAntlr message: " + re.getMessage() +
+                "\nAntlr column: " + re.getColumn();
+            LOG.error( msg );
             throw new ParseException( msg, re.getColumn() );
         }
         catch ( TokenStreamException tse )
         {
-            String msg = "Parser failure on name form description:\n\t" + nameFormDescription;
-            msg += "\nAntlr message: " + tse.getMessage();
+            String msg = "Parser failure on name form description:\n\t" + nameFormDescription +
+                "\nAntlr message: " + tse.getMessage();
+            LOG.error( msg );
             throw new ParseException( msg, 0 );
         }
-
     }
 
 
-    public AbstractSchemaDescription parse( String schemaDescription ) throws ParseException
+    /**
+     * Parses a NameForm description
+     * 
+     * @param The NameForm description to parse
+     * @return An instance of NameForm
+     */
+    public NameForm parse( String schemaDescription ) throws ParseException
     {
         return parseNameFormDescription( schemaDescription );
     }
-
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/NormalizerDescription.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/NormalizerDescription.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/NormalizerDescription.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/NormalizerDescription.java Wed Jan  6 17:52:15 2010
@@ -20,6 +20,9 @@
 
 package org.apache.directory.shared.ldap.schema.parsers;
 
+import org.apache.directory.shared.ldap.schema.LoadableSchemaObject;
+import org.apache.directory.shared.ldap.schema.SchemaObjectType;
+
 
 /**
  * An ApacheDS specific schema description for a Normalizer.
@@ -27,7 +30,26 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class NormalizerDescription extends AbstractAdsSchemaDescription
+public class NormalizerDescription extends LoadableSchemaObject
 {
+	/** SerialVersionUID */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Default constructor for a NormalizerDecription
+	 * @param oid The SyntaxChecker OID
+	 */
+	public NormalizerDescription( String oid ) 
+	{
+		super( SchemaObjectType.NORMALIZER, oid );
+	}
 
+    
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        return "SyntaxChecker description : " + getDescription();
+    }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/NormalizerDescriptionSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/NormalizerDescriptionSchemaParser.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/NormalizerDescriptionSchemaParser.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/NormalizerDescriptionSchemaParser.java Wed Jan  6 17:52:15 2010
@@ -22,6 +22,8 @@
 
 import java.text.ParseException;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import antlr.RecognitionException;
 import antlr.TokenStreamException;
@@ -35,12 +37,16 @@
  */
 public class NormalizerDescriptionSchemaParser extends AbstractSchemaParser
 {
+    /** The LoggerFactory used by this class */
+    protected static final Logger LOG = LoggerFactory.getLogger( NormalizerDescriptionSchemaParser.class );
+
 
     /**
      * Creates a schema parser instance.
      */
     public NormalizerDescriptionSchemaParser()
     {
+        super();
     }
 
 
@@ -71,9 +77,11 @@
     public synchronized NormalizerDescription parseNormalizerDescription( String normalizerDescription )
         throws ParseException
     {
+        LOG.debug( "Parsing a Normalizer : {}", normalizerDescription );
 
         if ( normalizerDescription == null )
         {
+            LOG.error( "Cannot parse a null Normalizer description" );
             throw new ParseException( "Null", 0 );
         }
 
@@ -81,29 +89,40 @@
 
         try
         {
-            NormalizerDescription nd = parser.normalizerDescription();
-            return nd;
+            NormalizerDescription normalizer = parser.normalizerDescription();
+
+            // Update the schemaName
+            setSchemaName( normalizer );
+
+            return normalizer;
         }
         catch ( RecognitionException re )
         {
-            String msg = "Parser failure on normalizer description:\n\t" + normalizerDescription;
-            msg += "\nAntlr message: " + re.getMessage();
-            msg += "\nAntlr column: " + re.getColumn();
+            String msg = "Parser failure on normalizer description:\n\t" + normalizerDescription +
+                "\nAntlr message: " + re.getMessage() +
+                "\nAntlr column: " + re.getColumn();
+            LOG.error( msg );
             throw new ParseException( msg, re.getColumn() );
         }
         catch ( TokenStreamException tse )
         {
-            String msg = "Parser failure on normalizer description:\n\t" + normalizerDescription;
-            msg += "\nAntlr message: " + tse.getMessage();
+            String msg = "Parser failure on normalizer description:\n\t" + normalizerDescription +
+                "\nAntlr message: " + tse.getMessage();
+            LOG.error( msg );
             throw new ParseException( msg, 0 );
         }
 
     }
 
 
-    public AbstractSchemaDescription parse( String schemaDescription ) throws ParseException
+    /**
+     * Parses a Normalizer description
+     * 
+     * @param The Normalizer description to parse
+     * @return An instance of NormalizerDescription
+     */
+    public NormalizerDescription parse( String schemaDescription ) throws ParseException
     {
         return parseNormalizerDescription( schemaDescription );
     }
-
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/ObjectClassDescriptionSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/ObjectClassDescriptionSchemaParser.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/ObjectClassDescriptionSchemaParser.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/ObjectClassDescriptionSchemaParser.java Wed Jan  6 17:52:15 2010
@@ -22,6 +22,9 @@
 
 import java.text.ParseException;
 
+import org.apache.directory.shared.ldap.schema.ObjectClass;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import antlr.RecognitionException;
 import antlr.TokenStreamException;
@@ -35,12 +38,16 @@
  */
 public class ObjectClassDescriptionSchemaParser extends AbstractSchemaParser
 {
+    /** The LoggerFactory used by this class */
+    protected static final Logger LOG = LoggerFactory.getLogger( ObjectClassDescriptionSchemaParser.class );
+
 
     /**
      * Creates a schema parser instance.
      */
     public ObjectClassDescriptionSchemaParser()
     {
+        // Nothing to do
     }
 
 
@@ -69,12 +76,14 @@
      * @return the parsed ObjectClassDescription bean
      * @throws ParseException if there are any recognition errors (bad syntax)
      */
-    public synchronized ObjectClassDescription parseObjectClassDescription( String objectClassDescription )
+    public synchronized ObjectClass parseObjectClassDescription( String objectClassDescription )
         throws ParseException
     {
+        LOG.debug( "Parsing an ObjectClass : {}", objectClassDescription );
 
         if ( objectClassDescription == null )
         {
+            LOG.error( "Cannot parse a null LdapComparator description" );
             throw new ParseException( "Null", 0 );
         }
 
@@ -82,27 +91,33 @@
 
         try
         {
-            ObjectClassDescription ocd = parser.objectClassDescription();
-            return ocd;
+            ObjectClass objectClass = parser.objectClassDescription();
+
+            // Update the schemaName
+            setSchemaName( objectClass );
+
+            return objectClass;
         }
         catch ( RecognitionException re )
         {
-            String msg = "Parser failure on object class description:\n\t" + objectClassDescription;
-            msg += "\nAntlr message: " + re.getMessage();
-            msg += "\nAntlr column: " + re.getColumn();
+            String msg = "Parser failure on object class description:\n\t" + objectClassDescription +
+                "\nAntlr message: " + re.getMessage()+
+                "\nAntlr column: " + re.getColumn();
+            LOG.error( msg );
             throw new ParseException( msg, re.getColumn() );
         }
         catch ( TokenStreamException tse )
         {
-            String msg = "Parser failure on object class description:\n\t" + objectClassDescription;
-            msg += "\nAntlr message: " + tse.getMessage();
+            String msg = "Parser failure on object class description:\n\t" + objectClassDescription +
+                "\nAntlr message: " + tse.getMessage();
+            LOG.error( msg );
             throw new ParseException( msg, 0 );
         }
 
     }
 
 
-    public AbstractSchemaDescription parse( String schemaDescription ) throws ParseException
+    public ObjectClass parse( String schemaDescription ) throws ParseException
     {
         return parseObjectClassDescription( schemaDescription );
     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/OpenLdapSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/OpenLdapSchemaParser.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/OpenLdapSchemaParser.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/OpenLdapSchemaParser.java Wed Jan  6 17:52:15 2010
@@ -31,7 +31,10 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.directory.shared.ldap.schema.syntaxes.OpenLdapObjectIdentifierMacro;
+import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.ObjectClass;
+import org.apache.directory.shared.ldap.schema.SchemaObject;
+import org.apache.directory.shared.ldap.schema.syntaxCheckers.OpenLdapObjectIdentifierMacro;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
 
 import antlr.RecognitionException;
@@ -50,11 +53,11 @@
     /** The list of parsed schema descriptions */
     private List<Object> schemaDescriptions;
 
-    /** The list of attribute type literals, initialized by splitParsedSchemaDescriptions() */
-    private List<AttributeTypeLiteral> attributeTypeLiterals;
+    /** The list of attribute type, initialized by splitParsedSchemaDescriptions() */
+    private List<AttributeType> attributeTypes;
 
-    /** The list of object class literals, initialized by splitParsedSchemaDescriptions()*/
-    private List<ObjectClassLiteral> objectClassLiterals;
+    /** The list of object classes, initialized by splitParsedSchemaDescriptions()*/
+    private List<ObjectClass> objectClasses;
 
     /** The map of object identifier macros, initialized by splitParsedSchemaDescriptions()*/
     private Map<String, OpenLdapObjectIdentifierMacro> objectIdentifierMacros;
@@ -88,9 +91,9 @@
      * 
      * @return the attribute types
      */
-    public List<AttributeTypeLiteral> getAttributeTypes()
+    public List<AttributeType> getAttributeTypes()
     {
-        return attributeTypeLiterals;
+        return attributeTypes;
     }
 
 
@@ -99,9 +102,9 @@
      * 
      * @return the object class types
      */
-    public List<ObjectClassLiteral> getObjectClassTypes()
+    public List<ObjectClass> getObjectClassTypes()
     {
-        return objectClassLiterals;
+        return objectClasses;
     }
 
 
@@ -124,8 +127,8 @@
      */
     private void afterParse() throws ParseException
     {
-        objectClassLiterals = new ArrayList<ObjectClassLiteral>();
-        attributeTypeLiterals = new ArrayList<AttributeTypeLiteral>();
+        objectClasses = new ArrayList<ObjectClass>();
+        attributeTypes = new ArrayList<AttributeType>();
         objectIdentifierMacros = new HashMap<String, OpenLdapObjectIdentifierMacro>();
 
         // split parsed schema descriptions
@@ -136,38 +139,17 @@
                 OpenLdapObjectIdentifierMacro oid = ( OpenLdapObjectIdentifierMacro ) obj;
                 objectIdentifierMacros.put( oid.getName(), oid );
             }
-            else if ( obj instanceof AttributeTypeDescription )
+            else if ( obj instanceof AttributeType )
             {
-                AttributeTypeDescription atd = ( AttributeTypeDescription ) obj;
-                AttributeTypeLiteral literal = new AttributeTypeLiteral( atd.getNumericOid() );
-                literal.setNames( atd.getNames().toArray( new String[atd.getNames().size()] ) );
-                literal.setDescription( atd.getDescription() );
-                literal.setSuperior( atd.getSuperType() );
-                literal.setEquality( atd.getEqualityMatchingRule() );
-                literal.setOrdering( atd.getOrderingMatchingRule() );
-                literal.setSubstr( atd.getSubstringsMatchingRule() );
-                literal.setSyntax( atd.getSyntax() );
-                literal.setLength( atd.getSyntaxLength() );
-                literal.setObsolete( atd.isObsolete() );
-                literal.setCollective( atd.isCollective() );
-                literal.setSingleValue( atd.isSingleValued() );
-                literal.setNoUserModification( !atd.isUserModifiable() );
-                literal.setUsage( atd.getUsage() );
-                attributeTypeLiterals.add( literal );
-            }
-            else if ( obj instanceof ObjectClassDescription )
-            {
-                ObjectClassDescription ocd = ( ObjectClassDescription ) obj;
-                ObjectClassLiteral literal = new ObjectClassLiteral( ocd.getNumericOid() );
-                literal.setNames( ocd.getNames().toArray( new String[ocd.getNames().size()] ) );
-                literal.setDescription( ocd.getDescription() );
-                literal.setSuperiors( ocd.getSuperiorObjectClasses().toArray(
-                    new String[ocd.getSuperiorObjectClasses().size()] ) );
-                literal.setMay( ocd.getMayAttributeTypes().toArray( new String[ocd.getMayAttributeTypes().size()] ) );
-                literal.setMust( ocd.getMustAttributeTypes().toArray( new String[ocd.getMustAttributeTypes().size()] ) );
-                literal.setClassType( ocd.getKind() );
-                literal.setObsolete( ocd.isObsolete() );
-                objectClassLiterals.add( literal );
+                AttributeType attributeType = ( AttributeType ) obj;
+
+                attributeTypes.add( attributeType );
+            }
+            else if ( obj instanceof ObjectClass )
+            {
+                ObjectClass objectClass = ( ObjectClass ) obj;
+
+                objectClasses.add( objectClass );
             }
         }
 
@@ -179,18 +161,20 @@
                 resolveObjectIdentifierMacro( oid );
             }
 
-            // apply object identifier macros to object classes and attribute types
-            for ( ObjectClassLiteral ocl : objectClassLiterals )
+            // apply object identifier macros to object classes
+            for ( ObjectClass objectClass : objectClasses )
             {
-                ocl.setOid( getResolveOid( ocl.getOid() ) );
+                objectClass.setOid( getResolveOid( objectClass.getOid() ) );
             }
-            for ( AttributeTypeLiteral atl : attributeTypeLiterals )
+            
+            // apply object identifier macros to attribute types
+            for ( AttributeType attributeType : attributeTypes )
             {
-                atl.setOid( getResolveOid( atl.getOid() ) );
-                atl.setSyntax( getResolveOid( atl.getSyntax() ) );
+                attributeType.setOid( getResolveOid( attributeType.getOid() ) );
+                attributeType.setSyntaxOid( getResolveOid( attributeType.getSyntaxOid() ) );
             }
+            
         }
-
     }
 
 
@@ -258,7 +242,7 @@
      * @throws IOException If the schemaObject can't be transformed to a byteArrayInputStream
      * @throws ParseException If the schemaObject can't be parsed
      */
-    public AbstractSchemaDescription parse( String schemaObject ) throws ParseException
+    public SchemaObject parse( String schemaObject ) throws ParseException
     {
         if ( schemaObject == null || schemaObject.trim().equals( "" ) )
         {
@@ -272,9 +256,9 @@
         {
             for ( Object obj : schemaDescriptions )
             {
-                if ( obj instanceof AbstractSchemaDescription )
+                if ( obj instanceof SchemaObject )
                 {
-                    return ( AbstractSchemaDescription ) obj;
+                    return ( SchemaObject ) obj;
                 }
             }
         }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/ParserDescriptionUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/ParserDescriptionUtils.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/ParserDescriptionUtils.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/ParserDescriptionUtils.java Wed Jan  6 17:52:15 2010
@@ -22,6 +22,14 @@
 
 import java.util.List;
 
+import javax.naming.NamingException;
+
+import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.LdapSyntax;
+import org.apache.directory.shared.ldap.schema.MatchingRule;
+import org.apache.directory.shared.ldap.schema.ObjectClass;
+import org.apache.directory.shared.ldap.schema.SchemaObject;
+
 
 
 /**
@@ -33,54 +41,54 @@
 public class ParserDescriptionUtils
 {
     /**
-     * Checks two schema objectClass descriptions for an exact match.
+     * Checks two schema objectClasses for an exact match.
      *
-     * @param ocd0 the first objectClass description to compare
-     * @param ocd1 the second objectClass description to compare
-     * @return true if both objectClasss descriptions match exactly, false otherwise
+     * @param ocd0 the first objectClass to compare
+     * @param ocd1 the second objectClass to compare
+     * @return true if both objectClasses match exactly, false otherwise
      */
-    public static boolean objectClassesMatch( ObjectClassDescription ocd0, ObjectClassDescription ocd1 )
+    public static boolean objectClassesMatch( ObjectClass oc0, ObjectClass oc1 ) throws NamingException
     {
         // compare all common description parameters
-        if ( ! descriptionsMatch( ocd0, ocd1 ) )
+        if ( ! descriptionsMatch( oc0, oc1 ) )
         {
             return false;
         }
 
         // compare the objectClass type (AUXILIARY, STRUCTURAL, ABSTRACT)
-        if ( ocd0.getKind() != ocd1.getKind() )
+        if ( oc0.getType() != oc1.getType() )
         {
             return false;
         }
         
         // compare the superior objectClasses (sizes must match)
-        if ( ocd0.getSuperiorObjectClasses().size() != ocd1.getSuperiorObjectClasses().size() )
+        if ( oc0.getSuperiorOids().size() != oc1.getSuperiorOids().size() )
         {
             return false;
         }
 
         // compare the superior objectClasses (sizes must match)
-        for ( int ii = 0; ii < ocd0.getSuperiorObjectClasses().size(); ii++ )
+        for ( int i = 0; i < oc0.getSuperiorOids().size(); i++ )
         {
-            if ( ! ocd0.getSuperiorObjectClasses().get( ii ).equals( ocd1.getSuperiorObjectClasses().get( ii ) ) )
+            if ( ! oc0.getSuperiorOids().get( i ).equals( oc1.getSuperiorOids().get( i ) ) )
             {
                 return false;
             }
         }
         
         // compare the must attributes (sizes must match)
-        for ( int ii = 0; ii < ocd0.getMustAttributeTypes().size(); ii++ )
+        for ( int i = 0; i < oc0.getMustAttributeTypeOids().size(); i++ )
         {
-            if ( ! ocd0.getMustAttributeTypes().get( ii ).equals( ocd1.getMustAttributeTypes().get( ii ) ) )
+            if ( ! oc0.getMustAttributeTypeOids().get( i ).equals( oc1.getMustAttributeTypeOids().get( i ) ) )
             {
                 return false;
             }
         }
         
         // compare the may attributes (sizes must match)
-        for ( int ii = 0; ii < ocd0.getMayAttributeTypes().size(); ii++ )
+        for ( int i = 0; i < oc0.getMayAttributeTypeOids().size(); i++ )
         {
-            if ( ! ocd0.getMayAttributeTypes().get( ii ).equals( ocd1.getMayAttributeTypes().get( ii ) ) )
+            if ( ! oc0.getMayAttributeTypeOids().get( i ).equals( oc1.getMayAttributeTypeOids().get( i ) ) )
             {
                 return false;
             }
@@ -91,76 +99,76 @@
     
     
     /**
-     * Checks two schema attributeType descriptions for an exact match.
+     * Checks two schema attributeTypes for an exact match.
      *
-     * @param atd0 the first attributeType description to compare
-     * @param atd1 the second attributeType description to compare
-     * @return true if both attributeType descriptions match exactly, false otherwise
+     * @param atd0 the first attributeType to compare
+     * @param atd1 the second attributeType to compare
+     * @return true if both attributeTypes match exactly, false otherwise
      */
-    public static boolean attributeTypesMatch( AttributeTypeDescription atd0, AttributeTypeDescription atd1 )
+    public static boolean attributeTypesMatch( AttributeType at0, AttributeType at1 )
     {
         // compare all common description parameters
-        if ( ! descriptionsMatch( atd0, atd1 ) )
+        if ( ! descriptionsMatch( at0, at1 ) )
         {
             return false;
         }
 
         // check that the same super type is being used for both attributes
-        if ( ! atd0.getSuperType().equals( atd1.getSuperType() ) )
+        if ( ! at0.getSuperiorOid().equals( at1.getSuperiorOid() ) )
         {
             return false;
         }
         
         // check that the same matchingRule is used by both ATs for EQUALITY
-        if ( ! atd0.getEqualityMatchingRule().equals( atd1.getEqualityMatchingRule() ) )
+        if ( ! at0.getEqualityOid().equals( at1.getEqualityOid() ) )
         {
             return false;
         }
         
         // check that the same matchingRule is used by both ATs for SUBSTRING
-        if ( ! atd0.getSubstringsMatchingRule().equals( atd1.getSubstringsMatchingRule() ) )
+        if ( ! at0.getSubstringOid().equals( at1.getSubstringOid() ) )
         {
             return false;
         }
         
         // check that the same matchingRule is used by both ATs for ORDERING
-        if ( ! atd0.getOrderingMatchingRule().equals( atd1.getOrderingMatchingRule() ) )
+        if ( ! at0.getOrderingOid().equals( at1.getOrderingOid() ) )
         {
             return false;
         }
         
         // check that the same syntax is used by both ATs
-        if ( ! atd0.getSyntax().equals( atd1.getSyntax() ) )
+        if ( ! at0.getSyntaxOid().equals( at1.getSyntaxOid() ) )
         {
             return false;
         }
         
         // check that the syntax length constraint is the same for both
-        if ( atd0.getSyntaxLength() != atd1.getSyntaxLength() )
+        if ( at0.getSyntaxLength() != at1.getSyntaxLength() )
         {
             return false;
         }
         
         // check that the ATs have the same single valued flag value
-        if ( atd0.isSingleValued() != atd1.isSingleValued() )
+        if ( at0.isSingleValued() != at1.isSingleValued() )
         {
             return false;
         }
         
         // check that the ATs have the same collective flag value
-        if ( atd0.isCollective() != atd1.isCollective() )
+        if ( at0.isCollective() != at1.isCollective() )
         {
             return false;
         }
         
         // check that the ATs have the same user modifiable flag value
-        if ( atd0.isUserModifiable() != atd1.isUserModifiable() )
+        if ( at0.isUserModifiable() != at1.isUserModifiable() )
         {
             return false;
         }
         
         // check that the ATs have the same USAGE
-        if ( atd0.getUsage() != atd1.getUsage() )
+        if ( at0.getUsage() != at1.getUsage() )
         {
             return false;
         }
@@ -170,22 +178,22 @@
     
     
     /**
-     * Checks to see if two matchingRule descriptions match exactly.
+     * Checks to see if two matchingRule match exactly.
      *
-     * @param mrd0 the first matchingRule description to compare
-     * @param mrd1 the second matchingRule description to compare
+     * @param mrd0 the first matchingRule to compare
+     * @param mrd1 the second matchingRule to compare
      * @return true if the matchingRules match exactly, false otherwise
      */
-    public static boolean matchingRulesMatch( MatchingRuleDescription mrd0, MatchingRuleDescription mrd1 )
+    public static boolean matchingRulesMatch( MatchingRule matchingRule0, MatchingRule matchingRule1 )
     {
         // compare all common description parameters
-        if ( ! descriptionsMatch( mrd0, mrd1 ) )
+        if ( ! descriptionsMatch( matchingRule0, matchingRule1 ) )
         {
             return false;
         }
 
         // check that the syntaxes of the matchingRules match
-        if ( ! mrd0.getSyntax().equals( mrd1.getSyntax() ) )
+        if ( ! matchingRule0.getSyntaxOid().equals( matchingRule1.getSyntaxOid() ) )
         {
             return false;
         }
@@ -195,15 +203,15 @@
     
     
     /**
-     * Checks to see if two syntax descriptions match exactly.
+     * Checks to see if two syntax match exactly.
      *
-     * @param lsd0 the first syntax description to compare
-     * @param lsd1 the second syntax description to compare
+     * @param ldapSyntax0 the first ldapSyntax to compare
+     * @param ldapSyntax1 the second ldapSyntax to compare
      * @return true if the syntaxes match exactly, false otherwise
      */
-    public static boolean syntaxesMatch( LdapSyntaxDescription lsd0, LdapSyntaxDescription lsd1 )
+    public static boolean syntaxesMatch( LdapSyntax ldapSyntax0, LdapSyntax ldapSyntax1 )
     {
-        return descriptionsMatch( lsd0, lsd1 );
+        return descriptionsMatch( ldapSyntax0, ldapSyntax1 );
     }
     
     
@@ -213,41 +221,41 @@
      * not compared because doing so would raise an exception since syntax 
      * descriptions do not support the OBSOLETE flag.
      * 
-     * @param asd0 the first schema description to compare 
-     * @param asd1 the second schema description to compare 
+     * @param lsd0 the first schema description to compare 
+     * @param lsd1 the second schema description to compare 
      * @return true if the descriptions match exactly, false otherwise
      */
-    public static boolean descriptionsMatch( AbstractSchemaDescription asd0, AbstractSchemaDescription asd1 )
+    public static boolean descriptionsMatch( SchemaObject so0, SchemaObject so1 )
     {
         // check that the OID matches
-        if ( ! asd0.getNumericOid().equals( asd1.getNumericOid() ) )
+        if ( ! so0.getOid().equals( so1.getOid() ) )
         {
             return false;
         }
         
         // check that the obsolete flag is equal but not for syntaxes
-        if ( ( asd0 instanceof LdapSyntaxDescription ) || ( asd1 instanceof LdapSyntaxDescription ) )
+        if ( ( so0 instanceof LdapSyntax ) || ( so1 instanceof LdapSyntax ) )
         {
-            if ( asd0.isObsolete() != asd1.isObsolete() )
+            if ( so0.isObsolete() != so1.isObsolete() )
             {
                 return false;
             }
         }
         
         // check that the description matches
-        if ( ! asd0.getDescription().equals( asd1.getDescription() ) )
+        if ( ! so0.getDescription().equals( so1.getDescription() ) )
         {
             return false;
         }
         
         // check alias names for exact match
-        if ( ! aliasNamesMatch( asd0, asd1 ) )
+        if ( ! aliasNamesMatch( so0, so1 ) )
         {
             return false;
         }
         
         // check extensions for exact match
-        if ( ! extensionsMatch( asd0, asd1 ) )
+        if ( ! extensionsMatch( so0, so1 ) )
         {
             return false;
         }
@@ -261,23 +269,23 @@
      * description.  The order of the extension values must match for a true
      * return.
      *
-     * @param asd0 the first schema description to compare the extensions of
-     * @param asd1 the second schema description to compare the extensions of
+     * @param lsd0 the first schema description to compare the extensions of
+     * @param lsd1 the second schema description to compare the extensions of
      * @return true if the extensions match exactly, false otherwise
      */
-    public static boolean extensionsMatch( AbstractSchemaDescription asd0, AbstractSchemaDescription asd1 )
+    public static boolean extensionsMatch( SchemaObject lsd0, SchemaObject lsd1 )
     {
         // check sizes first
-        if ( asd0.getExtensions().size() != asd1.getExtensions().size() )
+        if ( lsd0.getExtensions().size() != lsd1.getExtensions().size() )
         {
             return false;
         }
         
         // check contents and order of extension values must match
-        for ( String key : asd0.getExtensions().keySet() )
+        for ( String key : lsd0.getExtensions().keySet() )
         {
-            List<String> values0 = asd0.getExtensions().get( key );
-            List<String> values1 = asd1.getExtensions().get( key );
+            List<String> values0 = lsd0.getExtensions().get( key );
+            List<String> values1 = lsd1.getExtensions().get( key );
             
             // if the key is not present in asd1
             if ( values1 == null )
@@ -285,9 +293,9 @@
                 return false;
             }
             
-            for ( int ii = 0; ii < values0.size(); ii++ )
+            for ( int i = 0; i < values0.size(); i++ )
             {
-                if ( ! values0.get( ii ).equals( values1.get( ii ) ) )
+                if ( ! values0.get( i ).equals( values1.get( i ) ) )
                 {
                     return false;
                 }
@@ -306,18 +314,18 @@
      * @param asd1 the schema description to compare
      * @return true if alias names match exactly, false otherwise
      */
-    public static boolean aliasNamesMatch( AbstractSchemaDescription asd0, AbstractSchemaDescription asd1 )
+    public static boolean aliasNamesMatch( SchemaObject so0, SchemaObject so1 )
     {
         // check sizes first
-        if ( asd0.getNames().size() != asd1.getNames().size() )
+        if ( so0.getNames().size() != so1.getNames().size() )
         {
             return false;
         }
         
         // check contents and order must match too
-        for ( int ii = 0; ii < asd0.getNames().size(); ii++ )
+        for ( int i = 0; i < so0.getNames().size(); i++ )
         {
-            if ( ! asd0.getNames().get( ii ).equals( asd1.getNames().get( ii ) ) )
+            if ( ! so0.getNames().get( i ).equals( so1.getNames().get( i ) ) )
             {
                 return false;
             }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/SyntaxCheckerDescription.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/SyntaxCheckerDescription.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/SyntaxCheckerDescription.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/SyntaxCheckerDescription.java Wed Jan  6 17:52:15 2010
@@ -20,6 +20,9 @@
 
 package org.apache.directory.shared.ldap.schema.parsers;
 
+import org.apache.directory.shared.ldap.schema.LoadableSchemaObject;
+import org.apache.directory.shared.ldap.schema.SchemaObjectType;
+
 
 /**
  * An ApacheDS specific schema description for a SyntaxChecker.
@@ -27,7 +30,26 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class SyntaxCheckerDescription extends AbstractAdsSchemaDescription
+public class SyntaxCheckerDescription extends LoadableSchemaObject
 {
+	/** SerialVersionUID */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Default constructor for a SyntaxCheckerDecription
+	 * @param oid The SyntaxChecker OID
+	 */
+	public SyntaxCheckerDescription( String oid ) 
+	{
+		super( SchemaObjectType.SYNTAX_CHECKER, oid );
+	}
 
+    
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        return "SyntaxChecker description : " + getDescription();
+    }
 }



Mime
View raw message