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 */
020package org.apache.directory.api.ldap.model.schema;
021
022
023import java.util.Map;
024
025
026/**
027 * A class is used to resolve the normalizer mapping hash used for normalization.
028 * This interface is implemented and passed into several kinds of parsers that
029 * need to handle the normalization of LDAP name strings.
030 * 
031 * Why you may ask are we doing this?  Why not just pass in the map of 
032 * normalizers to these parsers and let them use that?  First off this mapping
033 * will not be static when dynamic updates are enabled to schema.  So if
034 * we just passed in the map then there would be no way to set a new map or
035 * trigger the change of the map when schema changes.  Secondly we cannot just
036 * pass server side objects that return this mapping because these parsers may
037 * and will be used in client side applications.  They will not have access to
038 * these server side objects that generate these mappings.  Instead when a 
039 * resolver is used we can create mock or almost right implementations.
040 * 
041 * @param <E> The normalizer type
042 * 
043 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
044 */
045public interface NormalizerMappingResolver<E extends Normalizer>
046{
047    /**
048     * Gets the Map containing the normalizers associated to an OID or name
049     * 
050     * @return The normalizer Map
051     * @throws Exception If not found
052     */
053    Map<String, E> getNormalizerMapping() throws Exception;
054}