netconf.git
4 months agoSimplify synchronization in MountPointOpenApi 89/109689/3
Ivan Hrasko [Tue, 9 Jan 2024 13:06:15 +0000 (14:06 +0100)]
Simplify synchronization in MountPointOpenApi

Use ConcurrentSkipListMap and ConcurrentHashMap for instanceIdToLongId
and longIdToInstanceId respectivelly which removes the necessity to use
additional locking when we put or get from them.

Change-Id: I8db52cd2aa69c5dacc465db1c20b4d4a6c7dacb2
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoRemove no more used RFC 8040 configuration file 40/109640/5
Ivan Hrasko [Fri, 5 Jan 2024 13:39:05 +0000 (14:39 +0100)]
Remove no more used RFC 8040 configuration file

Delete not used restconf8040.cfg file which was supposed to hold
configuration which can be in fact set in karaf's
etc/org.opendaylight.restconf.nb.rfc8040 file.

When present the file is used to overwrite default values specified in
OSGiNorthbound class.

JIRA: NETCONF-1219
Change-Id: I6dbc1c5696b59d6b2592dbbf01873243ebacd73f
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
4 months agoUse BufferedReader to read OpenApi 90/109690/3
Ivan Hrasko [Tue, 9 Jan 2024 15:18:56 +0000 (16:18 +0100)]
Use BufferedReader to read OpenApi

Use BufferedReader when creating OpenApi document to
achieve better efficiency.

JIRA: NETCONF-938
Change-Id: I11c6f935be2022c6fae175100e01f2c51a487831
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoEliminate OpenApiApplication class 45/106145/7
Ivan Hrasko [Wed, 24 May 2023 13:20:32 +0000 (15:20 +0200)]
Eliminate OpenApiApplication class

Eliminate OpenApiApplication by making it an anonymous
class in its sole user.

JIRA: NETCONF-1221
Change-Id: Idfdc00e66e15d812e1921c8e8404c50e8185fa7f
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoRemove JaxbContextResolver class 86/109686/1
Ivan Hrasko [Tue, 9 Jan 2024 08:08:33 +0000 (09:08 +0100)]
Remove JaxbContextResolver class

JaxbContextResolver class is unused and has been initially removed by
6baa311. We have accidentally bring it back with b85da3f3.

Remove it again now.

Change-Id: Ib24fc6bcc6d2dcbd68848d4fedb4ad77bf912bbb
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoMake toComponents method static 85/109685/1
Ivan Hrasko [Tue, 9 Jan 2024 08:01:58 +0000 (09:01 +0100)]
Make toComponents method static

SchemasStream#toComponents method can be static if we add context
as parameter.

Change-Id: I41c439a70387503e744ee4f877c62ea1bc6a3602
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoRemove no more valid TODO 84/109684/1
Ivan Hrasko [Tue, 9 Jan 2024 07:59:45 +0000 (08:59 +0100)]
Remove no more valid TODO

OpenApi rewrite to use streams has been completed and definitely
we have assigned payloads to its corrects paths.

Change-Id: If5907dd342d08e2126a7b74fbb0231f09505b271
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoUse base64 encoding for netconf device passwords 35/109035/22
Oleksandr Zharov [Tue, 21 Nov 2023 13:02:25 +0000 (14:02 +0100)]
Use base64 encoding for netconf device passwords

Changed password type to binary for encrypted authentication case to
enforce base64 encoding for odl-netconf-device model.

The binary type is in ODL represented by base64 encoding according
to RFC 7950.

This way we can ensure that authentication service is always able
to decrypt such password during connecting process.

We aim to not touch RPC create-device in netconf-node-topology model
thus we are no more reusing credentials from odl-netconf-device
but we create its own which are still using plain password which is
then encoded by RPC logic and translated into new binary format.

JIRA: NETCONF-1115
Change-Id: Ib70c4f69643162b49d8096ec255f3640ebee2e15
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoAdd call-home device connection verification 01/109301/4
lubos-cicut [Wed, 13 Dec 2023 11:30:46 +0000 (12:30 +0100)]
Add call-home device connection verification

Add verification to check that when netconf device calls home then
ODL connects it (enable in topology).

JIRA: NETCONF-1212
Change-Id: I843bc151b54b2bc20fedc2ead1b04d523b41f60b
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoRemove not used DataBroker reference 41/109641/1
Ivan Hrasko [Fri, 5 Jan 2024 13:51:01 +0000 (14:51 +0100)]
Remove not used DataBroker reference

Remove not used DataBroker from IetfZeroTouchCallHomeServerProvider.

Change-Id: I872a7f76af436e7743423aebb13309b42a731b30
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
5 months agoBump upstreams 79/109479/5
Robert Varga [Fri, 29 Dec 2023 09:56:46 +0000 (10:56 +0100)]
Bump upstreams

Adopt:
- odparent-13.0.10
- infrautils-6.0.5
- yangtools-11.0.5
- mdsal-12.0.4
- controller-8.0.4
- aaa-0.18.4

Change-Id: I8c5b540fd07ce872b97bd4d37d9cf493a30c1777
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoDo not use mockito-subclass 84/109484/2
Robert Varga [Fri, 29 Dec 2023 11:18:26 +0000 (12:18 +0100)]
Do not use mockito-subclass

The tests seem to work now out of the box, remove the workaround.

Change-Id: Id260fbdb9bc3d577936332b22461331b4d8171f5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoReduce the number of conditional operators in RestconfStream 30/109230/2
Oleksandr Zharov [Fri, 8 Dec 2023 17:02:33 +0000 (18:02 +0100)]
Reduce the number of conditional operators in RestconfStream

Refactored code to reduce number of lines that are
overloaded with conditions.

JIRA: NETCONF-1211
Change-Id: Ia2d0a1f785bebce03f6d6dc0c0553c0eeca244e0
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
5 months agoJunos device: Fix IllegalStateException 21/109321/2
Yaroslav Lastivka [Fri, 15 Dec 2023 10:05:32 +0000 (12:05 +0200)]
Junos device: Fix IllegalStateException

To address the IllegalStateException encountered in choice processing,
an additional condition has been implemented to check if the choice has cases.
This ensures proper handling and avoids the exception.

JIRA: NETCONF-938
Change-Id: I3d1062bb5a0505944cffb1d3df1ddc80de5f7e00
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
5 months agoRemove jackson-annotations from OpenApi 02/109302/2
Ivan Hrasko [Wed, 13 Dec 2023 11:32:14 +0000 (12:32 +0100)]
Remove jackson-annotations from OpenApi

Remove the last unnecessary usage and completely remove
jackson-annotations and related jackson-databind dependencies
from restconf OpenApi.

Change-Id: I08ccc9240bc45b753df2a5e6c0ba828b5e3a6f9e
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
5 months agoUpdate user-guide after login-password removal 13/109213/2
Oleksandr Zharov [Thu, 7 Dec 2023 17:47:18 +0000 (18:47 +0100)]
Update user-guide after login-password removal

Updated request payloads in user-giude to new one according
to login-password removal.

JIRA: NETCONF-1203
Change-Id: I8bb718cd1b30c70a1df1ab62e817ca5b34ef1756
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
5 months agoFix typos in the user-guide 23/109223/4
Yaroslav Lastivka [Fri, 8 Dec 2023 12:46:16 +0000 (14:46 +0200)]
Fix typos in the user-guide

Several typographical errors have been addressed in the NETCONF User Guide. These corrections will enhance the clarity and readability of the documentation, ensuring accurate and understandable information for users.

Change-Id: I6fa0346310ee90c9e1ef1c46077a4d4c83547ed8
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
5 months agoNetconf client configuration cleanup 95/108895/17
Ruslan Kashapov [Thu, 9 Nov 2023 11:08:22 +0000 (13:08 +0200)]
Netconf client configuration cleanup

Legacy attributes and related obsolete artifacts removed.

JIRA: NETCONF-1108
Change-Id: Ibf317c2bffb83793603eea343463a74fe37084d0
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoDeprecate WebSocket event stream delivery 61/109161/5
Robert Varga [Wed, 6 Dec 2023 09:20:55 +0000 (10:20 +0100)]
Deprecate WebSocket event stream delivery

We support RFC8040-standard delivery of events via Server-Sent Events
and Websockets do not offer any advantage over that. Deprecate them for
removal.

JIRA: NETCONF-1208
Change-Id: Ib52085f0df50d723ea27e4815e77c988c21135ba
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoRevert models description change 67/109167/8
Oleksandr Zharov [Wed, 6 Dec 2023 12:30:22 +0000 (13:30 +0100)]
Revert models description change

Reverted changes in models that was related to incorrect
display of ' in swagger.

JIRA: NETCONF-938
Change-Id: Ic62cea63facef03b7b2c23741d532565147e8872
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
5 months agoRemove OpenApiObject 74/109074/21
lubos-cicut [Mon, 27 Nov 2023 09:43:36 +0000 (10:43 +0100)]
Remove OpenApiObject

Remove OpenApiObject and all its components.

JIRA: NETCONF-938
Change-Id: I584a17db3404c3f3be1d084b86b790b1c99bca38
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
5 months agoAdapt API to OpenApiObject removal 05/108305/35
Ivan Hrasko [Tue, 10 Oct 2023 13:53:55 +0000 (15:53 +0200)]
Adapt API to OpenApiObject removal

Adapted REST API to use new logic.

Adapted tests for OpenApiInputStream.

JIRA: NETCONF-938
Change-Id: Idc6a35bb29f77c37e7ac70e873fd6b720fc5584d
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
5 months agoAdapt tests for OpenApi 04/108304/32
Ivan Hrasko [Tue, 10 Oct 2023 13:41:24 +0000 (15:41 +0200)]
Adapt tests for OpenApi

As intermediate step in adaptation from OpenApiObject record
removed all tests.

Edited AbstractDocumentTest class to save functionality.

JIRA: NETCONF-938
Change-Id: Ie64b28037652a7608f2129b19dd822400216e88e
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
5 months agoRe-implement logic for security and securitySchemes 09/108809/34
Yaroslav Lastivka [Mon, 30 Oct 2023 18:02:29 +0000 (20:02 +0200)]
Re-implement logic for security and securitySchemes

Added SecurityEntity, SecuritySchemesEntity for generating
Security fields in JSON.

JIRA: NETCONF-938
Change-Id: Ia45e5b590bee65325b7b131d5e4f11b0836c5634
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
5 months agoRe-implement paths for ChildNodes 36/109036/24
lubos-cicut [Mon, 20 Nov 2023 17:17:27 +0000 (18:17 +0100)]
Re-implement paths for ChildNodes

Re-implement logic for generating paths for child nodes
with new input streams approach.

JIRA: NETCONF-938
Change-Id: I38bda3346e8ec49751a2ac511ad8bd790a6d27cd
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
5 months agoRe-implement paths for RPCs 65/108865/23
Samuel Schneider [Mon, 6 Nov 2023 19:51:49 +0000 (20:51 +0100)]
Re-implement paths for RPCs

Re-implement logic for generating paths for RPCs
with new input streams approach.

JIRA: NETCONF-938
Change-Id: I4957d303148fcdffc0fb09b393209d72e9f7b63b
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
5 months agoRe-implement components/schemas for RPC's childs 24/109124/17
Matej Sramcik [Thu, 30 Nov 2023 08:08:35 +0000 (09:08 +0100)]
Re-implement components/schemas for RPC's childs

Re-implement logic for generating components/schemas for child
nodes of RPCs with new input streams approach.

JIRA: NETCONF-938
Change-Id: I9725d2772130d673ad0e6114df41dae568981c2e
Signed-off-by: Matej Sramcik <matej.sramcik@pantheon.tech>
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
5 months agoRe-implement components/schemas for nodes 45/109045/23
Yaroslav Lastivka [Tue, 21 Nov 2023 08:00:30 +0000 (10:00 +0200)]
Re-implement components/schemas for nodes

Re-implement logic for generating components/schemas for nodes
with new input streams approach.

JIRA: NETCONF-938
Change-Id: I81dad0f0049e69fc913a7b0ba4f7662d5356aa3a
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
5 months agoRe-implement components/schemas for actions 29/109029/11
Yaroslav Lastivka [Mon, 20 Nov 2023 13:36:50 +0000 (15:36 +0200)]
Re-implement components/schemas for actions

Re-implement logic for generating components/schemas for actions
with new input streams approach.

JIRA: NETCONF-938
Change-Id: I90a769a81fbf5d6199fbd51db73de981eda9acd6
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
5 months agoRe-implement components/schemas for RPCs 12/108912/23
Matej Sramcik [Fri, 10 Nov 2023 11:06:16 +0000 (12:06 +0100)]
Re-implement components/schemas for RPCs

Re-implement logic for generating components/schemas for RPCs
with new input streams approach.

JIRA: NETCONF-938
Change-Id: I9b42659155d16e3efd316608e436c97a2becd8bc
Signed-off-by: Matej Sramcik <matej.sramcik@pantheon.tech>
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
5 months agoWIP: Draft reading YANG context into OpenApiInputStream 58/108258/16
Ivan Hrasko [Thu, 24 Aug 2023 15:01:05 +0000 (17:01 +0200)]
WIP: Draft reading YANG context into OpenApiInputStream

We would like to create JSON document according to
OpenApi specification from EffectiveModelContext.

We are going to use OpenApiInputStream to create overall
document structure by deploying nested input streams.

For example we are creating nested input stream for 'paths'
where we are iterating over EffectiveModelContext multiple times
(for each module) to read each module's paths by dedicated input
stream. This way we will never have in memory more paths than paths
for one module.

The same applies for schemas.

Some parts of the document can be done without iterating over
EffectiveModelContext, like 'info', 'servers', etc. These are just
read from their respective entities where we even can use hard-coded
or constant values.

JIRA: NETCONF-938
Change-Id: I75db8424e5559786f402a6ed79d35b2ff8ec647e
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
5 months agoWIP: Add OpenApi{Entity,BodyWriter} 49/107149/20
Robert Varga [Mon, 31 Jul 2023 13:48:03 +0000 (15:48 +0200)]
WIP: Add OpenApi{Entity,BodyWriter}

With JAX-RS we can defer generation to when the response is created,
via indirection through a MessageBodyWriter.

This provides the basic wiring to do that.

JIRA: NETCONF-938
Change-Id: I7451cc49ac1cceddfde1ddf4bb1052a9888c1886
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
5 months agoFix NoSuchElementException for callhome topology node 20/109220/1
Ruslan Kashapov [Fri, 8 Dec 2023 10:23:52 +0000 (12:23 +0200)]
Fix NoSuchElementException for callhome topology node

Call-home to topology integration uses dynamically composed
Node in order to initialize Netconf layer. Some parameters
were omitted resulting NoSuchElementException on NetconfNodeHandler
instantiation. Set of required parameters was restored to prior
implementation in order to fix this.

JIRA: NETCONF-1183
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Change-Id: I94df8aa1f77580bb2d379f6c3d4e2046c13b35a6

5 months agoFix Call-Home services start failure 93/109193/3
Ruslan Kashapov [Thu, 7 Dec 2023 11:22:43 +0000 (13:22 +0200)]
Fix Call-Home services start failure

- reconfigured services to start automatically on feature install
- fixed NPE on TLS service start due to missing status recorder

JIRA: NETCONF-1183
Change-Id: I0c3bd91d0f81fc9343037ae9b06962c9929edf43
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
5 months agoFix NPE on logging topology node with no credentials 97/109197/3
Ruslan Kashapov [Thu, 7 Dec 2023 11:52:51 +0000 (13:52 +0200)]
Fix NPE on logging topology node with no credentials

When netconf topology node is passed for connection
it's configuration is logged with credentials masking.
However, it wasn't taken into account credentials
value could be null (tcp-only, tls and call-home
integration cases) resulting NPE on direct unconditional
toString() invocation.

Fix makes credentials masking conditional. It's performed
only if logging is enabled and credentials are defined.

JIRA: NETCONF-1204
Change-Id: Ie628b2c06dc014624cb17a6bb8a9bb03d7d8b359
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
5 months agoFix implementation of create-device RPC 94/109194/2
Peter Suna [Thu, 7 Dec 2023 11:18:46 +0000 (12:18 +0100)]
Fix implementation of create-device RPC

Store NetconfNode instead of NetconfNodeTopology in createDevice method
created from the parameter CreateDeviceInput. This modification allows
storing data augmented from the netconf-node-optional model.
Without this change, configuration from IgnoreMissingSchemaSources
would be lost.

JIRA: NETCONF-1192
Change-Id: Iff006fcfe2a41b40e8e41fca5c8a59fc9a55efcb
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
5 months agoAllow YANG PATCH to communicate ETag/Last-Modified 65/109165/1
Robert Varga [Wed, 6 Dec 2023 11:39:51 +0000 (12:39 +0100)]
Allow YANG PATCH to communicate ETag/Last-Modified

PATCH methods should communicate ETag/Last-Modified where applicable.
Introduce DataYangPatchResult to communicate these for YANG PATCH.

JIRA: NETCONF-1207
Change-Id: Ie98423c6615dc0ef2d19349d19e937f72ed03165
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoRepair testDeleteNonexistentData() 64/109164/2
Robert Varga [Wed, 6 Dec 2023 11:36:12 +0000 (12:36 +0100)]
Repair testDeleteNonexistentData()

Our refactoring forgot to delegate to assertTestDeleteNonexistentData(),
leading to far too few assertions. Fix that and add more assertions.

JIRA: NETCONF-1107
Change-Id: If0a0bbb60fbcee08c398da365e2536e4e4b08869
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoAllow plain PATCH to communicate ETag/Last-Modified 62/109162/2
Robert Varga [Wed, 6 Dec 2023 10:49:56 +0000 (11:49 +0100)]
Allow plain PATCH to communicate ETag/Last-Modified

PATCH methods should communicate ETag/Last-Modified where applicable.
Introduce DataPatchResult to communicate these for plain PATCH.

JIRA: NETCONF-1207
Change-Id: I3ed2e80385f2b5acdd90c04adab49b491ebd5a79
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoAllow dataPUT() to control ETag/Last-Modified 57/109157/3
Robert Varga [Wed, 6 Dec 2023 08:15:43 +0000 (09:15 +0100)]
Allow dataPUT() to control ETag/Last-Modified

When creating or replacing a data resource, the underlying strategy
should be free to indicate ETag/Last-Modified headers.

Allow this information to be communicated via DataPutResult and pick it
up when generating a Response.

JIRA: NETCONF-1207
Change-Id: I86b726fcaa5bfb7d762483f007d6de77b894f802
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoAllow dataPOST() to control Etag/Last-Modified 56/109156/3
Robert Varga [Wed, 6 Dec 2023 07:58:28 +0000 (08:58 +0100)]
Allow dataPOST() to control Etag/Last-Modified

In Create Resource Mode, each RestconfStrategy should be able to
communicate ETag and Last-Modified headers.

Retrofit DataPostResult.CreateResource to implement
ConfigurationMetadata and propagate its content when generating the HTTP
response.

JIRA: NETCONF-1207
Change-Id: I6b4440f018c17a41887fecc19b220542f360e2c6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoShift ETag/Last-Modified generation to RestconfStrategy 55/109155/4
Robert Varga [Wed, 6 Dec 2023 07:40:27 +0000 (08:40 +0100)]
Shift ETag/Last-Modified generation to RestconfStrategy

We should not be faking headers, but rather let them be controlled by
RestconfStrategy.

This patch introduces ConfigurationMetadata, as the baseline interface
capturing the two headers and DataGetResult as the container allowing
them to be communicated from RestconfServer.dataGET() methods.

JIRA: NETCONF-1207
Change-Id: I2c2b11a60eea0c6c868f2e82f88c002e702fdbc5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoRemove obsolete NetconfClientDispatcher 94/108894/11
Ruslan Kashapov [Thu, 9 Nov 2023 12:40:08 +0000 (14:40 +0200)]
Remove obsolete NetconfClientDispatcher

Removed obsolete NetconfClientDispatcher interface,
implementation, related components and tests

JIRA: NETCONF-1108
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Change-Id: I24efa1deb8a4dffff51ac68f1f8a91cff1771d01

5 months agoCall-Home provider migration to transport-api 81/108881/13
Ruslan Kashapov [Wed, 1 Nov 2023 08:57:22 +0000 (10:57 +0200)]
Call-Home provider migration to transport-api

- new implementation of callhome-server (using on transport-api)
  replacing callhome-protocol
- callhome-provider updated to use callhome-server
- status update for call-home devices no longer uses change
  listener of topology data tree as connection status source,
  uses implementation of CallHomeStatusReporter instead
- call-home data tree sync moved from
  IetfZeroTouchCallHomeServerProvider to CallHomeMountStatusReporter
- configuration provided for OSGI services serving as call-home servers

JIRA: NETCONF-1183
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Change-Id: I8aa57413acbbe5e7cb7f3ebd4ce6a662f1d668ea

5 months agoClean up data{DELETE,PATCH}() 48/109148/2
Robert Varga [Sat, 2 Dec 2023 10:04:53 +0000 (11:04 +0100)]
Clean up data{DELETE,PATCH}()

While we know what we are going to do with the ApiPath, split the lookup
and interpretation.

JIRA: NETCONF-1157
Change-Id: Ife099f18e3600194f7c922a9455d4a493ee9a28f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoClean up exception handling 46/109146/1
Robert Varga [Sat, 2 Dec 2023 09:30:33 +0000 (10:30 +0100)]
Clean up exception handling

There are a number of places where we allow RestconfDocumentedException
to be thrown, but we are returning a RestconfFuture. Make sure we catch
the exception and propagate it through the future.

JIRA: NETCONF-1157
Change-Id: Ia3a67e9469179302c0a9aabbc420a7a05fc8f08d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoEliminate InstanceIdentifierContext 70/109070/16
Robert Varga [Tue, 28 Nov 2023 18:42:41 +0000 (19:42 +0100)]
Eliminate InstanceIdentifierContext

Rework the way we lookup strategies and generally resolve ApiPath to
actual request paths.

The primary logic now rests with RestconfStrategy, which has a way to
recursively deal with yang-ext:mount steps, resulting in a strategy +
ApiPath tail.

These are then picked up by MdsalRestconfServer and routed to the target
strategy's actual method -- which then interprets the tail ApiPath as
appropriate.

JIRA: NETCONF-1157
Change-Id: I8a6391f5538ba5662bad1bef79186e9a1e08ae81
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoGeneralize ResourceBodyTest 28/109128/4
Robert Varga [Thu, 30 Nov 2023 10:53:42 +0000 (11:53 +0100)]
Generalize ResourceBodyTest

Use proper payloads instead of mucking with internals. This shows that
negative case is completely unreachable.

JIRA: NETCONF-1157
Change-Id: I88371fe99362bec68462f6872e874bb7bbf89e5a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoRemove duplicate container in network-topology 23/109123/2
Peter Suna [Wed, 29 Nov 2023 08:32:57 +0000 (09:32 +0100)]
Remove duplicate container in network-topology

Task NETCONF-670 resolves a failed request to create a device
using the RPC create-device. This task added the grouping
"netconf-node-augmented-optional-fields" to the required RPC
"create-device" but unintentionally to the augmentation for
the list "node" in the network-topology model.

The same augmentation is already done in the
"netconf-node-optional" model.

This results in preparing the same augmentation from
two different models.

JIRA: NETCONF-1192
Change-Id: Ief7a449ffdaff5d42eb52856fac41e87a8e0274a
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
6 months agoGeneralize validTopLevelNodeName() test 14/109114/1
Robert Varga [Tue, 28 Nov 2023 22:08:05 +0000 (23:08 +0100)]
Generalize validTopLevelNodeName() test

Assert the same violation in JSON/XML tests, which shows this method is
that XML is doing its own thing.

Since these are exercising this code path as they should, we can hide
the method and inline it.

Change-Id: I43d172283f4c0089726271e830b7e62f54b7db0c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoInline json_sub_container.json 13/109113/1
Robert Varga [Tue, 28 Nov 2023 21:36:13 +0000 (22:36 +0100)]
Inline json_sub_container.json

This is a simple resource, inline it to its two callers and eliminate
obsolete method which gets freed up.

Change-Id: I706dd3cf59e65e5feda0b787ef658bc41d77c922
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoInline xml_sub_container.xml 12/109112/1
Robert Varga [Tue, 28 Nov 2023 21:30:46 +0000 (22:30 +0100)]
Inline xml_sub_container.xml

This is a simple document, inline it directly in tests.

Change-Id: Ib0bbc244f9b599c1cdc5f4073fe0c361041cae16
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoInline foo.xml 11/109111/1
Robert Varga [Tue, 28 Nov 2023 21:25:50 +0000 (22:25 +0100)]
Inline foo.xml

This is a simplistic XML fragment, inline it.

Change-Id: I817fb9f29757d5e3a23a068699667138dcedbfc2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoMigrate AbstractResourceBodyTest to JUnit5 10/109110/1
Robert Varga [Tue, 28 Nov 2023 21:18:32 +0000 (22:18 +0100)]
Migrate AbstractResourceBodyTest to JUnit5

Clean up test interactions and migrate to JUnit5.

Change-Id: I4a62a1a980552205712b10552bb64229ead95b83
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoDo not hide DataGetParams.EMPTY 09/109109/1
Robert Varga [Tue, 28 Nov 2023 17:58:38 +0000 (18:58 +0100)]
Do not hide DataGetParams.EMPTY

This is a simple constant, do not hide it, as we are already a
transparent record-based DTO.

JIRA: NETCONF-773
Change-Id: I103cdc4e8341f53078204fc0c9f4192f80df65c6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoInline RestconfApplication 08/109108/1
Robert Varga [Tue, 28 Nov 2023 17:25:44 +0000 (18:25 +0100)]
Inline RestconfApplication

Use an anonymous Application subclass to initialize the servlet, which
makes it obvious JaxRsNorthbound has now mdsal.dom.api dependencies.

JIRA: NETCONF-773
Change-Id: I25aea4b6fdfc3d6d3561387956f2e92ff057c6e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoRefactor ReceiveEventsParams 07/109107/1
Robert Varga [Tue, 28 Nov 2023 17:08:01 +0000 (18:08 +0100)]
Refactor ReceiveEventsParams

This is a simple request DTO. Move it to restconf.server.api, where it
really belongs. Also rename it to EventStreamGetParams in keeping with
package naming.

JIRA: NETCONF-773
Change-Id: I06ca58bcf5dde64b9e8787b4d467a384a960596e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoCleanup restconf-nb dependencies 06/109106/1
Robert Varga [Tue, 28 Nov 2023 17:05:36 +0000 (18:05 +0100)]
Cleanup restconf-nb dependencies

We have accumulated some warnings, clean them up.

JIRA: NETCONF-773
Change-Id: I69058c298a63b2f084c1ab2cce46474b71bd6c51
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoRefactor ReadDataParams 04/109104/2
Robert Varga [Tue, 28 Nov 2023 16:40:28 +0000 (17:40 +0100)]
Refactor ReadDataParams

Rename these to DataGetParams in keeping with restconf.server.api
package, where this DTO belongs.

JIRA: NETCONF-773
Change-Id: Ie11b1e09d8a45c392d57e5e69c5857aae88b8935
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoReorder QueryParams 05/109105/2
Robert Varga [Tue, 28 Nov 2023 16:45:05 +0000 (17:45 +0100)]
Reorder QueryParams

odl-pretty-print is our extension, make sure it is filed in its
appropriate place.

JIRA: NETCONF-773
Change-Id: Ib57987e9cf33fe3e0959c6c4e14d23e94f92406d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoMove RestconfSchemaSourceUrlProvider 03/109103/1
Robert Varga [Tue, 28 Nov 2023 16:21:19 +0000 (17:21 +0100)]
Move RestconfSchemaSourceUrlProvider

This component is part of dealing with yang-library content, similar to
what we are doing for ietf-restconf, as both really should be transient
state.

Move it to restconf.server.mdsal, so it is co-located with other
datastore state-keeping components.

JIRA: NETCONF-773
Change-Id: I03da2c230123dbcbe04547e7304413c356f116b7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoRefactor root resource discovery 02/109102/1
Robert Varga [Tue, 28 Nov 2023 16:16:56 +0000 (17:16 +0100)]
Refactor root resource discovery

RootResourceDiscoveryServiceImpl is a mouthful and it is in a legacy
package.

Rename it to JaxRsWebHostMetadata, which is really what we are doing
here. Also eliminate RootFoundApplication by making it an anonymous
class in its sole user.

JIRA: NETCONF-773
Change-Id: I2dcaf136f5e8a324b5f31b72ad9bf5bcd7edbcd4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoRemove SSEApplication 01/109101/1
Robert Varga [Tue, 28 Nov 2023 16:08:20 +0000 (17:08 +0100)]
Remove SSEApplication

Use an anonymous Application subclass to tightly bind to the single
user.

JIRA: NETCONF-773
Change-Id: I38ae98f2c8e720785fbd7687ba8766e86419f6f9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoRemove yang.model.api fakes for /restconf/operations 00/109100/1
Robert Varga [Tue, 28 Nov 2023 15:55:24 +0000 (16:55 +0100)]
Remove yang.model.api fakes for /restconf/operations

We are not emitting operatiions content through NormalizedNodes and
thefore do not need to mock anything.

For MD-SAL binding this use case is already handled by the parser,
which creates the magic nodes as needed.

For NETCONF binding this can potentially be lacking, as the remote
EffectiveModelContext may not even have ietf-restconf -- it might be
useful there, but we will re-introduce it if need be.

JIRA: NETCONF-773
Change-Id: Ia3f0f07804702d8046a775634a861e92c1761593
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoClean up ParserIdentifierTest 99/109099/1
Robert Varga [Tue, 28 Nov 2023 15:05:44 +0000 (16:05 +0100)]
Clean up ParserIdentifierTest

At this point this class tests InstanceIdentifierContext. Clean it up,
rename it and move it to the same package.

JIRA: NETCONF-1157
Change-Id: I3d0f6836d248a1255aeb619943761162e4e83168
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoEliminate ParserIdentifier 98/109098/2
Robert Varga [Tue, 28 Nov 2023 14:54:35 +0000 (15:54 +0100)]
Eliminate ParserIdentifier

This is a useless class now. Move its sole method into
ParserIdentifierTest pending further specialization.

JIRA: NETCONF-1157
Change-Id: I6ae765a3934cac2d1139056a76d2f197d15bee59
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoEliminate IdentifierCodec 97/109097/1
Robert Varga [Tue, 28 Nov 2023 14:50:19 +0000 (15:50 +0100)]
Eliminate IdentifierCodec

This is now a mostly-useless indirection to
YangInstanceIdentifierSerializer. Eliminate it by inlining serialization
into callers and tests in YangInstanceIdentifierSerializerTest.

JIRA: NETCONF-1157
Change-Id: I6a560a3ce520570e63ea6b4add335bafe36c4438
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoClean up YangInstanceIdentifierSerializer 95/109095/2
Robert Varga [Tue, 28 Nov 2023 14:25:14 +0000 (15:25 +0100)]
Clean up YangInstanceIdentifierSerializer

Turn this class into a proper object, retaining DatabindContext and
having a serializePath() method.

JIRA: NETCONF-1157
Change-Id: I5c1b04346b17274c790fd02eb48cb0b952646f73
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoRefactor YangInstanceIdentifierDeserializer 94/109094/1
Robert Varga [Tue, 28 Nov 2023 11:42:10 +0000 (12:42 +0100)]
Refactor YangInstanceIdentifierDeserializer

This class is really all about normalizing ApiPath into a
YangInstanceIdentifier (and related information).

Rename it to ApiPathNormalizer and move it to restconf.server.spi, where
so it can be used any and all RestconfServer implementations.

JIRA: NETCONF-1157
Change-Id: I593b5c468650535aca2423724557c0b2aabe8aa0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoRemove an obsolete FIXME 92/109092/1
Robert Varga [Tue, 28 Nov 2023 11:30:30 +0000 (12:30 +0100)]
Remove an obsolete FIXME

We already have ApiPath here, the FIXME is no longer relevant.

JIRA: NETCONF-773
Change-Id: I1c46c86d4e84b2193e4ce374cbf5d9b2a81be795
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoRemove unused InstanceIdentifier factory methods 90/109090/1
Robert Varga [Tue, 28 Nov 2023 08:59:44 +0000 (09:59 +0100)]
Remove unused InstanceIdentifier factory methods

ofMountPoint{Path,Root}() are not used anywhere, remove them.

JIRA: NETCONF-1157
Change-Id: I33a4a653aab4b30add917e07bf7f9ecd25c55dce
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoAdd DataPatchPath 89/109089/1
Robert Varga [Tue, 28 Nov 2023 04:11:51 +0000 (05:11 +0100)]
Add DataPatchPath

This is a minimal capture of state we need, allowing us to reuse codecs.

Change-Id: Iefa54fef563ab1adac3a0cedd166d5aedbd45588
JIRA: NETCONF-1157
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoIntroduce DataPutPath 88/109088/1
Robert Varga [Tue, 28 Nov 2023 03:45:38 +0000 (04:45 +0100)]
Introduce DataPutPath

We need a way to identify resources, the PUT operation on top of /data
provides the semantics. This again allows us to share codecs.

JIRA: NETCONF-1157
Change-Id: I7099ce5e48d080b734705005c6331bd9a11a173c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoAdd OperationsPostPath 87/109087/3
Robert Varga [Tue, 28 Nov 2023 03:11:13 +0000 (04:11 +0100)]
Add OperationsPostPath

This is a nice capture of DatabindContext and the logic we need to
decode OperationInputBody -- using which we can reuse JSON/XML codecs.

JIRA: NETCONF-1157
Change-Id: I6a7136c1c54293be22a85ef015992cc2fb349971
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoIntroduce restconf.server.api.DataPostPath 84/109084/3
Robert Varga [Tue, 28 Nov 2023 01:33:37 +0000 (02:33 +0100)]
Introduce restconf.server.api.DataPostPath

DataPostPath is a state capture of the context we get parsing the
ApiPath. Define in in restconf.server.api and use it in ChildBody.

This has the immediate benefit of reusing JSON/XML codecs.

JIRA: NETCONF-1157
Change-Id: I4177f963b09a732929c61617f56fd1fb24d55396
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoPromote OperationOutput to restconf.server.api 86/109086/1
Robert Varga [Tue, 28 Nov 2023 02:14:48 +0000 (03:14 +0100)]
Promote OperationOutput to restconf.server.api

If we rename this to OperationsPostResult, this goes very nicely with
OperationsGetResult.

JIRA: NETCONF-773
Change-Id: Idcc8d43fac0a7b0125dad692a70c60c9f7158bcd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoUse ActionEffectiveStatement.input() 85/109085/1
Robert Varga [Tue, 28 Nov 2023 01:52:53 +0000 (02:52 +0100)]
Use ActionEffectiveStatement.input()

Do not use YangConstants, just refer to the effective model.

Change-Id: Id232bbb57de131bfe39991a80ef18ceaa30ec255
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoPromote DatabindContext to restconf.server.api 83/109083/1
Robert Varga [Tue, 28 Nov 2023 00:26:53 +0000 (01:26 +0100)]
Promote DatabindContext to restconf.server.api

The furst cut at our output will typically have NormalizedNode
structures and related DatabindContext, so so these can be driven home.

Duplicate DatabindProvider.currentContext() with
DatabindAware.databind().

JIRA: NETCONF-773
Change-Id: I62d10e8a912dfd62bbccaaa0cc52466caca7caa1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoDrop a FIXME 82/109082/1
Robert Varga [Tue, 28 Nov 2023 00:28:54 +0000 (01:28 +0100)]
Drop a FIXME

RestconfDocumentedExceptionMapper should end up being transmogrified
into a better error reporting tool. Drop a FIXME to that effect.

JIRA: NETCONF-1188
Change-Id: I58cd32b5c85c92cd3af8979037aa4bc199d25beb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoUse DatabindContext in instance identifier serialization 81/109081/2
Robert Varga [Mon, 27 Nov 2023 23:20:55 +0000 (00:20 +0100)]
Use DatabindContext in instance identifier serialization

The first thing this path does is create a DataSchemaContextTree -- so
let's pass a DatabindContext, which has that readily available.

JIRA: NETCONF-1157
Change-Id: Ia66d13e4489b00a28404274c9841f227391876ba
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoUse DatabindContext in deserialization path 80/109080/2
Robert Varga [Mon, 27 Nov 2023 23:04:16 +0000 (00:04 +0100)]
Use DatabindContext in deserialization path

Rather than passing a naked EffectiveModelContext, from which we create
a DataSchemaContextTree, pass down the readily-available
DatabindContext -- which provides the tree very cheaply.

JIRA: NETCONF-1157
Change-Id: I68c8478845392c9a1e2fc9fbeb92ed4803d93a5b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoRemove InstanceIdentifierContext.getSchemaContext() 79/109079/2
Robert Varga [Mon, 27 Nov 2023 22:31:18 +0000 (23:31 +0100)]
Remove InstanceIdentifierContext.getSchemaContext()

Use databind().modelContext() in callers, as they will want to be
shifting to using DatabindContext in some cases.

JIRA: NETCONF-1157
Change-Id: I2ec63f5b8e677f5806dafad5c2076dc8aba8fbf0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoUse DatabindContext in InstanceIdentifierContext 78/109078/4
Robert Varga [Mon, 27 Nov 2023 21:31:13 +0000 (22:31 +0100)]
Use DatabindContext in InstanceIdentifierContext

We are moving towards elimination of InstanceIdentifierContext, but
before we do that we need to make sure surrounding code passes around
DatabindContext instead of EffectiveModelContext.

This brings immediate an immediate benefit to YANG Patch body parsing,
as it can pick up the DataSchemaContextTree from DatabindContext.

JIRA: NETCONF-1157
Change-Id: I240cc150a7feab6e7344beefc863eb761d8e30d1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoEliminate DOMDatabindProvider 77/109077/3
Robert Varga [Mon, 27 Nov 2023 13:20:40 +0000 (14:20 +0100)]
Eliminate DOMDatabindProvider

We really need to integrate SourceResolve into RestconfStrategy, as we
really need to drive resolution from MdsalRestconfServer (and have
DatabindProvider really work only with EffectiveModelContext).

This also means RestconfStrategy has access to DatabindContext, which
brings immediate benefit of reusing DataSchemaContextTree instances
without a lookup-by-EffectiveModelContext.

JIRA: NETCONF-1157
Change-Id: I6954c1d168fa25d4ce6d261ae1fe1a23b1b0f6b0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoDisconnect WriterFieldsTranslator from InstanceIdentifierContext 69/109069/3
Robert Varga [Sun, 26 Nov 2023 15:10:54 +0000 (16:10 +0100)]
Disconnect WriterFieldsTranslator from InstanceIdentifierContext

We only need an EffectiveModelContext and target node. Communicate them
explicitly.

JIRA: NETCONF-1157
Change-Id: I5ac371b0086b19bcee06b0bfc5f9857267fb599a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoAdd DatabindContext.schemaTree() 71/109071/2
Robert Varga [Sun, 26 Nov 2023 16:35:53 +0000 (17:35 +0100)]
Add DatabindContext.schemaTree()

We need DataSchemaContextTree during binding of the URL. Retain a
reference in DatabindContext

JIRA: NETCONF-1157
Change-Id: If50b1880299f8b233f60e4198b77f7f11047e1dc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoMove DatabindProvider 68/109068/1
Robert Varga [Sun, 26 Nov 2023 13:00:48 +0000 (14:00 +0100)]
Move DatabindProvider

Promote DatabindProvider to restconf.server.spi package, which is closer
to where it needs to sit (which is probably server.api, depending on
use).

Change-Id: If73dba2479d87b86c77893b71021dd30bab4e459
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoHide ParserIdentifier 67/109067/1
Robert Varga [Sun, 26 Nov 2023 12:28:59 +0000 (13:28 +0100)]
Hide ParserIdentifier

We now only have a single production use or ParserIdentifier. Hide the
class and migrate out-of-package users.

JIRA: NETCONF-1157
Change-Id: I78b246cdb843e10bbb9d661c7a36aba1b4c3f46e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoRemove ParserConstants 66/109066/1
Robert Varga [Sun, 26 Nov 2023 11:46:50 +0000 (12:46 +0100)]
Remove ParserConstants

This class is not referenced anywhere, remove it.

JIRA: NETCONF-773
Change-Id: I3075910010fb9ca4dc48894a83b1ac9668c1a549
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoClean up RestconfSchemaSourceUrlProvider 65/109065/1
Robert Varga [Sun, 26 Nov 2023 11:41:31 +0000 (12:41 +0100)]
Clean up RestconfSchemaSourceUrlProvider

Explicitly annotate injection constructor and instantiate it only when
needed.

Change-Id: I07014f4106cf604681c9bbdb63da05dfc7d6bc3b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoRefactor modulesGET() methods 63/109063/6
Robert Varga [Sun, 26 Nov 2023 08:34:23 +0000 (09:34 +0100)]
Refactor modulesGET() methods

Make sure mountPath is passed to RestconfServer as ApiPath and make
source revision passed as a query parameter. This ends up
eliminating one reference to ParserIdentifier.

JIRA: NETCONF-1157
Change-Id: I4de5293126d3dc0c68b8ee132e5bfa56a1264008
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoEliminate RestconfSchemaServiceImpl 52/109052/5
Robert Varga [Thu, 23 Nov 2023 10:47:33 +0000 (11:47 +0100)]
Eliminate RestconfSchemaServiceImpl

RestconfSchemaServiceImpl is serving YANG/YIN schema sources. While this
capability is not standardized, integrate it into RestconfServer as
modules{Yin,Yang}GET().

This turns out to be a major refactor, as the implementation was shoddy
-- it required local DOMSchemaService to expose
DOMYangTextSourceProvider extension and then it used that when talking
to mount points.

This refactor integrates the ability to lookup sources into
DatabindContext, with the corresponding DOMDatabindProvider wiring. If
no DOMYangTextSourceProvider is present, we call back to using
YangTextSnippet.

JIRA: NETCONF-773
Change-Id: I57689b2915eda0486c0bb5d5ba6de992b3107c0b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoFix channel inactive handling for SSH transport 46/109046/5
Ruslan Kashapov [Wed, 22 Nov 2023 10:21:05 +0000 (12:21 +0200)]
Fix channel inactive handling for SSH transport

Channel inactive handler require to re-transfer the event
down the pipeline in order for subsequent handler to be
triggered as well. SSH transport pipeline did contain two
channel inactive handlers both terminating the event
resulting *NetconfSession not handling channel termination
properly.

Fixed, case covered by test.

JIRA: NETCONF-1200
Change-Id: I2a78709909e1b8509b562a8fa0bf640c45c91432
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoEliminate JaxRsApiPath 59/109059/3
Robert Varga [Fri, 24 Nov 2023 17:06:15 +0000 (18:06 +0100)]
Eliminate JaxRsApiPath

Bouncing through JaxRsApiPath is not entirely optimal, as we need to
expose that class -- which really is an implementation detail.

Eliminate the class in favor of JaxRsRestconf implementing
ParamConverterProvider for ApiPath.

While we could provide this support as an external component, inlining
it in JaxRsRestconf, which is the only relevant user, has the added
benefit of suppressing Jersey warnings about the resource not providing
any provider interfaces.

JIRA: NETCONF-1157
Change-Id: Id3d1cc5acf764bc03a46f792b3d8c2bf72c5bd85
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoFix /operations indexing 61/109061/2
Robert Varga [Fri, 24 Nov 2023 17:44:48 +0000 (18:44 +0100)]
Fix /operations indexing

Guava's Table does not work for indexing here, as it cannot support null
keys, which we require for storing Revision. Switch to using explicit
nested maps.

JIRA: NETCONF-773
Change-Id: I5812191a070eb9e631afd962ecf1d99e537f3fc3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoAdd FIXMEs 60/109060/2
Robert Varga [Fri, 24 Nov 2023 17:22:48 +0000 (18:22 +0100)]
Add FIXMEs

ETag and Last-Modified should be part of the response payload maintained
on RestconfServer side. Add FIXMEs to reflect that.

JIRA: NETCONF-773
Change-Id: Ice8369fb6545569477a137079691c79e55f32927
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoFix operations{Json,Xml}GET definition 58/109058/4
Robert Varga [Fri, 24 Nov 2023 15:55:26 +0000 (16:55 +0100)]
Fix operations{Json,Xml}GET definition

AsyncResponse should be @Suspended, otherwise we get a warnings from
Jersey that "A HTTP GET method, ..., should not consume any entity."

JIRA: NETCONF-773
Change-Id: I6ad989ae7bd8cd6a0303945d2bf6040c6fea8a5b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoFix JaxRsApiPath declaration 57/109057/4
Robert Varga [Fri, 24 Nov 2023 15:42:09 +0000 (16:42 +0100)]
Fix JaxRsApiPath declaration

We are using this class to define our mapping, which means its
constructor must be public. Fixes Jersey reporting "No injection source
found for a parameter of type" fatal message.

JIRA: NETCONF-1157
Change-Id: I75031376ce3ee453d9a5d60b7917c34e57c831fe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoApiPath is a HierarchicalIdentifier 43/109043/4
Robert Varga [Wed, 22 Nov 2023 03:05:30 +0000 (04:05 +0100)]
ApiPath is a HierarchicalIdentifier

ApiPath is essentially a counterpart to YangInstanceIdentifier -- hence
it should provide same services.

JIRA: NETCONF-773
Change-Id: I1d35e43723c484a99c2630f81129ee43222c60b7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoSwitch RestconfSchemaServiceImpl to RestconfFuture 48/109048/5
Robert Varga [Wed, 22 Nov 2023 04:47:34 +0000 (05:47 +0100)]
Switch RestconfSchemaServiceImpl to RestconfFuture

We want to have async execution as we really can execute async method --
for example from SchemaSources. This is the first step, converting to
use RestconfFuture.

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