netconf.git
15 months agoFix odl-yanglib feature usage 87/104087/12
Yaroslav Lastivka [Thu, 19 Jan 2023 11:55:38 +0000 (13:55 +0200)]
Fix odl-yanglib feature usage

The problem is that Initialization stops working correctly and
expect non-empty YanglibConfig provided by blueprint.

Were set default cache-folder to cache/schema, binding-addr to
localhost and binding-port port 8181 by creating new config
file.

JIRA: NETCONF-909
Change-Id: I76455310d014a5ad87051cb0ac749f5ce9f010c1
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoClean up mdsal-netconf-notification 44/104344/3
Robert Varga [Thu, 9 Feb 2023 15:11:57 +0000 (16:11 +0100)]
Clean up mdsal-netconf-notification

Remove impl.ops package and modernize classes a bit.

Change-Id: I4a5f549c2d05cefac544ce1a426815cbc2bc17d8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoConvert mdsal-netconf-notification to OSGi DS 43/104343/5
Robert Varga [Thu, 9 Feb 2023 13:07:42 +0000 (14:07 +0100)]
Convert mdsal-netconf-notification to OSGi DS

The blueprint here is quite simple, even if a bit confusing. At the end
of the day we have only two components with services and a few plugins.

JIRA: NETCONF-963
Change-Id: I8d715d1db2ac66972c432e2b2808ad02cba7a463
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoConvert sal-rest-docgen to OSGI DS 13/96713/14
Tomas Cere [Tue, 22 Jun 2021 10:35:57 +0000 (12:35 +0200)]
Convert sal-rest-docgen to OSGI DS

The generator is a few simple components. Rework their wiring to work
on top of OSGi DS.

JIRA: NETCONF-771
Change-Id: Iee36451c148c5fd414bda3c3ab43c7c8bac0b963
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoEliminate blueprint from netconf-topology-impl 42/104342/4
Robert Varga [Thu, 9 Feb 2023 11:56:02 +0000 (12:56 +0100)]
Eliminate blueprint from netconf-topology-impl

The blueprint now is purely service injection, convert
NetconfTopologyImpl into a component instead.

JIRA: NETCONF-960
Change-Id: Id769b2d53cc75b0c5528aa6a0dd23d2b2a83cc85
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoConvert NetconfSalKeystoreService into a component 41/104341/6
Robert Varga [Thu, 9 Feb 2023 11:20:59 +0000 (12:20 +0100)]
Convert NetconfSalKeystoreService into a component

This is a very simple component, activate it as part of
sal-netconf-connector rather than from topology blueprints.

Also remove the initial merge transaction, as it does not (and has not
for a long time) introduce any semantic state.

JIRA: NETCONF-960
Change-Id: Ibc182675bbd31eb970be6b2df0559fe5c852090e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoRemove org.opendaylight.netconf.topology.sb.keypair 39/104339/7
Robert Varga [Thu, 9 Feb 2023 10:06:54 +0000 (11:06 +0100)]
Remove org.opendaylight.netconf.topology.sb.keypair

This configuration holds the private key location and its pass phrase.
While we inject these values, they are not used anywhere.

JIRA: NETCONF-960
Change-Id: I0a5fd425a59137ac4d0dac5e2f2fd630c4f202bb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoConvert JaxRsNorthbound into a Component 38/104338/2
Robert Varga [Wed, 8 Feb 2023 23:18:52 +0000 (00:18 +0100)]
Convert JaxRsNorthbound into a Component

We have all we need to ditch blueprint, rehost Config Admin binding and
turn JaxRsNorthbound into a proper Component.

JIRA: NETCONF-959
Change-Id: Id2af0cc4925b34de01198cfcfd98bc63351399d3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoBump aaa to 0.17.5 37/104337/3
Robert Varga [Wed, 8 Feb 2023 22:38:41 +0000 (23:38 +0100)]
Bump aaa to 0.17.5

Pick up wiring changes implemented upstream. This unblocks removal
pretty much all the blueprints we have.

Change-Id: I090d89b6da40ffb774f1048361eea22c5d133da6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoTurn streams.Configuration into a record 36/104336/2
Robert Varga [Wed, 8 Feb 2023 22:51:52 +0000 (23:51 +0100)]
Turn streams.Configuration into a record

This is a pure data holder, convert it to a record. Also rename to
StreamsConfiguration to ensure naming conflicts do not occur.

JIRA: NETCONF-958
Change-Id: I01a203aeab692911799eb24ac4bcadcb029bf1f4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoRemove WebInitializer 27/104327/1
Robert Varga [Wed, 8 Feb 2023 19:36:20 +0000 (20:36 +0100)]
Remove WebInitializer

WebInitializer is a useless indirection, remove it and inline its logic
into JaxRsNorthbound.

JIRA: NETCONF-958
Change-Id: I8a51c128f4e17a36fb719f9c3209e0d7dde933a2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoRefactor restconf-nb blueprint 26/104326/2
Robert Varga [Wed, 8 Feb 2023 19:04:52 +0000 (20:04 +0100)]
Refactor restconf-nb blueprint

Blueprint here is really a large code fragment. Move it to a new class,
RestconfNorthbound, so that we purely inject dependencies/configuration.

JIRA: NETCONF-958
Change-Id: Ic7214393a599c136aa3876c111145182cc68db0b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoMove references to front 25/104325/2
Robert Varga [Wed, 8 Feb 2023 18:25:59 +0000 (19:25 +0100)]
Move references to front

References should be up first, as they are declaring dependencies.

Change-Id: Ie03d7889164943fbbf17f235401002a8ce370224
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoInline webSocketInitializer 24/104324/2
Robert Varga [Wed, 8 Feb 2023 18:22:04 +0000 (19:22 +0100)]
Inline webSocketInitializer

This bean is used only once, inline it in its sole caller.

Change-Id: I1f1ecb9c5747608c67a02b610f7f57064b76e2ac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoInline restconfDataStreamServiceImpl 23/104323/2
Robert Varga [Wed, 8 Feb 2023 18:20:56 +0000 (19:20 +0100)]
Inline restconfDataStreamServiceImpl

This bean is used only once, inline it in its sole user.

Change-Id: Iba47a40a7f798b5b3acd443e855b701fb543e5b4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoInline restconfApplication 22/104322/2
Robert Varga [Wed, 8 Feb 2023 18:19:38 +0000 (19:19 +0100)]
Inline restconfApplication

This bean is used only once, inline it in its sole user.

Change-Id: I00f886cee80d4c6e6279fe6de0f97b35067078f8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoInline dataStreamApplication 21/104321/2
Robert Varga [Wed, 8 Feb 2023 18:17:55 +0000 (19:17 +0100)]
Inline dataStreamApplication

This bean is used only once, inline it in its sole user.

Change-Id: I1540d48e3479a8bc62d0600e7845ab19772672a6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoInline threadPoolFactory 20/104320/1
Robert Varga [Wed, 8 Feb 2023 18:15:44 +0000 (19:15 +0100)]
Inline threadPoolFactory

This bean is used only once, inline it in its sole user.

Change-Id: I366274dc2b040fb666994957ad468fadd988609b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoConvert mdsal-netconf-tcp to OSGi DS 17/104317/2
Robert Varga [Wed, 8 Feb 2023 16:59:44 +0000 (17:59 +0100)]
Convert mdsal-netconf-tcp to OSGi DS

Create a disabled component instead using Declarative Services. This
enables it to be used without touching any code, just the SCR console.

JIRA: NETCONF-957
Change-Id: Id4fc561c3c8671de421b1410c3291390f87fbf56
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoMove unit tests to netconf.ssh package 15/104315/4
Robert Varga [Wed, 8 Feb 2023 16:44:34 +0000 (17:44 +0100)]
Move unit tests to netconf.ssh package

UTs should be co-located with the classes they are testing, clean that
up.

Change-Id: I59babf5ad47427a2bdb3e9145c2f0284d59a976c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoConvert mdsal-netconf-ssh to OSGi DS 14/104314/2
Robert Varga [Wed, 8 Feb 2023 16:38:30 +0000 (17:38 +0100)]
Convert mdsal-netconf-ssh to OSGi DS

This is a rather simple blueprint, just convert the single component we
have here. Since Declarative Services shutdown dependents before
deactivating the reference, we can also squash the unbind() method.

JIRA: NETCONF-956
Change-Id: If3c5af7bd212583d0f37af085a33468a8d905802
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoConvert mdsal-netconf-connector to OSGi DS 12/104312/4
Robert Varga [Wed, 8 Feb 2023 15:59:08 +0000 (16:59 +0100)]
Convert mdsal-netconf-connector to OSGi DS

This blueprint is extremely simple wiring, migrate it to Declarative
Services and also cleanup dependencies and code a bit.

JIRA: NETCONF-955
Change-Id: I54da9529206677f9d210d2db1cb7248a0ba0259b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoConvert mdsal-netconf-monitoring to OSGi DS 06/104306/5
Robert Varga [Wed, 8 Feb 2023 13:04:16 +0000 (14:04 +0100)]
Convert mdsal-netconf-monitoring to OSGi DS

These are just two simple components, convert them to Declarative
Services.

JIRA: NETCONF-954
Change-Id: I3bf22d265feb8a1db086df396fb5ebaa26bbecdd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoConvert mdsal-netconf-impl to OSGi DS 05/104305/4
Robert Varga [Wed, 8 Feb 2023 12:37:52 +0000 (13:37 +0100)]
Convert mdsal-netconf-impl to OSGi DS

The blueprint here is just picking up config admin tuneables and wires
things together. This patch converts this wiring to OSGi DS.
Unfortunately the config admin bits are jumbled together, hence we use
factory components to split them up.

JIRA: NETCONF-951
Change-Id: Icdabc7b2e62cb77a6bf5659274955463be993f88
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoBump json-unit-assertj to 2.36.1 13/104313/4
Ivan Hrasko [Wed, 8 Feb 2023 16:03:21 +0000 (17:03 +0100)]
Bump json-unit-assertj to 2.36.1

Fix CVE-2022-42003 by bumping json-unit-assertj to 2.36.1
which uses fixed jackson-databind version 2.14.0.

Change-Id: I3ab3cb9e03393ea1d223616e0b013f7f10e6a74c
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
15 months agoRemove duplicate authorization instantiation 08/104308/3
Robert Varga [Wed, 8 Feb 2023 13:42:21 +0000 (14:42 +0100)]
Remove duplicate authorization instantiation

We already have an authorization object, so it seems we should be
reusing it. This also fixes a potential leak as well.

JIRA: NETCONF-949
Change-Id: Id8c94b3f4deca9c62f3b02e1f0c9f3f36d5d23c9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoInline serverChannelInitializer 04/104304/3
Robert Varga [Wed, 8 Feb 2023 10:56:36 +0000 (11:56 +0100)]
Inline serverChannelInitializer

This bean is used only as an argument, inline it to make things clearer.

JIRA: NETCONF-951
Change-Id: Ie461efe86b7b80d087ad41770e8c75275db4b170
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoInline netconfServerSessionNegotiatorFactory 03/104303/3
Robert Varga [Wed, 8 Feb 2023 10:53:59 +0000 (11:53 +0100)]
Inline netconfServerSessionNegotiatorFactory

This bean is used only as an argument, inline it to make things clearer.

JIRA: NETCONF-951
Change-Id: If0430936c0ad85346ad26ee8903d2f3bfa73b870
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoSplit out NetconfMapperAggregator 99/104299/6
Robert Varga [Tue, 7 Feb 2023 18:47:51 +0000 (19:47 +0100)]
Split out NetconfMapperAggregator

Create a component to host the corresponding Blueprint element.
This starts the path to making the contract of
AggregatedNetconfOperationServiceFactory more explicit.

JIRA: NETCONF-951
Change-Id: Ic4f0164ac3423f39ca0d52a6200dcbbfa8f35f7f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoUse NetconfNodeUtils.DEFAULT_TOPOLOGY_IID 10/104310/1
Robert Varga [Wed, 8 Feb 2023 14:28:05 +0000 (15:28 +0100)]
Use NetconfNodeUtils.DEFAULT_TOPOLOGY_IID

We have an open-coded reference to "topology-netconf", squash it and use
the common centralized constant.

Change-Id: Id6399cd4534333b0cce16c0ebdae00c0ede2835b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoSimplify builder 09/104309/3
Robert Varga [Wed, 8 Feb 2023 13:59:07 +0000 (14:59 +0100)]
Simplify builder

We do not need the intermediate products, we can just pass them to a
fluent builder.

Change-Id: Id384d2fd54a454b89de7b43b12b23f1f135a767f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoUse a few more instanceof patterns 07/104307/1
Robert Varga [Wed, 8 Feb 2023 13:36:28 +0000 (14:36 +0100)]
Use a few more instanceof patterns

We can remove duplicate getter invocations, let's do that and also
eliminate the implied casts.

Change-Id: I582d64423b968b0c9e97b541feff80cfbaca7627
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoTurn SessionIdProvider into a component 98/104298/5
Robert Varga [Tue, 7 Feb 2023 18:11:04 +0000 (19:11 +0100)]
Turn SessionIdProvider into a component

SessionIdProvider is a service, make sure it is an interface with a
default provider, instantiated via OSGi DS. This make things a tad more
reasonable, as the provider will survive most reconfiguration.

JIRA: NETCONF-951
Change-Id: I18e95bca90ed886d13b4cc03e3a2f1b5169d7876
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoConvert netconf-config to OSGi DS 87/104287/16
Robert Varga [Mon, 6 Feb 2023 18:37:10 +0000 (19:37 +0100)]
Convert netconf-config to OSGi DS

Convert blueprint to explicit OSGi DS wiring, retaining the API and
behaviour of the wiring. This requires use of ComponentFactories to
deal with the fact the configuration is in a single configurationPid,
but really ends up being configuration of three inter-dependend classes.

JIRA: NETCONF-950
Change-Id: I19d506a336483bf0ea06a230ef5108a35d8845cc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoRemove unused method createDeviceCommunicator 96/104296/5
Ivan Hrasko [Tue, 7 Feb 2023 14:04:37 +0000 (15:04 +0100)]
Remove unused method createDeviceCommunicator

Remove unused method AbstractNetconfTopology#createDeviceCommunicator.

Change-Id: I0042b1e3ce772dc9853f83080737e0250e50d070
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
15 months agoAdd session-id to the operational datastore 90/91290/31
tobias.pobocik [Mon, 13 Jul 2020 08:46:42 +0000 (10:46 +0200)]
Add session-id to the operational datastore

Expose non-zero uint32 session-id provided by the device
in the HELLO-MESSAGE via operational datastore.

When device is disconnected null is used to indicate
a non-NETCONF entity session.

Session id can be used to retrieve session-specific info of the device.

JIRA: NETCONF-710
Change-Id: I1995e825cf32462232e164727a469a7b47d3acd0
Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
15 months agoAdd fixme to NetconfNodeUtils 95/104295/3
Ivan Hrasko [Tue, 7 Feb 2023 13:41:00 +0000 (14:41 +0100)]
Add fixme to NetconfNodeUtils

NetconfNodeUtils#extractUserCapabilities method is creating
UserPreferences from NetconfSessionPreferences.

Here the purpose is unclear because NetconfSessionPreferences
are (re)created in NetconfDeviceCommunicator#onSessionUp.

Change-Id: I78ae38ffbd327b29dd29753b8b61d1e9c07bf55b
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
15 months agoClarify NetconfSessionPreferences usage 94/104294/3
Ivan Hrasko [Tue, 7 Feb 2023 13:36:50 +0000 (14:36 +0100)]
Clarify NetconfSessionPreferences usage

Remove the only one usage of NetconfSessionPreferences method
fromStrings(collection) from production code and mark it
as visible for testing because now it is used only in tests.

Change-Id: Ib17ddafaed113e3f18588e1870b0d53bf26e1513
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
15 months agoHide CallHomeMountSessionManager 79/104279/6
Robert Varga [Mon, 6 Feb 2023 16:29:46 +0000 (17:29 +0100)]
Hide CallHomeMountSessionManager

This is an implementation detail not used anywhere, hide it and document
that it is non-final (as is CallHomeMountDispatcher) for testing
purposes.

Change-Id: Ibe8c662aab5b45a4f696719928c04fe2166f5077
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoInline constants in CallHomeAuthProviderImpl 78/104278/6
Robert Varga [Mon, 6 Feb 2023 16:16:16 +0000 (17:16 +0100)]
Inline constants in CallHomeAuthProviderImpl

We are using constants only during initialization, just pass them
as arguments.

Change-Id: Id1ada2d05c41a46e9f1823b2d9a16db3df6d2689
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoConvert TlsAllowedDevicesMonitorImpl to OSGi DS 76/104276/4
Robert Varga [Mon, 6 Feb 2023 15:51:30 +0000 (16:51 +0100)]
Convert TlsAllowedDevicesMonitorImpl to OSGi DS

This is a simple component, only depending on DataBroker. Use
declarative services to manage its lifecycle. Also eliminate close()
from the public contract of TlsAllowedDevicesMonitor to ensure it is
properly isolated.

JIRA: NETCONF-949
Change-Id: I4cc51ee5ea807f2b4db664b18b2f81888bb20a34
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoRequire allowedDevicesMonitor 75/104275/4
Robert Varga [Mon, 6 Feb 2023 15:36:04 +0000 (16:36 +0100)]
Require allowedDevicesMonitor

We cannot reasonably operate without the monitor, make sure to require
it.

JIRA: NETCONF-949
Change-Id: Ia0f8648fbcca17fbcf8143ee91085ffbb4f0579e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoReturn immutable set from findAllowedKeys() 74/104274/3
Robert Varga [Mon, 6 Feb 2023 15:31:48 +0000 (16:31 +0100)]
Return immutable set from findAllowedKeys()

We are returning a mutable HashSet, let's use a simple Set.copyOf()
instead. Also update the sole caller to perform this operation only
once, closing a TOCTOE race.

JIRA: NETCONF-949
Change-Id: If49fb938b8ac09e63bdfdef229ef22635c9bb652
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoRemove static state from TlsAllowedDevicesMonitorImpl 72/104272/4
Robert Varga [Mon, 6 Feb 2023 15:17:25 +0000 (16:17 +0100)]
Remove static state from TlsAllowedDevicesMonitorImpl

Using static maps will end up retaining information even after we have
restarted this class. Make sure the information gets removed by tying
the maps to a particular instance.

JIRA: NETCONF-949
Change-Id: I941d876c8a834b2db9a257ac258685cbca29dbe8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoClean up TlsAllowedDevicesMonitorImpl constants 71/104271/4
Robert Varga [Mon, 6 Feb 2023 15:12:48 +0000 (16:12 +0100)]
Clean up TlsAllowedDevicesMonitorImpl constants

We have single-use constants, let's just inline them to their use in
constructor.

JIRA: NETCONF-949
Change-Id: I12618fe42c46b0b561e85980f5cdbfce5201fad3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoRemove NetconfConnectorFactory 67/104267/3
Robert Varga [Mon, 6 Feb 2023 15:02:58 +0000 (16:02 +0100)]
Remove NetconfConnectorFactory

This interface is not used anywhere except for instantiation. Remove it.

Change-Id: I85ff414d10d8d54790989fea22f0c728c53c2e32
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoBump ietf-tcp-{common,client,server} to 2022-12-12 84/104284/2
Robert Varga [Mon, 6 Feb 2023 17:08:52 +0000 (18:08 +0100)]
Bump ietf-tcp-{common,client,server} to 2022-12-12

This is just a run-of-the-mill upgrade.

Change-Id: I0233d8e59cb9d8b467c283ae4c3f10e942266b37
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoBump ietf-keystore to 2022-12-12 83/104283/3
Robert Varga [Mon, 6 Feb 2023 17:05:00 +0000 (18:05 +0100)]
Bump ietf-keystore to 2022-12-12

This is just a run-of-the-mill upgrade.

Change-Id: I26ccadf05e7f864e5bacce989afa92fb1d12e274
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoBump ietf-crypto-types to 2022-12-12 82/104282/2
Robert Varga [Mon, 6 Feb 2023 17:03:06 +0000 (18:03 +0100)]
Bump ietf-crypto-types to 2022-12-12

This is just a run-of-the-mill upgrade.

Change-Id: If2c91e90f36c4dc34a0ee2ad1f8b3bb531768594
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoBump ietf-truststore to 2022-12-12 81/104281/2
Robert Varga [Mon, 6 Feb 2023 16:59:53 +0000 (17:59 +0100)]
Bump ietf-truststore to 2022-12-12

This is just a run-of-the mill upgrade.

Change-Id: I14357b9e2a770a369353eabfeb876cd2e0f17a7a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoFix testtool parameter signature 15/104215/4
Ivan Hrasko [Wed, 1 Feb 2023 15:53:16 +0000 (16:53 +0100)]
Fix testtool parameter signature

Add one missing '-' to testtool's "ip" parameter to make it look
the same way like other parameters.

Change-Id: Ib5aa71e4424d52aa9ff6d2ca9064e5751351d51e
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
15 months agoBump upstreams 68/104268/3
Robert Varga [Mon, 6 Feb 2023 14:36:19 +0000 (15:36 +0100)]
Bump upstreams

Adopt:
- odlparent-12.0.2
- intrautils-5.0.2
- yangtools-10.0.3
- mdsal-11.0.6
- controller-7.0.3
- aaa-0.17.4

Change-Id: I3e34e381b39c16a3a465fb37c5fc6584765ee4de
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoDo not pass outer model context 81/103981/4
Robert Varga [Wed, 11 Jan 2023 00:05:37 +0000 (01:05 +0100)]
Do not pass outer model context

createDeviceNotificationListener() is not using this argument at all, do
not pass it down.

Change-Id: I177aa0dfa3fffa706f1e9194326ba261eb2f186d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoAdd proper path validation 80/103980/4
Robert Varga [Wed, 11 Jan 2023 00:03:25 +0000 (01:03 +0100)]
Add proper path validation

Rather than incurring CCEs, make sure actually validate data and report
what is wrong.

Change-Id: I70b8172732e08bc44c999bea05ff5c0ce28beff0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoPoint out a few more ugly casts 79/103979/4
Robert Varga [Tue, 10 Jan 2023 23:50:20 +0000 (00:50 +0100)]
Point out a few more ugly casts

We are making quite a few assumptions, mark them for revision.

Change-Id: I29ae17b01f8e29d0ea67a8f8c215ebf47e9a1cbb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoModernize notification extraction 78/103978/4
Robert Varga [Tue, 10 Jan 2023 23:49:18 +0000 (00:49 +0100)]
Modernize notification extraction

Extract-transform-verify arguments before talking to anyone, making it
obvious the definitions do not actually leak.

Change-Id: I46c079a08d72bb9f9847a7766bc3025a932ae7b4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoAcquire DOMNotificationService before changing state 77/103977/4
Robert Varga [Tue, 10 Jan 2023 23:34:22 +0000 (00:34 +0100)]
Acquire DOMNotificationService before changing state

We have a potential source of exceptions triggering after we have
mutated state. Fix that.

Change-Id: Id178c124c37cde804b10975590a773fab0df644e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoMark a potential CCE 76/103976/5
Robert Varga [Tue, 10 Jan 2023 23:29:26 +0000 (00:29 +0100)]
Mark a potential CCE

We have blind cast here, mark it for fixing.

Change-Id: I77812192fb772fd8f9224db75bd5adaf0db97f77
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoDo not acquire DOMSchemaService twice 75/103975/4
Robert Varga [Tue, 10 Jan 2023 23:27:13 +0000 (00:27 +0100)]
Do not acquire DOMSchemaService twice

Properly sanitize input, exactly once. Prevents a 500 when there is no
DOMSchemaService exposed.

Change-Id: I304ba58efe82530186cbb5a28e0b9a79b138ff3e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoClean up DeviceNotificationListenerAdaptor 71/103971/4
Robert Varga [Tue, 10 Jan 2023 21:28:32 +0000 (22:28 +0100)]
Clean up DeviceNotificationListenerAdaptor

Reorg fields for clarity.

Change-Id: I088f8725f19b63c1ebebfc185598824d2a06b692
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoReuse NetconfClientBuilder in NetconfCallHomeServer 36/104136/1
Peter Suna [Tue, 24 Jan 2023 12:18:07 +0000 (13:18 +0100)]
Reuse NetconfClientBuilder in NetconfCallHomeServer

To prevent issues with connecting to devices that
use old key exchange algorithms, use the default NetconfSshClient
inside the NetconfCallHomeServer.

JIRA: NETCONF-887
Change-Id: I379c26281dcec6df10dcdbe0ccbfa8c3bea7e8f0
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
15 months agoBump versions to 5.0.2-SNAPSHOT 06/104106/2
Robert Varga [Mon, 23 Jan 2023 23:05:23 +0000 (00:05 +0100)]
Bump versions to 5.0.2-SNAPSHOT

This starts the next development iteration.

Change-Id: I00caf0b3e8c30bf4ed0e20a0ee04da09b87356db
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoRemove target schema node 88/104088/3
Ivan Hrasko [Fri, 20 Jan 2023 09:10:21 +0000 (10:10 +0100)]
Remove target schema node

Searching for target schema node is used only to verify that
we have "parsed" a schema node from input.

Its not needed to be processed in XMLPatchBodyReader and if
payload is invalid we get errors from other places.

Change-Id: I777999b61e3c6bd891f255d0bc301a65b1628034
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
15 months agoFix XML parser condition in XmlPatchBodyReader 70/103970/9
Peter Suna [Tue, 10 Jan 2023 09:55:13 +0000 (10:55 +0100)]
Fix XML parser condition in XmlPatchBodyReader

Remove redundant if condition which rejects to parse
LeafListSchemaNode or LeafSchemaNode value from XML.

JIRA: NETCONF-937
Change-Id: Ib001582b8476f4508bab7d746296cb7ea1b1619e
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoTest Json/Xml PatchBodyReaders on mixin nodes 83/103483/31
OleksandrZharov [Fri, 26 Aug 2022 15:43:24 +0000 (17:43 +0200)]
Test Json/Xml PatchBodyReaders on mixin nodes

Created tests for both JSON and XML PatchBodyReaders with
different types of mixin nodes.

JIRA: NETCONF-943
Change-Id: Idd9bc2da6d561463bdd01b9714ea9f61a7a86e88
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
15 months agoLock datastore for call-home devices 80/104080/3
Ivan Hrasko [Thu, 19 Jan 2023 09:07:51 +0000 (10:07 +0100)]
Lock datastore for call-home devices

Netconf callhome does not obey default datastore values as defined
in odl-netconf-device.yang model.

We have to set datastore lock to true manually when creating
configuration node.

This way we can prevent error when we are unable to connect callhome
device because of already closed session.

JIRA: NETCONF-942
Change-Id: I98bc0e01d8d5bd3c2fdd3f4c57546656db61569c
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
15 months agoBump upstreams 05/104105/1
Robert Varga [Mon, 23 Jan 2023 23:04:25 +0000 (00:04 +0100)]
Bump upstreams

Adopt:
- mdsal-11.0.4
- controller-7.0.2
- aaa-0.17.3

Change-Id: I7c0e0b241f2ff9d4b8160e8c53c54d2f3cef841d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoNetconfMonitoringService should use Registration 89/104089/2
Robert Varga [Fri, 20 Jan 2023 13:06:52 +0000 (14:06 +0100)]
NetconfMonitoringService should use Registration

We are using raw AutoCloseable here, whereas we should be using simple
registrations. It also flushes out a few places where we fail to clean
up registrations.

Change-Id: I60f956f7e7dd9b394834ae046069d0112d496975
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoReturn Registration on registerCapabilityListener() 82/104082/5
Robert Varga [Thu, 19 Jan 2023 21:05:13 +0000 (22:05 +0100)]
Return Registration on registerCapabilityListener()

Registrations, as a concept resulting via architecture-level fiat,
cannot throw exceptions. Codify this in registerCapabilityListener(),
which should previously have returned ListenerRegistration. Also clarify
nullness of return types.

Change-Id: I9f9cd1638568280ee4ae64ea104a665aeaca19e6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoBump versions to 5.0.1-SNAPSHOT 07/104007/3
Robert Varga [Wed, 11 Jan 2023 22:50:56 +0000 (23:50 +0100)]
Bump versions to 5.0.1-SNAPSHOT

This starts the next development iteration.

Change-Id: Icacee80f9e4660160a19e9f0c240c92f779819b0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoRemove Optional wrapping 74/103974/3
Robert Varga [Tue, 10 Jan 2023 22:57:00 +0000 (23:57 +0100)]
Remove Optional wrapping

We are needlessly verbose in what is essentially internal comms. Remove
the indirection, getting right of a weird .map(Function.identity()).

Change-Id: Ibe162079f9eb08b8602b8fa5216c217a9d33e333
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoRemove ListenersBroker's enumerators 73/103973/3
Robert Varga [Tue, 10 Jan 2023 21:50:03 +0000 (22:50 +0100)]
Remove ListenersBroker's enumerators

We never enumerate these, remove the accessors.

Change-Id: If4a5a30ce803de4bdb5fa36c560636d1ad72a318
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoDeprecate netconf-node-topology RPCs 94/103994/1
Robert Varga [Wed, 11 Jan 2023 17:43:37 +0000 (18:43 +0100)]
Deprecate netconf-node-topology RPCs

These RPCs are just augmenting the configuration datastore, deprecate
them for later removal.

JIRA: NETCONF-931
Change-Id: I6820a6111e9405dc58e198f8b782378efdf2bab8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoAdd WebContext names 93/103993/1
Robert Varga [Wed, 11 Jan 2023 17:30:05 +0000 (18:30 +0100)]
Add WebContext names

Provide descriptive names to each context we publish.

JIRA: NETCONF-940
Change-Id: I25558ad49bb6c5897a6c8bfb2a7195843cc48d61
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoSimplify YangLibProvider 92/103992/1
Robert Varga [Wed, 11 Jan 2023 17:29:14 +0000 (18:29 +0100)]
Simplify YangLibProvider

Use a CharSource with UTF-8 encoding instead of manually constructing
strings.

Change-Id: Ib87a30321ccebb4c22920966fec86cf872ba2173
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoModernize YangLibRestApp 91/103991/1
Robert Varga [Wed, 11 Jan 2023 17:28:27 +0000 (18:28 +0100)]
Modernize YangLibRestApp

Use Set.of() and make sure the service is not null.

Change-Id: I63c3feb978344ad08d794c3441890bfecb36d5cd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoBump aaa to 0.17.2 85/103985/2
Robert Varga [Wed, 11 Jan 2023 12:14:02 +0000 (13:14 +0100)]
Bump aaa to 0.17.2

Pick up features from upstream.

Change-Id: I8e0ce2bd0e291bd557e47ee2591aa0e3cbf9b0a2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoBind /notif to WebInitializer 83/103983/3
Robert Varga [Wed, 11 Jan 2023 01:01:13 +0000 (02:01 +0100)]
Bind /notif to WebInitializer

"/notif" is actually tied through WebInitializer, make sure that
connection is expressed in code.

Change-Id: I893fbece36ab8ec4d2fe30b3db9947f1521c9c71
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoRemove LocalUriInfo 82/103982/2
Robert Varga [Wed, 11 Jan 2023 00:39:51 +0000 (01:39 +0100)]
Remove LocalUriInfo

This is a rather shortcut to jax-rs, ditch the indirection.

Change-Id: I4bf70723c3cc58396c32df3db24d3618759e7cfe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoMark RestconfStreamsSubscriptionService's fate 72/103972/2
Robert Varga [Tue, 10 Jan 2023 21:49:21 +0000 (22:49 +0100)]
Mark RestconfStreamsSubscriptionService's fate

This interface is going to be removed, mark a FIXME to that effect.

Change-Id: I4c6d43abca9b465c4467721c9196ba17fd8bd021
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoNetconf Device Notification 67/93967/48
Nikhil Soni [Thu, 25 Aug 2022 11:36:59 +0000 (17:06 +0530)]
Netconf Device Notification

Requirement - HTTP client should be able to get Device notification
after subscription.

Implementation:
1. Added a new Device Notification Yang for Rest request which takes
 input of Device mount point path
2. Added a DeviceNotificationListenerAdaptor which is get registered
in Device Notification service (on Mount point)
3. Created a dynamic Rest Notification SSE HTTP rest url (Response of 1st rest
call )
4. Updated Test-tool for Notification

JIRA: NETCONF-745
Change-Id: I9cac35d0a7b0f79382d223ae4ec0ac4a3ce2bae9
Signed-off-by: Nikhil Soni <nikk.sonitech@gmail.com>
Signed-off-by: nikhil.soni.lumina <nikk.sonitech@gmail.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoSplit out restconf-api 25/103925/3
Robert Varga [Wed, 4 Jan 2023 20:28:50 +0000 (21:28 +0100)]
Split out restconf-api

We have a ton of constructs which constitute a RFC8040 binding to Java.
Split those out into restconf-api.

Change-Id: I2660b6b17c0d024534e630c5a62c82844b3894f0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoUse switch expressions in QueryParams 24/103924/1
Robert Varga [Wed, 4 Jan 2023 20:51:35 +0000 (21:51 +0100)]
Use switch expressions in QueryParams

This is a tad more expressive.

Change-Id: I52a42c01227228823516021586da07d472f9f8ff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoModernize ApiPath 23/103923/1
Robert Varga [Wed, 4 Jan 2023 19:11:40 +0000 (20:11 +0100)]
Modernize ApiPath

Use instanceof patterns throughout to reduce explicit casts.

Change-Id: I7b25e311686f0fb91b764f6a4e4f7e0e0dc44b04
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoCorrect CREDENTIALS_NODE_IDENTIFIER 17/103917/2
Robert Varga [Tue, 3 Jan 2023 22:13:27 +0000 (23:13 +0100)]
Correct CREDENTIALS_NODE_IDENTIFIER

The 'credentials' item needs to be properly rooted in
netconf-node-topology, otherwise we will end up with failures to
serialize the payload. Also intern new QNames while we are near them.

JIRA: NETCONF-936
Change-Id: Iaf2c067d1b1ae0ceed732f52964ce586ec6ea819
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoMove netconf{-client,impl,util} to protocol/ 02/103902/1
Robert Varga [Tue, 3 Jan 2023 09:23:20 +0000 (10:23 +0100)]
Move netconf{-client,impl,util} to protocol/

These three artifacts are the API and client and server implementations
-- make sure we keep them in protocol/.

Change-Id: Iba32fb7533c5f1214bcb43a57cb06d2ccc2920df
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoMove netconf-dom-api 00/103900/1
Robert Varga [Tue, 3 Jan 2023 09:12:26 +0000 (10:12 +0100)]
Move netconf-dom-api

netconf-dom-api is part of MD-SAL level integration, hence it should
live among plugins.

Change-Id: I887071ee77336e2da8b97d7849c425db18574da2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoMove netconf-api to protocol/ 99/103899/1
Robert Varga [Mon, 2 Jan 2023 18:39:25 +0000 (19:39 +0100)]
Move netconf-api to protocol/

netconf-api is MD-SAL independent protocol-level API, move it to
protocol/ top-level directory.

Change-Id: I5fc4f3fed415bed00f6a84a1cbba9a7eb2e1b99b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoMove sal-netconf-connector to plugins/ 98/103898/1
Robert Varga [Mon, 2 Jan 2023 18:37:06 +0000 (19:37 +0100)]
Move sal-netconf-connector to plugins/

sal-netconf-connector provides integration with MD-SAL, move it to
plugins/ directory.

Change-Id: I3b632f93ecf2fe4f7646b9127fead420de2cc2c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoMove netconf-console to apps/ 97/103897/1
Robert Varga [Mon, 2 Jan 2023 18:34:08 +0000 (19:34 +0100)]
Move netconf-console to apps/

netconf-console a typical application, move it to apps.

Change-Id: I35f81c663f910d1cdefa8e6c147fa88e405a0a88
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoMove shaded components to third-party/ 95/103895/2
Robert Varga [Mon, 2 Jan 2023 17:12:47 +0000 (18:12 +0100)]
Move shaded components to third-party/

In order to make the project more navigable, separate out shaded
artifacts to a new top-level directory.

Change-Id: I227c8338c61b8f341cf4c6aa37cb6715db1f7ff3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoMove netconf topology applications in apps/ 94/103894/2
Robert Varga [Mon, 2 Jan 2023 17:01:03 +0000 (18:01 +0100)]
Move netconf topology applications in apps/

As of making the project better navigable, introduce apps/ top-level
directory, which hosts end-to-end applications.

Populate this with netconf-topology-* and callhome-provider, as these
are "NETCONF over network-topology" applications.

Change-Id: Ia1d9ca8bed3ec644261ab268008245c463beeb60
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoAdd changed-leaf-nodes-only subscription extension 55/99855/22
Peter Puškár [Mon, 7 Nov 2022 12:37:17 +0000 (13:37 +0100)]
Add changed-leaf-nodes-only subscription extension

The behaviour of this extension is almost the same of
the odl-leaf-nodes-only except additional check is performed
where nodes containing the same data after write into them
are not contained in the notification that is being sent.
Unit tests contain cases for nested choice node serialization

JIRA: NETCONF-862
Change-Id: I9775b51b782f30161c6e33f5a0ac36326eb47d44
Signed-off-by: Peter Puškár <ppuskar@frinx.io>
Signed-off-by: Branislav Malo <bmalo@frinx.io>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoCleanup netconf dependencies a bit 83/103883/3
Robert Varga [Mon, 2 Jan 2023 10:47:02 +0000 (11:47 +0100)]
Cleanup netconf dependencies a bit

We have a ton of warnings on used/unused dependencies, clean them up a
bit.

Change-Id: I4435e95f547cd86873031f911188746363b2d82f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoMove netconf-node-{optional,topology}.yang 80/103880/2
Robert Varga [Sun, 1 Jan 2023 22:34:05 +0000 (23:34 +0100)]
Move netconf-node-{optional,topology}.yang

This is the final bit of making sal-netconf-connector independent of
netconf-topology.yang

JIRA: NETCONF-913
Change-Id: If94b2623bba3d5576e27075eecc3ca5772626eaf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoMove DEFAULT_TOPOLOGY_NAME 77/103877/2
Robert Varga [Sun, 1 Jan 2023 21:54:48 +0000 (22:54 +0100)]
Move DEFAULT_TOPOLOGY_NAME

RemoteDeviceId has no connection to topology, move DEFAULT_TOPOLOGY_NAME
and related constants to a better place.

JIRA: NETCONF-913
Change-Id: Ic54f8484c052a74579f9c35751f3e31478de557c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoMove DEFAULT_TOPOLOGY_IID 76/103876/3
Robert Varga [Sun, 1 Jan 2023 20:52:48 +0000 (21:52 +0100)]
Move DEFAULT_TOPOLOGY_IID

This is a pure topology construct, move it up one layer, further
reducing dependencies.

Change-Id: I3d10bc9caa53f2d1a0dcda2415effbd595a0ffc6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoMove RemoteDeviceId 75/103875/3
Robert Varga [Sun, 1 Jan 2023 20:45:34 +0000 (21:45 +0100)]
Move RemoteDeviceId

The class has lost most of its baggage and can now be promoted to an API
contract next to NetconfDeviceSchemasResolver, which is using it.
Reduces package tangle quite a bit.

JIRA: NETCONF-913
Change-Id: Ic662a9d972ac6f2e7adeb0a26ad5f976a5199ac8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoTurn RemoteDeviceId into a simple record 74/103874/2
Robert Varga [Sun, 1 Jan 2023 20:21:52 +0000 (21:21 +0100)]
Turn RemoteDeviceId into a simple record

There is no logic here and it is absolutely clear that this is just a
holder for two arguments.

Having record semantics actually helps, as we include the IP address
with toString(), which helps debugging.

JIRA: NETCONF-913
Change-Id: I1749d1d458a3ad2ba3b82b121b850caf5b9471b6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoRemove RemoteDeviceId.getTopologyPath() 73/103873/1
Robert Varga [Sun, 1 Jan 2023 20:09:54 +0000 (21:09 +0100)]
Remove RemoteDeviceId.getTopologyPath()

The name 'topologyPath()' implies attachment to network-topology,
whereas we only care about this being a valid path for
DOMMountPointService.

Eliminate this property and push the singleton value out to
NetconfDeviceMount for further processing.

JIRA: NETCONF-913
Change-Id: I70b4ac06a78c01fa3e0caf530bc4d6b36acae925
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>