directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r959367 - in /directory/shared/trunk: asn1/ ldap-aci/ ldap-aci/src/main/antlr/ ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/ ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/ ldap-aci/src/main/java/or...
Date Wed, 30 Jun 2010 16:25:23 GMT
Author: elecharny
Date: Wed Jun 30 16:25:22 2010
New Revision: 959367

URL: http://svn.apache.org/viewvc?rev=959367&view=rev
Log:
o Refactored the dependencies as we now have a new module for the SchemaManager tests
o The ACIItemparser is now SchemaAware
o Made the ACItem parser using AttributeType instead of Strings
o Load the SchemaManager when testing the ACI
o Moved the tests out of SchemaManager to SchemaManager tests

Added:
    directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AllUserAttributeTypesAndValuesItem.java
    directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AllUserAttributeTypesItem.java
Removed:
    directory/shared/trunk/ldap-schema-manager/src/test/
Modified:
    directory/shared/trunk/asn1/pom.xml
    directory/shared/trunk/ldap-aci/pom.xml
    directory/shared/trunk/ldap-aci/src/main/antlr/ACIItem.g
    directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/ACIItemChecker.java
    directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/ItemPermission.java
    directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java
    directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/ReusableAntlrACIItemParser.java
    directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AbstractAttributeTypeProtectedItem.java
    directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AllAttributeValuesItem.java
    directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AttributeTypeItem.java
    directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/SelfValueItem.java
    directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/ACIItemSyntaxChecker.java
    directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ACIItemChekerTest.java
    directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ACIItemParserTest.java
    directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ProtectedItem_AllAttributeValuesTest.java
    directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ProtectedItem_AttributeTypeTest.java
    directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ProtectedItem_SelfValueTest.java
    directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/ACIItemSyntaxCheckerTest.java
    directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaEntityFactory.java
    directory/shared/trunk/ldap-schema-manager/pom.xml
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SyntaxChecker.java

Modified: directory/shared/trunk/asn1/pom.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/pom.xml?rev=959367&r1=959366&r2=959367&view=diff
==============================================================================
--- directory/shared/trunk/asn1/pom.xml (original)
+++ directory/shared/trunk/asn1/pom.xml Wed Jun 30 16:25:22 2010
@@ -33,6 +33,7 @@
       <groupId>${project.groupId}</groupId>
       <artifactId>shared-i18n</artifactId>
     </dependency> 
+    
     <dependency>
       <groupId>org.apache.directory.junit</groupId>
       <artifactId>junit-addons</artifactId>

Modified: directory/shared/trunk/ldap-aci/pom.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-aci/pom.xml?rev=959367&r1=959366&r2=959367&view=diff
==============================================================================
--- directory/shared/trunk/ldap-aci/pom.xml (original)
+++ directory/shared/trunk/ldap-aci/pom.xml Wed Jun 30 16:25:22 2010
@@ -48,6 +48,16 @@
     </dependency>
 
     <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>shared-ldap-schema-loader</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>shared-ldap-schema-manager</artifactId>
+    </dependency>
+
+    <dependency>
       <groupId>antlr</groupId>
       <artifactId>antlr</artifactId>
     </dependency>

Modified: directory/shared/trunk/ldap-aci/src/main/antlr/ACIItem.g
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-aci/src/main/antlr/ACIItem.g?rev=959367&r1=959366&r2=959367&view=diff
==============================================================================
--- directory/shared/trunk/ldap-aci/src/main/antlr/ACIItem.g (original)
+++ directory/shared/trunk/ldap-aci/src/main/antlr/ACIItem.g Wed Jun 30 16:25:22 2010
@@ -50,16 +50,18 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.util.OptionalComponentsMonitor;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.name.RDN;
+import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.entry.StringValue;
+import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.entry.DefaultEntryAttribute;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.aci.protectedItem.AllAttributeValuesItem;
 import org.apache.directory.shared.ldap.aci.protectedItem.AttributeTypeItem;
 import org.apache.directory.shared.ldap.aci.protectedItem.AttributeValueItem;
 import org.apache.directory.shared.ldap.aci.protectedItem.SelfValueItem;
-import org.apache.directory.shared.ldap.entry.EntryAttribute;
-import org.apache.directory.shared.ldap.entry.DefaultEntryAttribute;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -440,7 +442,7 @@ allUserAttributeTypes
 attributeType
 {
     log.debug( "entered attributeType()" );
-    Set<String> attributeTypeSet = null;
+    Set<AttributeType> attributeTypeSet = null;
 }
     :
     ID_attributeType ( SP )+ attributeTypeSet=attributeTypeSet
@@ -452,7 +454,7 @@ attributeType
 allAttributeValues
 {
     log.debug( "entered allAttributeValues()" );
-    Set<String> attributeTypeSet = null;
+    Set<AttributeType> attributeTypeSet = null;
 }
     :
     ID_allAttributeValues ( SP )+ attributeTypeSet=attributeTypeSet
@@ -514,7 +516,7 @@ attributeValue
 selfValue
 {
     log.debug( "entered selfValue()" );
-    Set<String> attributeTypeSet = null;
+    Set<AttributeType> attributeTypeSet = null;
 }
     :
     ID_selfValue ( SP )+ attributeTypeSet=attributeTypeSet
@@ -650,21 +652,40 @@ restrictedValue returns [ ProtectedItem.
     }
     ;
 
-attributeTypeSet returns [ Set<String> attributeTypeSet ]
+attributeTypeSet returns [ Set<AttributeType> attributeTypeSet ]
 {
     log.debug( "entered attributeTypeSet()" );
     String oid = null;
-    attributeTypeSet = new HashSet<String>();
+    attributeTypeSet = new HashSet<AttributeType>();
+    AttributeType attributeType = null;
 }
     :
     OPEN_CURLY ( SP )*
         oid=oid ( SP )*
         {
-            attributeTypeSet.add( oid );
+            try
+            {
+                attributeType = schemaManager.lookupAttributeTypeRegistry( oid );
+                attributeTypeSet.add( attributeType );
+            }
+            catch ( LdapException le )
+            {
+                // The oid does not exist
+                // TODO : deal with such an exception
+            }
         }
             ( SEP ( SP )* oid=oid ( SP )*
             {
-                attributeTypeSet.add( oid );
+                try
+                {
+                    attributeType = schemaManager.lookupAttributeTypeRegistry( oid );
+                    attributeTypeSet.add( attributeType );
+                }
+                catch ( LdapException le )
+                {
+                    // The oid does not exist
+                    // TODO : deal with such an exception
+                }
             }
             )*
     CLOSE_CURLY

Modified: directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/ACIItemChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/ACIItemChecker.java?rev=959367&r1=959366&r2=959367&view=diff
==============================================================================
--- directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/ACIItemChecker.java (original)
+++ directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/ACIItemChecker.java Wed Jun 30 16:25:22 2010
@@ -25,6 +25,7 @@ import java.io.StringReader;
 import java.text.ParseException;
 
 import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 
 import antlr.RecognitionException;
 import antlr.TokenStreamException;
@@ -51,10 +52,11 @@ public class ACIItemChecker
     /**
      * Creates a ACIItem parser.
      */
-    public ACIItemChecker()
+    public ACIItemChecker( SchemaManager schemaManager )
     {
         this.lexer = new ReusableAntlrACIItemLexer( new StringReader( "" ) );
         this.checker = new ReusableAntlrACIItemParser( lexer );
+        this.checker.init( schemaManager );
         this.isNormalizing = false;
     }
 

Modified: directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/ItemPermission.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/ItemPermission.java?rev=959367&r1=959366&r2=959367&view=diff
==============================================================================
--- directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/ItemPermission.java (original)
+++ directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/ItemPermission.java Wed Jun 30 16:25:22 2010
@@ -33,8 +33,6 @@ import java.util.Collections;
  */
 public class ItemPermission extends Permission
 {
-    private static final long serialVersionUID = 3940100745409337694L;
-
     private final Collection<UserClass> userClasses;
 
 

Modified: directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java?rev=959367&r1=959366&r2=959367&view=diff
==============================================================================
--- directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java (original)
+++ directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java Wed Jun 30 16:25:22 2010
@@ -20,11 +20,12 @@
 package org.apache.directory.shared.ldap.aci;
 
 
-import java.io.Serializable;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.Set;
 
+import org.apache.directory.shared.ldap.aci.protectedItem.AllUserAttributeTypesAndValuesItem;
+import org.apache.directory.shared.ldap.aci.protectedItem.AllUserAttributeTypesItem;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 
 
@@ -51,13 +52,13 @@ public abstract class ProtectedItem
      * All user attribute type information associated with the entry, but not
      * values associated with those attributes.
      */
-    public static final AllUserAttributeTypes ALL_USER_ATTRIBUTE_TYPES = new AllUserAttributeTypes();
+    public static final AllUserAttributeTypesItem ALL_USER_ATTRIBUTE_TYPES = new AllUserAttributeTypesItem();
 
     /**
      * All user attribute information associated with the entry, including all
      * values of all user attributes.
      */
-    public static final AllUserAttributeTypesAndValues ALL_USER_ATTRIBUTE_TYPES_AND_VALUES = new AllUserAttributeTypesAndValues();
+    public static final AllUserAttributeTypesAndValuesItem ALL_USER_ATTRIBUTE_TYPES_AND_VALUES = new AllUserAttributeTypesAndValuesItem();
 
 
     /**
@@ -77,8 +78,6 @@ public abstract class ProtectedItem
      */
     public static class Classes extends ProtectedItem
     {
-        private static final long serialVersionUID = -8553151906617285325L;
-
         private final ExprNode classes;
 
 
@@ -157,9 +156,6 @@ public abstract class ProtectedItem
      */
     public static class Entry extends ProtectedItem
     {
-        private static final long serialVersionUID = -6971482229815999874L;
-
-
         private Entry()
         {
         }
@@ -171,46 +167,6 @@ public abstract class ProtectedItem
         }
     }
 
-    /**
-     * All user attribute type information associated with the entry, but not
-     * values associated with those attributes.
-     */
-    public static class AllUserAttributeTypes extends ProtectedItem
-    {
-        private static final long serialVersionUID = 3728652941148931359L;
-
-
-        private AllUserAttributeTypes()
-        {
-        }
-
-
-        public String toString()
-        {
-            return "allUserAttributeTypes";
-        }
-    }
-
-    /**
-     * All user attribute information associated with the entry, including all
-     * values of all user attributes.
-     */
-    public static class AllUserAttributeTypesAndValues extends ProtectedItem
-    {
-        private static final long serialVersionUID = 7250988885983604442L;
-
-
-        private AllUserAttributeTypesAndValues()
-        {
-        }
-
-
-        public String toString()
-        {
-            return "allUserAttributeTypesAndValues";
-        }
-    }
-
 
     /**
      * Restricts the maximum number of attribute values allowed for a specified
@@ -223,8 +179,6 @@ public abstract class ProtectedItem
      */
     public static class MaxValueCount extends ProtectedItem
     {
-        private static final long serialVersionUID = 5261651541488944572L;
-
         private final Set<ProtectedItem.MaxValueCountItem> items;
 
 
@@ -321,8 +275,6 @@ public abstract class ProtectedItem
      */
     public static class RangeOfValues extends ProtectedItem
     {
-        private static final long serialVersionUID = -8553151906617285325L;
-
         private final ExprNode filter;
 
 
@@ -408,8 +360,6 @@ public abstract class ProtectedItem
      */
     public static class MaxImmSub extends ProtectedItem
     {
-        private static final long serialVersionUID = -8553151906617285325L;
-
         private final int value;
 
 
@@ -485,7 +435,6 @@ public abstract class ProtectedItem
      */
     public static class RestrictedBy extends ProtectedItem
     {
-        private static final long serialVersionUID = -8157637446588058799L;
         private final Set<RestrictedByItem> items;
 
 
@@ -578,10 +527,8 @@ public abstract class ProtectedItem
     /**
      * An element of {@link MaxValueCount}.
      */
-    public static class MaxValueCountItem implements Serializable
+    public static class MaxValueCountItem
     {
-        private static final long serialVersionUID = 43697038363452113L;
-
         private String attributeType;
 
         private int maxCount;
@@ -630,10 +577,8 @@ public abstract class ProtectedItem
     /**
      * An element of {@link RestrictedBy}.
      */
-    public static class RestrictedByItem implements Serializable
+    public static class RestrictedByItem
     {
-        private static final long serialVersionUID = 4319052153538757099L;
-
         private String attributeType;
 
         private String valuesIn;

Modified: directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/ReusableAntlrACIItemParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/ReusableAntlrACIItemParser.java?rev=959367&r1=959366&r2=959367&view=diff
==============================================================================
--- directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/ReusableAntlrACIItemParser.java (original)
+++ directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/ReusableAntlrACIItemParser.java Wed Jun 30 16:25:22 2010
@@ -41,7 +41,7 @@ class ReusableAntlrACIItemParser extends
     /**
      * Creates a ReusableAntlrSubtreeSpecificationParser instance.
      */
-    public ReusableAntlrACIItemParser(TokenStream lexer)
+    public ReusableAntlrACIItemParser( TokenStream lexer )
     {
         super( lexer );
     }

Modified: directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AbstractAttributeTypeProtectedItem.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AbstractAttributeTypeProtectedItem.java?rev=959367&r1=959366&r2=959367&view=diff
==============================================================================
--- directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AbstractAttributeTypeProtectedItem.java (original)
+++ directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AbstractAttributeTypeProtectedItem.java Wed Jun 30 16:25:22 2010
@@ -24,13 +24,14 @@ import java.util.Iterator;
 import java.util.Set;
 
 import org.apache.directory.shared.ldap.aci.ProtectedItem;
+import org.apache.directory.shared.ldap.schema.AttributeType;
 
 /**
  * A base class for all items which protects attribute types (or its values)
  */
 public abstract class AbstractAttributeTypeProtectedItem extends ProtectedItem
 {
-    protected final Set<String> attributeTypes;
+    protected final Set<AttributeType> attributeTypes;
 
 
     /**
@@ -38,7 +39,7 @@ public abstract class AbstractAttributeT
      * 
      * @param attributeTypes the collection of attirbute IDs
      */
-    protected AbstractAttributeTypeProtectedItem( Set<String> attributeTypes )
+    protected AbstractAttributeTypeProtectedItem( Set<AttributeType> attributeTypes )
     {
         this.attributeTypes = Collections.unmodifiableSet( attributeTypes );
     }
@@ -47,7 +48,7 @@ public abstract class AbstractAttributeT
     /**
      * Returns an iterator of all attribute IDs.
      */
-    public Iterator<String> iterator()
+    public Iterator<AttributeType> iterator()
     {
         return attributeTypes.iterator();
     }
@@ -101,7 +102,7 @@ public abstract class AbstractAttributeT
         buf.append( "{ " );
         boolean isFirst = true;
 
-        for ( String attributeType : attributeTypes )
+        for ( AttributeType attributeType : attributeTypes )
         {
             if ( isFirst )
             {
@@ -112,7 +113,7 @@ public abstract class AbstractAttributeT
                 buf.append( ", " );
             }
 
-            buf.append( attributeType );
+            buf.append( attributeType.getName() );
         }
 
         buf.append( " }" );

Modified: directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AllAttributeValuesItem.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AllAttributeValuesItem.java?rev=959367&r1=959366&r2=959367&view=diff
==============================================================================
--- directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AllAttributeValuesItem.java (original)
+++ directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AllAttributeValuesItem.java Wed Jun 30 16:25:22 2010
@@ -21,6 +21,8 @@ package org.apache.directory.shared.ldap
 
 import java.util.Set;
 
+import org.apache.directory.shared.ldap.schema.AttributeType;
+
 /**
  * All attribute value information pertaining to specific attributes.
  */
@@ -31,7 +33,7 @@ public class AllAttributeValuesItem exte
      * 
      * @param attributeTypes the collection of attribute IDs.
      */
-    public AllAttributeValuesItem( Set<String> attributeTypes )
+    public AllAttributeValuesItem( Set<AttributeType> attributeTypes )
     {
         super( attributeTypes );
     }

Added: directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AllUserAttributeTypesAndValuesItem.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AllUserAttributeTypesAndValuesItem.java?rev=959367&view=auto
==============================================================================
--- directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AllUserAttributeTypesAndValuesItem.java (added)
+++ directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AllUserAttributeTypesAndValuesItem.java Wed Jun 30 16:25:22 2010
@@ -0,0 +1,39 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.shared.ldap.aci.protectedItem;
+
+import org.apache.directory.shared.ldap.aci.ProtectedItem;
+
+/**
+ * All user attribute information associated with the entry, including all
+ * values of all user attributes.
+ */
+public class AllUserAttributeTypesAndValuesItem extends ProtectedItem
+{
+    public AllUserAttributeTypesAndValuesItem()
+    {
+    }
+
+
+    public String toString()
+    {
+        return "allUserAttributeTypesAndValues";
+    }
+}

Added: directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AllUserAttributeTypesItem.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AllUserAttributeTypesItem.java?rev=959367&view=auto
==============================================================================
--- directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AllUserAttributeTypesItem.java (added)
+++ directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AllUserAttributeTypesItem.java Wed Jun 30 16:25:22 2010
@@ -0,0 +1,39 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.shared.ldap.aci.protectedItem;
+
+import org.apache.directory.shared.ldap.aci.ProtectedItem;
+
+/**
+ * All user attribute type information associated with the entry, but not
+ * values associated with those attributes.
+ */
+public class AllUserAttributeTypesItem extends ProtectedItem
+{
+    public AllUserAttributeTypesItem()
+    {
+    }
+
+
+    public String toString()
+    {
+        return "allUserAttributeTypes";
+    }
+}
\ No newline at end of file

Modified: directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AttributeTypeItem.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AttributeTypeItem.java?rev=959367&r1=959366&r2=959367&view=diff
==============================================================================
--- directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AttributeTypeItem.java (original)
+++ directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AttributeTypeItem.java Wed Jun 30 16:25:22 2010
@@ -21,6 +21,8 @@ package org.apache.directory.shared.ldap
 
 import java.util.Set;
 
+import org.apache.directory.shared.ldap.schema.AttributeType;
+
 /**
  * Attribute type information pertaining to specific attributes but not
  * values associated with the type.
@@ -32,7 +34,7 @@ public class AttributeTypeItem extends A
      * 
      * @param attributeTypes the collection of attribute IDs.
      */
-    public AttributeTypeItem( Set<String> attributeTypes )
+    public AttributeTypeItem( Set<AttributeType> attributeTypes )
     {
         super( attributeTypes );
     }

Modified: directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/SelfValueItem.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/SelfValueItem.java?rev=959367&r1=959366&r2=959367&view=diff
==============================================================================
--- directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/SelfValueItem.java (original)
+++ directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/SelfValueItem.java Wed Jun 30 16:25:22 2010
@@ -21,6 +21,8 @@ package org.apache.directory.shared.ldap
 
 import java.util.Set;
 
+import org.apache.directory.shared.ldap.schema.AttributeType;
+
 /**
  * The attribute value assertion corresponding to the current requestor. The
  * protected item selfValue applies only when the access controls are to be
@@ -36,7 +38,7 @@ public class SelfValueItem extends Abstr
      * 
      * @param attributeTypes the collection of attribute IDs.
      */
-    public SelfValueItem( Set<String> attributeTypes )
+    public SelfValueItem( Set<AttributeType> attributeTypes )
     {
         super( attributeTypes );
     }

Modified: directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/ACIItemSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/ACIItemSyntaxChecker.java?rev=959367&r1=959366&r2=959367&view=diff
==============================================================================
--- directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/ACIItemSyntaxChecker.java (original)
+++ directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/ACIItemSyntaxChecker.java Wed Jun 30 16:25:22 2010
@@ -23,6 +23,7 @@ import java.text.ParseException;
 
 import org.apache.directory.shared.ldap.aci.ACIItemChecker;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.SyntaxChecker;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
@@ -44,7 +45,7 @@ public class ACIItemSyntaxChecker extend
     private static final long serialVersionUID = 1L;
 
     /** An instance of ACI Item Checker */
-    private static final ACIItemChecker ACI_ITEM_CHECKER = new ACIItemChecker();
+    private static ACIItemChecker ACI_ITEM_CHECKER;
 
     /**
      * Creates a new instance of ACIItemSyntaxChecker
@@ -103,4 +104,13 @@ public class ACIItemSyntaxChecker extend
             return false;
         }
     }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setSchemaManager( SchemaManager schemaManager )
+    {
+        ACI_ITEM_CHECKER = new ACIItemChecker( schemaManager );
+    }
 }

Modified: directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ACIItemChekerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ACIItemChekerTest.java?rev=959367&r1=959366&r2=959367&view=diff
==============================================================================
--- directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ACIItemChekerTest.java (original)
+++ directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ACIItemChekerTest.java Wed Jun 30 16:25:22 2010
@@ -27,6 +27,10 @@ import java.text.ParseException;
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
+import org.apache.directory.shared.ldap.schema.loader.ldif.JarLdifSchemaLoader;
+import org.apache.directory.shared.ldap.schema.manager.impl.DefaultSchemaManager;
+import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -40,18 +44,21 @@ import org.junit.runner.RunWith;
 @Concurrent()
 public class ACIItemChekerTest
 {
-
     /** the ACIItem checker wrapper */
-    ACIItemChecker checker;
+    static private ACIItemChecker checker;
 
 
     /**
-     * Creates a ACIItemParserTest instance.
+     * Initialization
      */
-    public ACIItemChekerTest()
+    @BeforeClass
+    public static void init() throws Exception
     {
-        super();
-        checker = new ACIItemChecker();
+        JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+        schemaManager.loadAllEnabled();
+
+        checker = new ACIItemChecker( schemaManager );
     }
 
 
@@ -61,14 +68,49 @@ public class ACIItemChekerTest
     @Test
     public void testItemFirst() throws Exception
     {
-        String spec = " {  identificationTag  \"id1\" , precedence 114  , authenticationLevel simple  , "
-            + "itemOrUserFirst itemFirst  :{ protectedItems  { entry  , attributeType { 1.2.3    , ou }  , "
-            + " attributeValue { ou=people  , cn=Ersin  }  , rangeOfValues (cn=ErsinEr) , "
-            + "classes and : { item: xyz , or:{item:X,item:Y}   }}  , "
-            + "itemPermissions { { userClasses {allUsers  , userGroup { \"1.2=y,z=t\"  , \"a=b,c=d\" } "
-            + " , subtree { { base \"ou=people\" } } }   , grantsAndDenials  {  denyCompare  , grantModify } },"
-            + "{ precedence 10, userClasses {allUsers  , userGroup { \"1.2=y,z=t\"  , \"a=b,c=d\" } "
-            + " , subtree { { base \"ou=people\" } } }   , grantsAndDenials  {  denyCompare  , grantModify } } } }}";
+        String spec = 
+            " {  " +
+            "   identificationTag  \"id1\" , " +
+            "   precedence 114  , " +
+            "   authenticationLevel simple  , " +
+            "   itemOrUserFirst itemFirst  :" +
+            "   { " +
+            "     protectedItems  " +
+            "     { " +
+            "       entry  , " +
+            "       attributeType { 1.2.3    , ou }  ," +
+            "       attributeValue { ou=people  , cn=Ersin  }  , " +
+            "       rangeOfValues (cn=ErsinEr) , " +
+            "       classes and : " +
+            "       { " +
+            "         item: xyz , " +
+            "         or:{item:X,item:Y}   " +
+            "       }" +
+            "     }  , " +
+            "     itemPermissions " +
+            "     { " +
+            "       { " +
+            "         userClasses " +
+            "         {" +
+            "           allUsers  , " +
+            "           userGroup { \"1.2=y,z=t\"  , \"a=b,c=d\" } ," +
+            "           subtree { { base \"ou=people\" } } " +
+            "         }   , " +
+            "         grantsAndDenials  {  denyCompare  , grantModify } " +
+            "       }," +
+            "       { " +
+            "         precedence 10, " +
+            "         userClasses " +
+            "         {" +
+            "           allUsers  , " +
+            "           userGroup { \"1.2=y,z=t\"  , \"a=b,c=d\" } ," +
+            "           subtree { { base \"ou=people\" } } " +
+            "         }   , " +
+            "         grantsAndDenials  {  denyCompare  , grantModify } " +
+            "       } " +
+            "     } " +
+            "   }" +
+            " }";
 
         checker.parse( spec );
     }

Modified: directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ACIItemParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ACIItemParserTest.java?rev=959367&r1=959366&r2=959367&view=diff
==============================================================================
--- directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ACIItemParserTest.java (original)
+++ directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ACIItemParserTest.java Wed Jun 30 16:25:22 2010
@@ -29,6 +29,10 @@ import java.text.ParseException;
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
+import org.apache.directory.shared.ldap.schema.loader.ldif.JarLdifSchemaLoader;
+import org.apache.directory.shared.ldap.schema.manager.impl.DefaultSchemaManager;
+import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -43,16 +47,20 @@ public class ACIItemParserTest
 {
 
     /** the ACIItem parser wrapper */
-    ACIItemParser parser;
+    private static ACIItemParser parser;
 
 
     /**
-     * Creates a ACIItemParserTest instance.
+     * Initialization
      */
-    public ACIItemParserTest()
+    @BeforeClass
+    public static void init() throws Exception
     {
-        super();
-        parser = new ACIItemParser( null );
+        JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+        schemaManager.loadAllEnabled();
+
+        parser = new ACIItemParser( schemaManager );
     }
 
 
@@ -94,14 +102,41 @@ public class ACIItemParserTest
     @Test
     public void testItemFirst() throws Exception
     {
-        String spec = " {  identificationTag  \"id1\" , precedence 114  , authenticationLevel simple  , "
-            + "itemOrUserFirst itemFirst  :{ protectedItems  { entry  , attributeType { 1.2.3    , ou }  , "
-            + " attributeValue { ou=people  , cn=Ersin  }  , rangeOfValues (cn=ErsinEr) , "
-            + "classes and : { item: xyz , or:{item:X,item:Y}   }}  , "
-            + "itemPermissions { { userClasses {allUsers  , userGroup { \"1.2=y,z=t\"  , \"a=b,c=d\" } "
-            + " , subtree { { base \"ou=people\" } } }   , grantsAndDenials  {  denyCompare  , grantModify } },"
-            + "{ precedence 10, userClasses {allUsers  , userGroup { \"1.2=y,z=t\"  , \"a=b,c=d\" } "
-            + " , subtree { { base \"ou=people\" } } }   , grantsAndDenials  {  denyCompare  , grantModify } } } }}";
+        String spec = 
+            "{  " +
+            "  identificationTag  \"id1\" , " +
+            "  precedence 114  , " +
+            "  authenticationLevel simple  , " +
+            "  itemOrUserFirst itemFirst  :" +
+            "  { " +
+            "    protectedItems  { entry  , attributeType { 2.5.4.3    , ou } , " +
+            "    attributeValue { ou=people  , cn=Ersin  }  , " +
+            "    rangeOfValues (cn=ErsinEr) , " +
+            "    classes and : { item: xyz , or:{item:X,item:Y}   }" +
+            "  }  , " +
+            "  itemPermissions " +
+            "  { " +
+            "    { " +
+            "      userClasses " +
+            "        {" +
+            "          allUsers  , " +
+            "          userGroup { \"1.2=y,z=t\"  , \"a=b,c=d\" } , " +
+            "          subtree { { base \"ou=people\" } } " +
+            "        }   , " +
+            "      grantsAndDenials  {  denyCompare  , grantModify } " +
+            "    }," +
+            "    { " +
+            "      precedence 10, " +
+            "      userClasses " +
+            "      {" +
+            "        allUsers  , " +
+            "        userGroup { \"1.2=y,z=t\"  , \"a=b,c=d\" } ," +
+            "        subtree { { base \"ou=people\" } } " +
+            "      }   , " +
+            "      grantsAndDenials  {  denyCompare  , grantModify } } " +
+            "    } " +
+            "  }" +
+            "}";
 
         ACIItem item = parser.parse( spec );
         checkItemToString( spec, item );

Modified: directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ProtectedItem_AllAttributeValuesTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ProtectedItem_AllAttributeValuesTest.java?rev=959367&r1=959366&r2=959367&view=diff
==============================================================================
--- directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ProtectedItem_AllAttributeValuesTest.java (original)
+++ directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ProtectedItem_AllAttributeValuesTest.java Wed Jun 30 16:25:22 2010
@@ -29,6 +29,7 @@ import java.util.Set;
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.ldap.aci.protectedItem.AllAttributeValuesItem;
+import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -55,18 +56,18 @@ public class ProtectedItem_AllAttributeV
     @Before
     public void initNames() throws Exception
     {
-        Set<String> colA = new HashSet<String>();
-        colA.add( "aa" );
-        colA.add( "bb" );
-        colA.add( "cc" );
-        Set<String> colB = new HashSet<String>();
-        colB.add( "aa" );
-        colB.add( "bb" );
-        colB.add( "cc" );
-        Set<String> colC = new HashSet<String>();
-        colC.add( "bb" );
-        colC.add( "cc" );
-        colC.add( "dd" );
+        Set<AttributeType> colA = new HashSet<AttributeType>();
+        colA.add( new AttributeType( "aa" ) );
+        colA.add( new AttributeType( "bb" ) );
+        colA.add( new AttributeType( "cc" ) );
+        Set<AttributeType> colB = new HashSet<AttributeType>();
+        colB.add( new AttributeType( "aa" ) );
+        colB.add( new AttributeType( "bb" ) );
+        colB.add( new AttributeType( "cc" ) );
+        Set<AttributeType> colC = new HashSet<AttributeType>();
+        colC.add( new AttributeType( "bb" ) );
+        colC.add( new AttributeType( "cc" ) );
+        colC.add( new AttributeType( "dd" ) );
 
         allAttributeValuesA = new AllAttributeValuesItem( colA );
         allAttributeValuesACopy = new AllAttributeValuesItem( colA );

Modified: directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ProtectedItem_AttributeTypeTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ProtectedItem_AttributeTypeTest.java?rev=959367&r1=959366&r2=959367&view=diff
==============================================================================
--- directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ProtectedItem_AttributeTypeTest.java (original)
+++ directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ProtectedItem_AttributeTypeTest.java Wed Jun 30 16:25:22 2010
@@ -29,6 +29,7 @@ import java.util.Set;
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.ldap.aci.protectedItem.AttributeTypeItem;
+import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -55,18 +56,18 @@ public class ProtectedItem_AttributeType
     @Before
     public void initNames() throws Exception
     {
-        Set<String> colA = new HashSet<String>();
-        colA.add( "aa" );
-        colA.add( "bb" );
-        colA.add( "cc" );
-        Set<String> colB = new HashSet<String>();
-        colB.add( "aa" );
-        colB.add( "bb" );
-        colB.add( "cc" );
-        Set<String> colC = new HashSet<String>();
-        colC.add( "bb" );
-        colC.add( "cc" );
-        colC.add( "dd" );
+        Set<AttributeType> colA = new HashSet<AttributeType>();
+        colA.add( new AttributeType( "aa" ) );
+        colA.add( new AttributeType( "bb" ) );
+        colA.add( new AttributeType( "cc" ) );
+        Set<AttributeType> colB = new HashSet<AttributeType>();
+        colB.add( new AttributeType( "aa" ) );
+        colB.add( new AttributeType( "bb" ) );
+        colB.add( new AttributeType( "cc" ) );
+        Set<AttributeType> colC = new HashSet<AttributeType>();
+        colC.add( new AttributeType( "bb" ) );
+        colC.add( new AttributeType( "cc" ) );
+        colC.add( new AttributeType( "dd" ) );
 
         attributeTypeA = new AttributeTypeItem( colA );
         attributeTypeACopy = new AttributeTypeItem( colA );

Modified: directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ProtectedItem_SelfValueTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ProtectedItem_SelfValueTest.java?rev=959367&r1=959366&r2=959367&view=diff
==============================================================================
--- directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ProtectedItem_SelfValueTest.java (original)
+++ directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ProtectedItem_SelfValueTest.java Wed Jun 30 16:25:22 2010
@@ -29,6 +29,7 @@ import java.util.Set;
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.ldap.aci.protectedItem.SelfValueItem;
+import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -55,18 +56,18 @@ public class ProtectedItem_SelfValueTest
     @Before
     public void initNames() throws Exception
     {
-        Set<String> colA = new HashSet<String>();
-        colA.add( "aa" );
-        colA.add( "bb" );
-        colA.add( "cc" );
-        Set<String> colB = new HashSet<String>();
-        colB.add( "aa" );
-        colB.add( "bb" );
-        colB.add( "cc" );
-        Set<String> colC = new HashSet<String>();
-        colC.add( "bb" );
-        colC.add( "cc" );
-        colC.add( "dd" );
+        Set<AttributeType> colA = new HashSet<AttributeType>();
+        colA.add( new AttributeType( "aa" ) );
+        colA.add( new AttributeType( "bb" ) );
+        colA.add( new AttributeType( "cc" ) );
+        Set<AttributeType> colB = new HashSet<AttributeType>();
+        colB.add( new AttributeType( "aa" ) );
+        colB.add( new AttributeType( "bb" ) );
+        colB.add( new AttributeType( "cc" ) );
+        Set<AttributeType> colC = new HashSet<AttributeType>();
+        colC.add( new AttributeType( "bb" ) );
+        colC.add( new AttributeType( "cc" ) );
+        colC.add( new AttributeType( "dd" ) );
 
         selfValueA = new SelfValueItem( colA );
         selfValueACopy = new SelfValueItem( colA );

Modified: directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/ACIItemSyntaxCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/ACIItemSyntaxCheckerTest.java?rev=959367&r1=959366&r2=959367&view=diff
==============================================================================
--- directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/ACIItemSyntaxCheckerTest.java (original)
+++ directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/ACIItemSyntaxCheckerTest.java Wed Jun 30 16:25:22 2010
@@ -25,7 +25,10 @@ import static org.junit.Assert.assertTru
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
-import org.apache.directory.shared.ldap.schema.syntaxCheckers.ACIItemSyntaxChecker;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
+import org.apache.directory.shared.ldap.schema.loader.ldif.JarLdifSchemaLoader;
+import org.apache.directory.shared.ldap.schema.manager.impl.DefaultSchemaManager;
+import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -39,8 +42,17 @@ import org.junit.runner.RunWith;
 @Concurrent()
 public class ACIItemSyntaxCheckerTest
 {
-    ACIItemSyntaxChecker checker = new ACIItemSyntaxChecker();
+    private static ACIItemSyntaxChecker checker;
 
+    @BeforeClass
+    public static void init() throws Exception
+    {
+        JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+        schemaManager.loadAllEnabled();
+        checker = new ACIItemSyntaxChecker();
+        checker.setSchemaManager( schemaManager );
+    }
 
     @Test
     public void testNullString()

Modified: directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaEntityFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaEntityFactory.java?rev=959367&r1=959366&r2=959367&view=diff
==============================================================================
--- directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaEntityFactory.java (original)
+++ directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaEntityFactory.java Wed Jun 30 16:25:22 2010
@@ -250,7 +250,7 @@ public class SchemaEntityFactory impleme
     /**
      * Class load a syntaxChecker instance
      */
-    private SyntaxChecker classLoadSyntaxChecker( String oid, String className, EntryAttribute byteCode )
+    private SyntaxChecker classLoadSyntaxChecker( SchemaManager schemaManager, String oid, String className, EntryAttribute byteCode )
         throws Exception
     {
         // Try to class load the syntaxChecker
@@ -279,6 +279,9 @@ public class SchemaEntityFactory impleme
         // Inject the new OID, as the loaded syntaxChecker might have its own
         syntaxChecker.setOid( oid );
 
+        // Inject the SchemaManager for the comparator who needs it
+        syntaxChecker.setSchemaManager( schemaManager );
+        
         return syntaxChecker;
     }
 
@@ -322,7 +325,7 @@ public class SchemaEntityFactory impleme
         try
         {
             // Class load the syntaxChecker
-            SyntaxChecker syntaxChecker = classLoadSyntaxChecker( oid, className, byteCode );
+            SyntaxChecker syntaxChecker = classLoadSyntaxChecker( schemaManager, oid, className, byteCode );
     
             // Update the common fields
             setSchemaObjectProperties( syntaxChecker, entry, schema );
@@ -367,7 +370,7 @@ public class SchemaEntityFactory impleme
         EntryAttribute byteCode = getByteCode( syntaxCheckerDescription, SchemaConstants.SYNTAX_CHECKER );
 
         // Class load the SyntaxChecker
-        SyntaxChecker syntaxChecker = classLoadSyntaxChecker( oid, fqcn, byteCode );
+        SyntaxChecker syntaxChecker = classLoadSyntaxChecker( schemaManager, oid, fqcn, byteCode );
 
         // Update the common fields
         setSchemaObjectProperties( syntaxChecker, syntaxCheckerDescription, schema );

Modified: directory/shared/trunk/ldap-schema-manager/pom.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-schema-manager/pom.xml?rev=959367&r1=959366&r2=959367&view=diff
==============================================================================
--- directory/shared/trunk/ldap-schema-manager/pom.xml (original)
+++ directory/shared/trunk/ldap-schema-manager/pom.xml Wed Jun 30 16:25:22 2010
@@ -49,11 +49,6 @@
 
     <dependency>
       <groupId>${project.groupId}</groupId>
-      <artifactId>shared-ldap-aci</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>${project.groupId}</groupId>
       <artifactId>shared-ldap-schema</artifactId>
     </dependency>
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SyntaxChecker.java?rev=959367&r1=959366&r2=959367&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SyntaxChecker.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SyntaxChecker.java Wed Jun 30 16:25:22 2010
@@ -21,7 +21,6 @@ package org.apache.directory.shared.ldap
 
 
 import org.apache.directory.shared.ldap.exception.LdapException;
-
 import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 
@@ -86,6 +85,18 @@ public abstract class SyntaxChecker exte
 
 
     /**
+     * Store the SchemaManager in this instance. It may be necessary for some
+     * syntaxChecker which needs to have access to the oidNormalizer Map.
+     *
+     * @param schemaManager the schemaManager to store
+     */
+    public void setSchemaManager( SchemaManager schemaManager )
+    {
+        // Do nothing (general case).
+    }
+    
+    
+    /**
      * @see Object#equals()
      */
     @Override



Mime
View raw message