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.schema.converter;
021
022
023import java.util.List;
024import java.util.Map;
025
026import org.apache.directory.api.ldap.model.exception.LdapException;
027
028
029/**
030 * An interface defining the methods to be implemented by the SchemaElement 
031 * classes
032 *
033 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
034 */
035public interface SchemaElement
036{
037    /**
038     * Tells if the attributeType is obsolete
039     * 
040     * @return true if the schema element is obsolete, folse otherwise
041     */
042    boolean isObsolete();
043
044
045    /**
046     * Set the obsolete flag
047     * 
048     * @param isObsolete The value to be set
049     */
050    void setObsolete( boolean isObsolete );
051
052
053    /**
054     * @return the schema element's OID
055     */
056    String getOid();
057
058
059    /**
060     * @return Return the schema element description
061     */
062    String getDescription();
063
064
065    /**
066     * Set the schema element's description
067     * @param description The schema element's description
068     */
069    void setDescription( String description );
070
071
072    /**
073     * @return The list of names for the schemaElement
074     */
075    List<String> getNames();
076
077
078    /**
079     * Set a list of names for a schemaElement
080     * @param names The list of names of this schemaElement
081     */
082    void setNames( List<String> names );
083
084
085    /**
086     * @return The list of extensions for the schemaElement
087     */
088    Map<String, List<String>> getExtensions();
089
090
091    /**
092     * @param key the Extension key
093     * @return The list of a values for a given extension
094     */
095    List<String> getExtension( String key );
096
097
098    /**
099     * Set a list of extensions for a schemaElement
100     * @param extensions The list of extensions of this schemaElement
101     */
102    void setExtensions( Map<String, List<String>> extensions );
103
104
105    /**
106     * Generate a String representation of this schemaElement, formated
107     * as a ldif string 
108     * @param schemaName The schema from which is extracted this schemaElement
109     * @return A string representing the schemaElement as a Ldif formated  String 
110     * @throws org.apache.directory.api.ldap.model.exception.LdapException If any error occurs.
111     */
112    String toLdif( String schemaName ) throws LdapException;
113}