Remove duplicate ietf-yang-library models 21/73521/8
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 28 Jun 2018 09:32:35 +0000 (11:32 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 28 Jun 2018 15:52:15 +0000 (17:52 +0200)
ietf-yang-library is provided by MD-SAL, along with bridge utilities
to work with that model.

Remove the two versions hosted in netconf and consume the version from
mdsal.

Change-Id: If43f159ebac4fedbb267a85fd9df6d46897a5330
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
24 files changed:
features/netconf/odl-netconf-api/pom.xml
features/restconf/odl-restconf-common/pom.xml
features/yanglib/odl-yanglib/pom.xml
netconf/mdsal-netconf-yang-library/pom.xml
netconf/mdsal-netconf-yang-library/src/main/java/org/opendaylight/netconf/mdsal/yang/library/SchemaServiceToMdsalWriter.java
netconf/mdsal-netconf-yang-library/src/test/java/org/opendaylight/netconf/mdsal/yang/library/SchemaServiceToMdsalWriterTest.java
netconf/models/ietf-netconf-yang-library/pom.xml [deleted file]
netconf/models/ietf-netconf-yang-library/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/library/rev160409/OptionalRevisionBuilder.java [deleted file]
netconf/models/ietf-netconf-yang-library/src/main/yang/ietf-yang-library@2016-04-09.yang [deleted file]
netconf/models/pom.xml
netconf/netconf-artifacts/pom.xml
netconf/sal-netconf-connector/pom.xml
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/LibraryModulesSchemas.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/NetconfStateSchemasResolverImpl.java
netconf/yanglib/pom.xml
netconf/yanglib/src/main/java/org/opendaylight/yanglib/impl/YangLibProvider.java
netconf/yanglib/src/test/java/org/opendaylight/yanglib/impl/YangLibProviderTest.java
restconf/restconf-artifacts/pom.xml
restconf/restconf-models/ietf-yang-library/pom.xml [deleted file]
restconf/restconf-models/ietf-yang-library/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/library/rev160621/module/list/CommonLeafsRevisionBuilder.java [deleted file]
restconf/restconf-models/ietf-yang-library/src/main/yang/ietf-yang-library@2016-06-21.yang [deleted file]
restconf/restconf-models/pom.xml
restconf/restconf-nb-bierman02/pom.xml
restconf/restconf-nb-rfc8040/pom.xml

index 86cbef29535b1e4c97022d8b723f43207dfd3b99..1f985a5156c45167ecf0c45eeedb4a704369bb66 100644 (file)
@@ -93,8 +93,8 @@
             <artifactId>ietf-netconf-monitoring-extension</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.opendaylight.netconf</groupId>
-            <artifactId>ietf-netconf-yang-library</artifactId>
+            <groupId>org.opendaylight.mdsal.model</groupId>
+            <artifactId>rfc7895</artifactId>
         </dependency>
     </dependencies>
 </project>
index b7eddf7aadc48137409de76038e124155f4be889..eee6e7745065f6aecbbb1cc2857439d689245ec2 100644 (file)
             <artifactId>ietf-restconf</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.opendaylight.netconf</groupId>
-            <artifactId>ietf-yang-library</artifactId>
+            <groupId>org.opendaylight.mdsal.model</groupId>
+            <artifactId>rfc7895</artifactId>
         </dependency>
         <dependency>
             <groupId>org.opendaylight.netconf</groupId>
index 614aa3bc25c94cc6bce1bd9ad3432e264c3f5848..4d6ae449bdf79d94fd6ef2d39b2a50d414b08567 100644 (file)
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
-        <dependency>
-            <groupId>org.opendaylight.netconf</groupId>
-            <artifactId>ietf-netconf-yang-library</artifactId>
-            <version>1.5.0-SNAPSHOT</version>
-        </dependency>
 
         <dependency>
             <groupId>org.opendaylight.odlparent</groupId>
index d028269befdf55b665884d635fa4ea841a9356dd..d763ab0d427075477d75c08561d9f09360861874 100644 (file)
@@ -36,8 +36,8 @@
             <artifactId>ietf-inet-types-2013-07-15</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.opendaylight.netconf</groupId>
-            <artifactId>ietf-netconf-yang-library</artifactId>
+            <groupId>org.opendaylight.mdsal.model</groupId>
+            <artifactId>rfc7895</artifactId>
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
index 918e71d13f9aae83c3bf3a72fad293e702c0e2dc..b3fc2abfb0f5cbf4e989296685e3482def04d5bf 100644 (file)
@@ -8,28 +8,26 @@
 
 package org.opendaylight.netconf.mdsal.yang.library;
 
-import com.google.common.collect.Lists;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.MoreExecutors;
 import java.util.List;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Collectors;
 import javax.annotation.Nullable;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.sal.core.api.model.SchemaService;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.ModulesState;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.ModulesStateBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.OptionalRevision;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.module.list.Module.ConformanceType;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.module.list.ModuleBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.module.list.module.Submodules;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.module.list.module.SubmodulesBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.module.list.module.submodules.Submodule;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.module.list.module.submodules.SubmoduleBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.ModulesState;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.ModulesStateBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.RevisionUtils;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.module.list.Module.ConformanceType;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.module.list.ModuleBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.module.list.module.Submodule;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.module.list.module.SubmoduleBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.YangIdentifier;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.model.api.Module;
@@ -96,46 +94,29 @@ public class SchemaServiceToMdsalWriter implements SchemaContextListener, AutoCl
     }
 
     private ModulesState createModuleStateFromModules(final Set<Module> modules) {
-        final ModulesStateBuilder modulesStateBuilder = new ModulesStateBuilder();
-        final List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.module.list
-                .Module> moduleList =
-                Lists.newArrayList();
-
-        for (final Module module : modules) {
-            moduleList.add(createModuleEntryFromModule(module));
-        }
-
-        return modulesStateBuilder.setModule(moduleList).setModuleSetId(String.valueOf(moduleSetId.getAndIncrement()))
+        return new ModulesStateBuilder()
+                .setModule(modules.stream().map(this::createModuleEntryFromModule).collect(Collectors.toList()))
+                .setModuleSetId(String.valueOf(moduleSetId.getAndIncrement()))
                 .build();
     }
 
-    private org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.module.list.Module
+    private org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.module.list.Module
         createModuleEntryFromModule(final Module module) {
-        final ModuleBuilder moduleBuilder = new ModuleBuilder();
-
-        // TODO Conformance type is always set to Implement value, but it should it really be like this?
-        // TODO Add also deviations and features lists to module entries
-        moduleBuilder.setName(new YangIdentifier(module.getName()));
-
-        module.getQNameModule().getRevision().ifPresent(rev -> moduleBuilder.setRevision(
-            new OptionalRevision(rev.toString())));
-
-        return moduleBuilder.setNamespace(new Uri(module.getNamespace().toString()))
+        return new ModuleBuilder()
+                .setName(new YangIdentifier(module.getName()))
+                .setRevision(RevisionUtils.fromYangCommon(module.getQNameModule().getRevision()))
+                .setNamespace(new Uri(module.getNamespace().toString()))
+                // FIXME: Conformance type is always set to Implement value, but it should it really be like this?
                 .setConformanceType(ConformanceType.Implement)
-                .setSubmodules(createSubmodulesForModule(module))
+                .setSubmodule(createSubmodulesForModule(module))
+                // FIXME: Add also deviations and features lists to module entries
                 .build();
     }
 
-    private static Submodules createSubmodulesForModule(final Module module) {
-        final List<Submodule> submodulesList = Lists.newArrayList();
-        for (final Module subModule : module.getSubmodules()) {
-            final SubmoduleBuilder subModuleEntryBuilder = new SubmoduleBuilder()
-                    .setName(new YangIdentifier(subModule.getName()));
-            subModule.getQNameModule().getRevision().ifPresent(
-                rev -> subModuleEntryBuilder.setRevision(new OptionalRevision(rev.toString())));
-            submodulesList.add(subModuleEntryBuilder.build());
-        }
-
-        return new SubmodulesBuilder().setSubmodule(submodulesList).build();
+    private static List<Submodule> createSubmodulesForModule(final Module module) {
+        return module.getSubmodules().stream().map(subModule -> new SubmoduleBuilder()
+            .setName(new YangIdentifier(subModule.getName()))
+            .setRevision(RevisionUtils.fromYangCommon(subModule.getQNameModule().getRevision()))
+            .build()).collect(Collectors.toList());
     }
 }
index dda63840422dc62c4f5ef64152d1341af6343919..ce303751bd5d9f1f2e2e0ba20251713e8214bded 100644 (file)
@@ -14,7 +14,7 @@ import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
-import com.google.common.collect.Lists;
+import com.google.common.collect.ImmutableList;
 import com.google.common.util.concurrent.Futures;
 import org.junit.Before;
 import org.junit.Test;
@@ -25,14 +25,15 @@ import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.sal.core.api.model.SchemaService;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.ModulesState;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.ModulesStateBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.OptionalRevision;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.module.list.Module;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.module.list.ModuleBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.module.list.module.SubmodulesBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.module.list.module.submodules.Submodule;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.module.list.module.submodules.SubmoduleBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.ModulesState;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.ModulesStateBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.RevisionIdentifier;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.RevisionUtils;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.module.list.CommonLeafs.Revision;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.module.list.Module;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.module.list.ModuleBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.module.list.module.Submodule;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.module.list.module.SubmoduleBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.YangIdentifier;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -92,15 +93,16 @@ public class SchemaServiceToMdsalWriterTest {
 
     private static ModulesState createTestModuleState() {
         Submodule sub = new SubmoduleBuilder().setName(new YangIdentifier("test-submodule"))
+                .setRevision(RevisionUtils.emptyRevision())
                 .build();
 
         Module module = new ModuleBuilder().setName(new YangIdentifier("test-module"))
                 .setNamespace(new Uri("test:namespace"))
-                .setRevision(new OptionalRevision("2013-07-22"))
-                .setSubmodules(new SubmodulesBuilder().setSubmodule(Lists.newArrayList(sub)).build())
+                .setRevision(new Revision(new RevisionIdentifier("2013-07-22")))
+                .setSubmodule(ImmutableList.of(sub))
                 .setConformanceType(Module.ConformanceType.Implement)
                 .build();
         return new ModulesStateBuilder().setModuleSetId("0")
-                .setModule(Lists.newArrayList(module)).build();
+                .setModule(ImmutableList.of(module)).build();
     }
 }
diff --git a/netconf/models/ietf-netconf-yang-library/pom.xml b/netconf/models/ietf-netconf-yang-library/pom.xml
deleted file mode 100644 (file)
index 2ca7702..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Copyright (c) 2016 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
-  -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.opendaylight.netconf</groupId>
-        <artifactId>netconf-parent</artifactId>
-        <version>1.5.0-SNAPSHOT</version>
-        <relativePath>../../netconf-parent</relativePath>
-    </parent>
-
-    <groupId>org.opendaylight.netconf</groupId>
-    <artifactId>ietf-netconf-yang-library</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <name>${project.artifactId}</name>
-    <packaging>bundle</packaging>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.opendaylight.mdsal.model</groupId>
-            <artifactId>ietf-yang-types-20130715</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.mdsal.model</groupId>
-            <artifactId>ietf-inet-types-2013-07-15</artifactId>
-        </dependency>
-    </dependencies>
-</project>
diff --git a/netconf/models/ietf-netconf-yang-library/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/library/rev160409/OptionalRevisionBuilder.java b/netconf/models/ietf-netconf-yang-library/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/library/rev160409/OptionalRevisionBuilder.java
deleted file mode 100644 (file)
index 54ee117..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409;
-
-
-/**
- * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation.
- * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32).
- *
- * The reason behind putting it under src/main/java is:
- * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent
- * loss of user code.
- *
- */
-public class OptionalRevisionBuilder {
-
-    public static OptionalRevision getDefaultInstance(java.lang.String defaultValue) {
-        throw new java.lang.UnsupportedOperationException("Not yet implemented");
-    }
-
-}
diff --git a/netconf/models/ietf-netconf-yang-library/src/main/yang/ietf-yang-library@2016-04-09.yang b/netconf/models/ietf-netconf-yang-library/src/main/yang/ietf-yang-library@2016-04-09.yang
deleted file mode 100644 (file)
index d82d808..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-module ietf-yang-library {
-    namespace "urn:ietf:params:xml:ns:yang:ietf-yang-library";
-    prefix "yanglib";
-
-    import ietf-yang-types {
-      prefix yang;
-    }
-    import ietf-inet-types {
-      prefix inet;
-    }
-
-    organization
-      "IETF NETCONF (Network Configuration) Working Group";
-
-    contact
-      "WG Web:   <http://tools.ietf.org/wg/netconf/>
-       WG List:  <mailto:netconf@ietf.org>
-
-       WG Chair: Mehmet Ersue
-                 <mailto:mehmet.ersue@nsn.com>
-
-       WG Chair: Mahesh Jethanandani
-                 <mailto:mjethanandani@gmail.com>
-
-       Editor:   Andy Bierman
-                 <mailto:andy@yumaworks.com>
-
-       Editor:   Martin Bjorklund
-                 <mailto:mbj@tail-f.com>
-
-       Editor:   Kent Watsen
-                 <mailto:kwatsen@juniper.net>";
-
-    description
-      "This module contains monitoring information about the YANG
-       modules and submodules that are used within a YANG-based
-       server.
-
-       Copyright (c) 2016 IETF Trust and the persons identified as
-       authors of the code.  All rights reserved.
-
-       Redistribution and use in source and binary forms, with or
-       without modification, is permitted pursuant to, and subject
-       to the license terms contained in, the Simplified BSD License
-       set forth in Section 4.c of the IETF Trust's Legal Provisions
-       Relating to IETF Documents
-       (http://trustee.ietf.org/license-info).
-
-       This version of this YANG module is part of RFC XXXX; see
-       the RFC itself for full legal notices.";
-
-    // RFC Ed.: replace XXXX with actual RFC number and remove this
-    // note.
-
-    // RFC Ed.: remove this note
-    // Note: extracted from draft-ietf-netconf-yang-library-06.txt
-
-    // RFC Ed.: update the date below with the date of RFC publication
-    // and remove this note.
-    revision 2016-04-09 {
-      description
-        "Initial revision.";
-      reference
-        "RFC XXXX: YANG Module Library.";
-    }
-
-    /*
-     * Typedefs
-     */
-
-    // FIXME inline this union after https://bugs.opendaylight.org/show_bug.cgi?id=5826 is fixed
-    typedef optional-revision {
-      type union {
-        type revision-identifier;
-        type string { length 0; }
-      }
-      description
-        "The YANG module or submodule revision date.
-         A zero-length string is used if no revision statement
-         is present in the YANG module or submodule.";
-    }
-
-    typedef revision-identifier {
-      type string {
-        pattern '\d{4}-\d{2}-\d{2}';
-      }
-      description
-        "Represents a specific date in YYYY-MM-DD format.";
-    }
-
-    /*
-     * Groupings
-     */
-
-    grouping module-list {
-      description
-        "The module data structure is represented as a grouping
-         so it can be reused in configuration or another monitoring
-         data structure.";
-
-      grouping common-leafs {
-        description
-          "Common parameters for YANG modules and submodules.";
-
-        leaf name {
-          type yang:yang-identifier;
-          description
-            "The YANG module or submodule name.";
-        }
-        leaf revision {
-          type optional-revision;
-        }
-      }
-
-      grouping schema-leaf {
-        description
-          "Common schema leaf parameter for modules and submodules.";
-
-        leaf schema {
-          type inet:uri;
-          description
-            "Contains a URL that represents the YANG schema
-             resource for this module or submodule.
-
-             This leaf will only be present if there is a URL
-             available for retrieval of the schema for this entry.";
-        }
-      }
-
-      list module {
-        key "name revision";
-        description
-          "Each entry represents one revision of one module
-           currently supported by the server.";
-
-        uses common-leafs;
-        uses schema-leaf;
-
-        leaf namespace {
-          type inet:uri;
-          mandatory true;
-          description
-            "The XML namespace identifier for this module.";
-        }
-        leaf-list feature {
-          type yang:yang-identifier;
-          description
-            "List of YANG feature names from this module that are
-             supported by the server, regardless whether they are
-             defined in the module or any included submodule.";
-        }
-        list deviation {
-          key "name revision";
-          description
-            "List of YANG deviation module names and revisions
-             used by this server to modify the conformance of
-             the module associated with this entry.  Note that
-             the same module can be used for deviations for
-             multiple modules, so the same entry MAY appear
-             within multiple 'module' entries.
-
-             The deviation module MUST be present in the 'module'
-             list, with the same name and revision values.
-             The 'conformance-type' value will be 'implement' for
-             the deviation module.";
-          uses common-leafs;
-        }
-        leaf conformance-type {
-          type enumeration {
-            enum implement {
-              description
-                "Indicates that the server implements one or more
-                 protocol-accessible objects defined in the YANG module
-                 identified in this entry.  This includes deviation
-                 statements defined in the module.
-
-                 For YANG version 1.1 modules, there is at most one
-                 module entry with conformance type 'implement' for a
-                 particular module name, since YANG 1.1 requires that
-                 at most one revision of a module is implemented.
-
-                 For YANG version 1 modules, there SHOULD NOT be more
-                 than one module entry for a particular module name.";
-            }
-            enum import {
-              description
-                "Indicates that the server imports reusable definitions
-                 from the specified revision of the module, but does
-                 not implement any protocol accessible objects from
-                 this revision.
-
-                 Multiple module entries for the same module name MAY
-                 exist. This can occur if multiple modules import the
-                 same module, but specify different revision-dates in
-                 the import statements.";
-            }
-          }
-          mandatory true;
-          description
-            "Indicates the type of conformance the server is claiming
-             for the YANG module identified by this entry.";
-        }
-        container submodules {
-          description
-            "Contains information about all the submodules used
-             by the parent module entry";
-
-          list submodule {
-            key "name revision";
-            description
-              "Each entry represents one submodule within the
-               parent module.";
-            uses common-leafs;
-            uses schema-leaf;
-          }
-        }
-      }
-    }
-
-    /*
-     * Operational state data nodes
-     */
-
-    container modules-state {
-      config false;
-      description
-        "Contains YANG module monitoring information.";
-
-      leaf module-set-id {
-        type string;
-        mandatory true;
-        description
-          "Contains a server-specific identifier representing
-           the current set of modules and submodules.  The
-           server MUST change the value of this leaf if the
-           information represented by the 'module' list instances
-           has changed.";
-      }
-
-      uses module-list;
-    }
-
-    /*
-     * Notifications
-     */
-
-    notification yang-library-change {
-      description
-       "Generated when the set of modules and submodules supported
-        by the server has changed.";
-      leaf module-set-id {
-        type leafref {
-          path "/yanglib:modules-state/yanglib:module-set-id";
-        }
-        mandatory true;
-        description
-          "Contains the module-set-id value representing the
-           set of modules and submodules supported at the server at
-           the time the notification is generated.";
-      }
-    }
-
-}
-
index 737de17f36df5c87a7bbbff37f89b330fde8d4a7..513399998c95d2fb2338a588298d13744cd2b195 100644 (file)
@@ -27,6 +27,5 @@
     <module>ietf-netconf-monitoring</module>
     <module>ietf-netconf-notifications</module>
     <module>ietf-netconf-monitoring-extension</module>
-    <module>ietf-netconf-yang-library</module>
   </modules>
 </project>
index be58318e98534fbe4ae2d9fdf32d928813e41def..94338ba903cb2f9de8a4b07e7d60c7f3850bc532 100644 (file)
                 <version>${project.version}</version>
             </dependency>
 
-            <dependency>
-                <groupId>${project.groupId}</groupId>
-                <artifactId>ietf-netconf-yang-library</artifactId>
-                <version>${project.version}</version>
-            </dependency>
-
             <dependency>
                 <groupId>org.opendaylight.netconf</groupId>
                 <artifactId>yanglib</artifactId>
index d1306f1acab1a5e609f120083619cc3455ee16b5..795a743c597b7a8054b424f7783cc67b88b18785 100644 (file)
@@ -40,8 +40,8 @@
       <artifactId>ietf-netconf-notifications</artifactId>
     </dependency>
     <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>ietf-netconf-yang-library</artifactId>
+      <groupId>org.opendaylight.mdsal.model</groupId>
+      <artifactId>rfc7895</artifactId>
     </dependency>
     <dependency>
       <groupId>${project.groupId}</groupId>
index 9e62919cf688852953d57c428f2e363d22262c31..590996ea19dd9f939b3dadfb695b1e81c41e2af5 100644 (file)
@@ -47,8 +47,8 @@ import org.opendaylight.netconf.sal.connect.api.NetconfDeviceSchemas;
 import org.opendaylight.netconf.sal.connect.netconf.sal.NetconfDeviceRpc;
 import org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil;
 import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.ModulesState;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.module.list.Module;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.ModulesState;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.module.list.Module;
 import org.opendaylight.yangtools.util.xml.UntrustedXML;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.Revision;
@@ -88,7 +88,7 @@ public final class LibraryModulesSchemas implements NetconfDeviceSchemas {
     static {
         final ModuleInfoBackedContext moduleInfoBackedContext = ModuleInfoBackedContext.create();
         moduleInfoBackedContext.registerModuleInfo(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang
-                .library.rev160409.$YangModuleInfoImpl.getInstance());
+                .library.rev160621.$YangModuleInfoImpl.getInstance());
         LIBRARY_CONTEXT = moduleInfoBackedContext.tryToCreateSchemaContext().get();
     }
 
index 765c6108da846e97245aae4dc3df4572f2970fdf..dd43dad9381c6a28c0e45ddb75221c810b538172 100644 (file)
@@ -13,7 +13,7 @@ import org.opendaylight.netconf.sal.connect.api.NetconfDeviceSchemasResolver;
 import org.opendaylight.netconf.sal.connect.netconf.listener.NetconfSessionPreferences;
 import org.opendaylight.netconf.sal.connect.netconf.sal.NetconfDeviceRpc;
 import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.ModulesState;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.ModulesState;
 import org.opendaylight.yangtools.yang.common.QName;
 
 /**
index cb301d47f1906f118b8112d22f52456b341bbfbe..2751298d071d71a46c8eeabbca506c48d925590c 100644 (file)
@@ -47,8 +47,8 @@
             <artifactId>guava</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.opendaylight.netconf</groupId>
-            <artifactId>ietf-netconf-yang-library</artifactId>
+            <groupId>org.opendaylight.mdsal.model</groupId>
+            <artifactId>rfc7895</artifactId>
         </dependency>
         <dependency>
             <groupId>org.mockito</groupId>
index 8e9b378a167168cbca982254df0e0a1620a82b5f..e9270c4f1ee2846b892caf7ebe8a2725f0cc27d7 100644 (file)
@@ -22,13 +22,12 @@ import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.ModulesState;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.ModulesStateBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.OptionalRevision;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.RevisionIdentifier;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.module.list.Module;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.module.list.ModuleBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.module.list.ModuleKey;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.ModulesState;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.ModulesStateBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.RevisionUtils;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.module.list.Module;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.module.list.ModuleBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.module.list.ModuleKey;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.YangIdentifier;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.yanglib.impl.rev141210.YanglibConfig;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -53,7 +52,6 @@ import org.slf4j.LoggerFactory;
 public class YangLibProvider implements AutoCloseable, SchemaSourceListener {
     private static final Logger LOG = LoggerFactory.getLogger(YangLibProvider.class);
 
-    private static final OptionalRevision NO_REVISION = new OptionalRevision("");
     private static final Predicate<PotentialSchemaSource<?>> YANG_SCHEMA_SOURCE =
         input -> YangTextSchemaSource.class.isAssignableFrom(input.getRepresentation());
 
@@ -108,11 +106,9 @@ public class YangLibProvider implements AutoCloseable, SchemaSourceListener {
         for (PotentialSchemaSource<?> potentialYangSource : Iterables.filter(sources, YANG_SCHEMA_SOURCE)) {
             final YangIdentifier moduleName = new YangIdentifier(potentialYangSource.getSourceIdentifier().getName());
 
-            final OptionalRevision moduleRevision = getRevisionForModule(potentialYangSource.getSourceIdentifier());
-
             final Module newModule = new ModuleBuilder()
                     .setName(moduleName)
-                    .setRevision(moduleRevision)
+                    .setRevision(RevisionUtils.fromYangCommon(potentialYangSource.getSourceIdentifier().getRevision()))
                     .setSchema(getUrlForModule(potentialYangSource.getSourceIdentifier()))
                     .build();
 
@@ -155,7 +151,7 @@ public class YangLibProvider implements AutoCloseable, SchemaSourceListener {
                         .child(Module.class,
                                 new ModuleKey(
                                         new YangIdentifier(source.getSourceIdentifier().getName()),
-                                        getRevisionForModule(source.getSourceIdentifier()))));
+                                        RevisionUtils.fromYangCommon(source.getSourceIdentifier().getRevision()))));
 
         Futures.addCallback(tx.submit(), new FutureCallback<Void>() {
             @Override
@@ -180,9 +176,4 @@ public class YangLibProvider implements AutoCloseable, SchemaSourceListener {
     private static String revString(final SourceIdentifier id) {
         return id.getRevision().map(Revision::toString).orElse("");
     }
-
-    private static OptionalRevision getRevisionForModule(final SourceIdentifier sourceIdentifier) {
-        return sourceIdentifier.getRevision().map(rev -> new OptionalRevision(new RevisionIdentifier(rev.toString())))
-                .orElse(NO_REVISION);
-    }
 }
index 440174efa6193f60110cf9bab6f6ae8544d9ab86..f6c712976fc0981f1080ddfe3b456b1374bb2d1b 100644 (file)
@@ -34,18 +34,18 @@ import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.ModulesState;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.ModulesStateBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.OptionalRevision;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.RevisionIdentifier;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.module.list.Module;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.module.list.ModuleBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.module.list.ModuleKey;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.ModulesState;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.ModulesStateBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.RevisionIdentifier;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.RevisionUtils;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.module.list.CommonLeafs.Revision;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.module.list.Module;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.module.list.ModuleBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.module.list.ModuleKey;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.YangIdentifier;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.yanglib.impl.rev141210.YanglibConfig;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.yanglib.impl.rev141210.YanglibConfigBuilder;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.common.Revision;
 import org.opendaylight.yangtools.yang.model.repo.api.RevisionSourceIdentifier;
 import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
 import org.opendaylight.yangtools.yang.model.repo.api.YinSchemaSourceRepresentation;
@@ -108,7 +108,8 @@ public class YangLibProviderTest {
 
         list.add(
                 PotentialSchemaSource.create(
-                        RevisionSourceIdentifier.create("with-revision", Revision.of("2016-04-28")),
+                        RevisionSourceIdentifier.create("with-revision",
+                            org.opendaylight.yangtools.yang.common.Revision.of("2016-04-28")),
                         YangTextSchemaSource.class, PotentialSchemaSource.Costs.IMMEDIATE.getValue()));
 
         when(writeTransaction.submit()).thenReturn(Futures.immediateCheckedFuture(null));
@@ -118,7 +119,7 @@ public class YangLibProviderTest {
 
         Module newModule = new ModuleBuilder()
                 .setName(new YangIdentifier("no-revision"))
-                .setRevision(new OptionalRevision(""))
+                .setRevision(RevisionUtils.emptyRevision())
                 .setSchema(new Uri("http://www.fake.com:300/yanglib/schemas/no-revision/"))
                 .build();
 
@@ -126,7 +127,7 @@ public class YangLibProviderTest {
 
         newModule = new ModuleBuilder()
                 .setName(new YangIdentifier("with-revision"))
-                .setRevision(new OptionalRevision(new RevisionIdentifier("2016-04-28")))
+                .setRevision(new Revision(new RevisionIdentifier("2016-04-28")))
                 .setSchema(new Uri("http://www.fake.com:300/yanglib/schemas/with-revision/2016-04-28"))
                 .build();
 
@@ -220,13 +221,14 @@ public class YangLibProviderTest {
                 eq(InstanceIdentifier.create(ModulesState.class)
                         .child(Module.class,
                                 new ModuleKey(new YangIdentifier("unregistered-yang-schema-without-revision"),
-                                        new OptionalRevision("")))));
+                                        RevisionUtils.emptyRevision()))));
 
         verify(writeTransaction).submit();
 
         yangUnregistererSource =
                 PotentialSchemaSource.create(
-                        RevisionSourceIdentifier.create("unregistered-yang-with-revision", Revision.of("2016-04-28")),
+                        RevisionSourceIdentifier.create("unregistered-yang-with-revision",
+                            org.opendaylight.yangtools.yang.common.Revision.of("2016-04-28")),
                         YangTextSchemaSource.class, PotentialSchemaSource.Costs.LOCAL_IO.getValue());
 
         yangLibProvider.schemaSourceUnregistered(yangUnregistererSource);
@@ -236,7 +238,7 @@ public class YangLibProviderTest {
                 eq(InstanceIdentifier.create(ModulesState.class)
                         .child(Module.class,
                                 new ModuleKey(new YangIdentifier("unregistered-yang-with-revision"),
-                                        new OptionalRevision(new RevisionIdentifier("2016-04-28"))))));
+                                        new Revision(new RevisionIdentifier("2016-04-28"))))));
 
         verify(writeTransaction, times(2)).submit();
     }
index 3a31580640b9b90f7537df8e307cedc038edd951..6e595cf6b6a367255ba2b166c1cee27a5e83b7a2 100644 (file)
                 <artifactId>ietf-restconf</artifactId>
                 <version>${project.version}</version>
             </dependency>
-            <dependency>
-                <groupId>${project.groupId}</groupId>
-                <artifactId>ietf-yang-library</artifactId>
-                <version>${project.version}</version>
-            </dependency>
             <dependency>
                 <groupId>${project.groupId}</groupId>
                 <artifactId>ietf-restconf-monitoring</artifactId>
diff --git a/restconf/restconf-models/ietf-yang-library/pom.xml b/restconf/restconf-models/ietf-yang-library/pom.xml
deleted file mode 100644 (file)
index 285d35a..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Copyright (c) 2016 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
-  -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.opendaylight.netconf</groupId>
-        <artifactId>restconf-parent</artifactId>
-        <version>1.8.0-SNAPSHOT</version>
-        <relativePath>../../restconf-parent</relativePath>
-    </parent>
-
-    <groupId>org.opendaylight.netconf</groupId>
-    <artifactId>ietf-yang-library</artifactId>
-    <version>1.8.0-SNAPSHOT</version>
-    <packaging>bundle</packaging>
-    <name>${project.artifactId}</name>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.opendaylight.mdsal.model</groupId>
-            <artifactId>ietf-inet-types-2013-07-15</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.mdsal.model</groupId>
-            <artifactId>ietf-yang-types-20130715</artifactId>
-        </dependency>
-    </dependencies>
-</project>
diff --git a/restconf/restconf-models/ietf-yang-library/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/library/rev160621/module/list/CommonLeafsRevisionBuilder.java b/restconf/restconf-models/ietf-yang-library/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/library/rev160621/module/list/CommonLeafsRevisionBuilder.java
deleted file mode 100644 (file)
index 5bd5bc1..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.module.list;
-
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.module.list.CommonLeafs.Revision;
-
-
-/**
- * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation.
- * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32).
- *
- * The reason behind putting it under src/main/java is:
- * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent
- * loss of user code.
- *
- */
-public class CommonLeafsRevisionBuilder {
-
-    public static Revision getDefaultInstance(final java.lang.String defaultValue) {
-        return new Revision(defaultValue);
-    }
-
-}
diff --git a/restconf/restconf-models/ietf-yang-library/src/main/yang/ietf-yang-library@2016-06-21.yang b/restconf/restconf-models/ietf-yang-library/src/main/yang/ietf-yang-library@2016-06-21.yang
deleted file mode 100644 (file)
index bc466ee..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-module ietf-yang-library {
-  namespace "urn:ietf:params:xml:ns:yang:ietf-yang-library";
-  prefix "yanglib";
-  import ietf-yang-types {
-    prefix yang;
-  }
-  import ietf-inet-types {
-    prefix inet;
-  }
-  organization
-    "IETF NETCONF (Network Configuration) Working Group";
-  contact
-    "WG Web:   <https://datatracker.ietf.org/wg/netconf/>
-     WG List:  <mailto:netconf@ietf.org>
-     WG Chair: Mehmet Ersue
-               <mailto:mehmet.ersue@nsn.com>
-     WG Chair: Mahesh Jethanandani
-               <mailto:mjethanandani@gmail.com>
-     Editor:   Andy Bierman
-               <mailto:andy@yumaworks.com>
-     Editor:   Martin Bjorklund
-               <mailto:mbj@tail-f.com>
-     Editor:   Kent Watsen
-               <mailto:kwatsen@juniper.net>";
-  description
-    "This module contains monitoring information about the YANG
-     modules and submodules that are used within a YANG-based
-     server.
-     Copyright (c) 2016 IETF Trust and the persons identified as
-     authors of the code.  All rights reserved.
-     Redistribution and use in source and binary forms, with or
-     without modification, is permitted pursuant to, and subject
-     to the license terms contained in, the Simplified BSD License
-     set forth in Section 4.c of the IETF Trust's Legal Provisions
-     Relating to IETF Documents
-     (http://trustee.ietf.org/license-info).
-     This version of this YANG module is part of RFC 7895; see
-     the RFC itself for full legal notices.";
-  revision 2016-06-21 {
-    description
-      "Initial revision.";
-    reference
-      "RFC 7895: YANG Module Library.";
-  }
-  /*
-   * Typedefs
-   */
-  typedef revision-identifier {
-    type string {
-      pattern '\d{4}-\d{2}-\d{2}';
-    }
-    description
-      "Represents a specific date in YYYY-MM-DD format.";
-  }
-  /*
-   * Groupings
-   */
-  grouping module-list {
-    description
-      "The module data structure is represented as a grouping
-       so it can be reused in configuration or another monitoring
-       data structure.";
-    grouping common-leafs {
-      description
-        "Common parameters for YANG modules and submodules.";
-      leaf name {
-        type yang:yang-identifier;
-        description
-          "The YANG module or submodule name.";
-      }
-      leaf revision {
-        type union {
-          type revision-identifier;
-          type string { length 0; }
-        }
-        description
-          "The YANG module or submodule revision date.
-           A zero-length string is used if no revision statement
-           is present in the YANG module or submodule.";
-      }
-    }
-    grouping schema-leaf {
-      description
-        "Common schema leaf parameter for modules and submodules.";
-      leaf schema {
-        type inet:uri;
-        description
-          "Contains a URL that represents the YANG schema
-           resource for this module or submodule.
-           This leaf will only be present if there is a URL
-           available for retrieval of the schema for this entry.";
-      }
-    }
-    list module {
-      key "name revision";
-      description
-        "Each entry represents one revision of one module
-         currently supported by the server.";
-      uses common-leafs;
-      uses schema-leaf;
-      leaf namespace {
-        type inet:uri;
-        mandatory true;
-        description
-          "The XML namespace identifier for this module.";
-      }
-      leaf-list feature {
-        type yang:yang-identifier;
-        description
-          "List of YANG feature names from this module that are
-           supported by the server, regardless of whether they are
-           defined in the module or any included submodule.";
-      }
-      list deviation {
-        key "name revision";
-        description
-          "List of YANG deviation module names and revisions
-           used by this server to modify the conformance of
-           the module associated with this entry.  Note that
-           the same module can be used for deviations for
-           multiple modules, so the same entry MAY appear
-           within multiple 'module' entries.
-           The deviation module MUST be present in the 'module'
-           list, with the same name and revision values.
-           The 'conformance-type' value will be 'implement' for
-           the deviation module.";
-        uses common-leafs;
-      }
-      leaf conformance-type {
-        type enumeration {
-          enum implement {
-            description
-              "Indicates that the server implements one or more
-               protocol-accessible objects defined in the YANG module
-               identified in this entry.  This includes deviation
-               statements defined in the module.
-               For YANG version 1.1 modules, there is at most one
-               module entry with conformance type 'implement' for a
-               particular module name, since YANG 1.1 requires that,
-               at most, one revision of a module is implemented.
-               For YANG version 1 modules, there SHOULD NOT be more
-               than one module entry for a particular module name.";
-          }
-          enum import {
-            description
-              "Indicates that the server imports reusable definitions
-               from the specified revision of the module but does
-               not implement any protocol-accessible objects from
-               this revision.
-               Multiple module entries for the same module name MAY
-               exist.  This can occur if multiple modules import the
-               same module but specify different revision dates in
-               the import statements.";
-          }
-        }
-        mandatory true;
-        description
-          "Indicates the type of conformance the server is claiming
-           for the YANG module identified by this entry.";
-      }
-      list submodule {
-        key "name revision";
-        description
-          "Each entry represents one submodule within the
-           parent module.";
-        uses common-leafs;
-        uses schema-leaf;
-      }
-    }
-  }
-  /*
-   * Operational state data nodes
-   */
-  container modules-state {
-    config false;
-    description
-      "Contains YANG module monitoring information.";
-    leaf module-set-id {
-      type string;
-      mandatory true;
-      description
-        "Contains a server-specific identifier representing
-         the current set of modules and submodules.  The
-         server MUST change the value of this leaf if the
-         information represented by the 'module' list instances
-         has changed.";
-    }
-    uses module-list;
-  }
-  /*
-   * Notifications
-   */
-  notification yang-library-change {
-    description
-      "Generated when the set of modules and submodules supported
-       by the server has changed.";
-    leaf module-set-id {
-      type leafref {
-        path "/yanglib:modules-state/yanglib:module-set-id";
-      }
-      mandatory true;
-      description
-        "Contains the module-set-id value representing the
-         set of modules and submodules supported at the server at
-         the time the notification is generated.";
-    }
-  }
-}
index 7d758a4c7dad898d3553d4b14c5773c6c1505c97..6a3c27d676ae3bdbcb569e129d41e797145974db 100644 (file)
@@ -23,7 +23,6 @@
   <name>${project.artifactId}</name>
 
   <modules>
-    <module>ietf-yang-library</module>
     <module>ietf-restconf-monitoring</module>
     <module>ietf-restconf</module>
   </modules>
index 18f702c26f587d2f941fd9c24aec04ea4a5dce98..56a170953f1a4502d16d491cb2af24853089b790 100644 (file)
       <artifactId>yang-model-export</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.netconf</groupId>
-      <artifactId>ietf-yang-library</artifactId>
+      <groupId>org.opendaylight.mdsal.model</groupId>
+      <artifactId>rfc7895</artifactId>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.netconf</groupId>
index ac9f586a6b2aa201050bbbe2ec126dd006b4d94c..58fce6c60c4067f3921b96ddbca66ddc5b32e72d 100644 (file)
@@ -32,8 +32,8 @@
       <artifactId>restconf-common</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.netconf</groupId>
-      <artifactId>ietf-yang-library</artifactId>
+      <groupId>org.opendaylight.mdsal.model</groupId>
+      <artifactId>rfc7895</artifactId>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.netconf</groupId>