netconf.git
8 months agoRefactor NormalizedNodePayload 69/107869/2
Robert Varga [Thu, 14 Sep 2023 11:42:49 +0000 (13:42 +0200)]
Refactor NormalizedNodePayload

Turn this class into a record, with complete non-null semantics.

JIRA: NETCONF-773
Change-Id: I73e35fe4bd55f8382a86de0052839efc7b98be81
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoFix action invocation response 70/107870/1
Robert Varga [Thu, 14 Sep 2023 12:01:29 +0000 (14:01 +0200)]
Fix action invocation response

We should be checking for null here as well, which eliminates the last
user of NormalizedNodePayload.ofNullable().

Change-Id: I1397a6e382f4e8d202e98c3d07e6fd3201d0959a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoEliminate NormalizedNodePayload.headers 67/107867/1
Robert Varga [Thu, 14 Sep 2023 10:20:01 +0000 (12:20 +0200)]
Eliminate NormalizedNodePayload.headers

Convert the only user working with this facility to return a Response,
where it can set the location header directly.

JIRA: NETCONF-1102
Change-Id: Ice969014cf5532ea2cb93d1939cad5edf8c76335
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoDo not use InstanceIdentifierContext in postData() 63/107863/4
Robert Varga [Wed, 13 Sep 2023 20:00:37 +0000 (22:00 +0200)]
Do not use InstanceIdentifierContext in postData()

The variables being passed are trivial, refactor internal wiring to pass
appropriate variables instead.

JIRA: NETCONF-1157
Change-Id: I78de7bce3cd9aee231d8129e83dff54ee12a46f7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoReduce InstanceIdentifierContext proliferation 62/107862/4
Robert Varga [Wed, 13 Sep 2023 19:51:54 +0000 (21:51 +0200)]
Reduce InstanceIdentifierContext proliferation

Use local variable type inference to ease future migrations.

Change-Id: If86fb19df9b64dbbbbdcc94ad99dfa19ac0e19ec
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoDo not use InstanceIdentifierContext in NormalizedNodePayload 58/107858/5
Robert Varga [Wed, 13 Sep 2023 19:02:45 +0000 (21:02 +0200)]
Do not use InstanceIdentifierContext in NormalizedNodePayload

All writers have been proven to just need the Inference, ditch the
useless indirection through InstanceIdentifierContext.

JIRA: NETCONF-1157
Change-Id: I0f020b9a73198037dba51364b78ec3af7086b8d7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoRefactor AbstractNormalizedNodeBodyWriter 57/107857/5
Robert Varga [Wed, 13 Sep 2023 17:27:02 +0000 (19:27 +0200)]
Refactor AbstractNormalizedNodeBodyWriter

AbstractNormalizedNodeBodyWriter so that the three common dispatches are
handled in common code. This also modernizes them and pulls common bits
together.

This allows us to also switch the dispatch logic, so it operates on
SchemaInferenceStack instead of on SchemaNode.

All of this ends up showing that there is a bug in operation output
code, which causes us to emit an unnecessary declaration.

JIRA: NETCONF-1157
Change-Id: Icc781e884cecf7a5d64de63dd65b97e963fd4abe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoDo not use InstanceIdentifierContext in OperationsContent 61/107861/5
Robert Varga [Wed, 13 Sep 2023 19:33:40 +0000 (21:33 +0200)]
Do not use InstanceIdentifierContext in OperationsContent

We are really operating on an Inference, remove the indirection.

JIRA: NETCONF-1157
Change-Id: I382716104f4bd66163b2031fe91f47ad96556612
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoOperationsContent requires a context 60/107860/3
Robert Varga [Wed, 13 Sep 2023 19:14:05 +0000 (21:14 +0200)]
OperationsContent requires a context

All callers are guaranteed to have a non-null context, just ditch the
check.

Change-Id: I23d3d1873a5008b5da8683b665df4bf7e9dd0def
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoShare common parts of AbstractNormalizedNodeBodyWriter 56/107856/3
Robert Varga [Wed, 13 Sep 2023 16:34:47 +0000 (18:34 +0200)]
Share common parts of AbstractNormalizedNodeBodyWriter

The two specializations are doing similar things, let's move them closer
together by sharing the common bits. This has a nice effect of reducing
JAX-RS exposure a tiny bit.

JIRA: NETCONF-1157
Change-Id: I4868a890d77f7a8863e85969f94bcb260cada6ed
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoClean up XmlNormalizedNodeBodyWriter 55/107855/3
Robert Varga [Wed, 13 Sep 2023 16:28:22 +0000 (18:28 +0200)]
Clean up XmlNormalizedNodeBodyWriter

We are hunting down the actual state used from
InstanceIdentifierContext, this patch gets us a bit closer and it also
shows we have some oddities going on.

JIRA: NETCONF-1157
Change-Id: I0d623ddf11a00e93d45838ed9d316cee2eb9b715
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoClean up JsonNormalizedNodeBodyWriter 54/107854/3
Robert Varga [Wed, 13 Sep 2023 16:08:56 +0000 (18:08 +0200)]
Clean up JsonNormalizedNodeBodyWriter

We are hunting down the actual state used from
InstanceIdentifierContext, this patch gets us a bit closer and it also
shows we have some oddities going on.

JIRA: NETCONF-1157
Change-Id: I2754cdf7396a16fffc5bc0aedb266bec019c28cd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoFix JsonPatchBody javadoc warnings 59/107859/1
Robert Varga [Wed, 13 Sep 2023 19:07:31 +0000 (21:07 +0200)]
Fix JsonPatchBody javadoc warnings

We are using javadoc for private methods. That is wasteful, as the only
real information is a single sentence. Turn that into an ordinary
comment.

Change-Id: I8bb9b0b41c3bb1e782887cb781bf16d2b85618e9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoRemove InstanceIdentifierContext from PatchBody parsing 53/107853/1
Robert Varga [Wed, 13 Sep 2023 14:18:50 +0000 (16:18 +0200)]
Remove InstanceIdentifierContext from PatchBody parsing

We only need the path encoded from URL and the EffectiveModelContext.
This also splits the parsing and dispatch to simplifying the code flow.

JIRA: NETCONF-1157
Change-Id: I57be40b5f42da169215987f6ffa29395600e2283
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoMove InstanceIdentifierContext 52/107852/1
Robert Varga [Wed, 13 Sep 2023 12:21:19 +0000 (14:21 +0200)]
Move InstanceIdentifierContext

This is a legacy container, move it to restconf-nb, which is the only
place where it is being used.

JIRA: NETCONF-1157
Change-Id: I5d3690c598b860ea200437801ac00d715b8e8288
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoDisconnect PatchStatusContext from InstanceIdentifierContext 45/107845/4
Robert Varga [Tue, 12 Sep 2023 21:24:17 +0000 (23:24 +0200)]
Disconnect PatchStatusContext from InstanceIdentifierContext

All we need here is a reference to EffectiveModeContext, but later we
should be getting a DatabindContext.

Also highlight an encoding problem, where we are doing the wrong thing
based on YangInstanceIdentitier.toString().

JIRA: NETCONF-1157
Change-Id: I7213e3e02765822824d01139f4fbd590bc5f0e60
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoMigrate Collections references 42/107842/3
Robert Varga [Tue, 12 Sep 2023 18:08:49 +0000 (20:08 +0200)]
Migrate Collections references

Use List.of() instead of Collections. Also be smarter about treating
arrays.

Change-Id: I1674e00e4003587b176df939e250ea81d802453d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoImprove NetconfDataTreeService documentation 41/107841/2
Robert Varga [Tue, 12 Sep 2023 17:35:40 +0000 (19:35 +0200)]
Improve NetconfDataTreeService documentation

Remove XML escapes and spring {@code} elements.

Change-Id: I37f8a7b84bf9668feb56e9ea86d4452d7f7cfe83
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoAdd description to POST requests 67/107467/8
lubos-cicut [Tue, 22 Aug 2023 05:32:19 +0000 (07:32 +0200)]
Add description to POST requests

Add description to POST request (paths/…/post/description)
that states that user in example payload sees only the first
data node child of the resource to be created and that
this is in accordance with RFC 8040 which allows us to
create only one resource in POST request.

JIRA: NETCONF-1137
Change-Id: I8549cf860deb5e069a017c9e7247c0bce311e588
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
8 months agoOpenApi: Remove incorrect list POST requests 86/107086/20
Yaroslav Lastivka [Wed, 26 Jul 2023 15:18:03 +0000 (18:18 +0300)]
OpenApi: Remove incorrect list POST requests

Our logic creates POST requests for lists with keys, containing
multiple resources in payload. This does not align with the expected
structure for creating child resources in the YANG model.

Added condition that prevents the creation of POST requests
that has list as a last element.

JIRA: NETCONF-1101
Change-Id: I46820f222c9c5ef8078ac8675d2adc12b06f1253
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
8 months agoRefactor OpenApiTestUtils methods 35/107835/3
Ivan Hrasko [Tue, 12 Sep 2023 13:22:15 +0000 (15:22 +0200)]
Refactor OpenApiTestUtils methods

Change getPathParameters into getPathGetParameters and add
getPathPostParameters.

We assume that all paths present in OpenApi should have at least
GET example in the documentation.

Thus we can use GET operation as a base operation to get number of
parameters in path. We just need to drop 'content' parameter.

For actions and RPCs we can use getPathPostParameters method.

JIRA: NETCONF-1101
Change-Id: I2a0a24a5a567d7dd95b7adf6ec13dddb391fab51
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
8 months agoSkip structural nodes 83/107783/5
Robert Varga [Sun, 10 Sep 2023 15:37:24 +0000 (17:37 +0200)]
Skip structural nodes

We cannot just examine the content being changed, as this could lead
to us trying to report the entire MapNode disappearing -- which does not
have a instance-identifier representation.

JIRA: NETCONF-1152
Change-Id: Ie209b61a0ccd60b07c58ebb11edc518021c80092
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoImprove RestconfStrategy API surface 38/107838/4
Robert Varga [Tue, 12 Sep 2023 15:09:10 +0000 (17:09 +0200)]
Improve RestconfStrategy API surface

We have a number of methods which are only used internally, which formed
our (ugly) API surface. Hide them so we are free to evolve them.

Change-Id: I219d90e5f709c59e98739a73971a577f14659e9f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoUse NormalizedNodeStreamWriter to emit XML data 53/107753/12
Robert Varga [Thu, 7 Sep 2023 11:59:11 +0000 (13:59 +0200)]
Use NormalizedNodeStreamWriter to emit XML data

We are already instantiating NormalizedNode-based writer, which means we
get help in terms for formatting things. This is especially true of
identityrefs and instance-identifiers, where the XML codec does
absolutely the right thing.

This also allows us to ditch namespace repairing from our
XMLWriterFactory, so we are in explicit control of our namespaces.

JIRA: NETCONF-1152
Change-Id: I030d25a8e0b23a78b6c6e952b36395bd461b4c70
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoUse NormalizedNodeStreamWriter to emit JSON data 49/107749/11
Robert Varga [Wed, 6 Sep 2023 23:35:20 +0000 (01:35 +0200)]
Use NormalizedNodeStreamWriter to emit JSON data

We are already instantiating NormalizedNode-based writer, which means we
get help in terms for formatting things.

JIRA: NETCONF-1152
Change-Id: Ie076ba571887c70a94cdd1baf7ea5e1ec6d8e91f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoEliminate (ReadData)TransactionUtil 32/107832/3
Robert Varga [Tue, 12 Sep 2023 11:30:22 +0000 (13:30 +0200)]
Eliminate (ReadData)TransactionUtil

Integrate these utilities directly into RestconfStrategy.

JIRA: NETCONF-1107
Change-Id: Ic0ff3bcc2a7df03c7aa9faf0ac6e94c5b7ef7e96
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoCross-relate WithDefaultsParam 27/107827/8
Robert Varga [Tue, 12 Sep 2023 02:52:07 +0000 (04:52 +0200)]
Cross-relate WithDefaultsParam

RFC6243 defines with-defaults-mode typedef, tie it together with
WithDefaultsParam. This improves interoperability with NETCONF.

JIRA: NETCONF-1107
Change-Id: Ia4823f60dcb5d8fc240b3c028a892f9bbe59fa43
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoInline readAllData() 26/107826/4
Robert Varga [Tue, 12 Sep 2023 02:19:16 +0000 (04:19 +0200)]
Inline readAllData()

The two methods have simpler callers, remove an indirection by inlining
the code in the corresponding lambda.

JIRA: NETCONF-1107
Change-Id: Ic177e3d9016f3ed2dfc8edf880bad69c87695f80
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoRemove extractReadData() 15/107815/4
Robert Varga [Tue, 12 Sep 2023 02:11:32 +0000 (04:11 +0200)]
Remove extractReadData()

This utility function is tempting, but inlining will allow us to take on
the transaction callers separetely.

JIRA: NETCONF-1107
Change-Id: Idbf697bf1c4a641e8683c207dd22e710d31fc524
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoEliminate PatchDataTransactionUtil 08/107808/4
Robert Varga [Tue, 12 Sep 2023 01:27:34 +0000 (03:27 +0200)]
Eliminate PatchDataTransactionUtil

This class is hosting a single method, which is strongly related to
RestconfStrategy.

JIRA: NETCONF-1107
Change-Id: I15b32b055a9be8787d32be5ede12e1d40a539a94
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoRehost PatchDataTransactionUtil logging 07/107807/6
Robert Varga [Tue, 12 Sep 2023 01:07:29 +0000 (03:07 +0200)]
Rehost PatchDataTransactionUtil logging

We have simple wrappers that just log stuff and forward execution to
RestconfTransaction. Rehost these to final RestconfTransaction methods,
so we have greater traceability coverage.

JIRA: NETCONF-1107
Change-Id: I6548860a1d90daf06e5eb9077f803a4aae23fa91
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoClean up PatchDataTransactionUtil 06/107806/2
Robert Varga [Tue, 12 Sep 2023 00:40:55 +0000 (02:40 +0200)]
Clean up PatchDataTransactionUtil

Clean up code dispatch to simplify rehosting these utilities.

JIRA: NETCONF-1107
Change-Id: I2f3ad941c34ab97f09abe91e398fd02a4b757389
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoHide RestconfTransaction.readList() 05/107805/1
Robert Varga [Tue, 12 Sep 2023 00:50:00 +0000 (02:50 +0200)]
Hide RestconfTransaction.readList()

We have completed migration of utility methods which refer to this tiny
bit. Hide it from outside world, as it is an implementation detail.

JIRA: NETCONF-1107
Change-Id: Id6f3f3ccb8645af43e71662daf3975e5deb30062
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoRefactor WriteDataParams 04/107804/2
Robert Varga [Mon, 11 Sep 2023 23:41:33 +0000 (01:41 +0200)]
Refactor WriteDataParams

The empty holder is useless, as we can model the same thing with a
@Nullable parameter.

Rename WriteDataParams to Insert and make it nullable. This improves
dispatch in users and will allow us to further remodel this contract.

Change-Id: I33d4af49789cb2371170fc6489787b2e3b987fd9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoOptimize RestconfStrategy.postData() 03/107803/1
Robert Varga [Mon, 11 Sep 2023 23:03:48 +0000 (01:03 +0200)]
Optimize RestconfStrategy.postData()

The implementation is now tightly bound to a RestconfStrategy, which
allows us to check invariants before we embark on modifying the
datastore.

JIRA: NETCONF-1126
Change-Id: Iec2bec456e248a2d557ed6190719043226dfade2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoClean up documentation 02/107802/1
Robert Varga [Mon, 11 Sep 2023 22:39:30 +0000 (00:39 +0200)]
Clean up documentation

Do not reference DOMTransactionChain, we are not using it.

Change-Id: I3151a30bf1f7dd02cc66ffab157537e9cf2af5fd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoEliminate PostDataTransactionUtil 01/107801/3
Robert Varga [Mon, 11 Sep 2023 22:22:13 +0000 (00:22 +0200)]
Eliminate PostDataTransactionUtil

These utilities are tightly coupled to RestconfStrategy, rehost them
there.

JIRA: NETCONF-1126
Change-Id: Ifacc3efa84c4dc91fdde181abe66c54291883941
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoRestructure putData() implementation 00/107800/3
Robert Varga [Mon, 11 Sep 2023 21:53:40 +0000 (23:53 +0200)]
Restructure putData() implementation

Our new how in RestconfStrategy allows us to restructure how we go about
executing this operation. The new layout checks the paramteres before
allocating a transaction and nicely differentiates the two distinct code
paths based on insert parameter.

JIRA: NETCONF-1125
Change-Id: I20bc640b0d14f24f508f664703cd1d85d21a50cb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoEliminate PutDataTransactionUtil 99/107799/2
Robert Varga [Mon, 11 Sep 2023 21:18:38 +0000 (23:18 +0200)]
Eliminate PutDataTransactionUtil

The implementation here is inherently tied to RestconfStrategy. Rehost
methods to RestconfStrategy and PostDataTransactionUtil (for now).

JIRA: NETCONF-1125
Change-Id: I45ce8428ff08324bf2e97de6bde9e6f5ea896bb8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoMove CreateOrReplaceResult 97/107797/1
Robert Varga [Mon, 11 Sep 2023 19:38:35 +0000 (21:38 +0200)]
Move CreateOrReplaceResult

This is the result of a create-or-replace operation, which we will be
introducing in RestconfStrategy. Move the class there for co-location.

JIRA: NETCONF-1125
Change-Id: Id26574e2b567c769e54737316f8bd840cc4767af
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoSwitch netconf-server to transport-api 88/106788/14
Ruslan Kashapov [Mon, 3 Jul 2023 14:10:19 +0000 (17:10 +0300)]
Switch netconf-server to transport-api

New transport implementation makes NetconfServerDispatcher outdated.
NetconfServerFactory interface and implementation introduced
as replacement. Netconf subsystem factory added to serve netconf
over ssh.

JIRA: NETCONF-1106
Change-Id: Id74cf3511c1129710b231869c089b4339333d7e8
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoFix postData() definition 87/107787/1
Robert Varga [Mon, 11 Sep 2023 12:27:20 +0000 (14:27 +0200)]
Fix postData() definition

The version which posts to top-level of datastore should not take an
identifier. Fix that, preventing an error.

JIRA: NETCONF-1128
Change-Id: I6623c74bf58bfb507b7aabe094128113c62aded4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoCapture ListenersBroker instances 82/107782/2
Robert Varga [Sun, 10 Sep 2023 14:21:08 +0000 (16:21 +0200)]
Capture ListenersBroker instances

Rather than having random code call out to
ListenersBroker.getInstance(), make sure we get the reference in outer
scope, mostly in a field.

JIRA: NETCONF-1104
Change-Id: I88b61e53ee36567d52fe297841e6910dea13d2ee
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoDo not serialize the unchanged for child-nodes-only 74/107774/2
Sangwook Ha [Fri, 8 Sep 2023 15:52:54 +0000 (08:52 -0700)]
Do not serialize the unchanged for child-nodes-only

Subscribing data change notification with the child-nodes-only mode may
generate notifications with unnecessary data change events for the list
key nodes in the data path.

Serialize only data tree nodes with effective changes. This filters out
unnecessary data change events and prevents notification of data updates
without any real changes.

Also, add missing test cases for the child-nodes-only mode.

JIRA: NETCONF-1153
Change-Id: I2ed388ee2e5c364a96240d8b5a519651cf2f5b47
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
8 months agoRemove unused InstanceIdentifierContext methods 81/107781/1
Robert Varga [Sun, 10 Sep 2023 12:39:47 +0000 (14:39 +0200)]
Remove unused InstanceIdentifierContext methods

With NormalizedNodeBodyReaders gone, we have sufficiently trimmed the
variability on InstanceIdentifierContext invocation paths.

This patch removes almost all of the weird callers who do not provide an
actual YangInstanceIdentifier.

Change-Id: Iea422bec9d61f5c8d5f845ec8e8552a690b64c2a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoRemove rpc-{input,output}.json 80/107780/1
Robert Varga [Sun, 10 Sep 2023 12:35:43 +0000 (14:35 +0200)]
Remove rpc-{input,output}.json

These resources are not used anywhere. Remove them, but retain the
content of rpc-input.json in the expanded JsonOperationInputBodyTest.

Change-Id: Ia9947f811bbd2102afaef23c60388aaae7003ae7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoRemove rpc-{input,output}.xml 79/107779/1
Robert Varga [Sun, 10 Sep 2023 12:29:04 +0000 (14:29 +0200)]
Remove rpc-{input,output}.xml

rpc-input.xml is used in only a single place, inline it. rpc-output.xml
is not used, as we are asserting just the NormalizedNode structure,
hence it is removed.

Change-Id: Ibb9d3a27582421f3574300ae89b49ddbb8c50b1f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoRemove xmldata.xml 78/107778/1
Robert Varga [Sun, 10 Sep 2023 12:25:21 +0000 (14:25 +0200)]
Remove xmldata.xml

This is a single-use simple resource, inline it.

Change-Id: I341377055aff2bfe49796a39753f1f26ed9058df
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoRemove bug7933.xml 77/107777/1
Robert Varga [Sun, 10 Sep 2023 12:21:56 +0000 (14:21 +0200)]
Remove bug7933.xml

This is a single-use simple resource, inline it.

Change-Id: I350c0ddaa2233d6821cef6e2b25dac5c267176f1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoInline jsondata.json 76/107776/1
Robert Varga [Sun, 10 Sep 2023 12:20:13 +0000 (14:20 +0200)]
Inline jsondata.json

This is a simple document used in a single place, inline it.

Change-Id: I9adf9807ff33f5a301923a15dc6a526b5809d285
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoRemove AbstractNormalizedNodeBodyReader 23/107523/18
Robert Varga [Mon, 28 Aug 2023 09:23:48 +0000 (11:23 +0200)]
Remove AbstractNormalizedNodeBodyReader

We are using this reader only in postData(). Refactor users to
centralized dispatch and move the logic to ChildBody and its
specializations.

This refactor also improves dispatch to datastore resource, as we know
that such POST requests are not action invocations.

Invocation path is using OperationInputBody, so as to share decoding
with the RPC invocation path.

JIRA: NETCONF-1128
Change-Id: Ie632de94dce24d3a194c560ae41e3e86d1e8ac72
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoFix stream prefix 06/107406/1
Robert Varga [Fri, 8 Sep 2023 09:16:23 +0000 (11:16 +0200)]
Fix stream prefix

The change to tie together the strings has missed a path component, fix
that.

JIRA: NETCONF-1151
Change-Id: I09b3fa5d201c5316d0a8a63fa9c6f1b2d2fbaedc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 1b88bdb4cde0c2f04ec7a235a887cb8889ffb6c2)

9 months agoCentralize notification XML namespace 54/107754/1
Robert Varga [Thu, 7 Sep 2023 12:12:48 +0000 (14:12 +0200)]
Centralize notification XML namespace

We have a string literal which is not tied to a standard. Replace it
with a NamespaceURN.NOTIFICATION reference.

Change-Id: I2d3968e5a3a492d0455a5b153c8dbfe796672036
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoClean up JSON*Formatter.createText() 40/107740/5
Robert Varga [Wed, 6 Sep 2023 21:24:02 +0000 (23:24 +0200)]
Clean up JSON*Formatter.createText()

Use proper try-with-resources blocks and take advantage of method
returns.

Also improve element ordering, with eventTime being emitted before the
body.

Finally we tie the constants used to model and highlight the problems
that are in the current implementation.

Change-Id: Ie8f8659833d91f87903d9936d8bf2c9fad5b96ff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoRefactor EventFormatter interface 36/107736/3
Robert Varga [Wed, 6 Sep 2023 19:58:29 +0000 (21:58 +0200)]
Refactor EventFormatter interface

We are passing a ton of parameters around, where they are really state
captured in EventFormatter, but passed to AbstractWebsocketSerializer.

Split the four booleans we dance around into a separate TextParameters
record, which gets stored in each EventFormatter and passed to the
serializer as appropriate.

Change-Id: Ifa19e99f18a20c705e37ed0135982af9b50da755
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoOptimize AbstractWebsocketSerializer.convertPath() 35/107735/1
Robert Varga [Wed, 6 Sep 2023 20:24:51 +0000 (22:24 +0200)]
Optimize AbstractWebsocketSerializer.convertPath()

The serialization has a couple of classic duplications. Eliminate them
through simple addition of appendQName() utility method.

Also drop FIXMEs to examine the output, as it seems extremely fishy:
the namespace is a URN, which means ':' and '-' are not the same thing
and namespaces can very much differ by these.

Also key values are straight toString()'d which means QNames and similar
go through ODL-specific encoding.

Change-Id: I658e02517c1f155ba65ff9ae345228ee015a70aa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoAdd Child Nodes Only query parameter to SSE events 43/106843/6
Olivier Dugeon [Wed, 21 Jun 2023 08:35:21 +0000 (10:35 +0200)]
Add Child Nodes Only query parameter to SSE events

For SSE or Websocket, events are reported from the root node of the listen
Data Tree or from the modified leafs with the 'odl-leaf-nodes-only=true'
query parameter. This patch introduce a new 'odl-child-nodes-only' query
parameter to get only modified children in a compact form. This new option
could be considered as something in the middle between getting the whole
Data Tree from the root node and a per leaf node report.

JIRA: NETCONF-1076
Change-Id: Ibeda878a38a52f911dd8fbaa0503c4bfb56ea9b7
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoClarify NotificationQueryParams checks 34/107734/2
Robert Varga [Wed, 6 Sep 2023 17:20:45 +0000 (19:20 +0200)]
Clarify NotificationQueryParams checks

Using checkArgument() involves logical negation of the condition with
respect the message. This can get quite daunting when trying to
understand.

Switch to using plain if() statements, which make the logic much
clearer.

Also tie the messages to uri names, so users get clearer guidance.

Change-Id: I659921075fe3c9e4e234a86bceba24a771a1cf89
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoFix stack mismatch in data change event streams 65/106565/11
Sangwook Ha [Fri, 9 Jun 2023 22:17:30 +0000 (15:17 -0700)]
Fix stack mismatch in data change event streams

Data change event stream targeting a list instance requires a special
treatment to avoid mismatch between the writer stack and data.
Wrap the map entry in a map node to avoid the stack mismatch and
serialization error.

Also, add test cases to cover the use case to ListenerAdapterTest and
refactor/clean up the test class to reduce duplicate code and make file
& variable names more consistent.

JIRA: NETCONF-1051
Change-Id: I0e266f04fc77db6add4f1c44e6fd47f208c2e2f9
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoRefactor OperationInputBody 31/107731/4
Robert Varga [Wed, 6 Sep 2023 11:23:38 +0000 (13:23 +0200)]
Refactor OperationInputBody

Add utility to extract the ContainerNode rather than streaming them.
Also detect empty body.

JIRA: NETCONF-1128
Change-Id: I06b8366d15353785f0f859fb7d11b927a26c3b76
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoFix XmlResourceBody builder failure 33/107733/1
Robert Varga [Wed, 6 Sep 2023 13:52:47 +0000 (15:52 +0200)]
Fix XmlResourceBody builder failure

The migration patch was not rebased, leading to a mismatch in thrown
exceptions. Fix that up.

JIRA: NETCONF-1128
Change-Id: I939d15fe2fdb61fd55411c4f4753d9a43554dfad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoSpecialize RestconfDataServiceImpl.{put,plainPatch}Data() 68/107368/23
Robert Varga [Tue, 8 Aug 2023 13:56:55 +0000 (15:56 +0200)]
Specialize RestconfDataServiceImpl.{put,plainPatch}Data()

This peels another two uses of *NormalizedNodeBodyReader, where the operation
is:
- create-or-replace, i.e. PUT
- merge, i.e. plain PATCH

In both cases the body is the resource being acted on. These body types
relate directly to target resource, hence they are represented through
ResourceBody.

JIRA: NETCONF-1128
Change-Id: Iabc0ec7e6c3d2aa1044d2fefb5f1f2635e86d094
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoRequire parent topology to have been created 13/107713/2
Robert Varga [Tue, 5 Sep 2023 13:27:16 +0000 (15:27 +0200)]
Require parent topology to have been created

There is no point in re-issuing empty merges for topology, just require
it to have been created beforehand (which we already require in the
constructor).

JIRA: NETCONF-1148
Change-Id: Icd804e6d7f95651d2adbfb080171a9f264e21e79
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoProperly synchronize NetconfDeviceTopologyAdapter 96/107696/5
Robert Varga [Mon, 4 Sep 2023 20:53:33 +0000 (22:53 +0200)]
Properly synchronize NetconfDeviceTopologyAdapter

The adapter is using TransactionChain, which should always be guarded.
Make sure we guard that even when callers fail to provide their own
guards.

There is a further bug, where a failed last transaction would not
complete the closeFuture(), leaving callers stack.

Finally we disconnect from AutoCloseable and provide a shutdown()
method, which allows users to decide on how to synchronize the datastore
access. This allows us to concurrently shutdown the mount point and
datastore state and wait for the completion of the latter only after
both actions have been initiated.

JIRA: NETCONF-1146
Change-Id: Ieeb6ca485bed3553224f6845d04ae07d4c5d5176
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoBump upstreams 27/107627/5
Robert Varga [Thu, 31 Aug 2023 09:36:41 +0000 (11:36 +0200)]
Bump upstreams

Adopt:
- odlparent-13.0.4
- infrautils-6.0.2
- yangtools-11.0.1
- mdsal-12.0.1
- controller-8.0.1
- aaa-0.18.1

Change-Id: I7bc5776b8963ebbaa52b961cc3b2cfa6757b0ca3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoFix checkstyle 29/107629/4
Robert Varga [Thu, 31 Aug 2023 10:23:46 +0000 (12:23 +0200)]
Fix checkstyle

Upgraded checkstyle is flushing out new things, fix them up.

Change-Id: I46ac6cf74c243a80a6866d649914628eb19b3576
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoAdd NetconfMessage.of(Document) method 33/107433/16
matus.matok [Tue, 15 Aug 2023 16:24:29 +0000 (18:24 +0200)]
Add NetconfMessage.of(Document) method

Added a new static NetconfMessage.of(Document) factory method, which
takes a document as a parameter and based on its content returns a
correct NetconfMessage subclass or throws an exception.

JIRA: NETCONF-1014
Change-Id: I55d3c29c01df5c7d34d53f372a80729ec129a22c
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoFix netconf-server-mdsal dependencies 56/107556/1
Robert Varga [Tue, 29 Aug 2023 17:33:55 +0000 (19:33 +0200)]
Fix netconf-server-mdsal dependencies

We have used undeclared dependencies, fix that.

Change-Id: I1a3aaee271b32fbfcffa00c519d75076c53652fe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoRework NetconfStartExiMessage 29/107429/7
matus.matok [Tue, 15 Aug 2023 11:21:00 +0000 (13:21 +0200)]
Rework NetconfStartExiMessage

Renamed NetconfStartExiMessage to NetconfStartExiMessageProvider as
it iss no longer a subclass of NetconfMessage. but instead it provides
a create() method that returns an RpcMessage with specific payload.

JIRA: NETCONF-1014
Change-Id: I9ab387523663854fd40bcd831bd00c0940467780
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoMake NotificationMessage constructor private 25/107425/6
matus.matok [Tue, 15 Aug 2023 09:57:37 +0000 (11:57 +0200)]
Make NotificationMessage constructor private

Made NotificationMessage constructor private and added a new static
factory method, ofNotificationContext(), with the same semantics.

This enables adding another static method, where the document will
not be wrapped, if it already represents a valid NotificationMessage.

JIRA: NETCONF-1014
Change-Id: I74ca0bb09be2652d5179956e5b54c17d9c655ab0
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoAdd is{Notification,Rpc,RpcReply}Message methods 89/107389/8
matus.matok [Fri, 11 Aug 2023 08:34:35 +0000 (10:34 +0200)]
Add is{Notification,Rpc,RpcReply}Message methods

Added public static methods is{Notification,Rpc,RpcReply}Message(Document) methods
that return true, if the document in the parameter is a NotificationMessage,
RpcMessage or RpcReplyMessage respectively. To be used in the static method
NetconfMessage.of(Document).

JIRA: NETCONF-1014
Change-Id: I61da444487bafcf9bc5e15cf8dbf8b9fa978218e
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoIntroduce RpcMessage and RpcReplyMessage 73/107373/13
matus.matok [Tue, 8 Aug 2023 12:09:00 +0000 (14:09 +0200)]
Introduce RpcMessage and RpcReplyMessage

Introduced RpcMessage and RpcReplyMessage both extending NetconfMessage, with
basic wrapping functionality. Added tests to verify correct wrapping.

JIRA: NETCONF-1014
Change-Id: I72d5d03dde6553201d2fca4db1faf5d0a844d872
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoAssert reported error 17/107517/1
Robert Varga [Sat, 26 Aug 2023 19:20:29 +0000 (21:20 +0200)]
Assert reported error

We are asserting that an error is throw, but we are not making it clear
which error should be reported. Check all errors for their
getErrorMessage().

JIRA: NETCONF-1128
Change-Id: Idded2736f070216b3c2dc976c8d9ddc601393410
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoClean up JsonBodyReaderTest 16/107516/1
Robert Varga [Sat, 26 Aug 2023 12:31:15 +0000 (14:31 +0200)]
Clean up JsonBodyReaderTest

Introduce useful utility methods.

Change-Id: Ie59e31f3c0d1156b341ee4c26c628f83ef8ff4bd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoClean up RestconfDataServiceImplTest 15/107515/1
Robert Varga [Sat, 26 Aug 2023 12:19:02 +0000 (14:19 +0200)]
Clean up RestconfDataServiceImplTest

Constify test data, so that we have proper connections to the model,
reusing constructs where possible.

Change-Id: I24ef54c73c7bbb1af3792cce32b379d073ad49e8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoInline XML patch payloads 14/107514/2
Robert Varga [Sat, 26 Aug 2023 09:02:49 +0000 (11:02 +0200)]
Inline XML patch payloads

Having external XMLs is not nice, inline them as multiline strings.

Change-Id: I9f7eb79fa7691861fdf8a640b8e14422bbbc24ff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoMake resource access explicit 13/107513/2
Robert Varga [Sat, 26 Aug 2023 08:59:33 +0000 (10:59 +0200)]
Make resource access explicit

Rather than providing an InputStream, introduce a method which takes
the resource name and acquires that way.

Change-Id: I8858d193af97143baea399ffa077d5fc4101c080
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoMigrate more JSON patch payloads 12/107512/2
Robert Varga [Sat, 26 Aug 2023 08:43:40 +0000 (10:43 +0200)]
Migrate more JSON patch payloads

Inline test resources as string literals, making tests a lot cleaner.

Change-Id: I575a705167c7981efca977bf6806993fa86ff478
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoImprove reader mocking 11/107511/2
Robert Varga [Sat, 26 Aug 2023 08:32:48 +0000 (10:32 +0200)]
Improve reader mocking

Rather than passing a boolean flag, split POST/PUT method mocking, so as
to identify callers relying on either.

JIRA: NETCONF-1128
Change-Id: I8220b91da162b3a41b298e364f03da41933956fa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoEliminate AbstractBodyReaderTest.mediaType 10/107510/4
Robert Varga [Sat, 26 Aug 2023 07:55:01 +0000 (09:55 +0200)]
Eliminate AbstractBodyReaderTest.mediaType

This field is used only by concrete tests, where its content can be made
constant. Performing the trivial conversion eliminates a constructor
upcall.

JIRA: NETCONF-1128
Change-Id: I8d57ddf6047b2e3ff9d15c9cb19036eb909eb1d8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoIntroduce AbstractBody 09/107509/4
Robert Varga [Sat, 26 Aug 2023 07:23:57 +0000 (09:23 +0200)]
Introduce AbstractBody

We need to be careful about managing our InputStreams, hence unify
handling between PatchBody and StreamableOperationInputBody.

JIRA: NETCONF-1128
Change-Id: If3c3372a9dee328a27bc03b7ce19a78d690a941b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoInline AbstractIdentifierAwareJaxRsProvider 08/107508/4
Robert Varga [Sat, 26 Aug 2023 07:10:25 +0000 (09:10 +0200)]
Inline AbstractIdentifierAwareJaxRsProvider

This class has only AbstractNormalizedNodeBodyReader as its subclass,
merge the two together, allowing us to further evolve interactions.

JIRA: NETCONF-1128
Change-Id: Iad564da8983cbe06541cdbab04343f286bbd0d46
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoEliminate AbstractPatchBodyReader 47/107447/16
Robert Varga [Thu, 17 Aug 2023 20:44:59 +0000 (22:44 +0200)]
Eliminate AbstractPatchBodyReader

This patch refactors RestconfDataServiceImpl to not rely on JAX-RS for
parsing YANG Patch body. Instead of that we introduce PatchBody backed
by an InputStream and two specializations to handle parsing from
JSON/XML.

JIRA: NETCONF-1128
Change-Id: Ia7363d641ac8e3c3719bb19e8a311a9452f79a86
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoDisconnect JsonPatchBodyReader state 07/107507/1
Robert Varga [Fri, 25 Aug 2023 20:46:22 +0000 (22:46 +0200)]
Disconnect JsonPatchBodyReader state

The parser bits are independent of the class, make sure have that
expressed.

JIRA: NETCONF-1128
Change-Id: I98e27622e0101ed7772ae3e82ad9df6fa59f85c8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoPeel out AbstractInstanceIdentifierTest 06/107506/1
Robert Varga [Fri, 25 Aug 2023 20:17:12 +0000 (22:17 +0200)]
Peel out AbstractInstanceIdentifierTest

We are parsing the same context in three different tests. Centralize its
creation.

JIRA: NETCONF-1128
Change-Id: I19c32ca5de6a2ebb62c9569841d947e1c6666762
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoClarify patchData() naming 05/107505/1
Robert Varga [Fri, 25 Aug 2023 17:45:46 +0000 (19:45 +0200)]
Clarify patchData() naming

We have three methods with deal with HTTP PATCH, but they are defined in
different standards. Make this obvious in method names, lowering
reader's mental overload.

JIRA: NETCONF-1128
Change-Id: Icdd296bca23ada97d0197037d5558e26cc5a5d0d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoInline some JSON patch test files 04/107504/1
Robert Varga [Fri, 25 Aug 2023 16:43:58 +0000 (18:43 +0200)]
Inline some JSON patch test files

There is just no point in keeping these files separate, integrate them
into tests.

JIRA: NETCONF-1128
Change-Id: I2e9ab971c13dfb5eea168f5847da2adab03ccb91
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoUnify *PatchBodyReader(MountPoint)Tests 03/107503/4
Robert Varga [Fri, 25 Aug 2023 15:44:34 +0000 (17:44 +0200)]
Unify *PatchBodyReader(MountPoint)Tests

We have thorough duplication of tests here, refactor the class hierarchy
to keep us from duplicating things.

JIRA: NETCONF-1128
Change-Id: I541d708d0e00940cbd703d6dec3dacf2cf30e935
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoIntroduce AbstractPatchBodyReaderTest 02/107502/3
Robert Varga [Fri, 25 Aug 2023 15:15:38 +0000 (17:15 +0200)]
Introduce AbstractPatchBodyReaderTest

Eliminate the explicit dependency of AbstractBodyReaderTest on
PatchContext by introducing an intermediate superclass.

Also clean up references for resource loading, using the local class
name instead of a superclass.

JIRA: NETCONF-1128
Change-Id: Ie0c7a7d7f868863a27ca14d700aa0dc67190222f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoClean up moduleDataTest() 98/107498/2
Robert Varga [Fri, 25 Aug 2023 13:22:51 +0000 (15:22 +0200)]
Clean up moduleDataTest()

Make sure this test is as close as possible to its non-mounpoint
counterpart.

Change-Id: Icfc9e9f0e9f7eb189cd37f3d98cf092976902f27
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoAdd global description 66/107466/6
lubos-cicut [Tue, 22 Aug 2023 05:34:22 +0000 (07:34 +0200)]
Add global description

Add global description (info/description) to OpenApi that
states that we are providing full API for configurational
data because only those can be edited (by POST, PUT, PATCH,
DELETE) and for operational we only provide GET API.

In addition, for majority of request user can see only
config data in examples. That’s because we can show only one
example per request.

The exception when user can see operational data in example
is when data are representing operational (config false)
container with no config data in it.

JIRA: NETCONF-1138
Change-Id: I5c9de0c8780289f4557c7ce9995b8cb5d44e0290
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
9 months agoEliminate TestUtils 97/107497/2
Robert Varga [Fri, 25 Aug 2023 12:13:54 +0000 (14:13 +0200)]
Eliminate TestUtils

The utility methods in this class are not used anywhere: eliminate the
entire class.

Change-Id: Iac4c46b0506a76d51284869a211d5f0b1b32c4da
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoEliminate TestUtils.loadSchemaContext() 96/107496/2
Robert Varga [Fri, 25 Aug 2023 12:10:22 +0000 (14:10 +0200)]
Eliminate TestUtils.loadSchemaContext()

There is no need to have this particular method, as we have a
replacement readily available. Also speed up the sole callers by
unifying them in an abstract superclass.

Change-Id: Ifebba4ac3e284d501dfb5867fd38affea0564b16
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoEliminate TestRestconfUtils 93/107493/3
Robert Varga [Fri, 25 Aug 2023 10:41:53 +0000 (12:41 +0200)]
Eliminate TestRestconfUtils

This class is largely unused. Move the single used method to
AbstractBodyReaderTest, adjusting its users.

Change-Id: I26aa4f974c9bc7e3f431a470dc9a05571eebd330
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoEliminate schemaContextLoader() 92/107492/3
Robert Varga [Fri, 25 Aug 2023 10:36:49 +0000 (12:36 +0200)]
Eliminate schemaContextLoader()

This is a superfluous method, replace it with a proper constructor
defaulting to the shared baseline context.

Change-Id: I5629bf33ce2af941693c2ca17b2a4438a2b861fb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoRemove superfluous throws 90/107490/3
Robert Varga [Fri, 25 Aug 2023 10:23:04 +0000 (12:23 +0200)]
Remove superfluous throws

There is no point in declaring reflection-related exceptions as thrown,
since we never report them. Clean this particular mess up.

Change-Id: I9c1214420ce62a27b0fd4d7ffe90717ed2598086
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoReduce TestRestconfUtils proliferation 89/107489/3
Robert Varga [Fri, 25 Aug 2023 10:16:16 +0000 (12:16 +0200)]
Reduce TestRestconfUtils proliferation

We are parsing a single resource directory, use the appropriate tool
from yang-test-util.

Change-Id: Ibcb077754dc61e3bc7f35fb6e98d77a0e5bea543
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoSpeed up XmlPatchBodyReader 88/107488/3
Robert Varga [Fri, 25 Aug 2023 09:54:22 +0000 (11:54 +0200)]
Speed up XmlPatchBodyReader

Use local variable type inference to improve binding to
implementations. Also use instanceof pattern to skip duplicate item
lookups.

Change-Id: Ic768fcd171a3d62a02d47de0f36e5bd80bc112cf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoRemove unused jsonPatchBodyReader.readFrom() 87/107487/5
Robert Varga [Fri, 25 Aug 2023 09:26:23 +0000 (11:26 +0200)]
Remove unused jsonPatchBodyReader.readFrom()

This method is completely unused, remove it.

JIRA: NETCONF-1128
Change-Id: Ib74ee6a414982ce9432f032eb2a49bf5ff085b37
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoFix restconf capabilities writer 69/107469/4
Yaroslav Lastivka [Wed, 2 Aug 2023 10:39:07 +0000 (13:39 +0300)]
Fix restconf capabilities writer

Using incorrect type of leaf set causes validation failure
on attempt to persist capabilities to datastore. Also fixed
typo in method name.

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