<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:10:37 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[MDSAL-699] CodeGenerator cannot implement listeners for notifications inside groupings</title>
                <link>https://jira.opendaylight.org/browse/MDSAL-699</link>
                <project id="10137" key="MDSAL">mdsal</project>
                    <description>&lt;p&gt;We are experimenting with Broadband forum yang files and noticed that yang notifications are declared in groupings. The groupings are used by containers.&#160;&lt;/p&gt;

&lt;p&gt;The MD-SAL code generator does not create listeners for this type of yang, nor does it even recognize that notification &quot;object&quot; is even a notification.&#160;&lt;/p&gt;

&lt;p&gt;Is this a bug in the mdsal code generator?&#160;&lt;/p&gt;

&lt;p&gt;A yang file is attached, as will as an even simplified version below. We have a grouping declared with is a notification for device state changes. A container has a sub container that uses this grouping.&#160;&#160;&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;module test-grouping-notif-a {
&#160; yang-version 1.1;
&#160; namespace &quot;urn:test:yang:grouping:notifa&quot;;
  prefix test-grouping-notifa;

&#160; organization &quot;Some organization&quot;;
  contact &quot;Some contact&quot;;
&#160; description
 &#160; &#160;&quot;This is a test yang created to reproduce an issue where groupings 
&#160; &#160; &#160;including notifications do not generate a listener from the md-sal code generator&quot;;
&#160; revision 2021-10-18 {
    description &quot;test&quot;;
  }

&#160; grouping notification-grouping-a {
&#160; &#160; description &quot;This is a grouping which contains a notification&quot;;
 &#160;&#160; notification device-state-change {
 &#160; &#160; &#160;description &quot;Device state changed&quot;;
 &#160; &#160; &#160;leaf event {
 &#160; &#160; &#160; &#160;type enumeration {
 &#160; &#160; &#160; &#160; &#160;enum online;
&#160; &#160; &#160; &#160; &#160; enum offline;
 &#160; &#160; &#160; &#160;}

&#160; &#160; &#160; &#160; description &quot;events definition for device state change&quot;;
 &#160; &#160; &#160;}
 &#160;  }
  }

  container grouping-notif-a {
  &#160; description &quot;Just a test yang model&quot;;
 &#160;  container device-notification-a {
 &#160;  &#160; description &quot;A notification that is wrapped in a grouping&quot;;
 &#160;  &#160; uses notification-grouping-a;
 &#160;  }
  }
}&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The code generator creates a &quot;DeviceStateChange&quot; interface like this:&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&#160; &#160; @Generated(&lt;span class=&quot;code-quote&quot;&gt;&quot;mdsal-binding-generator&quot;&lt;/span&gt;)
 &#160; &#160; &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;interface&lt;/span&gt; DeviceStateChange
 &#160; &#160; &#160; &#160; &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt;
 &#160; &#160; &#160; &#160; DataObject,
 &#160; &#160; &#160; &#160; Augmentable&amp;lt;DeviceStateChange&amp;gt;,
 &#160; &#160; &#160; &#160; InstanceNotification&amp;lt;DeviceStateChange, DeviceNotificationA&amp;gt;
 &#160; &#160; {
&#160;&#160;
&#160; &#160; @Generated(&lt;span class=&quot;code-quote&quot;&gt;&quot;mdsal-binding-generator&quot;&lt;/span&gt;)
 &#160; &#160; &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;interface&lt;/span&gt; DeviceNotificationA&#160; &#160;&#160;
 &#160; &#160; &#160; &#160; &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt;
 &#160; &#160; &#160; &#160; ChildOf&amp;lt;GroupingNotifA&amp;gt;,
 &#160; &#160; &#160; &#160; &#160;Augmentable&amp;lt;DeviceNotificationA&amp;gt;,
 &#160; &#160; &#160; &#160; NotificationGroupingA
 &#160; &#160; {
&#160;
&#160; &#160; @Generated(&lt;span class=&quot;code-quote&quot;&gt;&quot;mdsal-binding-generator&quot;&lt;/span&gt;)
 &#160; &#160; &#160; &#160; &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;interface&lt;/span&gt; NotificationGroupingA
 &#160; &#160; &#160; &#160; &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt;
 &#160; &#160; &#160; &#160; DataObject
 &#160; &#160; {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;So, there is no object that extends &quot;NotificationListener&quot; here.&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;The code generator is show in a snippet from a pom.xml file.&#160;&lt;/p&gt;

&lt;p&gt;org.opendaylight.mdsal.binding.maven.api.gen.plugin.CodeGeneratorImpl version 7.0.6&lt;/p&gt;

&lt;p&gt;pom.xml generator:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&amp;lt;plugin&amp;gt;
 &amp;lt;groupId&amp;gt;org.opendaylight.yangtools&amp;lt;/groupId&amp;gt;
 &amp;lt;artifactId&amp;gt;yang-maven-plugin&amp;lt;/artifactId&amp;gt;
 &amp;lt;version&amp;gt;6.0.5&amp;lt;/version&amp;gt;
 &amp;lt;dependencies&amp;gt;
  &amp;lt;dependency&amp;gt;
   &amp;lt;groupId&amp;gt;org.opendaylight.mdsal&amp;lt;/groupId&amp;gt;
   &amp;lt;artifactId&amp;gt;maven-sal-api-gen-plugin&amp;lt;/artifactId&amp;gt;
   &amp;lt;version&amp;gt;7.0.6&amp;lt;/version&amp;gt;
   &amp;lt;type&amp;gt;jar&amp;lt;/type&amp;gt;
  &amp;lt;/dependency&amp;gt;
 &amp;lt;/dependencies&amp;gt;
 &amp;lt;executions&amp;gt;
  &amp;lt;execution&amp;gt;
   &amp;lt;id&amp;gt;binding&amp;lt;/id&amp;gt;
   &amp;lt;goals&amp;gt;
    &amp;lt;goal&amp;gt;generate-sources&amp;lt;/goal&amp;gt;
   &amp;lt;/goals&amp;gt;
   &amp;lt;configuration&amp;gt;
    &amp;lt;yangFilesRootDir&amp;gt;${yangFilesPath}&amp;lt;/yangFilesRootDir&amp;gt;
    &amp;lt;codeGenerators&amp;gt;
     &amp;lt;generator&amp;gt;
      &amp;lt;codeGeneratorClass&amp;gt;org.opendaylight.mdsal.binding.maven.api.gen.plugin.CodeGeneratorImpl&amp;lt;/codeGeneratorClass&amp;gt;
      &amp;lt;outputBaseDir&amp;gt;${salGeneratorPath}&amp;lt;/outputBaseDir&amp;gt;
     &amp;lt;/generator&amp;gt;
    &amp;lt;/codeGenerators&amp;gt;
    &amp;lt;inspectDependencies&amp;gt;&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;&amp;lt;/inspectDependencies&amp;gt;
   &amp;lt;/configuration&amp;gt;
  &amp;lt;/execution&amp;gt;
 &amp;lt;/executions&amp;gt;
&amp;lt;/plugin&amp;gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="34674">MDSAL-699</key>
            <summary>CodeGenerator cannot implement listeners for notifications inside groupings</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.opendaylight.org/images/icons/priorities/major.svg">Medium</priority>
                        <status id="5" iconUrl="https://jira.opendaylight.org/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10003">Cannot Reproduce</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="rmagaldi">Robert Magaldi</reporter>
                        <labels>
                    </labels>
                <created>Tue, 19 Oct 2021 00:43:43 +0000</created>
                <updated>Tue, 19 Oct 2021 18:34:01 +0000</updated>
                            <resolved>Tue, 19 Oct 2021 06:35:41 +0000</resolved>
                                    <version>7.0.6</version>
                                                    <component>Binding codegen</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="69727" author="rovarga" created="Tue, 19 Oct 2021 06:35:41 +0000"  >&lt;p&gt;This a instance (YANG 1.1) notification. These follow a different codegen pattern from global (YANG 1.0) notifications. This is similar to how YANG 1.1 actions result in different codegen from YANG 1.0 rpcs.&lt;/p&gt;

&lt;p&gt;Generated files for this model are:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;./$YangModelBindingProvider.java
./$YangModuleInfoImpl.java
./GroupingNotifBuilder.java
./grouping/notif/DeviceNotificationBuilder.java
./grouping/notif/device/notification/DeviceStateChangeBuilder.java
./grouping/notif/device/notification/DeviceStateChange.java
./grouping/notif/DeviceNotification.java
./GroupingNotif.java
./grouping/notif/ManagedDeviceBuilder.java
./grouping/notif/managed/device/DeviceBuilder.java
./grouping/notif/managed/device/Device.java
./grouping/notif/managed/device/DeviceKey.java
./grouping/notif/ManagedDevice.java
./NotificationGrouping.java
./TestGroupingNotifData.java
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;here DeviceStateChange.java has the following:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
@Generated(&lt;span class=&quot;code-quote&quot;&gt;&quot;mdsal-binding-generator&quot;&lt;/span&gt;)
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;interface&lt;/span&gt; DeviceStateChange
 &#160;&#160;&#160;&lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt;
 &#160;&#160;&#160;DataObject,
 &#160;&#160;&#160;Augmentable&amp;lt;DeviceStateChange&amp;gt;,
 &#160;&#160;&#160;InstanceNotification&amp;lt;DeviceStateChange, DeviceNotification&amp;gt;
{
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="69728" author="JIRAUSER13915" created="Tue, 19 Oct 2021 12:32:28 +0000"  >&lt;p&gt;Are there any examples on how to generate listeners using yang 1.1 models which are created in this manner (using InstanceNotification)? Thanks for your time.&#160;&lt;/p&gt;

&lt;p&gt;Found this&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.opendaylight.org/browse/MDSAL-494&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.opendaylight.org/browse/MDSAL-494&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.opendaylight.org/browse/MDSAL-700&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.opendaylight.org/browse/MDSAL-700&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Does this mean they are not supported&#160; yet?&lt;/p&gt;</comment>
                            <comment id="69729" author="rovarga" created="Tue, 19 Oct 2021 15:21:16 +0000"  >&lt;p&gt;Yes it does. &lt;a href=&quot;https://jira.opendaylight.org/browse/MDSAL-494&quot; title=&quot;Add support for listening for and publishing of instance notifications&quot; class=&quot;issue-link&quot; data-issue-key=&quot;MDSAL-494&quot;&gt;&lt;del&gt;MDSAL-494&lt;/del&gt;&lt;/a&gt; is the tracker for the mdsal-binding-api part of the support. The patch associated with that issue is pretty much the API we are looking to expose.&lt;br/&gt;
&lt;a href=&quot;https://jira.opendaylight.org/browse/MDSAL-700&quot; title=&quot;Add support for listening on individual notifications&quot; class=&quot;issue-link&quot; data-issue-key=&quot;MDSAL-700&quot;&gt;&lt;del&gt;MDSAL-700&lt;/del&gt;&lt;/a&gt; is about refreshing the YANG 1.0 notification design to Java 8+.&lt;/p&gt;</comment>
                            <comment id="69730" author="JIRAUSER13915" created="Tue, 19 Oct 2021 18:34:01 +0000"  >&lt;p&gt;One more question &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.opendaylight.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;, although I hate to ask this question..&#160;&lt;/p&gt;

&lt;p&gt;Is there an estimated time when the 1.1 support for notifications would be available?&#160; Is it months or a year?&#160;&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="16709" name="test-grouping-notif@2021-10-18.yang" size="1665" author="rmagaldi" created="Tue, 19 Oct 2021 00:09:50 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i040an:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>