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 java.util.Comparator;
21  
22  import javax.naming.NamingException;
23  
24  import org.apache.ldap.common.schema.CachingNormalizer;
25  import org.apache.ldap.common.schema.ComparableComparator;
26  import org.apache.ldap.common.schema.DeepTrimNormalizer;
27  import org.apache.ldap.common.schema.DeepTrimToLowerNormalizer;
28  import org.apache.ldap.common.schema.NormalizingComparator;
29  
30  
31  
32  /***
33   * A producer of Comparator objects for the inetorgperson schema.  This code has been
34   * automatically generated using schema files in the OpenLDAP format along with
35   * the eve schema plugin for maven.  This has been done to facilitate
36   * Eve<->OpenLDAP schema interoperability.
37   *
38   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
39   * @version $Rev: 264732 $
40   */
41  public class InetorgpersonComparatorProducer extends AbstractBootstrapProducer
42  {
43      public InetorgpersonComparatorProducer()
44      {
45          super( ProducerTypeEnum.COMPARATOR_PRODUCER );
46      }
47  
48  
49      // ------------------------------------------------------------------------
50      // BootstrapProducer Methods
51      // ------------------------------------------------------------------------
52  
53  
54      /***
55       * @see org.apache.ldap.server.schema.bootstrap.BootstrapProducer#produce(BootstrapRegistries, org.apache.ldap.server.schema.bootstrap.ProducerCallback)
56       */
57      public void produce( BootstrapRegistries registries, ProducerCallback cb )
58          throws NamingException
59      {
60  
61          Comparator comparator;
62  
63          /*
64           * Straight out of RFC 2798 for InetOrgPerson: Section 9.3.3
65           * =========================================================
66  
67              ( 2.5.13.5 NAME 'caseExactMatch'
68                SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
69  
70              ( 2.5.13.7 NAME 'caseExactSubstringsMatch'
71                SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )
72  
73              ( 2.5.13.12 NAME 'caseIgnoreListSubstringsMatch'
74                SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )
75  
76          */
77  
78          comparator = new NormalizingComparator(
79                  new CachingNormalizer( new DeepTrimNormalizer() ),
80                  new ComparableComparator() );
81          cb.schemaObjectProduced( this, "2.5.13.5", comparator );
82  
83          comparator = new NormalizingComparator(
84                  new CachingNormalizer( new DeepTrimNormalizer() ),
85                  new ComparableComparator() );
86          cb.schemaObjectProduced( this, "2.5.13.7", comparator );
87  
88          comparator = new NormalizingComparator(
89                  new CachingNormalizer( new DeepTrimToLowerNormalizer() ),
90                  new ComparableComparator() );
91          cb.schemaObjectProduced( this, "2.5.13.12", comparator );
92  
93          /*
94           * Straight out of RFC 2798 for InetOrgPerson: Section 9.3.4
95           * =========================================================
96  
97              ( 1.3.6.1.4.1.1466.109.114.3 NAME 'caseIgnoreIA5SubstringsMatch'
98                SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )
99          */
100 
101         comparator = new NormalizingComparator(
102                 new CachingNormalizer( new DeepTrimToLowerNormalizer() ),
103                 new ComparableComparator() );
104         cb.schemaObjectProduced( this, "1.3.6.1.4.1.1466.109.114.3", comparator );
105     }
106 }