Fixup yanglib-mdsal-writer 52/110852/3
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 18 Mar 2024 15:10:59 +0000 (16:10 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 19 Mar 2024 06:28:48 +0000 (07:28 +0100)
commit0d19b7801f34a695c2c4b69449a3e843eb0a0921
treed314f2075d361fc6f299afc5d569d4486369dd43
parent4d5c11acae4d4c036142bd54a071cc9b46a8ce7d
Fixup yanglib-mdsal-writer

yanglib-mdsal-writer does not write out module-state by default, which
our CSIT expects. We also should be friendly to RFC7895 clients and have
this content by default.

Furthermore the @Inject needs to be separated from @Activate, as we do
not have OSGi configuration in javax.inject world. Use a compatible
writeLegacy=true default and Optional for URL provider.

Moreover there is a bug where the initial update would not be written if
the listener is executed before registration is stored into the object
field. Fix that by using an explicit boolean to track the closed state.

Finally enable multiple Urls to be reported in the RFC8525 container.
For RFC7895 compatibility we pick the first Url in iteration order.

JIRA: NETCONF-1277
Change-Id: I8cbb2af5e4e7b8ec713126bad981fb5a38c4240f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
apps/yanglib-mdsal-writer/pom.xml
apps/yanglib-mdsal-writer/src/main/java/org/opendaylight/netconf/yanglib/writer/YangLibraryContentBuilderUtil.java
apps/yanglib-mdsal-writer/src/main/java/org/opendaylight/netconf/yanglib/writer/YangLibrarySchemaSourceUrlProvider.java
apps/yanglib-mdsal-writer/src/main/java/org/opendaylight/netconf/yanglib/writer/YangLibraryWriter.java
apps/yanglib-mdsal-writer/src/test/java/org/opendaylight/netconf/yanglib/writer/YangLibraryWriterTest.java
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/server/mdsal/RestconfSchemaSourceUrlProvider.java
restconf/restconf-nb/src/test/java/org/opendaylight/restconf/server/mdsal/RestconfSchemaSourceUrlProviderTest.java