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