<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:15:07 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>[NETCONF-472] ReadDataTransactionUtil creates two NotificationListenerAdapters for JSON stream</title>
                <link>https://jira.opendaylight.org/browse/NETCONF-472</link>
                <project id="10142" key="NETCONF">netconf</project>
                    <description>&lt;p&gt;when you get &lt;a href=&quot;http://localhost:8181/restconf/18/data/ietf-restconf-monitoring:restconf-state/streams&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://localhost:8181/restconf/18/data/ietf-restconf-monitoring:restconf-state/streams&lt;/a&gt;, ReadDataTransactionUtil&lt;br/&gt;
will read notification data from yang modules and create NotificationListenerAdapters for each NotificationDefinition.&lt;br/&gt;
the Code snippet as below:&lt;br/&gt;
    public static NormalizedNode&amp;lt;?, ?&amp;gt; readData(final String identifier, final String content,&lt;br/&gt;
                                                final TransactionVarsWrapper transactionNode, final String withDefa,&lt;br/&gt;
                                                final SchemaContextRef schemaContextRef, final UriInfo uriInfo) {&lt;br/&gt;
        if (identifier.contains(STREAMS_PATH) &amp;amp;&amp;amp; !identifier.contains(STREAM_PATH_PART)) {&lt;br/&gt;
            final DOMDataReadWriteTransaction wTx = transactionNode.getTransactionChain().newReadWriteTransaction();&lt;br/&gt;
            final SchemaContext schemaContext = schemaContextRef.get();&lt;br/&gt;
            final boolean exist = SubscribeToStreamUtil.checkExist(schemaContext, wTx);&lt;/p&gt;

&lt;p&gt;            for (final NotificationDefinition notificationDefinition : schemaContextRef.get().getNotifications()) {&lt;br/&gt;
                final List&amp;lt;NotificationListenerAdapter&amp;gt; notifiStreamXML =&lt;br/&gt;
                        CreateStreamUtil.createYangNotifiStream(notificationDefinition, schemaContextRef,&lt;br/&gt;
                                NotificationOutputType.XML.getName());&lt;br/&gt;
                final List&amp;lt;NotificationListenerAdapter&amp;gt; notifiStreamJSON =&lt;br/&gt;
                        CreateStreamUtil.createYangNotifiStream(notificationDefinition, schemaContextRef,&lt;br/&gt;
                                NotificationOutputType.JSON.getName());&lt;br/&gt;
                notifiStreamJSON.addAll(notifiStreamXML);&lt;/p&gt;

&lt;p&gt;                for (final NotificationListenerAdapter listener : notifiStreamJSON) &lt;/p&gt;
{
                    final URI uri = SubscribeToStreamUtil.prepareUriByStreamName(uriInfo, listener.getStreamName());
                    final NormalizedNode mapToStreams =
                            RestconfMappingNodeUtil.mapYangNotificationStreamByIetfRestconfMonitoring(
                                    listener.getSchemaPath().getLastComponent(), schemaContext.getNotifications(),
                                    null, listener.getOutputType(), uri,
                                    SubscribeToStreamUtil.getMonitoringModule(schemaContext), exist);
                    SubscribeToStreamUtil.writeDataToDS(schemaContext,
                            listener.getSchemaPath().getLastComponent().getLocalName(), wTx, exist,
                            mapToStreams);
                }
&lt;p&gt;            }&lt;br/&gt;
            SubscribeToStreamUtil.submitData(wTx);&lt;br/&gt;
        }&lt;br/&gt;
        return readData(content, transactionNode, withDefa);&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;Obviously, it&apos;s wrong to add the notifiStreamXML object to notifiStreamJSON. It leads that two NotificationListenerAdapter will exist in Notifcator for JSON streamName: one is for XML, one if for JSON. It&apos;s not what we want. So I change it to like this below:&lt;/p&gt;

&lt;p&gt;public static NormalizedNode&amp;lt;?, ?&amp;gt; readData(final String identifier, final String content,&lt;br/&gt;
        final TransactionVarsWrapper transactionNode, final String withDefa,&lt;br/&gt;
        final SchemaContextRef schemaContextRef, final UriInfo uriInfo) {&lt;br/&gt;
    if (identifier.contains(STREAMS_PATH) &amp;amp;&amp;amp; !identifier.contains(STREAM_PATH_PART)) {&lt;br/&gt;
        final DOMDataReadWriteTransaction wTx = transactionNode.getTransactionChain().newReadWriteTransaction();&lt;br/&gt;
        final SchemaContext schemaContext = schemaContextRef.get();&lt;br/&gt;
        final boolean exist = SubscribeToStreamUtil.checkExist(schemaContext, wTx);&lt;/p&gt;

&lt;p&gt;        for (final NotificationDefinition notificationDefinition : schemaContextRef.get().getNotifications()) {&lt;br/&gt;
            final List&amp;lt;NotificationListenerAdapter&amp;gt; notifiStreamXML =&lt;br/&gt;
                    CreateStreamUtil.createYangNotifiStream(notificationDefinition, schemaContextRef,&lt;br/&gt;
                            NotificationOutputType.XML.getName());&lt;br/&gt;
            final List&amp;lt;NotificationListenerAdapter&amp;gt; notifiStreamJSON =&lt;br/&gt;
                    CreateStreamUtil.createYangNotifiStream(notificationDefinition, schemaContextRef,&lt;br/&gt;
                            NotificationOutputType.JSON.getName());&lt;/p&gt;

&lt;p&gt;            List&amp;lt;NotificationListenerAdapter&amp;gt; notifiStream = Lists.newArrayList();&lt;br/&gt;
            notifiStream.addAll(notifiStreamXML);&lt;br/&gt;
            notifiStream.addAll(notifiStreamJSON);&lt;br/&gt;
            for (final NotificationListenerAdapter listener : notifiStream) &lt;/p&gt;
{
                final URI uri = SubscribeToStreamUtil.prepareUriByStreamName(uriInfo, listener.getStreamName());
                final NormalizedNode mapToStreams =
                        RestconfMappingNodeUtil.mapYangNotificationStreamByIetfRestconfMonitoring(
                                listener.getSchemaPath().getLastComponent(), schemaContext.getNotifications(),
                                null, listener.getOutputType(), uri,
                                SubscribeToStreamUtil.getMonitoringModule(schemaContext), exist);
                SubscribeToStreamUtil.writeDataToDS(schemaContext,
                        listener.getSchemaPath().getLastComponent().getLocalName(), wTx, exist,
                        mapToStreams);
            }
&lt;p&gt;        }&lt;br/&gt;
        SubscribeToStreamUtil.submitData(wTx);&lt;br/&gt;
    }&lt;br/&gt;
    return readData(content, transactionNode, withDefa);&lt;br/&gt;
}&lt;br/&gt;
If doing so, there will only one NotificationListenerAdapter for JSON stream and one for XML stream.&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="21485">NETCONF-472</key>
            <summary>ReadDataTransactionUtil creates two NotificationListenerAdapters for JSON stream</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                                <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="10000">Done</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="wusandi@163.com">wu sandi</reporter>
                        <labels>
                    </labels>
                <created>Thu, 14 Sep 2017 06:25:43 +0000</created>
                <updated>Fri, 15 Mar 2019 22:22:45 +0000</updated>
                            <resolved>Mon, 28 May 2018 02:27:53 +0000</resolved>
                                                                    <component>restconf-nb</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="40224" author="wusandi@163.com" created="Thu, 14 Sep 2017 07:03:10 +0000"  >&lt;p&gt;I have fix this bug by commit &lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/63122/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/63122/&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="62777" author="opendaylight.release" created="Thu, 3 May 2018 10:22:04 +0000"  >&lt;p&gt;Andrew, moving it to you for now.&lt;/p&gt;

&lt;p&gt;Please&#160;decide to who this should be assigned.&#160;&#160;&lt;/p&gt;</comment>
                            <comment id="62794" author="agrimberg" created="Thu, 3 May 2018 16:03:08 +0000"  >&lt;p&gt;You must have meant some other Andrew. I have no knowledge of how to do anything related to this!&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </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_10208" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>External issue ID</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9160</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10201" key="com.atlassian.jira.plugin.system.customfieldtypes:url">
                        <customfieldname>External issue URL</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[https://bugs.opendaylight.org/show_bug.cgi?id=9160]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i01yr3:</customfieldvalue>

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