/* * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.yangtools.yang.model.api; import java.net.URI; import java.util.List; import java.util.Optional; import java.util.Set; import org.opendaylight.yangtools.concepts.Immutable; import org.opendaylight.yangtools.concepts.SemVer; import org.opendaylight.yangtools.yang.common.QNameModule; import org.opendaylight.yangtools.yang.common.Revision; import org.opendaylight.yangtools.yang.common.YangVersion; /** * This interface contains the methods for getting the data from the YANG * module.
*
* Example of YANG module
* {@link #getName() module} module_name{
  {@link #getYangVersion() yang-version} "1";

  {@link #getNamespace() namespace} "urn:module:namespace";
  {@link #getPrefix() prefix} "prefix";

  {@link #getDescription() description} "description test";
  {@link #getReference() reference} "reference test";

  {@link #getOrganization() organization} "John Doe, john.doe@email.com";
  {@link #getContact() contact} "http://www.opendaylight.org/";

  {@link #getFeatures() feature} feature-test{
     description "description of some feature";
  }
  {@link #getNotifications() notification} notification-test;
  {@link #getRpcs() rpc} rpc-test;
  {@link #getIdentities() identity} identity-test;
  {@link #getExtensionSchemaNodes() extension} extension-test;
  {@link #getRevision() revision} 2011-08-27 {
  {@link #getImports() import} other_module {
    prefix "other_module_prefix"
    revision-date 2011-08-27
  }

  container cont {
  }
  {@link #getAugmentations() augment} "/cont" { ;
  }
}
*/ public interface Module extends DataNodeContainer, DocumentedNode, Immutable, NotificationNodeContainer, NamespaceRevisionAware { /** * Returns the name of the module which is specified as argument of YANG * {@link Module module} keyword. * * @return string with the name of the module */ String getName(); /** * Returns a {@link QNameModule}, which contains the namespace and * the revision of the module. * * @return QNameModule identifier. */ QNameModule getQNameModule(); /** * Returns the namespace of the module which is specified as argument of * YANG {@link Module namespace} * keyword. If you need both namespace and revision, please consider using * {@link #getQNameModule()}. * * @return URI format of the namespace of the module */ @Override default URI getNamespace() { return getQNameModule().getNamespace(); } /** * Returns the revision date for the module. If you need both namespace and * revision, please consider using {@link #getQNameModule()}. * * @return date of the module revision which is specified as argument of * YANG {@link Module revison} * keyword */ @Override default Optional getRevision() { return getQNameModule().getRevision(); } /** * Returns the semantic version of yang module. * *

* If the semantic version is not specified, default semantic version of * module is returned. * * @return SemVer semantic version of yang module which is specified as * argument of * (urn:opendaylight:yang:extension:semantic-version?revision * =2016-02-02)semantic-version statement */ Optional getSemanticVersion(); /** * Returns the prefix of the module. * * @return string with the module prefix which is specified as argument of * YANG {@link Module prefix} * keyword */ String getPrefix(); /** * Returns the YANG version. * * @return YANG version of this module. */ YangVersion getYangVersion(); /** * Returns the module organization. * * @return string with the name of the organization specified in the module * as the argument of YANG {@link Module organization} keyword */ Optional getOrganization(); /** * Returns the module contact. * *

* The contact represents the person or persons to whom technical queries * concerning this module should be sent, such as their name, postal * address, telephone number, and electronic mail address. * * @return string with the contact data specified in the module as the * argument of YANG {@link Module contact} keyword */ Optional getContact(); /** * Returns imports which represents YANG modules which are imported to this * module via import statement. * * @return set of module imports which are specified in the module as the * argument of YANG {@link Module import} keywords. */ Set getImports(); Set getSubmodules(); /** * Returns FeatureDefinition instances which contain data from * feature statements defined in the module. * *

* The feature is used to define a mechanism by which portions of the schema * are marked as conditional. * * @return feature statements in lexicographical order which are specified * in the module as the argument of YANG {@link Module feature} keywords. */ Set getFeatures(); /** * Returns AugmentationSchema instances which contain data from * augment statements defined in the module. * * @return set of the augmentation schema instances which are specified in * the module as YANG {@link Module augment} keyword and are * lexicographically ordered */ Set getAugmentations(); /** * Returns RpcDefinition instances which contain data from * rpc statements defined in the module. * * @return set of the rpc definition instances which are specified in the * module as YANG {@link Module rpc} keywords and are lexicographicaly * ordered */ Set getRpcs(); /** * Returns Deviation instances which contain data from * deviation statements defined in the module. * * @return set of the deviation instances */ Set getDeviations(); /** * Returns IdentitySchemaNode instances which contain data from * identity statements defined in the module. * * @return set of identity schema node instances which are specified in the * module as YANG {@link Module identity} keywords and are * lexicographically ordered */ Set getIdentities(); /** * Returns ExtensionDefinition instances which contain data * from extension statements defined in the module. * * @return set of extension definition instances which are specified in the * module as YANG {@link Module extension} keyword and are * lexicographically ordered */ List getExtensionSchemaNodes(); }