0da03eb986d914797343a4b973fe7b49af3bb2f3
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / Module.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.yangtools.yang.model.api;
9
10 import java.util.List;
11 import java.util.Set;
12 import javax.annotation.concurrent.Immutable;
13
14 /**
15  * This interface contains the methods for getting the data from the YANG
16  * module.<br>
17  * <br>
18  * <i>Example of YANG module</i> <code><br>
19  * {@link #getName() <b><font color="#FF0000">module</font></b>} module_name{<br>
20     &nbsp;&nbsp;{@link #getYangVersion() <b><font color="#8b4513">yang-version</font></b>} "1";<br><br>
21
22     &nbsp;&nbsp;{@link #getNamespace() <b><font color="#00FF00">namespace</font></b>} "urn:module:namespace";<br>
23     &nbsp;&nbsp;{@link #getPrefix() <b><font color="#0000FF">prefix</font></b><a name="prefix"></a>} "prefix";<br><br>
24
25     &nbsp;&nbsp;{@link #getDescription() <b><font color="#b8860b">description</font></b>} "description test";<br>
26     &nbsp;&nbsp;{@link #getReference() <b><font color="#008b8b">reference</font></b>} "reference test";<br><br>
27
28     &nbsp;&nbsp;{@link #getOrganization() <b><font color="#606060">organization</font></b>} "John Doe, john.doe@email.com";<br>
29     &nbsp;&nbsp;{@link #getContact() <b><font color="#FF9900">contact</font></b>} "http://www.opendaylight.org/";<br><br>
30
31     &nbsp;&nbsp;{@link #getFeatures() <b><font color="#8b0000">feature</font></b>} feature-test{<br>
32     &nbsp;&nbsp;&nbsp;&nbsp; description "description of some feature";<br>
33     &nbsp;&nbsp;}<br>
34
35     &nbsp;&nbsp;{@link #getNotifications() <b><font color="#b22222">notification</font></b>} notification-test;<br>
36     &nbsp;&nbsp;{@link #getRpcs() <b><font color="#d2691e">rpc</font></b>} rpc-test;<br>
37     <!-- &nbsp;&nbsp;{@link #getDeviations() <b><font color="#b8860b">deviation</font></b>} deviation-test;<br> -->
38     &nbsp;&nbsp;{@link #getIdentities() <b><font color="#bdb76b">identity</font></b>} identity-test;<br>
39     &nbsp;&nbsp;{@link #getExtensionSchemaNodes() <b><font color="#808000">extension</font></b>} extension-test;<br>
40
41
42     &nbsp;&nbsp;{@link #getRevision() <b><font color="#339900">revision</font></b>} 2011-08-27 {<br>
43
44     &nbsp;&nbsp;{@link #getImports() <b><font color="#9400d3">import</font></b>} other_module {<br>
45     &nbsp;&nbsp;&nbsp;&nbsp;prefix "other_module_prefix"<br>
46     &nbsp;&nbsp;&nbsp;&nbsp;revision-date 2011-08-27<br>
47     &nbsp;&nbsp;}<br><br>
48
49     &nbsp;&nbsp;container cont {<br>
50     &nbsp;&nbsp;}<br>
51
52     &nbsp;&nbsp;{@link #getAugmentations() <b><font color="#dc143c">augment</font></b>} "/cont" { ;<br>
53     &nbsp;&nbsp;}<br>
54     }
55
56     </code>
57  */
58 @Immutable
59 public interface Module extends DataNodeContainer, SourceStreamAware, ModuleIdentifier {
60     /**
61      * Returns the prefix of the module
62      *
63      * @return string with the module prefix which is specified as argument of
64      *         YANG {@link Module <b><font color="#0000FF">prefix</font></b>}
65      *         keyword
66      */
67     String getPrefix();
68
69     /**
70      * Returns the YANG version.
71      *
72      * Default value is 1.
73      *
74      * @return string with the module YANG version which is specified as
75      *         argument of YANG {@link Module <b> <font
76      *         color="#8b4513">yang-version</font></b>} keyword
77      */
78     String getYangVersion();
79
80     /**
81      * Returns the module description.
82      *
83      * @return string with the module description which is specified as argument
84      *         of YANG {@link Module <b><font
85      *         color="#b8860b">description</font></b>} keyword
86      */
87     String getDescription();
88
89     /**
90      * Returns the module reference.
91      *
92      * @return string with the module reference which is specified as argument
93      *         of YANG {@link Module <b><font
94      *         color="#008b8b">reference</font></b>} keyword
95      */
96     String getReference();
97
98     /**
99      * Returns the module organization.
100      *
101      * @return string with the name of the organization specified in the module
102      *         as the argument of YANG {@link Module <b><font
103      *         color="#606060">organization</font></b>} keyword
104      */
105     String getOrganization();
106
107     /**
108      * Returns the module contact.
109      *
110      * The contact represents the person or persons to whom technical queries
111      * concerning this module should be sent, such as their name, postal
112      * address, telephone number, and electronic mail address.
113      *
114      * @return string with the contact data specified in the module as the
115      *         argument of YANG {@link Module <b><font
116      *         color="#FF9900">contact</font></b>} keyword
117      */
118     String getContact();
119
120     /**
121      * Returns imports which represents YANG modules which are imported to this
122      * module via <b>import</b> statement.
123      *
124      * @return set of module imports which are specified in the module as the
125      *         argument of YANG {@link Module <b><font
126      *         color="#9400d3">import</font></b>} keywords.
127      */
128     Set<ModuleImport> getImports();
129
130     Set<Module> getSubmodules();
131
132     /**
133      * Returns <code>FeatureDefinition</code> instances which contain data from
134      * <b>feature</b> statements defined in the module.
135      *
136      * The feature is used to define a mechanism by which portions of the schema
137      * are marked as conditional.
138      *
139      * @return feature statements in lexicographical order which are specified
140      *         in the module as the argument of YANG {@link Module <b><font
141      *         color="#8b0000">feature</font></b>} keywords.
142      */
143     Set<FeatureDefinition> getFeatures();
144
145     /**
146      * Returns <code>NotificationDefinition</code> instances which contain data
147      * from <b>notification</b> statements defined in the module.
148      *
149      * @return notification statements in lexicographical order which are
150      *         specified in the module as the argument of YANG {@link Module
151      *         <b><font color="#b22222">notification</font></b>} keywords.
152      */
153     Set<NotificationDefinition> getNotifications();
154
155     /**
156      * Returns <code>AugmentationSchema</code> instances which contain data from
157      * <b>augment</b> statements defined in the module.
158      *
159      * @return set of the augmentation schema instances which are specified in
160      *         the module as YANG {@link Module <b><font
161      *         color="#dc143c">augment</font></b>} keyword and are
162      *         lexicographically ordered
163      */
164     Set<AugmentationSchema> getAugmentations();
165
166     /**
167      * Returns <code>RpcDefinition</code> instances which contain data from
168      * <b>rpc</b> statements defined in the module.
169      *
170      * @return set of the rpc definition instances which are specified in the
171      *         module as YANG {@link Module <b><font
172      *         color="#d2691e">rpc</font></b>} keywords and are lexicographicaly
173      *         ordered
174      */
175     Set<RpcDefinition> getRpcs();
176
177     /**
178      * Returns <code>Deviation</code> instances which contain data from
179      * <b>deviation</b> statements defined in the module.
180      *
181      * @return set of the deviation instances
182      */
183     Set<Deviation> getDeviations();
184
185     /**
186      * Returns <code>IdentitySchemaNode</code> instances which contain data from
187      * <b>identity</b> statements defined in the module.
188      *
189      * @return set of identity schema node instances which are specified in the
190      *         module as YANG {@link Module <b><font
191      *         color="#bdb76b">identity</font></b>} keywords and are
192      *         lexicographically ordered
193      */
194     Set<IdentitySchemaNode> getIdentities();
195
196     /**
197      * Returns <code>ExtensionDefinition</code> instances which contain data
198      * from <b>extension</b> statements defined in the module.
199      *
200      * @return set of extension definition instances which are specified in the
201      *         module as YANG {@link Module <b><font
202      *         color="#808000">extension</font></b>} keyword and are
203      *         lexicographically ordered
204      */
205     List<ExtensionDefinition> getExtensionSchemaNodes();
206
207     /**
208      * Returns unknown nodes defined in module.
209      *
210      * @return unknown nodes in lexicographical order
211      */
212     List<UnknownSchemaNode> getUnknownSchemaNodes();
213
214     /**
215      * Get yang source.
216      */
217     String getSource();
218
219 }