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.registries.Registries;
026 import org.apache.directory.shared.ldap.constants.SchemaConstants;
027 import org.apache.directory.shared.ldap.schema.Normalizer;
028 import org.apache.directory.shared.ldap.schema.normalizers.DeepTrimToLowerNormalizer;
029 import org.apache.directory.shared.ldap.schema.normalizers.NoOpNormalizer;
030
031
032
033 /**
034 * A producer of Normalizer objects for the apachemeta schema.
035 * Modified by hand from generated code
036 *
037 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
038 * @version $Rev$
039 */
040 public class ApachemetaNormalizerProducer extends AbstractBootstrapProducer
041 {
042 public ApachemetaNormalizerProducer()
043 {
044 super( ProducerTypeEnum.NORMALIZER_PRODUCER );
045 }
046
047
048 // ------------------------------------------------------------------------
049 // BootstrapProducer Methods
050 // ------------------------------------------------------------------------
051
052
053 /**
054 * @see BootstrapProducer#produce(Registries, ProducerCallback)
055 */
056 public void produce( Registries registries, ProducerCallback cb )
057 throws NamingException
058 {
059 Normalizer normalizer = null;
060
061 normalizer = new NameOrNumericIdNormalizer( registries.getOidRegistry() );
062 cb.schemaObjectProduced( this, "1.3.6.1.4.1.18060.0.4.0.1.0", normalizer );
063
064 normalizer = new NoOpNormalizer();
065 cb.schemaObjectProduced( this, "1.3.6.1.4.1.18060.0.4.0.1.1", normalizer );
066
067 normalizer = new NoOpNormalizer();
068 cb.schemaObjectProduced( this, "1.3.6.1.4.1.18060.0.4.0.1.2", normalizer );
069
070 normalizer = new DeepTrimToLowerNormalizer();
071 cb.schemaObjectProduced( this, "1.3.6.1.4.1.18060.0.4.0.1.3", normalizer );
072
073 normalizer = new DeepTrimToLowerNormalizer();
074 cb.schemaObjectProduced( this, "1.3.6.1.4.1.18060.0.4.0.1.4", normalizer );
075
076 // For entryUuid
077 normalizer = new NoOpNormalizer();
078 cb.schemaObjectProduced( this, SchemaConstants.ENTRY_UUID_AT_OID, normalizer );
079
080 // For entryCSN
081 normalizer = new NoOpNormalizer();
082 cb.schemaObjectProduced( this, SchemaConstants.ENTRY_CSN_AT_OID, normalizer );
083 }
084 }