You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2006/12/12 02:05:00 UTC

svn commit: r485972 - in /directory/branches/trunks/schema/apacheds: bootstrap-partition/ bootstrap-plugin/ bootstrap-plugin/src/main/java/org/ bootstrap-plugin/src/main/java/org/apache/ bootstrap-plugin/src/main/java/org/apache/directory/ bootstrap-pl...

Author: akarasulu
Date: Mon Dec 11 17:04:59 2006
New Revision: 485972

URL: http://svn.apache.org/viewvc?view=rev&rev=485972
Log:
getting everything to compile and puting proper constructs in right schemas

Added:
    directory/branches/trunks/schema/apacheds/bootstrap-plugin/src/main/java/org/
    directory/branches/trunks/schema/apacheds/bootstrap-plugin/src/main/java/org/apache/
    directory/branches/trunks/schema/apacheds/bootstrap-plugin/src/main/java/org/apache/directory/
    directory/branches/trunks/schema/apacheds/bootstrap-plugin/src/main/java/org/apache/directory/server/
    directory/branches/trunks/schema/apacheds/bootstrap-plugin/src/main/java/org/apache/directory/server/core/
    directory/branches/trunks/schema/apacheds/bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/
    directory/branches/trunks/schema/apacheds/bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/
    directory/branches/trunks/schema/apacheds/bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/BootstrapPlugin.java
Removed:
    directory/branches/trunks/schema/apacheds/bootstrap-schema/src/main/java/org/apache/directory/server/core/schema/bootstrap/InetorgpersonComparatorProducer.java
    directory/branches/trunks/schema/apacheds/bootstrap-schema/src/main/java/org/apache/directory/server/core/schema/bootstrap/InetorgpersonMatchingRuleProducer.java
    directory/branches/trunks/schema/apacheds/bootstrap-schema/src/main/java/org/apache/directory/server/core/schema/bootstrap/InetorgpersonNormalizerProducer.java
Modified:
    directory/branches/trunks/schema/apacheds/bootstrap-partition/pom.xml
    directory/branches/trunks/schema/apacheds/bootstrap-plugin/pom.xml
    directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/ApachemetaMatchingRuleProducer.java
    directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/SystemComparatorProducer.java
    directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/SystemMatchingRuleProducer.java
    directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/SystemNormalizerProducer.java
    directory/branches/trunks/schema/apacheds/core/src/main/schema/apachemeta.schema
    directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java

Modified: directory/branches/trunks/schema/apacheds/bootstrap-partition/pom.xml
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/bootstrap-partition/pom.xml?view=diff&rev=485972&r1=485971&r2=485972
==============================================================================
--- directory/branches/trunks/schema/apacheds/bootstrap-partition/pom.xml (original)
+++ directory/branches/trunks/schema/apacheds/bootstrap-partition/pom.xml Mon Dec 11 17:04:59 2006
@@ -32,4 +32,24 @@
       <version>${pom.version}</version>
     </dependency>
   </dependencies>
+  <build>
+    <plugins>
+  	  <plugin>
+	    <groupId>org.apache.directory.server</groupId>
+  	    <artifactId>apacheds-bootstrap-plugin</artifactId>
+        <configuration>
+          <bootstrapSchemaClasses>
+          	<bootstrapSchemaClass>org.apache.directory.server.core.schema.bootstrap.NisSchema</bootstrapSchemaClass>
+          </bootstrapSchemaClasses>
+        </configuration>
+        <executions>
+          <execution>
+            <goals>
+              <goal>generate</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
 </project>

Modified: directory/branches/trunks/schema/apacheds/bootstrap-plugin/pom.xml
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/bootstrap-plugin/pom.xml?view=diff&rev=485972&r1=485971&r2=485972
==============================================================================
--- directory/branches/trunks/schema/apacheds/bootstrap-plugin/pom.xml (original)
+++ directory/branches/trunks/schema/apacheds/bootstrap-plugin/pom.xml Mon Dec 11 17:04:59 2006
@@ -17,6 +17,25 @@
   </description>
   <dependencies>
     <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-project</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>nlog4j</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-core</artifactId>
+      <version>${pom.version}</version>
+    </dependency>
+    <dependency>
       <groupId>org.apache.directory.server</groupId>
       <artifactId>apacheds-bootstrap-schema</artifactId>
       <version>${pom.version}</version>

Added: directory/branches/trunks/schema/apacheds/bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/BootstrapPlugin.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/BootstrapPlugin.java?view=auto&rev=485972
==============================================================================
--- directory/branches/trunks/schema/apacheds/bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/BootstrapPlugin.java (added)
+++ directory/branches/trunks/schema/apacheds/bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/BootstrapPlugin.java Mon Dec 11 17:04:59 2006
@@ -0,0 +1,239 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.server.core.bootstrap.plugin;
+
+import java.io.File;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.Set;
+
+import javax.naming.NamingException;
+import javax.naming.directory.BasicAttributes;
+
+import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.DirectoryServiceConfiguration;
+import org.apache.directory.server.core.DirectoryServiceListener;
+import org.apache.directory.server.core.configuration.MutablePartitionConfiguration;
+import org.apache.directory.server.core.configuration.MutableStartupConfiguration;
+import org.apache.directory.server.core.configuration.StartupConfiguration;
+import org.apache.directory.server.core.interceptor.InterceptorChain;
+import org.apache.directory.server.core.partition.PartitionNexus;
+import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
+import org.apache.directory.server.core.schema.Registries;
+import org.apache.directory.server.core.schema.bootstrap.ApacheSchema;
+import org.apache.directory.server.core.schema.bootstrap.ApachemetaSchema;
+import org.apache.directory.server.core.schema.bootstrap.BootstrapRegistries;
+import org.apache.directory.server.core.schema.bootstrap.BootstrapSchema;
+import org.apache.directory.server.core.schema.bootstrap.BootstrapSchemaLoader;
+import org.apache.directory.server.core.schema.bootstrap.CoreSchema;
+import org.apache.directory.server.core.schema.bootstrap.SystemSchema;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+
+/**
+ * Document me!
+ *
+ * @goal generate
+ * @description creates and pre-loads ApacheDS schema partition
+ * @phase generate-sources
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class BootstrapPlugin extends AbstractMojo
+{
+    /**
+     * The target directory into which the plugin generates schema partion files.
+     * 
+     * @parameter expression="target/classes"
+     */
+    private File outputDirectory;
+    
+    /**
+     * The name of the set of bootstrap schemas to load into the registries
+     * and ultimately into the schema partition being built.
+     * 
+     * @parameter 
+     */
+    private String[] bootstrapSchemaClasses;
+
+
+    /**
+     * Loads a bunch of bootstrap classes into memory then adds them to a new 
+     * schema partition within the target area.  The db files for this partition
+     * are then packaged into the jar by the jar plugin.
+     */
+    public void execute() throws MojoExecutionException, MojoFailureException
+    {
+        getLog().error( "Fake error" );
+        
+        // -------------------------------------------------------------------
+        // load the bootstrap schemas to pre-load into the partition
+        // -------------------------------------------------------------------
+
+        Registries registries = new BootstrapRegistries();
+        Set<BootstrapSchema> schemas = new HashSet<BootstrapSchema>();
+        
+        // always include these 
+        schemas.add( new SystemSchema() );
+        schemas.add( new ApacheSchema() );
+        schemas.add( new ApachemetaSchema() );
+        schemas.add( new CoreSchema() );
+        
+        // start looking up and loading the other schemas
+        for ( String schemaClassName: bootstrapSchemaClasses )
+        {
+            try
+            {
+                Class schemaClass = Class.forName( schemaClassName );
+                schemas.add( ( BootstrapSchema ) schemaClass.newInstance() );
+            }
+            catch ( ClassNotFoundException e )
+            {
+                e.printStackTrace();
+                throw new MojoFailureException( "Could not find BootstrapSchema class: " + schemaClassName );
+            }
+            catch ( InstantiationException e )
+            {
+                e.printStackTrace();
+                throw new MojoFailureException( "Could not instantiate BootstrapSchema class: " + schemaClassName );
+            }
+            catch ( IllegalAccessException e )
+            {
+                e.printStackTrace();
+                throw new MojoFailureException( "Could not instantiate BootstrapSchema class due to security: "
+                    + schemaClassName );
+            }
+        }
+        
+        BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
+        try
+        {
+            loader.load( schemas, ( BootstrapRegistries ) registries );
+        }
+        catch ( NamingException e )
+        {
+            e.printStackTrace();
+            throw new MojoFailureException( "Failed to load bootstrap registries with schemas: " + e.getMessage() );
+        }
+        
+        // start up the schema partition
+        JdbmPartition partition = new JdbmPartition();
+        
+        MutableStartupConfiguration msConf = new MutableStartupConfiguration();
+        msConf.setWorkingDirectory( outputDirectory );
+        
+        MojoDSConfig dsConfig = new MojoDSConfig( registries, msConf );
+        MutablePartitionConfiguration mpConfig = new MutablePartitionConfiguration();
+        mpConfig.setCacheSize( 1000 );
+        BasicAttributes rootEntry = new BasicAttributes( "objectClass", "organizationalUnit", true );
+        rootEntry.put( "ou", "schema" );
+        mpConfig.setContextEntry( rootEntry );
+
+        Set<String> indexedAttributes = new HashSet<String>();
+        indexedAttributes.add( "ou" );
+        indexedAttributes.add( "cn" );
+        indexedAttributes.add( "oid" );
+        mpConfig.setIndexedAttributes( indexedAttributes );
+        
+        try
+        {
+            mpConfig.setSuffix( "ou=schema" );
+        }
+        catch ( NamingException e1 )
+        {
+            e1.printStackTrace();
+        }
+        
+        mpConfig.setName( "schema" );
+        
+        try
+        {
+            partition.init( dsConfig, mpConfig );
+        }
+        catch ( NamingException e )
+        {
+            e.printStackTrace();
+        }
+    }
+    
+    
+    class MojoDSConfig implements DirectoryServiceConfiguration
+    {
+        Registries registries = null;
+        StartupConfiguration conf = null;
+        
+        public MojoDSConfig( Registries registries, StartupConfiguration conf )
+        {
+            this.registries = registries;
+        }
+
+        public Hashtable getEnvironment()
+        {
+            return new Hashtable();
+        }
+
+        public String getInstanceId()
+        {
+            return "default";
+        }
+
+        public InterceptorChain getInterceptorChain()
+        {
+            // not used by partition
+            return null;
+        }
+
+        public PartitionNexus getPartitionNexus()
+        {
+            // also not used 
+            return null;
+        }
+
+        public Registries getRegistries()
+        {
+            return registries;
+        }
+
+        public DirectoryService getService()
+        {
+            // not used by partition
+            return null;
+        }
+
+        public DirectoryServiceListener getServiceListener()
+        {
+            // not used by partition
+            return null;
+        }
+
+        public StartupConfiguration getStartupConfiguration()
+        {
+            // not used by partition
+            return null;
+        }
+
+        public boolean isFirstStart()
+        {
+            // not used by partition
+            return true;
+        }
+    }
+}

Modified: directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/ApachemetaMatchingRuleProducer.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/ApachemetaMatchingRuleProducer.java?view=diff&rev=485972&r1=485971&r2=485972
==============================================================================
--- directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/ApachemetaMatchingRuleProducer.java (original)
+++ directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/ApachemetaMatchingRuleProducer.java Mon Dec 11 17:04:59 2006
@@ -24,9 +24,12 @@
 
 import javax.naming.NamingException;
 
+import org.apache.directory.server.core.schema.SyntaxRegistry;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
 import org.apache.directory.shared.ldap.schema.NoOpNormalizer;
 import org.apache.directory.shared.ldap.schema.Normalizer;
+import org.apache.directory.shared.ldap.schema.ObjectIdentifierComparator;
+import org.apache.directory.shared.ldap.schema.ObjectIdentifierNormalizer;
 import org.apache.directory.shared.ldap.schema.Syntax;
 
 
@@ -66,6 +69,63 @@
         
         matchingRule = new NameOrNumericIdMatch( registries.getOidRegistry() );
         cb.schemaObjectProduced( this, matchingRule.getOid(), matchingRule );
+        
+        matchingRule = new NumericOidMatch( registries.getSyntaxRegistry() );
+        cb.schemaObjectProduced( this, matchingRule.getOid(), matchingRule );
+    }
+    
+    
+    public static class NumericOidMatch implements MatchingRule
+    {
+        private static final long serialVersionUID = 1L;
+
+        final String[] NAMES = new String[] { "numericOidMatch" };
+        Syntax syntax;
+        
+        public NumericOidMatch( SyntaxRegistry registry ) throws NamingException
+        {
+            this.syntax = registry.lookup( "1.3.6.1.4.1.1466.115.121.1.38" );
+        }
+        
+        public Comparator getComparator() throws NamingException
+        {
+            return new ObjectIdentifierComparator();
+        }
+
+        public Normalizer getNormalizer() throws NamingException
+        {
+            return new ObjectIdentifierNormalizer();
+        }
+
+        public Syntax getSyntax() throws NamingException
+        {
+            return syntax;
+        }
+
+        public String getDescription()
+        {
+            return "a matching rule for numeric oids";
+        }
+
+        public String getName()
+        {
+            return NAMES[0];
+        }
+
+        public String[] getNames()
+        {
+            return NAMES;
+        }
+
+        public String getOid()
+        {
+            return "1.3.6.1.4.1.18060.0.4.0.1.2";
+        }
+
+        public boolean isObsolete()
+        {
+            return false;
+        }
     }
 
     

Modified: directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/SystemComparatorProducer.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/SystemComparatorProducer.java?view=diff&rev=485972&r1=485971&r2=485972
==============================================================================
--- directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/SystemComparatorProducer.java (original)
+++ directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/SystemComparatorProducer.java Mon Dec 11 17:04:59 2006
@@ -257,6 +257,45 @@
 
         comparator = new ComparableComparator();
         cb.schemaObjectProduced( this, "2.5.13.13", comparator );
+        
+        /*
+         * Straight out of RFC 2798 for InetOrgPerson: Section 9.3.3
+         * =========================================================
+
+         ( 2.5.13.5 NAME 'caseExactMatch'
+         SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
+
+         ( 2.5.13.7 NAME 'caseExactSubstringsMatch'
+         SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )
+
+         ( 2.5.13.12 NAME 'caseIgnoreListSubstringsMatch'
+         SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )
+
+         */
+
+        comparator = new NormalizingComparator( new CachingNormalizer( new DeepTrimNormalizer() ),
+            new ComparableComparator() );
+        cb.schemaObjectProduced( this, "2.5.13.5", comparator );
+
+        comparator = new NormalizingComparator( new CachingNormalizer( new DeepTrimNormalizer() ),
+            new ComparableComparator() );
+        cb.schemaObjectProduced( this, "2.5.13.7", comparator );
+
+        comparator = new NormalizingComparator( new CachingNormalizer( new DeepTrimToLowerNormalizer() ),
+            new ComparableComparator() );
+        cb.schemaObjectProduced( this, "2.5.13.12", comparator );
+
+        /*
+         * Straight out of RFC 2798 for InetOrgPerson: Section 9.3.4
+         * =========================================================
+
+         ( 1.3.6.1.4.1.1466.109.114.3 NAME 'caseIgnoreIA5SubstringsMatch'
+         SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )
+         */
+
+        comparator = new NormalizingComparator( new CachingNormalizer( new DeepTrimToLowerNormalizer() ),
+            new ComparableComparator() );
+        cb.schemaObjectProduced( this, "1.3.6.1.4.1.1466.109.114.3", comparator );
 
     }
 }

Modified: directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/SystemMatchingRuleProducer.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/SystemMatchingRuleProducer.java?view=diff&rev=485972&r1=485971&r2=485972
==============================================================================
--- directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/SystemMatchingRuleProducer.java (original)
+++ directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/SystemMatchingRuleProducer.java Mon Dec 11 17:04:59 2006
@@ -324,5 +324,51 @@
             { "octetStringOrderingMatch" } );
         mrule.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.40" );
         cb.schemaObjectProduced( this, mrule.getOid(), mrule );
+
+        /*
+         * Straight out of RFC 2798 for InetOrgPerson: Section 9.3.3
+         * =========================================================
+
+         ( 2.5.13.5 NAME 'caseExactMatch'
+         SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
+
+         ( 2.5.13.7 NAME 'caseExactSubstringsMatch'
+         SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )
+
+         ( 2.5.13.12 NAME 'caseIgnoreListSubstringsMatch'
+         SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )
+         */
+
+        mrule = new BootstrapMatchingRule( "2.5.13.5", registries );
+        mrule.setNames( new String[]
+            { "caseExactMatch" } );
+        mrule.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.15" );
+        cb.schemaObjectProduced( this, mrule.getOid(), mrule );
+
+        mrule = new BootstrapMatchingRule( "2.5.13.7", registries );
+        mrule.setNames( new String[]
+            { "caseExactSubstringsMatch" } );
+        mrule.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.58" );
+        cb.schemaObjectProduced( this, mrule.getOid(), mrule );
+
+        mrule = new BootstrapMatchingRule( "2.5.13.12", registries );
+        mrule.setNames( new String[]
+            { "caseIgnoreListSubstringsMatch" } );
+        mrule.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.58" );
+        cb.schemaObjectProduced( this, mrule.getOid(), mrule );
+
+        /*
+         * Straight out of RFC 2798 for InetOrgPerson: Section 9.3.4
+         * =========================================================
+
+         ( 1.3.6.1.4.1.1466.109.114.3 NAME 'caseIgnoreIA5SubstringsMatch'
+         SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )
+         */
+
+        mrule = new BootstrapMatchingRule( "1.3.6.1.4.1.1466.109.114.3", registries );
+        mrule.setNames( new String[]
+            { "caseIgnoreIA5SubstringsMatch" } );
+        mrule.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.58" );
+        cb.schemaObjectProduced( this, mrule.getOid(), mrule );
     }
 }

Modified: directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/SystemNormalizerProducer.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/SystemNormalizerProducer.java?view=diff&rev=485972&r1=485971&r2=485972
==============================================================================
--- directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/SystemNormalizerProducer.java (original)
+++ directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/SystemNormalizerProducer.java Mon Dec 11 17:04:59 2006
@@ -250,5 +250,39 @@
 
         normalizer = new NoOpNormalizer();
         cb.schemaObjectProduced( this, "2.5.13.13", normalizer );
+
+        /*
+         * Straight out of RFC 2798 for InetOrgPerson: Section 9.3.3
+         * =========================================================
+
+         ( 2.5.13.5 NAME 'caseExactMatch'
+         SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
+
+         ( 2.5.13.7 NAME 'caseExactSubstringsMatch'
+         SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )
+
+         ( 2.5.13.12 NAME 'caseIgnoreListSubstringsMatch'
+         SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )
+         */
+
+        normalizer = new CachingNormalizer( new DeepTrimNormalizer() );
+        cb.schemaObjectProduced( this, "2.5.13.5", normalizer );
+
+        normalizer = new CachingNormalizer( new DeepTrimNormalizer() );
+        cb.schemaObjectProduced( this, "2.5.13.7", normalizer );
+
+        normalizer = new CachingNormalizer( new DeepTrimToLowerNormalizer() );
+        cb.schemaObjectProduced( this, "2.5.13.12", normalizer );
+
+        /*
+         * Straight out of RFC 2798 for InetOrgPerson: Section 9.3.4
+         * =========================================================
+
+         ( 1.3.6.1.4.1.1466.109.114.3 NAME 'caseIgnoreIA5SubstringsMatch'
+         SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )
+         */
+
+        normalizer = new CachingNormalizer( new DeepTrimToLowerNormalizer() );
+        cb.schemaObjectProduced( this, "1.3.6.1.4.1.1466.109.114.3", normalizer );
     }
 }

Modified: directory/branches/trunks/schema/apacheds/core/src/main/schema/apachemeta.schema
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/core/src/main/schema/apachemeta.schema?view=diff&rev=485972&r1=485971&r2=485972
==============================================================================
--- directory/branches/trunks/schema/apacheds/core/src/main/schema/apachemeta.schema (original)
+++ directory/branches/trunks/schema/apacheds/core/src/main/schema/apachemeta.schema Mon Dec 11 17:04:59 2006
@@ -23,8 +23,11 @@
 #              +------------------------------+-----------------------------+
 #              |          Syntax OID          |            name             |
 #              +------------------------------+-----------------------------+
-#              | 1.3.6.1.4.1.18060.0.4.0.0.0  | nameOrNumericId             |
 #              | 1.3.6.1.4.1.18060.0.4.0.0.1  | objectClassType             |
+#              | 1.3.6.1.4.1.18060.0.4.0.0.2  | NumericOid                  |
+#              | 1.3.6.1.4.1.18060.0.4.0.0.3  | attributeTypeUsage          |
+#              | 1.3.6.1.4.1.18060.0.4.0.0.4  | number                      |
+#              | 1.3.6.1.4.1.18060.0.4.0.0.5  | oidLen                      |
 #              +------------------------------+-----------------------------+
 #
 #              +------------------------------+-----------------------------+
@@ -32,6 +35,7 @@
 #              +------------------------------+-----------------------------+
 #              | 1.3.6.1.4.1.18060.0.4.0.1.0  | nameOrNumericIdMatch        |
 #              | 1.3.6.1.4.1.18060.0.4.0.1.1  | objectClassTypeMatch        |
+#              | 1.3.6.1.4.1.18060.0.4.0.1.2  | numericOidMatch             |
 #              +------------------------------+-----------------------------+
 #
 #              +------------------------------+-----------------------------+
@@ -67,6 +71,7 @@
 #              | 1.3.6.1.4.1.18060.0.4.0.2.28 | m-extensionDITContentRule   |
 #              | 1.3.6.1.4.1.18060.0.4.0.2.29 | m-applies                   |
 #              | 1.3.6.1.4.1.18060.0.4.0.2.30 | m-extensionMatchingRuleUse  |
+#              | 1.3.6.1.4.1.18060.0.4.0.2.31 | m-matchingRuleSyntax        |
 #              +------------------------------+-----------------------------+
 #
 #              +------------------------------+-----------------------------+
@@ -185,7 +190,7 @@
 attributetype ( 1.3.6.1.4.1.18060.0.4.0.2.1 NAME 'm-oid'
     DESC 'The Object Identifier'
     EQUALITY objectIdentifierMatch
-    SYNTAX 1.3.6.1.4.1.1466.115.121.1.38
+    SYNTAX 1.3.6.1.4.1.18060.0.4.0.0.2
     SINGLE-VALUE
 )
 
@@ -216,21 +221,21 @@
 attributetype ( 1.3.6.1.4.1.18060.0.4.0.2.5 NAME 'm-supObjectclass'
     DESC 'The list of superiors'
     EQUALITY nameOrNumericIdMatch
-    SYNTAX 1.3.6.1.4.1.18060.0.4.0.0.0
+    SYNTAX 1.3.6.1.4.1.1466.115.121.1.38
 )
 
 # --- m-must AttributeType ----------------------------------------------------
 attributetype ( 1.3.6.1.4.1.18060.0.4.0.2.6 NAME 'm-must'
     DESC 'The list of mandatory ATs'
     EQUALITY nameOrNumericIdMatch
-    SYNTAX 1.3.6.1.4.1.18060.0.4.0.0.0
+    SYNTAX 1.3.6.1.4.1.1466.115.121.1.38
 )
 
 # --- m-may AttributeType -----------------------------------------------------
 attributetype ( 1.3.6.1.4.1.18060.0.4.0.2.7 NAME 'm-may'
     DESC 'The list of authorized ATs'
     EQUALITY nameOrNumericIdMatch
-    SYNTAX 1.3.6.1.4.1.18060.0.4.0.0.0
+    SYNTAX 1.3.6.1.4.1.1466.115.121.1.38
 )
 
 # --- m-typeObjectClass AttributeType ---------------------------------------
@@ -252,7 +257,7 @@
 attributetype ( 1.3.6.1.4.1.18060.0.4.0.2.10 NAME 'm-supAttributeType'
     DESC 'The list of superior'
     EQUALITY nameOrNumericIdMatch
-    SYNTAX 1.3.6.1.4.1.18060.0.4.0.0.0
+    SYNTAX 1.3.6.1.4.1.1466.115.121.1.38
     SINGLE-VALUE
 )
 
@@ -260,7 +265,7 @@
 attributetype ( 1.3.6.1.4.1.18060.0.4.0.2.11 NAME 'm-equality'
     DESC 'Equality matching rule'
     EQUALITY nameOrNumericIdMatch
-    SYNTAX 1.3.6.1.4.1.18060.0.4.0.0.0
+    SYNTAX 1.3.6.1.4.1.1466.115.121.1.38
     SINGLE-VALUE
 )
 
@@ -268,7 +273,7 @@
 attributetype ( 1.3.6.1.4.1.18060.0.4.0.2.12 NAME 'm-ordering'
     DESC 'Ordering matching rule'
     EQUALITY nameOrNumericIdMatch
-    SYNTAX 1.3.6.1.4.1.18060.0.4.0.0.0
+    SYNTAX 1.3.6.1.4.1.1466.115.121.1.38
     SINGLE-VALUE
 )
 
@@ -276,15 +281,15 @@
 attributetype ( 1.3.6.1.4.1.18060.0.4.0.2.13 NAME 'm-substr'
     DESC 'Substring matching rule'
     EQUALITY nameOrNumericIdMatch
-    SYNTAX 1.3.6.1.4.1.18060.0.4.0.0.0
+    SYNTAX 1.3.6.1.4.1.1466.115.121.1.38
     SINGLE-VALUE
 )
 
-# --- m-syntax AttributeType --------------------------------------------------
-attributetype ( 1.3.6.1.4.1.18060.0.4.0.2.14 NAME 'm-syntax'
-    DESC 'The attribute syntax'
+# --- m-attributeTypeSyntaxsyntax AttributeType -------------------------------
+attributetype ( 1.3.6.1.4.1.18060.0.4.0.2.14 NAME 'm-attributeTypesyntax'
+    DESC 'The attributeType syntax'
     EQUALITY nameOrNumericIdMatch
-    SYNTAX 1.3.6.1.4.1.18060.0.4.0.0.0
+    SYNTAX 1.3.6.1.4.1.18060.0.4.0.0.2
     SINGLE-VALUE
 )
 
@@ -312,8 +317,8 @@
     SINGLE-VALUE
 )
 
-# --- m-usage AttributeType ---------------------------------------------------
-attributetype ( 1.3.6.1.4.1.18060.0.4.0.2.18 NAME 'm-usage'
+# --- m-attributeTypeUusage AttributeType -------------------------------------
+attributetype ( 1.3.6.1.4.1.18060.0.4.0.2.18 NAME 'm-attributeTypeUsage'
     DESC 'Type of operation'
     EQUALITY caseIgnoreMatch
     SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
@@ -331,21 +336,21 @@
 attributetype ( 1.3.6.1.4.1.18060.0.4.0.2.20 NAME 'm-ruleId'
     DESC 'The rule ID'
     EQUALITY ruleIDMatch
-    SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
+    SYNTAX 1.3.6.1.4.1.18060.0.4.0.0.4
 )
 
 # --- m-form AttributeType ----------------------------------------------------
 attributetype ( 1.3.6.1.4.1.18060.0.4.0.2.21 NAME 'm-form'
     DESC 'The name form associated with this DITStructure rule'
     EQUALITY caseIgnoreMatch
-    SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
+    SYNTAX 1.3.6.1.4.1.1466.115.121.1.38
 )
 
 # --- m-supDITStructureRule AttributeType -------------------------------------
 attributetype ( 1.3.6.1.4.1.18060.0.4.0.2.22 NAME 'm-supDITStructureRule'
     DESC 'The list of superiors'
     EQUALITY supDITStructureRuleMatch
-    SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
+    SYNTAX 1.3.6.1.4.1.1466.115.121.1.36
 )
 
 # --- m-extensionDITStructureRule AttributeType -------------------------------
@@ -359,7 +364,7 @@
 attributetype ( 1.3.6.1.4.1.18060.0.4.0.2.24 NAME 'm-oc'
     DESC 'The structural ObjectClass'
     EQUALITY numericOidMatch
-    SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
+    SYNTAX 1.3.6.1.4.1.1466.115.121.1.38
 )
 
 # --- m-extensionNameForm AttributeType ---------------------------------------
@@ -373,14 +378,14 @@
 attributetype ( 1.3.6.1.4.1.18060.0.4.0.2.26 NAME 'm-aux'
     DESC 'List of auxiliary ObjectClasses'
     EQUALITY numericOidMatch
-    SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
+    SYNTAX 1.3.6.1.4.1.1466.115.121.1.38
 )
 
 # --- m-not AttributeType -----------------------------------------------------
 attributetype ( 1.3.6.1.4.1.18060.0.4.0.2.27 NAME 'm-not'
     DESC 'List of precluded attribute types'
     EQUALITY numericOidMatch
-    SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
+    SYNTAX 1.3.6.1.4.1.1466.115.121.1.38
 )
 
 # --- m-extensionDITContentRule AttributeType ---------------------------------
@@ -394,7 +399,7 @@
 attributetype ( 1.3.6.1.4.1.18060.0.4.0.2.29 NAME 'm-applies'
     DESC 'List of attribute types the matching rule applies to'
     EQUALITY numericOidMatch
-    SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
+    SYNTAX 1.3.6.1.4.1.1466.115.121.1.38
 )
 
 # --- m-extensionMatchingRuleUse AttributeType --------------------------------
@@ -402,4 +407,12 @@
     DESC 'Extensions for DITContentRule'
     EQUALITY caseIgnoreMatch
     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
+)
+
+# --- m-matchingRuleSyntax AttributeType --------------------------------
+attributetype ( 1.3.6.1.4.1.18060.0.4.0.2.31 NAME 'm-matchingRuleSyntax'
+    DESC 'The matchingRule attribute syntax '
+    EQUALITY NumericOidMatch
+    SYNTAX 1.3.6.1.4.1.18060.0.4.0.0.2
+    SINGLE-VALUE
 )

Modified: directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java?view=diff&rev=485972&r1=485971&r2=485972
==============================================================================
--- directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java (original)
+++ directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java Mon Dec 11 17:04:59 2006
@@ -126,7 +126,7 @@
     {
         Attribute attr = new BasicAttribute( "objectClass", "organizationalPerson" );
         SchemaService.alterObjectClasses( attr, registries.getObjectClassRegistry() );
-        assertEquals( 3, attr.size() );
+        assertEquals( 2, attr.size() );
         assertTrue( attr.contains( "person" ) );
         assertTrue( attr.contains( "organizationalPerson" ) );
     }
@@ -137,7 +137,7 @@
         Attribute attr = new BasicAttribute( "objectClass", "organizationalPerson" );
         attr.add( "residentialPerson" );
         SchemaService.alterObjectClasses( attr, registries.getObjectClassRegistry() );
-        assertEquals( 4, attr.size() );
+        assertEquals( 3, attr.size() );
         assertTrue( attr.contains( "person" ) );
         assertTrue( attr.contains( "organizationalPerson" ) );
         assertTrue( attr.contains( "residentialPerson" ) );
@@ -146,11 +146,11 @@
 
     public void testAlterObjectClassesOverlappingAndDsa() throws NamingException
     {
-        Attribute attr = new BasicAttribute( "objectClass", "inetOrgPerson" );
+        Attribute attr = new BasicAttribute( "objectClass", "organizationalPerson" );
         attr.add( "residentialPerson" );
         attr.add( "dSA" );
         SchemaService.alterObjectClasses( attr, registries.getObjectClassRegistry() );
-        assertEquals( 6, attr.size() );
+        assertEquals( 5, attr.size() );
         assertTrue( attr.contains( "person" ) );
         assertTrue( attr.contains( "organizationalPerson" ) );
         assertTrue( attr.contains( "residentialPerson" ) );