X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=yang%2Fyang-model-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fmodel%2Fapi%2FSchemaContext.java;h=e51e4684323f63df9bd14fa6f6501ce1b48a034e;hb=dd2edcd83da73c13333e496c7ae9aa59a5111d15;hp=1555bbb38ff5b12cf149cea73310d63bc87fcd85;hpb=16d198e69a05520776c25daf6949107042928a60;p=yangtools.git diff --git a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/SchemaContext.java b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/SchemaContext.java index 1555bbb38f..e51e468432 100644 --- a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/SchemaContext.java +++ b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/SchemaContext.java @@ -11,17 +11,21 @@ import java.net.URI; import java.util.Date; import java.util.Set; +import org.opendaylight.yangtools.yang.common.QName; + /** * The interface contains the methods for manipulating all the top level context * data (data from all red modules) like YANG notifications, extensions, * operations... */ -public interface SchemaContext { +public interface SchemaContext extends ContainerSchemaNode { + + public static final QName NAME = QName.create(URI.create("urn:ietf:params:xml:ns:netconf:base:1.0"), null, "data"); /** * Returns data schema node instances which represents direct subnodes (like * leaf, leaf-list, list, container) in all YANG modules in the context. - * + * * @return set of DataSchemaNode instances which represents * YANG data nodes at the module top level */ @@ -29,16 +33,16 @@ public interface SchemaContext { /** * Returns modules which are part of the schema context. - * + * * @return set of the modules which belong to the schema context */ Set getModules(); /** - * + * * Returns notification definition instances which are defined as the direct * subelements in all YANG modules in the context. - * + * * @return set of NotificationDefinition instances which * represents nodes defined via notification YANG * keyword @@ -48,7 +52,7 @@ public interface SchemaContext { /** * Returns rpc definition instances which are defined as the direct * subelements in all YANG modules in the context. - * + * * @return set of RpcDefinition instances which represents * nodes defined via rpc YANG keyword */ @@ -57,7 +61,7 @@ public interface SchemaContext { /** * Returns extencion definition instances which are defined as the direct * subelements in all YANG modules in the context - * + * * @return set of ExtensionDefinition instances which * represents nodes defined via extension YANG keyword */ @@ -66,7 +70,7 @@ public interface SchemaContext { /** * Returns module instance (from the context) with concrete name and * revision date. - * + * * @param name * string with the module name * @param revision @@ -75,18 +79,29 @@ public interface SchemaContext { * same as are the values specified in parameters name * and revision. In other cases the null * value is returned. - * + * */ Module findModuleByName(final String name, final Date revision); /** - * + * * Returns module instance (from the context) with concrete namespace. - * + * * @param namespace * URI instance with specified namespace * @return module instance which has namespace equal to the * namespace or null in other cases */ - Module findModuleByNamespace(final URI namespace); + Set findModuleByNamespace(final URI namespace); + + /** + * Returns module instance based on given namespace and revision. If + * revision is not specified, returns module with newest revision. + * + * @param namespace + * @param revision + * @return + */ + Module findModuleByNamespaceAndRevision(final URI namespace, final Date revision); + }