netconf.git
7 weeks agoMake restconf-mdsal-spi a module 70/112770/5
Robert Varga [Thu, 25 Jul 2024 11:51:44 +0000 (13:51 +0200)]
Make restconf-mdsal-spi a module

Make sure this artifact is a good citizen by declaring its module-info.

JIRA: NETCONF-773
Change-Id: I159f89888055e5bbc892f8d7a04d0cec27172fe2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 weeks agoRemove ExtendedOptions workaround 00/112800/2
Robert Varga [Fri, 26 Jul 2024 13:49:21 +0000 (15:49 +0200)]
Remove ExtendedOptions workaround

https://issues.apache.org/jira/browse/KARAF-7690 has been fixed quite a
while ago, remove the framework working it around.

Change-Id: Ie44343950f3f55457463bb40bd983dca09c449ec
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 weeks agoUse release controller artifacts 04/112804/1
Robert Varga [Sat, 27 Jul 2024 05:18:37 +0000 (07:18 +0200)]
Use release controller artifacts

Ditch use of snapshots, as we have a corresponding release.

Change-Id: I37e80b47ae88755ee1a9aa8ee80a85f9ad04b404
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoStabilize upstreams 92/112792/5
Robert Varga [Thu, 25 Jul 2024 20:19:10 +0000 (22:19 +0200)]
Stabilize upstreams

Adopt:
- odlparent-14.0.2
- infrautils-7.0.2
- yangtools-14.0.1
- mdsal-14.0.0

Change-Id: I133e92588122fe446d38f3f62d4fa428e6edc16f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoCentralize jsonassert version 43/112743/2
Robert Varga [Wed, 24 Jul 2024 01:57:00 +0000 (03:57 +0200)]
Centralize jsonassert version

Use bnd-parent's dependencyManagement section to define the dependency
on jsonassert.

Change-Id: I35b1df622a493c641ac42ab4ed282a39000fbe20
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoUpdate swagger UI to version 5.17.14 88/112688/2
lubos-cicut [Mon, 22 Jul 2024 11:17:15 +0000 (13:17 +0200)]
Update swagger UI to version 5.17.14

Updated Swagger UI from 5.13.0 to latest current version:
https://github.com/swagger-api/swagger-ui/releases/tag/v5.14.0
https://github.com/swagger-api/swagger-ui/releases/tag/v5.15.0
https://github.com/swagger-api/swagger-ui/releases/tag/v5.15.1
https://github.com/swagger-api/swagger-ui/releases/tag/v5.15.2
https://github.com/swagger-api/swagger-ui/releases/tag/v5.16.0
https://github.com/swagger-api/swagger-ui/releases/tag/v5.16.1
https://github.com/swagger-api/swagger-ui/releases/tag/v5.16.2
https://github.com/swagger-api/swagger-ui/releases/tag/v5.17.0
https://github.com/swagger-api/swagger-ui/releases/tag/v5.17.1
https://github.com/swagger-api/swagger-ui/releases/tag/v5.17.2
https://github.com/swagger-api/swagger-ui/releases/tag/v5.17.3
https://github.com/swagger-api/swagger-ui/releases/tag/v5.17.4
https://github.com/swagger-api/swagger-ui/releases/tag/v5.17.5
https://github.com/swagger-api/swagger-ui/releases/tag/v5.17.6
https://github.com/swagger-api/swagger-ui/releases/tag/v5.17.7
https://github.com/swagger-api/swagger-ui/releases/tag/v5.17.8
https://github.com/swagger-api/swagger-ui/releases/tag/v5.17.9
https://github.com/swagger-api/swagger-ui/releases/tag/v5.17.10
https://github.com/swagger-api/swagger-ui/releases/tag/v5.17.12
https://github.com/swagger-api/swagger-ui/releases/tag/v5.17.13
https://github.com/swagger-api/swagger-ui/releases/tag/v5.17.14

JIRA: NETCONF-1340
Change-Id: I936ab7acbf5b518c696a9ef1feccbdea55108f39
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
8 weeks agoMove restconf-mdsal-spi tests 41/112741/2
Robert Varga [Wed, 24 Jul 2024 01:09:55 +0000 (03:09 +0200)]
Move restconf-mdsal-spi tests

We have a few tests lingering in restconf-nb. Move them to their proper
artifact.

JIRA: NETCONF-773
Change-Id: I846b29eb2dbffa510448390c0ce0dcba249f52cd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoHide AbstractNotificationListenerTest 40/112740/2
Robert Varga [Wed, 24 Jul 2024 01:03:31 +0000 (03:03 +0200)]
Hide AbstractNotificationListenerTest

This class has just two subclasses, both of which live in
restconf.mdsal.spi. Move the class there and hide it.

JIRA: NETCONF-773
Change-Id: I9b9e1bb056dc3cf1237a3ca6fceae09dddeb8ce7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoSplit out CreateNotificationStreamRpcTest 39/112739/3
Robert Varga [Wed, 24 Jul 2024 00:43:47 +0000 (02:43 +0200)]
Split out CreateNotificationStreamRpcTest

Move this test test to sal-remote-impl. This necessitates promoting
CompletingServerRequest to restconf-server-api's test-jar for
visibility.

JIRA: NETCONF-773
Change-Id: Ia1756562131086580f34ad02314f498731a92b3d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoMove restconf-nb 37/112737/5
Robert Varga [Tue, 23 Jul 2024 23:20:14 +0000 (01:20 +0200)]
Move restconf-nb

We have now evacuated everything out, restconf-nb is a simple
application wiring of restconf-mdsal and restconf-server-jaxrs.

JIRA: NETCONF-773
Change-Id: I7e86c27a007c900ad848acd5b85a95e5598cce76
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoSplit out restconf-server-jaxrs 36/112736/6
Robert Varga [Tue, 23 Jul 2024 23:09:00 +0000 (01:09 +0200)]
Split out restconf-server-jaxrs

We now have a neatly self-sufficient JAX-RS endpoint. Split it out into
its own artifact, controlled via JaxRsEndpoint(Configuration).

JIRA: NETCONF-773
Change-Id: I350460030251e396ceb9dc0829c77f1de1d48de5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoRemove websocket-client 38/112738/2
Robert Varga [Tue, 23 Jul 2024 23:24:31 +0000 (01:24 +0200)]
Remove websocket-client

Now that we do not have websocket delivery, there is no point in keeping
websocket-client around.

JIRA: NETCONF-1209
Change-Id: I5283756bc6f5b03ba7a31d2b2deedaa62cf5225b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoRefactor restconf-nb configuration 34/112734/3
Robert Varga [Tue, 23 Jul 2024 22:03:15 +0000 (00:03 +0200)]
Refactor restconf-nb configuration

Define a JaxRsEndpointConfiguration as the holder of all things that
need configuring in restconf.nb.jaxrs.

Refactor JaxRsNorthbound to live in the same package and to expose the
configuration with proper lifecycle -- such that it can directly
implement SSESenderFactory and manage DefaultPingExecutor.

JIRA: NETCONF-773
Change-Id: I901d1dd33efd9f540dfb3645ddf054e5e9b72fe3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoEnforce bnd-parent dependency convergence 35/112735/2
Robert Varga [Tue, 23 Jul 2024 22:24:54 +0000 (00:24 +0200)]
Enforce bnd-parent dependency convergence

All artifacts using bnd-parent must have precise dependencies.

JIRA: NETCONF-773
Change-Id: I8feb762a0b3cf3df6ce12939960ce796d724bb68
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoRemove StreamsConfiguration.idleTimeout() 33/112733/1
Robert Varga [Tue, 23 Jul 2024 19:57:57 +0000 (21:57 +0200)]
Remove StreamsConfiguration.idleTimeout()

This timer is not used anywhere, remove it and all references to it.

JIRA: NETCONF-773
Change-Id: I012ddc8f9308b36c2e281981878e625b1744f90c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoSplit out restconf-mdsal-spi 31/112731/9
Robert Varga [Tue, 23 Jul 2024 16:00:31 +0000 (18:00 +0200)]
Split out restconf-mdsal-spi

We have a numbner of SPI-level constructs lurking in
restconf-server-mdsal. Move them out to restconf-mdsal-spi.

Also introduce DOMServerStrategy, which is a DOMService carrier of a
ServerStrategy.

JIRA: NETCONF-773
Change-Id: I034de08684f1de38022b4daf31a1730278ca3594
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoMark FIXMEs for OSGiNorthbound.Configuration 30/112730/2
Robert Varga [Tue, 23 Jul 2024 15:24:25 +0000 (17:24 +0200)]
Mark FIXMEs for OSGiNorthbound.Configuration

Northbound configuration entains a number of differing things, let's
make sure we mark up what is related to what.

JIRA: NETCONF-773
Change-Id: Iba625fa77e39d9c3c342a8599191ac28d24494c2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoEliminate restconf-common-models 29/112729/4
Robert Varga [Tue, 23 Jul 2024 15:04:37 +0000 (17:04 +0200)]
Eliminate restconf-common-models

The only remaining model is odl-device-notification. Move it to
apps/odl-device-notification and adopt restconf-nb support bits.

JIRA: NETCONF-773
Change-Id: I55b2122d7d44a58e2b9db9c3bb6cefd386cf7cf6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoSplit out sal-remote-impl 26/112726/4
Robert Varga [Tue, 23 Jul 2024 12:50:18 +0000 (14:50 +0200)]
Split out sal-remote-impl

This patch creates a sal-remote-impl, which implements sal-remote.yang
and related models.

JIRA: NETCONF-773
Change-Id: Ie29804b92a9b1fee6c3ed5aa336f6f832e9c9105
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoMove ErrorTagsTest 27/112727/2
Robert Varga [Tue, 23 Jul 2024 13:38:23 +0000 (15:38 +0200)]
Move ErrorTagsTest

This this really should be called ErrorTagMappingTest and live in
restconf-server-spi. Rename/move it.

JIRA: NETCONF-773
Change-Id: I0c478241d65e2321748f1912dad8513339ab189f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoPromote netconf-test-models 24/112724/4
Robert Varga [Tue, 23 Jul 2024 12:20:15 +0000 (14:20 +0200)]
Promote netconf-test-models

netconf-test-models are used by both restconf-nb and netconf-topology.

Let's promote them to a common place, so that tests can rely on Java
Bindings. Also ditch non-production models from restconf-common-models.

JIRA: NETCONF-773
Change-Id: I2309162d87785ac45533de392b3bf58338630f91
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoSplit out sal-remote from restconf-common-modules 23/112723/3
Robert Varga [Tue, 23 Jul 2024 11:55:50 +0000 (13:55 +0200)]
Split out sal-remote from restconf-common-modules

sal-remote describes a piece of application-level functionality. Split
the model out from restconf-common, so it does not get mingled with
other things unnecessarily.

JIRA: NETCONF-773
Change-Id: I450e94684fe7cfadc17c2fa7d45997de5be7d859
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoSplit out restconf-server-mdsal 22/112722/4
Robert Varga [Tue, 23 Jul 2024 10:21:14 +0000 (12:21 +0200)]
Split out restconf-server-mdsal

MdsalRestconfServer does not have dependencies in restconf-nb, this
patch splits it's production code out into plugins/restconf-server-mdsal.

JIRA: NETCONF-773
Change-Id: Icca2218d6ada133e37afd5929342595ec5978b6f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoRename nb.rfc8040.rests.transactions to server.mdsal.data 21/112721/1
Robert Varga [Tue, 23 Jul 2024 10:16:55 +0000 (12:16 +0200)]
Rename nb.rfc8040.rests.transactions to server.mdsal.data

RestconfStrategy et al. are (mostly) MD-SAL-specific data access, move
them to server.mdsal.data.

JIRA: NETCONF-773
Change-Id: Ia89ecac72e59dbcc8428ccf8fbd6e4a135529baa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoMove ErrorTag{s,Mapping} to restconf.server.spi 20/112720/3
Robert Varga [Tue, 23 Jul 2024 09:47:19 +0000 (11:47 +0200)]
Move ErrorTag{s,Mapping} to restconf.server.spi

Remove the JAX-RS reference and promote this class to
restconf-server-spi, so it is more easily accessible.

JIRA: NETCONF-773
Change-Id: I391ee842a171ea249072c77b571f6de77ab1c25d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoSeparate out SSESenderFactory 94/112694/4
Robert Varga [Mon, 22 Jul 2024 22:03:22 +0000 (00:03 +0200)]
Separate out SSESenderFactory

We have a few service invariants we can capture, let's do that to
simplify DefaultRestconfStreamServletFactory.

JIRA: NETCONF-773
Change-Id: I5b5c67278ec5c210210f6b3ce8686395ecce1973
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoSimplify ensureParentsByMerge 03/112303/13
Oleksandr Zharov [Thu, 27 Jun 2024 13:15:08 +0000 (15:15 +0200)]
Simplify ensureParentsByMerge

Refactored MdsalRestconfTransaction#ensureParentsByMerge by using
some of the YangInstanceIdentifier methods.
Added test to verify merged path for refactored method.

JIRA: NETCONF-1329
Change-Id: I21b08f11bdfc710e264a371afe1d30acfdfa1e2c
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
8 weeks agoBump mina-sshd to 2.13.1 63/112563/3
Robert Varga [Mon, 15 Jul 2024 11:23:18 +0000 (13:23 +0200)]
Bump mina-sshd to 2.13.1

https://github.com/apache/mina-sshd/releases/tag/sshd-2.13.1

Change-Id: Id9924ba53dcd269bc7ebbf5517d7d7de7df54fc1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoTest cleanup after migration to JUnit5 57/112357/3
lubos-cicut [Fri, 28 Jun 2024 06:31:23 +0000 (08:31 +0200)]
Test cleanup after migration to JUnit5

Two tests cannot be migrated to JUnit5 because they depend on mdsal
tests that are not migrated. They are marked as TODO.

Some tests have been migrated but with forgotten access modifier, this
patch will clean them up.

JIRA: NETCONF-1310
Change-Id: Ic9499e3b8c6e29a8363d95dd4c1163437ca5ed15
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
8 weeks agoSeparate out RestconfStream.LocationProvider 93/112693/5
Robert Varga [Mon, 22 Jul 2024 20:28:51 +0000 (22:28 +0200)]
Separate out RestconfStream.LocationProvider

There is no point in having a RestconfStream.Registry without an
endpoint providing access to it.

This patch separates out RestconfStream.LocationProvider, which acts as
a provider of stream locations -- eliminating the need for the
URLConstants hotspot.

JIRA: NETCONF-773
Change-Id: Ic6e7ad614a4c7a0ab8dec10a0f8b27d9b07153d7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoMove URLConstants.MODULES_* constants 92/112692/2
Robert Varga [Mon, 22 Jul 2024 20:03:19 +0000 (22:03 +0200)]
Move URLConstants.MODULES_* constants

These relate to how JaxRsRestconf is laid out, hence move them there,
reducing their exposure.

This also means that RestconfSchemaSourceUrlProvider is really something
like a 'JaxRxYangLibrary' support -- we keep it simple here, but at some
point it should be possible to run with an external yanglib server.

JIRA: NETCONF-773
Change-Id: I226f89e096b6236bcaa4bd7bb1c1e1215518efbd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoImprove ServerDataOperations 91/112691/3
Robert Varga [Mon, 22 Jul 2024 17:35:16 +0000 (19:35 +0200)]
Improve ServerDataOperations

Valid implementations may need to serialize the data we are passing in,
hence we should be providing DatabindPath.Data instead of
YangInstanceIdentifier.

JIRA: NETCONF-1331
Change-Id: I042452b2f7182fb3a1dafaac7fb2890174bcd890
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoMove SSEStreamService 90/112690/1
Robert Varga [Mon, 22 Jul 2024 17:06:17 +0000 (19:06 +0200)]
Move SSEStreamService

We have specific implementation requirements around SSE integration in
JAX-RS, most notably SSESender which uses a PingExecutor.

Separate these out into restconf.nb.jaxrs to reduce their exposure.

JIRA: NETCONF-773
Change-Id: Ia29e258e6b2f00297ec2a2d8bdc9df7dd83a1773
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoMake MdsalServerStrategy implement only ServerDataOperations 41/112641/15
Robert Varga [Fri, 19 Jul 2024 03:43:46 +0000 (05:43 +0200)]
Make MdsalServerStrategy implement only ServerDataOperations

MdsalRestconfStrategy is acting as the root of a MdsalRestconfServer,
which is really a historical thing.

MdsalServerStrategy is a new class which takes over the role of the root
ServerStrategy, with a clear relationship with MdsalRestconfServer.

This moves a chunk of logic out of (Mdsal)RestconfStrategy, bringing
RestconfStrategy making it just an implementation of
ServerDataOperations.

JIRA: NETCONF-1331
Change-Id: I7fce7a7f1b857f2c4ce45722831dd2d5404a8be4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoConvert restconf-server-spi to bnd-parent 60/112660/1
Robert Varga [Sat, 20 Jul 2024 17:10:13 +0000 (19:10 +0200)]
Convert restconf-server-spi to bnd-parent

restconf-server-spi is a simple single-package module, use bnd-parent to
build it.

JIRA: NETCONF-773
Change-Id: I87c794b8c0639a4c1ce2a1f0d8c52f3e5e216a62
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoAdd utility ServerErrorPath constructor 59/112659/1
Robert Varga [Sat, 20 Jul 2024 17:02:42 +0000 (19:02 +0200)]
Add utility ServerErrorPath constructor

We can use DatabindPath.Data as an alternative, making construction a
tad more user-friendly.

JIRA: NETCONF-773
Change-Id: I3d51c6dc012caf5e8ad706577be03b8ad7be7ab5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoConvert restconf-server-api to bnd-parent 58/112658/1
Robert Varga [Sat, 20 Jul 2024 17:01:40 +0000 (19:01 +0200)]
Convert restconf-server-api to bnd-parent

restconf-server-api is a simple single-package module, use bnd-parent to
build it.

JIRA: NETCONF-773
Change-Id: I33a013b95e65892c38a4e02e323e3d235f63455e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoConvert transport-api to bnd-parent 57/112657/1
Robert Varga [Sat, 20 Jul 2024 15:21:11 +0000 (17:21 +0200)]
Convert transport-api to bnd-parent

transport-api is a simple component, convert it to use bnd-parent.
Whiler we are at it, drop the trivial use of @GuardedBy, as it does not
warrant the management checker-qual dependency.

Change-Id: Icef477bccc65e1b28448c8972607f1a6e01230e3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoRemove restconf.server.mdsal.ResourceRequest 56/112656/1
Robert Varga [Sat, 20 Jul 2024 15:12:50 +0000 (17:12 +0200)]
Remove restconf.server.mdsal.ResourceRequest

This class is not used anywhere, remove it.

JIRA: NETCONF-773
Change-Id: I74725c4450fc8d7456d11f38836576b68dc1b3a9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoConvert netconf-api to bnd-parent 54/112654/1
Robert Varga [Sat, 20 Jul 2024 13:26:45 +0000 (15:26 +0200)]
Convert netconf-api to bnd-parent

netconf-api is quite simple. Update it to use bnd-parent instead of
netconf-parent.

JIRA: NETCONF-773
Change-Id: I01d61d59c1bbc180b7dbdffef187c447d62a8133
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoAdd bnd-parent 53/112653/1
Robert Varga [Sat, 20 Jul 2024 13:13:17 +0000 (15:13 +0200)]
Add bnd-parent

bnd-parent is a much more modern take on bundle-parent. Unlike plain
'netconf-parent', it does not deal with YANG Binding generation.

JIRA: NETCONF-773
Change-Id: I2274a3635d3640afada0d1b606cdab0c84cd19c4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoTurn restconf-server-api into a module 51/112651/1
Robert Varga [Sat, 20 Jul 2024 12:57:09 +0000 (14:57 +0200)]
Turn restconf-server-api into a module

Add module-info.java and clean up reported warnings.

JIRA: NETCONF-773
Change-Id: I5ae08908038ba695e657f7e4ac78f5b85218007b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoTurn restconf-server-api into a module 50/112650/1
Robert Varga [Sat, 20 Jul 2024 12:46:04 +0000 (14:46 +0200)]
Turn restconf-server-api into a module

Add module-info.java and clean up reported warnings.

JIRA: NETCONF-773
Change-Id: I5b541656d6cf16217b525a5dcb1e7e87ab078b0b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoAdd restconf.api module documentation 49/112649/1
Robert Varga [Sat, 20 Jul 2024 12:45:09 +0000 (14:45 +0200)]
Add restconf.api module documentation

Add a simple block of Javadoc.

JIRA: NETCONF-773
Change-Id: I3379d619aca3359a0df902558043f6bd438a289e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoUse doCallRealMethod() instread of a mock QName 48/112648/1
Robert Varga [Sat, 20 Jul 2024 08:03:25 +0000 (10:03 +0200)]
Use doCallRealMethod() instread of a mock QName

EffectiveModelContext has a default method here, make use of that.

JIRA: NETCONF-1331
Change-Id: I7704a9600cb01d7c1c9927d49be657a21e58e095
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoUse a switch expression in RestconfStrategy.prepareData() 39/112639/5
Robert Varga [Fri, 19 Jul 2024 01:30:33 +0000 (03:30 +0200)]
Use a switch expression in RestconfStrategy.prepareData()

Instead of an if/else cascade, use a simple switch expression.

JIRA: NETCONF-1331
Change-Id: I80c2bd57a36fe936e819643a2a446dc48d81e13c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoRefactor ServerRpcOperations implementations 32/112632/5
Robert Varga [Thu, 18 Jul 2024 23:59:13 +0000 (01:59 +0200)]
Refactor ServerRpcOperations implementations

We support both local and DOMRpcService-mediated RPC implementations,
but have the relationship rather hard-coded.

InterceptingServerRpcOperations provides the ability to look up a
RpcImplementation and delegate to it. If the lookup fails, the request
will be forwarded to a downstream ServerRpcOperations.

A default downstream is provided as NotSupportedServerRpcOperations,
which always completes the request with an ErrorTag.NOT_SUPPORTED
error.

We also split out DOMRpcService-based implementation into
MdsalServerRpcOperations and have RestconfStrategy instantiate a
combination of these two.

The same is true for a DOMActionService-based implementation, named
MdsalServerActionOperations.

JIRA: NETCONF-1331
Change-Id: Icdf1690a816a67b972eb331e56db038cd0474e1e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoSplit out server.spi.ServerStrategy 96/112296/13
Robert Varga [Thu, 18 Jul 2024 14:42:33 +0000 (16:42 +0200)]
Split out server.spi.ServerStrategy

RestconfStrategy has accrued a lot of code related to request
invocation, which is shared between the two final specializations.

This patch introduces restconf.server.spi.ServerStrategy, which
defines the contract exposed towards a RestconfServer implementation.

We also pull down the common body handling bits into an
AbstractServerStrategy, so they can we widely shared.

JIRA: NETCONF-1331
Change-Id: If0f0b5615ec06abcf50c2e600760bd4f6c87a756
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoRemove restconf.nb.rfc8040.legacy 26/112626/1
Robert Varga [Thu, 18 Jul 2024 10:17:34 +0000 (12:17 +0200)]
Remove restconf.nb.rfc8040.legacy

We have a single class here, move it to restconf.nb.jaxrs.

JIRA: NETCONF-773
Change-Id: Ied43a4bbe8deebc43b8f6b75d867756228df3fb9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoMove restconf.server.spi tests 18/112618/4
Robert Varga [Wed, 17 Jul 2024 22:14:13 +0000 (00:14 +0200)]
Move restconf.server.spi tests

Move the test substrate into restconf-server-spi test-jar, from whence
it can be consumed by downstreams. This allows us to move test where
they belong.

Resources are troublesome, so we end up duplicating
instanceidentifier/yang models -- which is okay for now, but should be
cleaned up later.

JIRA: NETCONF-773
Change-Id: I7f3e85ea0151f2ed1f083572a17844bf150cc431
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoFactor out restconf-server-spi 16/112616/4
Robert Varga [Wed, 17 Jul 2024 20:57:38 +0000 (22:57 +0200)]
Factor out restconf-server-spi

Move RESTCONF SPI-level contracts into a separate component.

JIRA: NETCONF-773
Change-Id: I5a24130606d55f9a89c8cf857d3d405afc402730
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoMove nb.rc8040.Insert to server.spi 15/112615/3
Robert Varga [Wed, 17 Jul 2024 20:35:18 +0000 (22:35 +0200)]
Move nb.rc8040.Insert to server.spi

There is no point in keeping this class specific to northbound, move it
to server.spi.

JIRA: NETCONF-773
Change-Id: I222d65bdf45b0c4988a21eb63e86e356735bf4fe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoFix draft-ietf-crypto-types description 17/112617/1
Robert Varga [Wed, 17 Jul 2024 21:24:25 +0000 (23:24 +0200)]
Fix draft-ietf-crypto-types description

We have the netconf- infix confused, fix that up.

JIRA: NETCONF-773
Change-Id: Ibc389ca448e0d7586ec7fccf41721c7f9d07b900
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoMake stream subpath flexible 14/112614/2
Robert Varga [Wed, 17 Jul 2024 20:26:33 +0000 (22:26 +0200)]
Make stream subpath flexible

AbstractRestconfStreamRegistry has no opinions on location, except it
needs to be non-null. Push the knowledge out of server.spi.

JIRA: NETCONF-773
Change-Id: I40597fd04e818df529ee95e52ea8b01156498d58
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoFactor out restconf-server-api 13/112613/2
Robert Varga [Wed, 17 Jul 2024 17:11:17 +0000 (19:11 +0200)]
Factor out restconf-server-api

Separate out restconf.server.api from restconf-nb into a dedicated
restconf-server-api artifact.

Also move separate out ietf-restconf-server artifact packaging so as to
make dependencies more clear.

draft-ietf-netconf-crypto-types is renamed to match naming based on YANG
modules rather than drafts.

JIRA: NETCONF-773
Change-Id: I62f4f99144a7519022f35d7e7657e51ba36f9a77
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoRemove restconf-common 24/112224/11
Robert Varga [Tue, 18 Jun 2024 10:47:22 +0000 (12:47 +0200)]
Remove restconf-common

Move the two remaining classes to restconf.server.api and remove
restconf-common artifact.

JIRA: NETCONF-773
Change-Id: I14990e3b3e59ce77d9f1186338f3c09b8fa1e671
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoRemove RestconfDocumentedException 23/112223/11
Robert Varga [Tue, 18 Jun 2024 08:53:47 +0000 (10:53 +0200)]
Remove RestconfDocumentedException

We now have everything we need in ServerException. Migrate the final
holdouts and eliminate RestconfDocumentedException.

JIRA: NETCONF-1188
Change-Id: I217453054c5c066b0d0b44559318b110d6fd32b0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoEliminate RestconfFuture 20/112220/15
Robert Varga [Tue, 18 Jun 2024 06:09:35 +0000 (08:09 +0200)]
Eliminate RestconfFuture

We are just hooking to Future.get(), there is no need for a dedicated
class.

JIRA: NETCONF-1188
Change-Id: I4801aafd1c5b12432d45dff669183373d6ccbd4d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoAdopt models from mdsal 95/112595/4
Robert Varga [Tue, 16 Jul 2024 20:12:34 +0000 (22:12 +0200)]
Adopt models from mdsal

MDSAL-862 has expanded the library, let's take advantage of that and
remove our packaging of these.

Change-Id: Ie9f4cbdd69e97650f0f15e3843b1946d9f23a00e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoBump upstreams 95/112495/8
Robert Varga [Mon, 8 Jul 2024 17:50:12 +0000 (19:50 +0200)]
Bump upstreams

Adopt:
- odlparent-14.0.1
- infrautils-7.0.1
- yangtools-14.0.0
- mdsal-14.0.0-SNAPSHOT
- controller-10.0.0-SNAPSHOT
- aaa-0.20.0-SNAPSHOT

Change-Id: I559b0a163a984e39426f1f944fa15faf8ae820ca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoFix TCPClient.connect() initialization 43/112543/9
Robert Varga [Sat, 13 Jul 2024 12:20:33 +0000 (14:20 +0200)]
Fix TCPClient.connect() initialization

The firing of ChannelFutureListeners and handler callbacks is slightly
diifferent in that listeners may be fired in a separate pass, but
handler callbacks are guaranteed to fire during event reception.

We really want to fire when the channel becomes active, similarly to the
no-op we have via ConnectChannelInitializer -- thus immediately updating
the pipeline.

This ensures that NettyIoSession.channelActive() has been invoked before
Netty can deliver any events to it.

While we are touching SshClientServerTest, make it package-protected and
hide its fields, as JUnit5 can handle that.

JIRA: NETCONF-1348
Change-Id: I68a718d1870a572dc6a1a8bafd5c7b31e6ee4ece
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoHide TcpClientServerTest 45/112545/2
Robert Varga [Sat, 13 Jul 2024 15:13:38 +0000 (17:13 +0200)]
Hide TcpClientServerTest

We are using JUnit5, so there's no point in exposing this class or its
methods.

Change-Id: If8392809ab603a24a7a241ce1b336d387a681dd8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoFix typo in commands descriptions 36/112536/2
Ivan Hrasko [Thu, 11 Jul 2024 12:37:07 +0000 (14:37 +0200)]
Fix typo in commands descriptions

Fix typo in NetconfConnectDeviceCommand and NetconfUpdateDeviceCommand
option description for schemaless option.

Change "surpport" to "support".

Change-Id: Ic1de685ab264c0a614e215fa0f961bac5d5c72d8
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
2 months agoDisable transport-ssh integration tests 42/112542/1
Ivan Hrasko [Fri, 12 Jul 2024 13:50:47 +0000 (15:50 +0200)]
Disable transport-ssh integration tests

Either transport-ssh or its test have not satisfying performance
resulting in permanent failures on Jenkins or low resources PC locally.

JIRA: NETCONF-1348
Change-Id: I3d024a17ca8cf900ee811a94d45b362f46ffdaea
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
2 months agoFix pagination javadoc 87/112487/1
Ivan Hrasko [Mon, 8 Jul 2024 11:15:55 +0000 (13:15 +0200)]
Fix pagination javadoc

Fix the order of offset and limit parameters in javadoc.

JIRA: NETCONF-1225
Change-Id: Ic497539662a6459850b9196fd0aec0e3e65d33b1
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
2 months agoOpenAPI: Implement pagination test 36/111436/17
lubos-cicut [Wed, 17 Apr 2024 07:27:59 +0000 (09:27 +0200)]
OpenAPI: Implement pagination test

This patch tests the implementation of pagination, which allows us
to retrieve a OpenApi document for selected number of modules from
schema. In this case ?offset=3&limit=5.

JIRA: NETCONF-1225
Change-Id: I3ecf8b810649a58c05b8a2c8433135c8c3694db5
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
2 months agoOpenAPI: Implement pagination 00/111200/21
Ivan Hrasko [Tue, 2 Apr 2024 12:58:38 +0000 (14:58 +0200)]
OpenAPI: Implement pagination

Enable user to limit number of modules for which OpenAPI documentation
is generated.

Then new API parameters offset and limit can be used as:
?offset=0&limit=0 for all modules
?offset=0&limit=10 for first 10 modules
?offset=10&limit=10 for 10-20 modules
?offset=1000 offset is out of range return empty paths and components
?limit=1000 limit out of range return all models
?offset=-1 or ?limit=-1 negative number always return empty paths and
components

JIRA: NETCONF-1225
Change-Id: Ib091a622f90c554946fc0f7504397de3814f681e
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
2 months agoImprove Swagger UI Update Process 10/111410/6
Anton Okhrimenko [Sat, 27 Apr 2024 01:59:31 +0000 (03:59 +0200)]
Improve Swagger UI Update Process

Our custom code is now separated in:
styles.css, swagger-initializer.js, logo_small.png
and configuration.js. Everything controlled from index.html.

Everything from swagger UI distro is now placed in swagger-ui directory
without any modification.

This helps us make the process to update to latest swagger UI
distribution easier.

All we need is to replace the content of swagger-ui directory.

JIRA: NETCONF-1302
Change-Id: I389b52026e832f3b21834546ec4d4362cbd518dd
Signed-off-by: Anton Okhrimenko <Anton.Okhrimenko@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
2 months agoAdd ability to control width/depth from UI 09/111409/11
Anton Okhrimenko [Fri, 26 Apr 2024 22:21:27 +0000 (00:21 +0200)]
Add ability to control width/depth from UI

Added UI elements to control width and depth of the schema.

JIRA: NETCONF-1301, NETCONF-1320
Change-Id: Id7df9bc402f62591777b074da295c351202a0464
Signed-off-by: Anton Okhrimenko <Anton.Okhrimenko@pantheon.tech>
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
2 months agoHardcode width and depth parameters 06/111406/7
Anton Okhrimenko [Tue, 23 Apr 2024 23:43:13 +0000 (01:43 +0200)]
Hardcode width and depth parameters

Hardcode width and depth parameters values for RESTCONF OpenAPI.
Our aim is to load big models in web browsers successfully by default.

JIRA: NETCONF-1300
Change-Id: Id628d156ab3ecb5daacc988d1c9136518f87b264
Signed-off-by: Anton Okhrimenko <Anton.Okhrimenko@pantheon.tech>
2 months agoImplement depth parameter 22/111222/53
Ivan Hrasko [Wed, 3 Apr 2024 13:31:08 +0000 (15:31 +0200)]
Implement depth parameter

Implement depth parameter to enable to retrieve OpenAPI
document in smaller chunks for every model.

JIRA: NETCONF-1298
Change-Id: Ia615a776b6daa1d1d1b0de6d0863613d9d29ee79
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
2 months agoImplement width parameter 02/111502/30
Oleksandr Zharov [Tue, 23 Apr 2024 17:03:59 +0000 (19:03 +0200)]
Implement width parameter

Added width parameter that limit number of children that will be present
in every module/node of the result schema.

JIRA: NETCONF-1298
Change-Id: I86e9e2b5cf837a21f92be39ceb2579bb5d990757
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
2 months agoDocument TLS "key-id" option 75/112275/8
Oleksandr Zharov [Tue, 25 Jun 2024 10:04:06 +0000 (12:04 +0200)]
Document TLS "key-id" option

Updated request payload for TLS device with newly added key-id
that specifies the set of keys used for the connection.

JIRA: NETCONF-1324
Change-Id: I3450a00be68c5dc655add454c2cb6db59053d941
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
2 months agoOpenApi add POST request to device root 57/108357/24
Yaroslav Lastivka [Thu, 26 Oct 2023 10:32:41 +0000 (13:32 +0300)]
OpenApi add POST request to device root

Added root POST request example for first device model,
and first controller model

JIRA: NETCONF-1169
Change-Id: I45b668709e65ce97543b194b16372c12953eb5e2
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
2 months agoCreate SchemasEntity class to simplify SchemasStream 52/110252/9
lubos-cicut [Thu, 15 Feb 2024 14:51:32 +0000 (15:51 +0100)]
Create SchemasEntity class to simplify SchemasStream

Created SchemasEntity class to simplify SchemasStream. SchemasEntity
now hold collection of SchemaEntity. Class SchemaStream is no more
necessary.

JIRA: NETCONF-1247
Change-Id: I5490a9b4694f01043dabef5ba6487538f89a20cd
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
2 months agoMove client config creation to lockedConnect method 07/112007/5
Yaroslav Lastivka [Thu, 6 Jun 2024 09:34:21 +0000 (12:34 +0300)]
Move client config creation to lockedConnect method

NetconfNodeHandler has been refactored to handle client configuration
creation within the NetconfNodeHandler#lockedConnect method.

This approach allows nodeHandler to be successfully created even with
an invalid encrypted password and added into activeConnectors.
If the device has the max-connection-attempts parameter, we will attempt
to establish the connection a specified number of times.
If unsuccessful, the status will be changed to unable-to-connect.
On exception, the device's operational data is removed using a DELETE
request.

JIRA: NETCONF-1317
Change-Id: I3e13d2c904e01ddf195fc9d9a057c0f1e0828a66
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoOpenAPI: Improve anydata example 76/111976/3
lubos-cicut [Tue, 4 Jun 2024 12:15:57 +0000 (14:15 +0200)]
OpenAPI: Improve anydata example

Example template for anydata was
"<%s> ... </%s>", localName, localName
for both XML and JSON, which was incorrect.

Now we create empty object that is translatable to XML/JSON.
Into schema added description which informs the users that this is
unknown data and needs to be filled in by them.

JIRA: NETCONF-1319
Change-Id: I6440ff95f06ffa3d320ff50b93ee996ca1398052
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
2 months agoOpenApi: Test nonconfig input and output for actions 07/111207/5
lubos-cicut [Tue, 2 Apr 2024 16:06:00 +0000 (18:06 +0200)]
OpenApi: Test nonconfig input and output for actions

Test nonconfig inputs and outputs for actions

JIRA: NETCONF-1314
Change-Id: I58d60ee16b085b016ff57d4a03c8357cd0257cca
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
2 months agoMake timeout and keep-alive configurable for Call-Home 27/109627/23
Samuel Schneider [Tue, 27 Jun 2023 07:52:21 +0000 (09:52 +0200)]
Make timeout and keep-alive configurable for Call-Home

Make request timeout and keep-alive configurable for Call-Home
services. And propagate connection timeout configuration
correctly.

Additionally, join configurations for both TLS and SSH services into
one so all configurations for callhome-provider bundle are in one
place.

JIRA: NETCONF-1213
Change-Id: I453d092bf3c5a77404e951cd4de5cce849727f2b
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
2 months agoFix accumulating KeepaliveTask executions 63/111763/10
Martin Sunal [Sun, 5 May 2024 15:29:33 +0000 (17:29 +0200)]
Fix accumulating KeepaliveTask executions

Parallel RPC executions were causing additional KeepaliveTask
scheduling. This change ensures that KeepaliveTask is
not scheduled prematurely and preventing redundant executions.

JIRA: NETCONF-1318 NETCONF-1308
Change-Id: Ic20a3f5b1b2f56d2f272013c86faa1c0c08b60ea
Signed-off-by: Martin Sunal <martin@paxet.io>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
2 months agoSimplify working with Capability objects 71/107471/37
Oleksandr Zharov [Tue, 22 Aug 2023 11:40:01 +0000 (13:40 +0200)]
Simplify working with Capability objects

Added Utility class with two methods to simplify creating/parsing
Capability objects. The first is a method that can parse an urn
string and create a Capability from it. The second is a method that
extracts capabilities from all present modules.

Added test for new logic.

JIRA: NETCONF-1015
Change-Id: I85edf4e20d6b53677c0fe216c83edf4e6bdb010c
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
2 months agoDesign a Capability object model 46/105846/30
Robert Varga [Fri, 5 May 2023 00:21:03 +0000 (02:21 +0200)]
Design a Capability object model

Implemented YangModuleCapability and EXiCapability
which extend ParameterizedCapability.
These classes appear to represent YANG module capabilities
and have attributes like content, revision, module name,
features, deviations, etc.
Added enumeration of SimpleCapability which implements
the Capability interface, listing various NETCONF
capabilities based on different RFCs and drafts.

JIRA: NETCONF-1015
Change-Id: I6c935dc4818e1968d656ce00aa08fb82f7650fc5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
2 months agoRemove unnecessary check for canceled future 27/112227/4
Peter Suna [Tue, 18 Jun 2024 16:20:33 +0000 (18:20 +0200)]
Remove unnecessary check for canceled future

The requests queue contains only instances of UncancellableFuture
with "uncancellable" set to "true". Thus checking for cancellation
is unnecessary.

Change-Id: If63f271ebc6659f3d90de3c1b502678f28b1268d
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
2 months agoRelease semaphore after disconnection 26/112226/3
Peter Suna [Tue, 18 Jun 2024 16:13:36 +0000 (18:13 +0200)]
Release semaphore after disconnection

Ensure semaphore is released when requests are removed in
the tearDown method. This ensures that the concurrent RPC
limit corresponds accurately to the actual requests.

JIRA: NETCONF-1332
Change-Id: Id677b5d05805d50c193235f6b2a594bb76f0ef59
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
2 months agoCleanup OpenAPI tests 99/112299/3
Ivan Hrasko [Wed, 26 Jun 2024 11:16:26 +0000 (13:16 +0200)]
Cleanup OpenAPI tests

Use JUnit 5 code style (no more public test methods) and
remove unnecessary empty lines.

JIRA: NETCONF-1309
Change-Id: If14b89e2a6a39fe4b585a796bab4fffcaea7a339
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
2 months agoCheck for netconf interleave capability 38/110738/14
Samuel Schneider [Thu, 14 Mar 2024 16:49:40 +0000 (17:49 +0100)]
Check for netconf interleave capability

Add check for interleave capability.
Do not allow notification subscription at all if it is not present.

JIRA: NETCONF-91
Change-Id: Id346ff8c1c73eb8c1be4a006216b15dadebf3dd4
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
2 months agoPrevent NPE for Credentials 92/110192/50
Yaroslav Lastivka [Thu, 8 Feb 2024 13:22:54 +0000 (15:22 +0200)]
Prevent NPE for Credentials

Added mandatory field to Credential choice.
Changed the logic for writing device data into the OPERATIONAL
datastore to include credentials.

JIRA: NETCONF-1235
Change-Id: Ibb2640efcaf301c06e29199008a0c9cedf124a34
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
2 months agoUse JUnit5 code style in BugDocumentTest 74/112274/2
lubos-cicut [Tue, 25 Jun 2024 08:45:32 +0000 (10:45 +0200)]
Use JUnit5 code style in BugDocumentTest

Remove unnecessary access modifiers and simplify source for
parameterized test.

JIRA: NETCONF-1309
Change-Id: Ibc1fe843701d006ee0f98e8ee32fba96f62dbea5
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
2 months agoMigrate plugins/netconf-server-mdsal/notifications tests to JUnit5 10/111810/5
Oleksandr Zharov [Tue, 21 May 2024 17:59:27 +0000 (19:59 +0200)]
Migrate plugins/netconf-server-mdsal/notifications tests to JUnit5

Migrated plugins/netconf-server-mdsal/notifications tests from JUnit4
to JUnit5.

JIRA: NETCONF-1310
Change-Id: Ic34fa191ae4ddf84953b7fc12555ac0b1eff61ec
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
2 months agoRemove unnecessary casting 81/111681/4
lubos-cicut [Mon, 13 May 2024 09:19:54 +0000 (11:19 +0200)]
Remove unnecessary casting

Removed unnecessary casting of DataSchemaNode.

Change-Id: I60748937179fb6fdcda3b311e71d3fdb8bf74cd4
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
2 months agoOpenapi: Missing schema for node processed by another parent test 80/111680/6
lubos-cicut [Mon, 13 May 2024 08:41:38 +0000 (10:41 +0200)]
Openapi: Missing schema for node processed by another parent test

If the same node was a child of more than one parent, only the first
one was processed.

Parent patch fixes this problem. Now when node is processed it will be
saved with the current parent. This patch tests if generated document
is as expected.

Created new test to simplify testing of new reported bugs.

JIRA: NETCONF-1309
Change-Id: I7cc72f5d12286154056da6f5b551a11429518332
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
2 months agoOpenapi: Missing schema for node processed by another parent 79/111679/3
lubos-cicut [Mon, 13 May 2024 07:05:04 +0000 (09:05 +0200)]
Openapi: Missing schema for node processed by another parent

If the same node was a child of more than one parent, only the first
one was processed.

This patch fixes this problem. Now when node is processed it will
check if his clear name is saved in set of names.

JIRA: NETCONF-1309
Change-Id: Ia8360b2e51084001cc2a7a4e4645b301801c3a4c
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
3 months agoRemove most RestconfDocumentedException users 46/111346/18
Robert Varga [Tue, 18 Jun 2024 06:37:12 +0000 (08:37 +0200)]
Remove most RestconfDocumentedException users

ServerException provides equivalent facilities with better call
convention and semantics. Migrate most users over.

JIRA: NETCONF-1188
Change-Id: I1733374f38c645c25ab6a98ef6590530fbec17d0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoEliminate TransactionUtil 21/112221/6
Robert Varga [Tue, 18 Jun 2024 08:38:17 +0000 (10:38 +0200)]
Eliminate TransactionUtil

The methods here are primarily used in RestconfStrategy implementations.
Rehost them there.

JIRA: NETCONF-1188
Change-Id: Ib0e2425a7664601981c6f0c2cfd352856a0bd358
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoBump sshd to 2.13.0 30/112230/1
Robert Varga [Wed, 19 Jun 2024 08:41:35 +0000 (10:41 +0200)]
Bump sshd to 2.13.0

https://github.com/apache/mina-sshd/releases/tag/sshd-2.13.0

Change-Id: I91417e758dcb2f9ee3d2fe08d8df692f646ebc5c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoSupport auth* service integration for HttpTransport 35/111735/7
Ruslan Kashapov [Fri, 17 May 2024 13:29:12 +0000 (16:29 +0300)]
Support auth* service integration for HttpTransport

Due to channel handler is stateful object using same auth*
handler for multiple connection causes error. Fixed by
replacing handler instance with handler factory usage.

Server API extended to accept custom authn/authz handler
factory. This allows external services integration.

JIRA: NETCONF-1316
Change-Id: I99cd267c0955b93d10e7f75de31897533edb5b9b
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoUse ServerException to report DOMRpcResult errors 19/112219/7
Robert Varga [Tue, 18 Jun 2024 06:05:43 +0000 (08:05 +0200)]
Use ServerException to report DOMRpcResult errors

Move RpcError mapping away from RestconfError and use it only in
ServerError.

Change-Id: I444aca99b2fe66167cb80bff3198484b768b4a7b
JIRA: NETCONF-1188
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoMove RestconfFuture to rfc8040.rest.transations 18/112218/7
Robert Varga [Tue, 18 Jun 2024 04:18:02 +0000 (06:18 +0200)]
Move RestconfFuture to rfc8040.rest.transations

ExistenceCheck is the sole remaining user of RestconfFuture et al.
Relocate and hide these classes before we embark on more interation.

JIRA: NETCONF-1188
Change-Id: Ieb7590f75b0498a13b3e2793989da18a4bb3da79
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRemove RestconfDocumentedException throws 17/112217/8
Robert Varga [Tue, 18 Jun 2024 03:08:16 +0000 (05:08 +0200)]
Remove RestconfDocumentedException throws

Convert all remaining throwing callsites to throw ServerException
instead.

This introduces a ton of try/catch exception blocks around
RestconfTransaction. These will be dealth with in subsequent patches,
where RestconfTransaction gains proper ServerRequest integration.

This also flushes out a few tests which are asserting direct throws,
which we update here to use assertError() instead.

JIRA: NETCONF-1188
Change-Id: I0da8929a42496426cda8b172658014a828cb1c29
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRefactor ServerRequest 16/112216/6
Robert Varga [Mon, 17 Jun 2024 21:08:48 +0000 (23:08 +0200)]
Refactor ServerRequest

Our invocation currently routes responses via RestconfFuture and then
via RestconfCallback.

This is quite superfluous indirection, which we eliminate by expading
ServerRequest to being an entity that can be completed -- just like a
RestconfCallback.

We then create a specialized JaxRsServerRequest, which is essentially
what JaxRsRestconfCallback used to be, and use it instead of
RestconfFuture in RestconfServer.

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