001 /*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements. See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership. The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License. You may obtain a copy of the License at
009 *
010 * http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied. See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 *
019 */
020 package org.apache.directory.server.schema.bootstrap;
021
022
023 import javax.naming.NamingException;
024
025 import org.apache.directory.server.schema.bootstrap.ProducerTypeEnum;
026 import org.apache.directory.server.schema.registries.Registries;
027 import org.apache.directory.shared.ldap.constants.SchemaConstants;
028
029
030 /**
031 * A producer of MatchingRule objects for the eve schema.
032 * Probably modified by hand from generated code
033 *
034 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
035 * @version $Rev: 781789 $
036 */
037 public class ApacheMatchingRuleProducer extends AbstractBootstrapProducer
038 {
039 public ApacheMatchingRuleProducer()
040 {
041 super( ProducerTypeEnum.MATCHING_RULE_PRODUCER );
042 }
043
044
045 // ------------------------------------------------------------------------
046 // BootstrapProducer Methods
047 // ------------------------------------------------------------------------
048
049 /**
050 * @see BootstrapProducer#produce(Registries, org.apache.directory.server.schema.bootstrap.ProducerCallback)
051 */
052 public void produce( Registries registries, ProducerCallback cb ) throws NamingException
053 {
054 BootstrapMatchingRule mrule = null;
055
056 mrule = new BootstrapMatchingRule( "1.3.6.1.4.1.18060.0.4.1.1.1", registries );
057 mrule.setNames( new String[]
058 { "exactDnAsStringMatch" } );
059 mrule.setSyntaxOid( SchemaConstants.DN_SYNTAX );
060 cb.schemaObjectProduced( this, mrule.getOid(), mrule );
061
062 mrule = new BootstrapMatchingRule( "1.3.6.1.4.1.18060.0.4.1.1.2", registries );
063 mrule.setNames( new String[]
064 { "bigIntegerMatch" } );
065 mrule.setSyntaxOid( SchemaConstants.INTEGER_SYNTAX );
066 cb.schemaObjectProduced( this, mrule.getOid(), mrule );
067
068 mrule = new BootstrapMatchingRule( "1.3.6.1.4.1.18060.0.4.1.1.3", registries );
069 mrule.setNames( new String[]
070 { "jdbmStringMatch" } );
071 mrule.setSyntaxOid( SchemaConstants.DIRECTORY_STRING_SYNTAX );
072 cb.schemaObjectProduced( this, mrule.getOid(), mrule );
073
074 // For uuidMatch
075 mrule = new BootstrapMatchingRule( SchemaConstants.UUID_MATCH_MR_OID, registries );
076 mrule.setNames( new String[]
077 { SchemaConstants.UUID_MATCH_MR } );
078 mrule.setSyntaxOid( SchemaConstants.UUID_SYNTAX );
079 cb.schemaObjectProduced( this, mrule.getOid(), mrule );
080
081 // For uuidOrderingMatch
082 mrule = new BootstrapMatchingRule( SchemaConstants.UUID_ORDERING_MATCH_MR_OID, registries );
083 mrule.setNames( new String[]
084 { SchemaConstants.UUID_ORDERING_MATCH_MR } );
085 mrule.setSyntaxOid( SchemaConstants.UUID_SYNTAX );
086 cb.schemaObjectProduced( this, mrule.getOid(), mrule );
087
088 // For CSNMatch
089 mrule = new BootstrapMatchingRule( SchemaConstants.CSN_MATCH_MR_OID, registries );
090 mrule.setNames( new String[]
091 { SchemaConstants.CSN_MATCH_MR } );
092 mrule.setSyntaxOid( SchemaConstants.CSN_SYNTAX );
093 cb.schemaObjectProduced( this, mrule.getOid(), mrule );
094
095 // For CSNOrderingMatch
096 mrule = new BootstrapMatchingRule( SchemaConstants.CSN_ORDERING_MATCH_MR_OID, registries );
097 mrule.setNames( new String[]
098 { SchemaConstants.CSN_ORDERING_MATCH_MR } );
099 mrule.setSyntaxOid( SchemaConstants.CSN_SYNTAX );
100 cb.schemaObjectProduced( this, mrule.getOid(), mrule );
101
102 // For CSNSidMatch
103 mrule = new BootstrapMatchingRule( SchemaConstants.CSN_SID_MATCH_MR_OID, registries );
104 mrule.setNames( new String[]
105 { SchemaConstants.CSN_SID_MATCH_MR } );
106 mrule.setSyntaxOid( SchemaConstants.CSN_SID_SYNTAX );
107 cb.schemaObjectProduced( this, mrule.getOid(), mrule );
108 }
109 }