directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r808050 [1/2] - in /directory/shared/branches/shared-schema/ldap/src: main/antlr/ main/java/org/apache/directory/shared/ldap/schema/ main/java/org/apache/directory/shared/ldap/schema/parsers/ test/java/org/apache/directory/shared/ldap/schem...
Date Wed, 26 Aug 2009 15:22:34 GMT
Author: elecharny
Date: Wed Aug 26 15:22:31 2009
New Revision: 808050

URL: http://svn.apache.org/viewvc?rev=808050&view=rev
Log:
o Added the ObjectClass class
o Fixed the parsers
o Fixed some of the other SchemaObjects
o Many other fixes

Modified:
    directory/shared/branches/shared-schema/ldap/src/main/antlr/schema.g
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITContentRule.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRuleUse.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/NameForm.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClass.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/AttributeTypeDescriptionSchemaParser.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/DITContentRuleDescriptionSchemaParser.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/DITStructureRuleDescriptionSchemaParser.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapSyntaxDescriptionSchemaParser.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleDescriptionSchemaParser.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleUseDescriptionSchemaParser.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/NameFormDescriptionSchemaParser.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/NormalizerDescriptionSchemaParser.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/ObjectClassDescriptionSchemaParser.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/SyntaxCheckerDescriptionSchemaParser.java
    directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/ObjectClassDescriptionSchemaParserTest.java

Modified: directory/shared/branches/shared-schema/ldap/src/main/antlr/schema.g
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/antlr/schema.g?rev=808050&r1=808049&r2=808050&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/antlr/schema.g (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/antlr/schema.g Wed Aug 26 15:22:31
2009
@@ -36,12 +36,11 @@
 import org.apache.directory.shared.ldap.schema.parsers.NormalizerDescription;
 import org.apache.directory.shared.ldap.schema.parsers.ParserMonitor;
 import org.apache.directory.shared.ldap.schema.AttributeType;
-import org.apache.directory.shared.ldap.schema.parsers.ObjectClassDescription;
+import org.apache.directory.shared.ldap.schema.ObjectClass;
 import org.apache.directory.shared.ldap.schema.parsers.SyntaxCheckerDescription;
 import org.apache.directory.shared.ldap.schema.syntaxChecker.OpenLdapObjectIdentifierMacro;
 import org.apache.directory.shared.ldap.schema.ObjectClassTypeEnum;
 import org.apache.directory.shared.ldap.schema.UsageEnum;
-import org.apache.directory.shared.ldap.schema.registries.Registries;
 
 }
 
@@ -247,7 +246,7 @@
 openLdapSchema returns [List<Object> list = new ArrayList<Object>()]
     {
         AttributeType attributeType = null;
-        ObjectClassDescription ocd = null;
+        ObjectClass objectClass = null;
         OpenLdapObjectIdentifierMacro oloid = null;
     }
     :
@@ -256,7 +255,7 @@
         |
         attributeType = openLdapAttributeType { list.add( attributeType ); }
         |
-        ocd = openLdapObjectClass { list.add( ocd ); }
+        objectClass = openLdapObjectClass { list.add( objectClass ); }
     )*
     ;
 
@@ -277,14 +276,14 @@
     ;
     
 
-openLdapObjectClass returns [ObjectClassDescription ocd]
+openLdapObjectClass returns [ObjectClass objectClass]
     {
         matchedProduction( "openLdapObjectClass()" );
     }
     :
     (
         OBJECTCLASS
-        ( ocd=objectClassDescription )
+        ( objectClass=objectClassDescription )
     )
     ;
     
@@ -323,37 +322,37 @@
      * xstring = "X" HYPHEN 1*( ALPHA / HYPHEN / USCORE ) 
      * </pre>
     */
-objectClassDescription returns [ObjectClassDescription ocd = new ObjectClassDescription()]
+objectClassDescription returns [ObjectClass objectClass]
     {
         matchedProduction( "objectClassDescription()" );
         ElementTracker et = new ElementTracker();
     }
     :
-    ( oid:STARTNUMERICOID { ocd.setNumericOid(numericoid(oid.getText())); } )
+    ( oid:STARTNUMERICOID { objectClass = new ObjectClass(numericoid(oid.getText())); } )
     (
-        ( name:NAME { et.track("NAME", name); ocd.setNames(qdescrs(name.getText())); } )
+        ( name:NAME { et.track("NAME", name); objectClass.setNames(qdescrs(name.getText()));
} )
         |
-        ( desc:DESC { et.track("DESC", desc); ocd.setDescription(qdstring(desc.getText()));
} )
+        ( desc:DESC { et.track("DESC", desc); objectClass.setDescription(qdstring(desc.getText()));
} )
         |
-        ( obsolete:OBSOLETE { et.track("OBSOLETE", obsolete); ocd.setObsolete( true ); }
)
+        ( obsolete:OBSOLETE { et.track("OBSOLETE", obsolete); objectClass.setObsolete( true
); } )
         |
-        ( sup:SUP { et.track("SUP", sup); ocd.setSuperiorObjectClasses(oids(sup.getText()));
} )
+        ( sup:SUP { et.track("SUP", sup); objectClass.setSuperiorOids(oids(sup.getText()));
} )
         |
-        ( kind1:ABSTRACT { et.track("KIND", kind1); ocd.setKind( ObjectClassTypeEnum.ABSTRACT
); }
+        ( kind1:ABSTRACT { et.track("KIND", kind1); objectClass.setType( ObjectClassTypeEnum.ABSTRACT
); }
           |
-          kind2:STRUCTURAL { et.track("KIND", kind2); ocd.setKind( ObjectClassTypeEnum.STRUCTURAL
); }
+          kind2:STRUCTURAL { et.track("KIND", kind2); objectClass.setType( ObjectClassTypeEnum.STRUCTURAL
); }
           |
-          kind3:AUXILIARY { et.track("KIND", kind3); ocd.setKind( ObjectClassTypeEnum.AUXILIARY
); } 
+          kind3:AUXILIARY { et.track("KIND", kind3); objectClass.setType( ObjectClassTypeEnum.AUXILIARY
); } 
         )
         |
-        ( must:MUST { et.track("MUST", must); ocd.setMustAttributeTypes(oids(must.getText()));
} )
+        ( must:MUST { et.track("MUST", must); objectClass.setMustAttributeTypeOids(oids(must.getText()));
} )
         |
-        ( may:MAY { et.track("MAY", may); ocd.setMayAttributeTypes(oids(may.getText()));
} )
+        ( may:MAY { et.track("MAY", may); objectClass.setMayAttributeTypeOids(oids(may.getText()));
} )
         |
         ( extension:EXTENSION { 
             Extension ex = extension(extension.getText());
             et.track(ex.key, extension); 
-            ocd.addExtension(ex.key, ex.values); 
+            objectClass.addExtension(ex.key, ex.values); 
          } )
     )*    
     RPAR

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITContentRule.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITContentRule.java?rev=808050&r1=808049&r2=808050&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITContentRule.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITContentRule.java
Wed Aug 26 15:22:31 2009
@@ -158,6 +158,11 @@
         mustAttributeTypeOids = new ArrayList<String>();
         notAttributeTypeOids = new ArrayList<String>();
         auxObjectClassOids = new ArrayList<String>();
+
+        mayAttributeTypes = new ArrayList<AttributeType>();
+        mustAttributeTypes = new ArrayList<AttributeType>();
+        notAttributeTypes = new ArrayList<AttributeType>();
+        auxObjectClasses = new ArrayList<ObjectClass>();
     }
 
     

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRuleUse.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRuleUse.java?rev=808050&r1=808049&r2=808050&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRuleUse.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRuleUse.java
Wed Aug 26 15:22:31 2009
@@ -104,6 +104,7 @@
         super(  SchemaObjectType.MATCHING_RULE_USE, oid );
         
         applicableAttributeOids = new ArrayList<String>();
+        applicableAttributes = new ArrayList<AttributeType>();
     }
     
 

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/NameForm.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/NameForm.java?rev=808050&r1=808049&r2=808050&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/NameForm.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/NameForm.java
Wed Aug 26 15:22:31 2009
@@ -64,7 +64,7 @@
  *     NameFormDescription = LPAREN WSP
  *         numericoid                ; object identifier
  *         [ SP &quot;NAME&quot; SP qdescrs ]  ; short names (descriptors)
- *         [ SP &quot;DESC&quot; SP qdstring ] ; description
+ *         [ SP &quot;DESC&quot; SP qdstring ] ;String description
  *         [ SP &quot;OBSOLETE&quot; ]         ; not active
  *         SP &quot;OC&quot; SP oid            ; structural object class
  *         SP &quot;MUST&quot; SP oids         ; attribute types
@@ -87,7 +87,7 @@
  *   shall be different.
  * </pre>
  * 
- * @see <a href="http://www.faqs.org/rfcs/rfc2252.html">RFC2252 Section 6.22</a>
+ * @see <a href="http://www.faqs.org/rfcs/rfc225String2.html">RFC2252 Section 6.22</a>
  * @see <a
  *      href="http://www.ietf.org/internet-drafts/draft-ietf-ldapbis-models-11.txt">ldapbis
  *      [MODELS]</a>
@@ -131,6 +131,9 @@
         
         mustAttributeTypeOids = new ArrayList<String>();
         mayAttributeTypeOids = new ArrayList<String>();
+
+        mustAttributeTypes = new ArrayList<AttributeType>();
+        mayAttributeTypes = new ArrayList<AttributeType>();
     }
     
     

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClass.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClass.java?rev=808050&r1=808049&r2=808050&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClass.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClass.java
Wed Aug 26 15:22:31 2009
@@ -20,6 +20,7 @@
 package org.apache.directory.shared.ldap.schema;
 
 
+import java.util.ArrayList;
 import java.util.List;
 
 import javax.naming.NamingException;
@@ -71,118 +72,370 @@
  */
 public class ObjectClass extends SchemaObject
 {
+    /** The serialVersionUID */
+    private static final long serialVersionUID = 1L;
+
+    /** The ObjectClass type : ABSTRACT, AUXILIARY or STRUCTURAL */
+    private ObjectClassTypeEnum objectClassType = ObjectClassTypeEnum.STRUCTURAL;
+    
+    /** The ObjectClass superior OIDs */
+    private List<String> superiorOids;
+
+    /** The ObjectClass superiors */
+    private List<ObjectClass> superiors;
+
+    /** The list of allowed AttributeType OIDs */
+    private List<String> mayAttributeTypeOids;
+
+    /** The list of allowed AttributeTypes */
+    private List<AttributeType> mayAttributeTypes;
+
+    /** The list of required AttributeType OIDs */
+    private List<String> mustAttributeTypeOids;
+
+    /** The list of required AttributeTypes */
+    private List<AttributeType> mustAttributeTypes;
+
     /**
-     * Gets the superclasses of this ObjectClass.
-     * 
-     * @return the superclasses
-     * @throws NamingException
-     *             if there is a failure resolving the object
+     * Creates a new instance of MatchingRuleUseDescription
      */
-    ObjectClass[] getSuperClasses() throws NamingException;
+    public ObjectClass( String oid )
+    {
+        super(  SchemaObjectType.OBJECT_CLASS, oid );
+        
+        mayAttributeTypeOids = new ArrayList<String>();
+        mustAttributeTypeOids = new ArrayList<String>();
+        superiorOids = new ArrayList<String>();
 
+        mayAttributeTypes = new ArrayList<AttributeType>();
+        mustAttributeTypes = new ArrayList<AttributeType>();
+        superiors = new ArrayList<ObjectClass>();
+    }
 
+    
     /**
-     * Gets the type of this ObjectClass as a type safe enum.
-     * 
-     * @return the ObjectClass type as an enum
+     * @return the mayAttributeTypeOids
      */
-    ObjectClassTypeEnum getType();
+    public List<String> getMayAttributeTypeOids()
+    {
+        return mayAttributeTypeOids;
+    }
+
+
+    /**
+     * @return the mayAttributeTypes
+     */
+    public List<AttributeType> getMayAttributeTypes()
+    {
+        return mayAttributeTypes;
+    }
+
     
+    /**
+     * Add an allowed AttributeType
+     *
+     * @param oid The attributeType oid
+     */
+    public void addMayAttributeTypeOids( String oid )
+    {
+        if ( !isReadOnly )
+        {
+            mayAttributeTypeOids.add( oid );
+        }
+    }
+
+
+    /**
+     * Add an allowed AttributeType
+     *
+     * @param attributeType The attributeType
+     */
+    public void addMayAttributeTypes( AttributeType attributeType )
+    {
+        if ( !isReadOnly )
+        {
+            if ( ! mayAttributeTypeOids.contains( attributeType.getOid() ) )
+            {
+                mayAttributeTypes.add( attributeType );
+                mayAttributeTypeOids.add( attributeType.getOid() );
+            }
+        }
+    }
+
     
     /**
-     * Set the ObjectClass type, one of ABSTRACT, AUXILIARY or STRUCTURAL.
-     * 
-     * @param type The ObjectClassType value
+     * @param mayAttributeTypeOids the mayAttributeTypeOids to set
      */
-    void setType( ObjectClassTypeEnum type );
+    public void setMayAttributeTypeOids( List<String> mayAttributeTypeOids )
+    {
+        if ( !isReadOnly )
+        {
+            this.mayAttributeTypeOids = mayAttributeTypeOids;
+        }
+    }
     
     
     /**
-     * Tells if the current ObjectClass is STRUCTURAL
-     * 
-     * @return <code>true</code> if the ObjectClass is STRUCTURAL
-     */
-    boolean isStructural();
+     * Sets the list of allowed AttributeTypes
+     *
+     * @param mayAttributeTypes the list of allowed AttributeTypes
+     */
+    public void setMayAttributeTypes( List<AttributeType> mayAttributeTypes )
+    {
+        if ( !isReadOnly )
+        {
+            this.mayAttributeTypes = mayAttributeTypes;
+            
+            // update the OIDS now
+            mayAttributeTypeOids.clear();
+            
+            for ( AttributeType may : mayAttributeTypes )
+            {
+                mayAttributeTypeOids.add( may.getOid() );
+            }
+        }
+    }
+
+
+    /**
+     * @return the mustAttributeTypeOids
+     */
+    public List<String> getMustAttributeTypeOids()
+    {
+        return mustAttributeTypeOids;
+    }
+
+
+    /**
+     * @return the mustAttributeTypes
+     */
+    public List<AttributeType> getMustAttributeTypes()
+    {
+        return mustAttributeTypes;
+    }
+
     
+    /**
+     * Add a required AttributeType OID
+     *
+     * @param oid The attributeType OID
+     */
+    public void addMustAttributeTypeOids( String oid )
+    {
+        if ( !isReadOnly )
+        {
+            mustAttributeTypeOids.add( oid );
+        }
+    }
+
 
     /**
-     * Tells if the current ObjectClass is ABSTRACT
+     * Add a required AttributeType
+     *
+     * @param attributeType The attributeType
+     */
+    public void addMustAttributeTypes( AttributeType attributeType )
+    {
+        if ( !isReadOnly )
+        {
+            if ( ! mustAttributeTypeOids.contains( attributeType.getOid() ) )
+            {
+                mustAttributeTypes.add( attributeType );
+                mustAttributeTypeOids.add( attributeType.getOid() );
+            }
+        }
+    }
+
+
+    /**
+     * @param mustAttributeTypeOids the mustAttributeTypeOids to set
+     */
+    public void setMustAttributeTypeOids( List<String> mustAttributeTypeOids )
+    {
+        if ( !isReadOnly )
+        {
+            this.mustAttributeTypeOids = mustAttributeTypeOids;
+        }
+    }
+
+    
+    /**
+     * Sets the list of required AttributeTypes
+     *
+     * @param mayAttributeTypes the list of required AttributeTypes
+     */
+    public void setMustAttributeTypes( List<AttributeType> mustAttributeTypes )
+    {
+        if ( !isReadOnly )
+        {
+            this.mustAttributeTypes = mustAttributeTypes;
+            
+            // update the OIDS now
+            mustAttributeTypeOids.clear();
+            
+            for ( AttributeType may : mustAttributeTypes )
+            {
+                mustAttributeTypeOids.add( may.getOid() );
+            }
+        }
+    }
+    
+    
+    /**
+     * Gets the superclasses of this ObjectClass.
      * 
-     * @return <code>true</code> if the ObjectClass is ABSTRACT
+     * @return the superclasses
+     * @throws NamingException if there is a failure resolving the object
      */
-    boolean isAbstract();
-    
+    public List<ObjectClass> getSuperiors() throws NamingException
+    {
+        return superiors;
+    }
 
+    
     /**
-     * Tells if the current ObjectClass is AUXILIARY
+     * Gets the superclasses OIDsof this ObjectClass.
      * 
-     * @return <code>true</code> if the ObjectClass is AUXILIARY
+     * @return the superclasses OIDs
+     * @throws NamingException if there is a failure resolving the object
      */
-    boolean isAuxiliary();
+    public List<String> getSuperiorOids() throws NamingException
+    {
+        return superiorOids;
+    }
+
+
+    /**
+     * Add some superior ObjectClass OIDs
+     *
+     * @param oids The superior ObjectClass OIDs
+     */
+    public void addSuperiorOids( String... oids )
+    {
+        if ( !isReadOnly )
+        {
+            for ( String oid : oids )
+            {
+                if ( !superiorOids.contains( oid ) )
+                {
+                    superiorOids.add( oid );
+                }
+            }
+        }
+    }
 
 
     /**
-     * Gets the AttributeTypes OIDs whose attributes must be present within an entry
-     * of this ObjectClass.
+     * Add some superior ObjectClasses
+     *
+     * @param objectClasses The superior ObjectClasses
+     */
+    public void addSuperior( ObjectClass... objectClasses )
+    {
+        if ( !isReadOnly )
+        {
+            for ( ObjectClass objectClass : objectClasses )
+            {
+                if ( !superiorOids.contains( objectClass.getOid() ) )
+                {
+                    superiorOids.add( objectClass.getOid() );
+                    superiors.add( objectClass );
+                }
+            }
+        }
+    }
+
+    
+    /**
+     * Sets the superior object classes
      * 
-     * @return the OIDs of attributes that must be within entries of
-     *         this ObjectClass
-     * @throws NamingException if there is a failure resolving the object
+     * @param oids the object classes to set
      */
-    List<String> getMustOids() throws NamingException;
+    public void setSuperiors( List<ObjectClass> superiors )
+    {
+        if ( !isReadOnly )
+        {
+            this.superiors = superiors;
+            
+            // update the OIDS now
+            superiorOids.clear();
+            
+            for ( ObjectClass oc : superiors )
+            {
+                superiorOids.add( oc.getOid() );
+            }
+        }
+    }
 
+    
+    /**
+     * Sets the superior object class OIDs
+     * 
+     * @param oids the object class OIDs to set
+     */
+    public void setSuperiorOids( List<String> superiorOids )
+    {
+        if ( !isReadOnly )
+        {
+            this.superiorOids = superiorOids;
+        }
+    }
+    
 
     /**
-     * Gets the AttributeTypes whose attributes must be present within an entry
-     * of this ObjectClass.
+     * Gets the type of this ObjectClass as a type safe enum.
      * 
-     * @return the AttributeTypes that must be within entries of
-     *         this ObjectClass
-     * @throws NamingException if there is a failure resolving the object
+     * @return the ObjectClass type as an enum
      */
-    List<AttributeType> getMustATs() throws NamingException;
+    public ObjectClassTypeEnum getType()
+    {
+        return objectClassType;
+    }
     
     
     /**
-     * Sets the attributeTypes' OID which must be present within an entry
-     * of this ObjectClass
+     * Set the ObjectClass type, one of ABSTRACT, AUXILIARY or STRUCTURAL.
      * 
-     * @param oids The list of OIDs representing the MUST AttributeTypes
-     * @throws NamingException If the addition failed
+     * @param type The ObjectClassType value
      */
-    void setMustOids( List<String> oids ) throws NamingException;
-
-
+    public void setType( ObjectClassTypeEnum objectClassType )
+    {
+        if ( !isReadOnly )
+        {
+            this.objectClassType = objectClassType;
+        }
+    }
+    
+    
     /**
-     * Gets the AttributeType OIDs whose attributes may be present within an entry
-     * of this ObjectClass.
+     * Tells if the current ObjectClass is STRUCTURAL
      * 
-     * @return the OIDs of attributes that may be within entries of
-     *         this ObjectClass
-     * @throws NamingException
-     *             if there is a failure resolving the object
+     * @return <code>true</code> if the ObjectClass is STRUCTURAL
      */
-    List<String> getMayOids() throws NamingException;
-
+    public boolean isStructural()
+    {
+        return objectClassType == ObjectClassTypeEnum.STRUCTURAL;
+    }
+    
 
     /**
-     * Gets the AttributeType whose attributes may be present within an entry
-     * of this ObjectClass.
+     * Tells if the current ObjectClass is ABSTRACT
      * 
-     * @return the AttributeTypes that may be within entries of
-     *         this ObjectClass
-     * @throws NamingException
-     *             if there is a failure resolving the object
+     * @return <code>true</code> if the ObjectClass is ABSTRACT
      */
-    List<AttributeType> getMayATs() throws NamingException;
-    
+    public boolean isAbstract()
+    {
+        return objectClassType == ObjectClassTypeEnum.ABSTRACT;
+    }
     
+
     /**
-     * Sets the attributeTypes' OID which may be present within an entry
-     * of this ObjectClass
+     * Tells if the current ObjectClass is AUXILIARY
      * 
-     * @param oids The list of OIDs representing the MAY AttributeTypes
-     * @throws NamingException If the addition failed
+     * @return <code>true</code> if the ObjectClass is AUXILIARY
      */
-    void setMayOids( List<String> oids ) throws NamingException;
+    public boolean isAuxiliary()
+    {
+        return objectClassType == ObjectClassTypeEnum.AUXILIARY;
+    }
 }
\ No newline at end of file

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java?rev=808050&r1=808049&r2=808050&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java
Wed Aug 26 15:22:31 2009
@@ -32,7 +32,6 @@
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.Value;
-import org.apache.directory.shared.ldap.schema.parsers.AbstractAdsSchemaDescription;
 import org.apache.directory.shared.ldap.schema.parsers.AbstractSchemaDescription;
 import org.apache.directory.shared.ldap.schema.parsers.AttributeTypeDescription;
 import org.apache.directory.shared.ldap.util.StringTools;
@@ -345,10 +344,10 @@
         StringBuffer buf = new StringBuffer();
         buf.append( "( " ).append( oc.getOid() );
 
-        if ( oc.getNamesRef() != null && oc.getNamesRef().length > 0 )
+        if ( oc.getNames() != null && oc.getNames().size() > 0 )
         {
             buf.append( " NAME " );
-            render( buf, oc.getNamesRef() ).append( " " );
+            render( buf, oc.getNames() ).append( " " );
         }
         else
         {
@@ -389,7 +388,7 @@
         }
 
         buf.append( " X-SCHEMA '" );
-        buf.append( oc.getSchema() );
+        buf.append( oc.getSchemaName() );
         buf.append( "'" );
 
         // @todo extensions are not presently supported and skipped
@@ -464,10 +463,10 @@
         StringBuffer buf = new StringBuffer();
         buf.append( "( " ).append( at.getOid() );
 
-        if ( at.getNamesRef() != null && at.getNamesRef().length > 0 )
+        if ( at.getNames() != null && at.getNames().size() > 0 )
         {
             buf.append( " NAME " );
-            render( buf, at.getNamesRef() ).append( " " );
+            render( buf, at.getNames() ).append( " " );
         }
         else
         {
@@ -484,9 +483,9 @@
             buf.append( " OBSOLETE" );
         }
 
-        if ( at.getSuperior() != null )
+        if ( at.getSup() != null )
         {
-            buf.append( " SUP " ).append( at.getSuperior().getName() );
+            buf.append( " SUP " ).append( at.getSup().getName() );
         }
 
         if ( at.getEquality() != null )
@@ -535,7 +534,7 @@
         }
 
         buf.append( " X-SCHEMA '" );
-        buf.append( at.getSchema() );
+        buf.append( at.getSchemaName() );
         buf.append( "'" );
 
         // @todo extensions are not presently supported and skipped
@@ -787,10 +786,10 @@
         StringBuffer buf = new StringBuffer();
         buf.append( "( " ).append( mr.getOid() );
 
-        if ( mr.getNamesRef() != null && mr.getNamesRef().length > 0 )
+        if ( mr.getNames() != null && mr.getNames().size() > 0 )
         {
             buf.append( " NAME " );
-            render( buf, mr.getNamesRef() ).append( " " );
+            render( buf, mr.getNames() ).append( " " );
         }
         else
         {
@@ -813,7 +812,7 @@
         }
 
         buf.append( " X-SCHEMA '" );
-        buf.append( mr.getSchema() );
+        buf.append( mr.getSchemaName() );
         buf.append( "'" );
 
         // @todo extensions are not presently supported and skipped
@@ -886,7 +885,7 @@
     {
         StringBuffer buf = new StringBuffer();
         buf.append( "( " ).append( mru.getOid() ).append( " NAME " );
-        render( buf, mru.getNamesRef() ).append( " " );
+        render( buf, mru.getNames() ).append( " " );
 
         if ( mru.getDescription() != null )
         {
@@ -894,7 +893,7 @@
         }
 
         buf.append( " X-SCHEMA '" );
-        buf.append( mru.getSchema() );
+        buf.append( mru.getSchemaName() );
         buf.append( "'" );
 
         // @todo extensions are not presently supported and skipped
@@ -913,7 +912,7 @@
     {
         StringBuffer buf = new StringBuffer();
         buf.append( "( " ).append( dcr.getOid() ).append( " NAME " );
-        render( buf, dcr.getNamesRef() ).append( " " );
+        render( buf, dcr.getNames() ).append( " " );
 
         if ( dcr.getDescription() != null )
         {
@@ -921,7 +920,7 @@
         }
 
         buf.append( " X-SCHEMA '" );
-        buf.append( dcr.getSchema() );
+        buf.append( dcr.getSchemaName() );
         buf.append( "'" );
 
         // @todo extensions are not presently supported and skipped
@@ -940,7 +939,7 @@
     {
         StringBuffer buf = new StringBuffer();
         buf.append( "( " ).append( dsr.getOid() ).append( " NAME " );
-        render( buf, dsr.getNamesRef() ).append( " " );
+        render( buf, dsr.getNames() ).append( " " );
 
         if ( dsr.getDescription() != null )
         {
@@ -948,7 +947,7 @@
         }
 
         buf.append( " X-SCHEMA '" );
-        buf.append( dsr.getSchema() );
+        buf.append( dsr.getSchemaName() );
         buf.append( "' )" );
 
         return buf;
@@ -962,7 +961,7 @@
     {
         StringBuffer buf = new StringBuffer();
         buf.append( "( " ).append( nf.getOid() ).append( " NAME " );
-        render( buf, nf.getNamesRef() ).append( " " );
+        render( buf, nf.getNames() ).append( " " );
 
         if ( nf.getDescription() != null )
         {
@@ -970,7 +969,7 @@
         }
 
         buf.append( " X-SCHEMA '" );
-        buf.append( nf.getSchema() );
+        buf.append( nf.getSchemaName() );
         buf.append( "' )" );
 
         return buf;
@@ -985,10 +984,10 @@
      * @param description The description to transform to a String
      * @return
      */
-    public static String render( AbstractAdsSchemaDescription description )
+    public static String render( LoadableSchemaObject description )
     {
         StringBuilder buf = new StringBuilder();
-        buf.append( "( " ).append( description.getNumericOid() ).append( " " );
+        buf.append( "( " ).append( description.getOid() ).append( " " );
 
         if ( description.getDescription() != null )
         {
@@ -1003,14 +1002,14 @@
         }
 
         buf.append( " X-SCHEMA '" );
-        buf.append( getSchema( description ) );
+        buf.append( getSchemaName( description ) );
         buf.append( "' )" );
 
         return buf.toString();
     }
 
 
-    private static String getSchema( AbstractSchemaDescription desc )
+    private static String getSchemaName( SchemaObject desc )
     {
         List<String> values = desc.getExtensions().get( "X-SCHEMA" );
 

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/AttributeTypeDescriptionSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/AttributeTypeDescriptionSchemaParser.java?rev=808050&r1=808049&r2=808050&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/AttributeTypeDescriptionSchemaParser.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/AttributeTypeDescriptionSchemaParser.java
Wed Aug 26 15:22:31 2009
@@ -88,6 +88,8 @@
         throws ParseException
     {
 
+        LOG.debug( "Parsing an AttributeType : {}", attributeTypeDescription );
+
         if ( attributeTypeDescription == null )
         {
             LOG.error( "Cannot parse a null AttributeType" );

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/DITContentRuleDescriptionSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/DITContentRuleDescriptionSchemaParser.java?rev=808050&r1=808049&r2=808050&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/DITContentRuleDescriptionSchemaParser.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/DITContentRuleDescriptionSchemaParser.java
Wed Aug 26 15:22:31 2009
@@ -73,6 +73,7 @@
     public synchronized DITContentRule parseDITContentRuleDescription( String ditContentRuleDescription
)
         throws ParseException
     {
+        LOG.debug( "Parsing a DITContentRule : {}", ditContentRuleDescription );
 
         if ( ditContentRuleDescription == null )
         {

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/DITStructureRuleDescriptionSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/DITStructureRuleDescriptionSchemaParser.java?rev=808050&r1=808049&r2=808050&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/DITStructureRuleDescriptionSchemaParser.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/DITStructureRuleDescriptionSchemaParser.java
Wed Aug 26 15:22:31 2009
@@ -77,6 +77,7 @@
     public synchronized DITStructureRule parseDITStructureRuleDescription( String ditStructureRuleDescription
)
         throws ParseException
     {
+        LOG.debug( "Parsing a DITStructureRule : {}", ditStructureRuleDescription );
 
         if ( ditStructureRuleDescription == null )
         {

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapSyntaxDescriptionSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapSyntaxDescriptionSchemaParser.java?rev=808050&r1=808049&r2=808050&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapSyntaxDescriptionSchemaParser.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapSyntaxDescriptionSchemaParser.java
Wed Aug 26 15:22:31 2009
@@ -67,6 +67,7 @@
     public synchronized LdapSyntax parseLdapSyntaxDescription( String ldapSyntaxDescription
)
         throws ParseException
     {
+        LOG.debug( "Parsing a LdapSyntax : {}", ldapSyntaxDescription );
 
         if ( ldapSyntaxDescription == null )
         {

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleDescriptionSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleDescriptionSchemaParser.java?rev=808050&r1=808049&r2=808050&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleDescriptionSchemaParser.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleDescriptionSchemaParser.java
Wed Aug 26 15:22:31 2009
@@ -73,6 +73,7 @@
     public synchronized MatchingRule parseMatchingRuleDescription( String matchingRuleDescription
)
         throws ParseException
     {
+        LOG.debug( "Parsing a MatchingRule : {}", matchingRuleDescription );
 
         if ( matchingRuleDescription == null )
         {

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleUseDescriptionSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleUseDescriptionSchemaParser.java?rev=808050&r1=808049&r2=808050&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleUseDescriptionSchemaParser.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleUseDescriptionSchemaParser.java
Wed Aug 26 15:22:31 2009
@@ -74,6 +74,7 @@
     public synchronized MatchingRuleUse parseMatchingRuleUseDescription( String matchingRuleUseDescription
)
         throws ParseException
     {
+        LOG.debug( "Parsing a MatchingRuleUse : {}", matchingRuleUseDescription );
 
         if ( matchingRuleUseDescription == null )
         {

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/NameFormDescriptionSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/NameFormDescriptionSchemaParser.java?rev=808050&r1=808049&r2=808050&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/NameFormDescriptionSchemaParser.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/NameFormDescriptionSchemaParser.java
Wed Aug 26 15:22:31 2009
@@ -72,6 +72,7 @@
     public synchronized NameForm parseNameFormDescription( String nameFormDescription)
         throws ParseException
     {
+        LOG.debug( "Parsing a NameForm : {}", nameFormDescription );
 
         if ( nameFormDescription == null )
         {

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/NormalizerDescriptionSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/NormalizerDescriptionSchemaParser.java?rev=808050&r1=808049&r2=808050&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/NormalizerDescriptionSchemaParser.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/NormalizerDescriptionSchemaParser.java
Wed Aug 26 15:22:31 2009
@@ -78,6 +78,7 @@
     public synchronized NormalizerDescription parseNormalizerDescription( String normalizerDescription
)
         throws ParseException
     {
+        LOG.debug( "Parsing a Normalizer : {}", normalizerDescription );
 
         if ( normalizerDescription == null )
         {

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/ObjectClassDescriptionSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/ObjectClassDescriptionSchemaParser.java?rev=808050&r1=808049&r2=808050&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/ObjectClassDescriptionSchemaParser.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/ObjectClassDescriptionSchemaParser.java
Wed Aug 26 15:22:31 2009
@@ -22,6 +22,10 @@
 
 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,6 +39,10 @@
  */
 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.
      */
@@ -69,11 +77,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 );
         }
 
@@ -81,27 +92,29 @@
 
         try
         {
-            ObjectClassDescription ocd = parser.objectClassDescription();
-            return ocd;
+            ObjectClass objectClass = parser.objectClassDescription();
+            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/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/SyntaxCheckerDescriptionSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/SyntaxCheckerDescriptionSchemaParser.java?rev=808050&r1=808049&r2=808050&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/SyntaxCheckerDescriptionSchemaParser.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/SyntaxCheckerDescriptionSchemaParser.java
Wed Aug 26 15:22:31 2009
@@ -77,6 +77,7 @@
     public synchronized SyntaxCheckerDescription parseSyntaxCheckerDescription( String syntaxCheckerDescription
)
         throws ParseException
     {
+        LOG.debug( "Parsing a SyntaxChecker : {}", syntaxCheckerDescription );
 
         if ( syntaxCheckerDescription == null )
         {



Mime
View raw message