View Javadoc

1   /*
2    *   Copyright 2004 The Apache Software Foundation
3    *
4    *   Licensed under the Apache License, Version 2.0 (the "License");
5    *   you may not use this file except in compliance with the License.
6    *   You may obtain a copy of the License at
7    *
8    *       http://www.apache.org/licenses/LICENSE-2.0
9    *
10   *   Unless required by applicable law or agreed to in writing, software
11   *   distributed under the License is distributed on an "AS IS" BASIS,
12   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *   See the License for the specific language governing permissions and
14   *   limitations under the License.
15   *
16   */
17  package org.apache.ldap.server.schema.bootstrap;
18  
19  
20  import org.apache.ldap.common.schema.*;
21  
22  import javax.naming.NamingException;
23  import java.util.Comparator;
24  
25  
26  
27  /***
28   * A producer of Comparator objects for the inetorgperson schema.  This code has been
29   * automatically generated using schema files in the OpenLDAP format along with
30   * the eve schema plugin for maven.  This has been done to facilitate
31   * Eve<->OpenLDAP schema interoperability.
32   *
33   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
34   * @version $Rev: 159259 $
35   */
36  public class InetorgpersonComparatorProducer extends AbstractBootstrapProducer
37  {
38      public InetorgpersonComparatorProducer()
39      {
40          super( ProducerTypeEnum.COMPARATOR_PRODUCER );
41      }
42  
43  
44      // ------------------------------------------------------------------------
45      // BootstrapProducer Methods
46      // ------------------------------------------------------------------------
47  
48  
49      /***
50       * @see org.apache.ldap.server.schema.bootstrap.BootstrapProducer#produce(BootstrapRegistries, org.apache.ldap.server.schema.bootstrap.ProducerCallback)
51       */
52      public void produce( BootstrapRegistries registries, ProducerCallback cb )
53          throws NamingException
54      {
55  
56          Comparator comparator;
57  
58          /*
59           * Straight out of RFC 2798 for InetOrgPerson: Section 9.3.3
60           * =========================================================
61  
62              ( 2.5.13.5 NAME 'caseExactMatch'
63                SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
64  
65              ( 2.5.13.7 NAME 'caseExactSubstringsMatch'
66                SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )
67  
68              ( 2.5.13.12 NAME 'caseIgnoreListSubstringsMatch'
69                SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )
70  
71          */
72  
73          comparator = new NormalizingComparator(
74                  new CachingNormalizer( new DeepTrimNormalizer() ),
75                  new ComparableComparator() );
76          cb.schemaObjectProduced( this, "2.5.13.5", comparator );
77  
78          comparator = new NormalizingComparator(
79                  new CachingNormalizer( new DeepTrimNormalizer() ),
80                  new ComparableComparator() );
81          cb.schemaObjectProduced( this, "2.5.13.7", comparator );
82  
83          comparator = new NormalizingComparator(
84                  new CachingNormalizer( new DeepTrimToLowerNormalizer() ),
85                  new ComparableComparator() );
86          cb.schemaObjectProduced( this, "2.5.13.12", comparator );
87  
88          /*
89           * Straight out of RFC 2798 for InetOrgPerson: Section 9.3.4
90           * =========================================================
91  
92              ( 1.3.6.1.4.1.1466.109.114.3 NAME 'caseIgnoreIA5SubstringsMatch'
93                SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )
94          */
95  
96          comparator = new NormalizingComparator(
97                  new CachingNormalizer( new DeepTrimToLowerNormalizer() ),
98                  new ComparableComparator() );
99          cb.schemaObjectProduced( this, "1.3.6.1.4.1.1466.109.114.3", comparator );
100     }
101 }