b273c760815cc146057e73a81feb864fcc88008b
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / SchemaContext.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.net.URI;
11 import java.util.Date;
12 import java.util.Set;
13
14 /**
15  * The interface contains the methods for manipulating all the top level context
16  * data (data from all red modules) like YANG notifications, extensions,
17  * operations...
18  */
19 public interface SchemaContext {
20
21     /**
22      * Returns data schema node instances which represents direct subnodes (like
23      * leaf, leaf-list, list, container) in all YANG modules in the context.
24      * 
25      * @return set of <code>DataSchemaNode</code> instances which represents
26      *         YANG data nodes at the module top level
27      */
28     Set<DataSchemaNode> getDataDefinitions();
29
30     /**
31      * Returns modules which are part of the schema context.
32      * 
33      * @return set of the modules which belong to the schema context
34      */
35     Set<Module> getModules();
36
37     /**
38      * 
39      * Returns notification definition instances which are defined as the direct
40      * subelements in all YANG modules in the context.
41      * 
42      * @return set of <code>NotificationDefinition</code> instances which
43      *         represents nodes defined via <code>notification</code> YANG
44      *         keyword
45      */
46     Set<NotificationDefinition> getNotifications();
47
48     /**
49      * Returns rpc definition instances which are defined as the direct
50      * subelements in all YANG modules in the context.
51      * 
52      * @return set of <code>RpcDefinition</code> instances which represents
53      *         nodes defined via <code>rpc</code> YANG keyword
54      */
55     Set<RpcDefinition> getOperations();
56
57     /**
58      * Returns extencion definition instances which are defined as the direct
59      * subelements in all YANG modules in the context
60      * 
61      * @return set of <code>ExtensionDefinition</code> instances which
62      *         represents nodes defined via <code>extension</code> YANG keyword
63      */
64     Set<ExtensionDefinition> getExtensions();
65
66     /**
67      * Returns module instance (from the context) with concrete name and
68      * revision date.
69      * 
70      * @param name
71      *            string with the module name
72      * @param revision
73      *            date of the module revision
74      * @return module instance which has name and revision (if specified) the
75      *         same as are the values specified in parameters <code>name</code>
76      *         and <code>revision</code>. In other cases the <code>null</code>
77      *         value is returned.
78      * 
79      */
80     Module findModuleByName(final String name, final Date revision);
81
82     /**
83      * 
84      * Returns module instance (from the context) with concrete namespace.
85      * 
86      * @param namespace
87      *            URI instance with specified namespace
88      * @return module instance which has namespace equal to the
89      *         <code>namespace</code> or <code>null</code> in other cases
90      */
91     Set<Module> findModuleByNamespace(final URI namespace);
92     
93     Module findModuleByNamespaceAndRevision(final URI namespace,final Date revision);
94 }