View Javadoc
1   /*
2    *  Licensed to the Apache Software Foundation (ASF) under one
3    *  or more contributor license agreements.  See the NOTICE file
4    *  distributed with this work for additional information
5    *  regarding copyright ownership.  The ASF licenses this file
6    *  to you under the Apache License, Version 2.0 (the
7    *  "License"); you may not use this file except in compliance
8    *  with the License.  You may obtain a copy of the License at
9    *  
10   *    https://www.apache.org/licenses/LICENSE-2.0
11   *  
12   *  Unless required by applicable law or agreed to in writing,
13   *  software distributed under the License is distributed on an
14   *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   *  KIND, either express or implied.  See the License for the
16   *  specific language governing permissions and limitations
17   *  under the License. 
18   *  
19   */
20  package org.apache.directory.api.ldap.schema.converter;
21  
22  
23  import java.util.List;
24  import java.util.Map;
25  
26  import org.apache.directory.api.ldap.model.exception.LdapException;
27  
28  
29  /**
30   * An interface defining the methods to be implemented by the SchemaElement 
31   * classes
32   *
33   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
34   */
35  public interface SchemaElement
36  {
37      /**
38       * Tells if the attributeType is obsolete
39       * 
40       * @return true if the schema element is obsolete, folse otherwise
41       */
42      boolean isObsolete();
43  
44  
45      /**
46       * Set the obsolete flag
47       * 
48       * @param isObsolete The value to be set
49       */
50      void setObsolete( boolean isObsolete );
51  
52  
53      /**
54       * @return the schema element's OID
55       */
56      String getOid();
57  
58  
59      /**
60       * @return Return the schema element description
61       */
62      String getDescription();
63  
64  
65      /**
66       * Set the schema element's description
67       * @param description The schema element's description
68       */
69      void setDescription( String description );
70  
71  
72      /**
73       * @return The list of names for the schemaElement
74       */
75      List<String> getNames();
76  
77  
78      /**
79       * Set a list of names for a schemaElement
80       * @param names The list of names of this schemaElement
81       */
82      void setNames( List<String> names );
83  
84  
85      /**
86       * @return The list of extensions for the schemaElement
87       */
88      Map<String, List<String>> getExtensions();
89  
90  
91      /**
92       * @param key the Extension key
93       * @return The list of a values for a given extension
94       */
95      List<String> getExtension( String key );
96  
97  
98      /**
99       * 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 }