netconf.git
4 weeks agoRefactor transport-http response delivery 67/111267/2
Robert Varga [Thu, 4 Apr 2024 14:16:57 +0000 (16:16 +0200)]
Refactor transport-http response delivery

Using a ListenableFuture brings in lifecycle headache, as the reported
value is retained indefinitely -- forcing us to make copies of the
response.

Rework the APIs in terms of FutureCallback instead -- i.e. we report the
response while having a reference to it and the callback can retain it
if need be (in which case it takes ownership of it).

Also introduce ClientRequestDispatcher to eliminate a bit of duplicate
code.

Change-Id: I350467582b5f5bd67d5241d47a5d4cbaef19adaa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoDocument get module source 19/111219/2
lubos-cicut [Wed, 3 Apr 2024 11:05:55 +0000 (13:05 +0200)]
Document get module source

Document how to get module source.

JIRA: NETCONF-1287
Change-Id: Ica59f07a6086f0b9f17e1228160e7b335780057c
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
4 weeks agoProperly encapsulate PatchBody normalization 54/111254/2
Robert Varga [Thu, 4 Apr 2024 02:54:28 +0000 (04:54 +0200)]
Properly encapsulate PatchBody normalization

Every PatchBody needs to be interpreted in terms of a ResourceContext,
which is capable of resolving sub-resources.

Structuring the code this way disconnects PatchBody from server.spi
contract. The prerequisite wiring is then provided through a
restconf.server.spi.DefaultResourceContext based a Data path and
ApiPathNormalizer.

This makes the semantics crispy-clear, allowing us to ditch a few
re-lookups which are no longer necessary.

JIRA: NETCONF-1288
Change-Id: I37d4903d1cc1bbb8eb3e8db3ac08c2142f661c88
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoEliminate restconf.nb.rfc8040.utils package 53/111253/3
Robert Varga [Thu, 4 Apr 2024 01:20:17 +0000 (03:20 +0200)]
Eliminate restconf.nb.rfc8040.utils package

Move WriterFieldsTranslator to restconf.nb.rfc8040.rests.transactions,
exposed for testing. This eliminates the utils package, simplifying
layout a bit.

Change-Id: I2a5e79aa5c942bd9226b9c5b981f89ffe0e96865
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoHide NetconfFieldsTranslator 52/111252/2
Robert Varga [Thu, 4 Apr 2024 01:16:11 +0000 (03:16 +0200)]
Hide NetconfFieldsTranslator

There is only one user of this class, move it to the same package and
hide it by inlining it into NetconfRestconfStrategy.

Change-Id: Ib614b046bd6dcdf51e4b09d8b7cdec3b43c16629
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoSplit out ApiPathCanonizer 47/111247/1
Robert Varga [Thu, 4 Apr 2024 00:32:21 +0000 (02:32 +0200)]
Split out ApiPathCanonizer

ApiPathNormalizer has grown quite complicated, simplify it by splitting
canonicalize() into ApiPathCanonizer.dataToApiPath().

JIRA: NETCONF-1288
Change-Id: Ia7f36de2f27d511fb6e2230d1c8a83b443a09f11
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoImprove ApiPathNormalizer.normalizeSubResource() 37/111237/2
Robert Varga [Wed, 3 Apr 2024 20:37:52 +0000 (22:37 +0200)]
Improve ApiPathNormalizer.normalizeSubResource()

Split out the normalization logic so that we can restart at a given
point -- which conveniently is pretty much covered by the semantics of
DatabindPath.Data.

This allows us to skip the canonicalize()/parse() step and proceed to
normalization directly.

JIRA: NETCONF-1288
Change-Id: I642dd0286dea60efa1fade3b7edc37fbb4f0536c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoMove patch target resolution 36/111236/1
Robert Varga [Wed, 3 Apr 2024 20:13:54 +0000 (22:13 +0200)]
Move patch target resolution

We now have a lingua franca between PatchBody and ApiPathNormalizer.
Take advantage of that and define the normalizeSubResource() utility
method.

JIRA: NETCONF-1288
Change-Id: Ie3aa238be767918a7c4c795fda04649823aa2824
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoRemove OperationsPostPath 35/111235/3
Robert Varga [Wed, 3 Apr 2024 17:24:02 +0000 (19:24 +0200)]
Remove OperationsPostPath

DatabindPath.OperationPath provides a more powerful tool, use that
instead.

JIRA: NETCONF-1288
Change-Id: If234477cf6f304945c4e0dc574c59f0e2983d725
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoRemove DataPostPath 34/111234/3
Robert Varga [Wed, 3 Apr 2024 16:49:00 +0000 (18:49 +0200)]
Remove DataPostPath

We have a more powerful tool in DatabindPath.Data, use that instead.

JIRA: NETCONF-1288
Change-Id: I80e1e122aebec9348d83b0a8d28cd82cea7ad840
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoEliminate DataPatchPath 33/111233/2
Robert Varga [Wed, 3 Apr 2024 16:27:21 +0000 (18:27 +0200)]
Eliminate DataPatchPath

We have DatabindPath.Data, which is exactly what we are getting from
normalization, only more powerful. Use that instead.

JIRA: NETCONF-1288
Change-Id: I095f7080585d30dd29b2afcf94dea9544bea574a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoEliminate DataPutPath 32/111232/2
Robert Varga [Wed, 3 Apr 2024 16:17:21 +0000 (18:17 +0200)]
Eliminate DataPutPath

This interface has been useful, but now we have DatabindPath.Data, which
is a more powerful tool with equivalent semantics.

JIRA: NETCONF-1288
Change-Id: Ie135a1f7e6260bec0b6190fc331dc3ad559879f4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoPromote ApiPathNormalizer.Path to server.api.DatabindPath 31/111231/2
Robert Varga [Wed, 3 Apr 2024 15:45:44 +0000 (17:45 +0200)]
Promote ApiPathNormalizer.Path to server.api.DatabindPath

A DatabindPath is an ApiPath bound to a DatabindContext, having the
corresponding databind() method.

This naturally fix into server.api, as it provides a semantic capture of
the request, which we already do in this package.

JIRA: NETCONF-1288
Change-Id: I55552caf24d999d5523c51b872ff77e7bcc0aece
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoBump versions to 7.0.5-SNAPSHOT 23/111223/1
Robert Varga [Wed, 3 Apr 2024 14:46:09 +0000 (16:46 +0200)]
Bump versions to 7.0.5-SNAPSHOT

This starts the next development iteration.

Change-Id: I54909500c90cca82c3d8440e4fe0241789029594
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoRelease netconf v7.0.4
jenkins-releng [Wed, 3 Apr 2024 12:22:55 +0000 (12:22 +0000)]
Release netconf

4 weeks agoRework YangInstanceIdentifier/URI path conversion 73/111073/24
lubos-cicut [Tue, 26 Mar 2024 14:27:41 +0000 (15:27 +0100)]
Rework YangInstanceIdentifier/URI path conversion

YangInstanceIdentifierSerializer has a rather ambiguous name and
description, but essentially it does what it advertizes: it takes a
YangInstanceIdentifier and creates a String corresponding to
ApiPath.parse().

Unfortunately this process handles values through String.valueOf(),
which obviously does the wrong thing for non-trivial values, such as
identityref and instance-identifier.

We already have a component handling ApiPath -> YangInstanceIdentifier
conversion, the ApiPathNormalizer.

This patch completely replaces
YangInstanceIdentifierSerializer.serializePath() with
ApiPathNormalizer.canonicalize(). It essentially does the same thing,
but returns an ApiPath as the result. Users can use ApiPath.toString()
to then get the String representation, if needed.

JIRA: NETCONF-1264
Change-Id: I1093eb2cbd84ae269430f918e48b98cc2fb4e805
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoRequire ApiIdentifier to be instantiated with Unqualified 15/111215/5
Robert Varga [Wed, 3 Apr 2024 08:56:34 +0000 (10:56 +0200)]
Require ApiIdentifier to be instantiated with Unqualified

We are using Unqualified internally, require users to pass it down.

JIRA: NETCONF-1264
Change-Id: I273a384331c175a34621c634071e46bb6cd035ad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoFix full lists removal for remote devices via Restconf. 25/109125/14
Ruslan Kashapov [Thu, 30 Nov 2023 07:59:17 +0000 (09:59 +0200)]
Fix full lists removal for remote devices via Restconf.

When full list removal by yang instance identifier is
requested via restconf on remote device (topology node)
the command wasn't properly translated into netconf message,
because there is no single XML node which describes whole
list, the 'remove' or 'delete' operation can be assigned to.
Invalid netconf message constructed did cause parse error
on device side.

The fix converts list removal command into list elements
removals one by one, with instance identifier of each item
defined explicitly.

JIRA: NETCONF-1245
Change-Id: I78e008845b486aeb011530123b9fe081af482fdf
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
4 weeks agoFix serializeMapWithOneKeyTest() 12/111212/1
Robert Varga [Tue, 2 Apr 2024 17:21:19 +0000 (19:21 +0200)]
Fix serializeMapWithOneKeyTest()

Yet again we are passing the wrong key, fix this up before the test
starts failing due to correct serialization.

JIRA: NETCONF-1264
Change-Id: I71f30735174383e5914253490d9912779802e6b9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoFix serializeNoPercentEncodingTest() 10/111210/1
Robert Varga [Tue, 2 Apr 2024 17:19:00 +0000 (19:19 +0200)]
Fix serializeNoPercentEncodingTest()

We do not specify the correct key here. Fix this mistake, as the test
will start failing once we do proper encoding.

JIRA: NETCONF-1264
Change-Id: I8c8eafcd221535a4d1e011bcb2f0096cad4f3409
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoFix serializeMapWithMultipleKeysTest() 09/111209/1
Robert Varga [Tue, 2 Apr 2024 17:13:31 +0000 (19:13 +0200)]
Fix serializeMapWithMultipleKeysTest()

The keys are expected to be Uint8 and Boolean, not strings. Fix this up,
as the test will start failing when we perform proper encoding.

JIRA: NETCONF-1264
Change-Id: I29f141984550a787a6f8837bef0467d0ab0d426e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoFix serializePercentEncodingTest() 08/111208/1
Robert Varga [Tue, 2 Apr 2024 16:56:15 +0000 (18:56 +0200)]
Fix serializePercentEncodingTest()

The test is passing the wrong QName for key leaf, which should be
'name'. Fix this as this test will start failing when we perform proper
encoding.

JIRA: NETCONF-1264
Change-Id: Ida98ac1e0c486a25bcb02d2728f6ea389d297538
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoExpose ListInstance.of() methods 06/111206/1
Robert Varga [Tue, 2 Apr 2024 15:59:52 +0000 (17:59 +0200)]
Expose ListInstance.of() methods

ListInstance assumes there is at least one item. Static factory methods
to create ListInstances which validate this invariant. Parser code uses
the now-private-again constructor.

JIRA: NETCONF-1264
Change-Id: I969df7f60c89cf7259830dae584d833f1217d949
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoFix serializeLeafListTest() 05/111205/1
Robert Varga [Tue, 2 Apr 2024 15:43:56 +0000 (17:43 +0200)]
Fix serializeLeafListTest()

leaf-list-0 has 'type boolean' and hence 'instance' is not a valid
value. This test demonstrates that YangInstanceIdentifier is not
validating values, letting garbage in.

This test will start failing once we process values correctly, hence fix
it up ahead of time.

JIRA: NETCONF-1264
Change-Id: I23c7e21eb4e0ca3474debe7faafd7a22aa7f5103
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoOpenAPI: do not generate duplicated schemas 10/111010/4
Samuel Schneider [Mon, 25 Mar 2024 17:23:05 +0000 (18:23 +0100)]
OpenAPI: do not generate duplicated schemas

Skip processing of node if it was already processed.
Currently, we generate multiple schemas with different name
for the same node and the last one is used.

JIRA: NETCONF-1270
Change-Id: I817f5d5db9183b0162b663bd2e80f5971ea8366a
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
4 weeks agoExpose ListInstance constructor 70/111170/2
Robert Varga [Tue, 2 Apr 2024 07:45:19 +0000 (09:45 +0200)]
Expose ListInstance constructor

The only way to create a ListInstance is through parsing. Expose the
constructor so it can be externally instantiated, just like
ApiIdentifier.

JIRA: NETCONF-1264
Change-Id: I917b18266cc1acda5bc5c4108df228c368c4ff33
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoUpdate swagger UI to version 5.13.0 73/111173/2
Oleksandr Zharov [Tue, 2 Apr 2024 08:25:20 +0000 (10:25 +0200)]
Update swagger UI to version 5.13.0

It seems that some bugs in the Swagger UI caused problems with
missing action input and output. This is fixed by simply updating
Swagger to a newer version.

Updated Swager UI from 5.11.8 to latest current version:
https://github.com/swagger-api/swagger-ui/releases/tag/v5.12.0
https://github.com/swagger-api/swagger-ui/releases/tag/v5.13.0

JIRA: NETCONF-1286
Change-Id: I47c2982f3d475a1523ec83683b83d6d3b2eea99e
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
4 weeks agoTurn ApiPath into a record 63/111163/2
Robert Varga [Mon, 1 Apr 2024 21:31:21 +0000 (23:31 +0200)]
Turn ApiPath into a record

Expose the canonical constructor and adjust callers to use ApiPath.of().

JIRA: NETCONF-1264
Change-Id: I74f0e17b15d363f096cb7d4a369519a7ba879e7a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoMake leaf-list parsing explicit 62/111162/2
Robert Varga [Mon, 1 Apr 2024 20:28:13 +0000 (22:28 +0200)]
Make leaf-list parsing explicit

We have an implicit fall-through which assumes leaf-list value. Make
that assumption explicit, along with the requirement to have exactly one
item.

JIRA: NETCONF-1264
Change-Id: Iab5638ccf76a8471050411835d9dd80146d93b01
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoEliminate ApiPathNormalizer.modelContext 61/111161/1
Robert Varga [Mon, 1 Apr 2024 20:14:37 +0000 (22:14 +0200)]
Eliminate ApiPathNormalizer.modelContext

The EffectiveModelContext is a DatabindContext-invariant, eliminate the
intermediate field and defer to DatabindContext.modelContext().

Change-Id: Ie3f7b5d37cd20c154758e0c58594e908bd418009
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoFix ApiPathNormalizer value handling 55/111155/3
Robert Varga [Mon, 1 Apr 2024 16:20:23 +0000 (18:20 +0200)]
Fix ApiPathNormalizer value handling

RESTCONF API resources' values are defined in terms of RFC7951, plus
perscent escapes. Percent-escaping for values is already handled by
ApiPathParser, hence we can just pass the values to the codec,
simplifying ApiPathNormalizer quite a bit.

JIRA: NETCONF-1264
Change-Id: Ie97dfbf2a156dd2441c71d6333527a9ddcb71834
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoDocument ApiPathNormalizer 58/111158/1
Robert Varga [Mon, 1 Apr 2024 17:15:18 +0000 (19:15 +0200)]
Document ApiPathNormalizer

Document and improve the ApiPathNormalizer contract, part one. We
document the intent and the contract, moving implementation records
to Path.{Data,Action,Rpc}.

Change-Id: Ic3eac676d94f1dff2b3a8a3d0ff5331239afce20
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoSimplify upgradeCodecFactory() 39/111139/2
Robert Varga [Thu, 28 Mar 2024 13:32:26 +0000 (14:32 +0100)]
Simplify upgradeCodecFactory()

The lamda we return here is a simple if-else return.

JIRA: NETCONF-1248
Change-Id: Ia772eba569ccf9c0559abfab086772dbf31dce1b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoFix transport-http dependency 38/111138/2
Robert Varga [Thu, 28 Mar 2024 13:31:31 +0000 (14:31 +0100)]
Fix transport-http dependency

We have a missing netty-handler dependency, eliciting a warning. Fix
that.

JIRA: NETCONF-1248
Change-Id: I8021408a56a22855b85c3417d010454058854e3e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoShare codepath in ServerChannelInitializer 37/111137/2
Robert Varga [Thu, 28 Mar 2024 12:36:26 +0000 (13:36 +0100)]
Share codepath in ServerChannelInitializer

The failure path shares the same epilogue as the success path. Dispatch
to onSuccess() to share the actual code.

JIRA: NETCONF-1248
Change-Id: I34f9bf37e3652fab6a1a5691ceabedf4132b4124
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoBump upstreams 53/111153/1
Robert Varga [Mon, 1 Apr 2024 08:24:01 +0000 (10:24 +0200)]
Bump upstreams

Adopt:
- controller-9.0.2
- aaa-0.19.3

Change-Id: I239feed92922e9616a3191ec910cdd24cbe3798f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 weeks agoFix POST request with insert parameter 96/109196/14
Samuel Schneider [Thu, 7 Dec 2023 11:53:59 +0000 (12:53 +0100)]
Fix POST request with insert parameter

Fix the issue when Fix POST request with insert parameter
were incorrectly trying to add data to parent of the parent
element. POST requests inherently operate on parent resources
in the path.

Add tests for this behavior.

JIRA: NETCONF-1178
Change-Id: I4bf3218321cf3348b1ecef2f841899c3f7dbf1d6
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
5 weeks agoHTTP transport implementation 91/110191/20
Ruslan Kashapov [Thu, 8 Feb 2024 11:48:57 +0000 (13:48 +0200)]
HTTP transport implementation

HTTP Client and Server implementation using Netty's
HTTP codecs. Existing TCP and TLS transport layers are used
as underlay. HTTP/2 and Basic Authentication support provided.

JIRA: NETCONF-1248
Change-Id: If02446a24f174663ff497148bde436923f73c8a6
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 weeks agoKeystore Plaintext Storage API and Local File implementation 89/110389/14
Ruslan Kashapov [Tue, 20 Feb 2024 09:47:23 +0000 (11:47 +0200)]
Keystore Plaintext Storage API and Local File implementation

Data is being persisted into local file with AES-GCM-SIV encryption
using 16 or 32 byte key and dynamically generated nonce.

New feature artifact includes plaintext storage api, local file
storage implementation and karaf shell commands (cli) to access
and modify the data.

JIRA: NETCONF-1257
Change-Id: I841d255c4bcda5ecee7560b28330e568591f8833
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
5 weeks agoFix OpenAPI explorer redirection URL 65/111065/2
Yaroslav Lastivka [Tue, 26 Mar 2024 13:30:09 +0000 (15:30 +0200)]
Fix OpenAPI explorer redirection URL

Previously, the redirection path was incorrectly leading to
a non-existent URL, causing the OpenAPI explorer to fail to load.

The redirection path in getApiExplorer method has been updated
to reflect the correct URL structure.

JIRA: NETCONF-1281
Change-Id: I2eec3b841c00de324d59d24267281beb2025ddf0
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
5 weeks agoRemove json-unit-assertj dependency 09/111009/2
Ivan Hrasko [Mon, 25 Mar 2024 15:48:39 +0000 (16:48 +0100)]
Remove json-unit-assertj dependency

We are not using json-unit-assertj dependency.
Remove it.

Change-Id: I03eb652257098212e91245c0c0213c29085e9f61
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
5 weeks agoFix TCPServer javadoc 12/111012/1
Ivan Hrasko [Tue, 26 Mar 2024 07:37:52 +0000 (08:37 +0100)]
Fix TCPServer javadoc

Fix javadoc for TCPServer#listen method.

Change-Id: I485dc2a0833dd7409bc1d7f0050d3566178902dd
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
6 weeks agoFix topology-singleton Import-Packages 94/110994/1
Robert Varga [Fri, 22 Mar 2024 15:05:40 +0000 (16:05 +0100)]
Fix topology-singleton Import-Packages

javax.annotation is optional, hence it should be marked as such.

JIRA: NETCONF-1280
Change-Id: I9aff41421ab56b82844b57f817c28be23b3670e5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoFix parsing of union values 86/110986/5
Robert Varga [Thu, 21 Mar 2024 14:11:17 +0000 (15:11 +0100)]
Fix parsing of union values

TypeDefinitionAwareCodec is no longer handling unions because it cannot
reliably do so -- because they may indirect through leafref, or end up
being a complex type.

Since we are already handling leafref, identityref and
instance-identifier correctly, complete the translation by adding
explicit handling for unions.

JIRA: NETCONF-1265
Change-Id: I88980ba18df8e52d3395d5f0bcf8b8ef0c187949
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoSplit up prepareValueByType() 85/110985/4
Robert Varga [Thu, 21 Mar 2024 13:49:47 +0000 (14:49 +0100)]
Split up prepareValueByType()

This method does some heavy lifting in an atomic unit. Split out
DataSchemaNode type checking and clarify leafref resolution.

JIRA: NETCONF-1265
Change-Id: I7be50b5692ea7f33af5444688fc462edb2b591ec
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoFix instance-identifier ApiPath normalization 65/110965/7
Robert Varga [Thu, 21 Mar 2024 11:05:26 +0000 (12:05 +0100)]
Fix instance-identifier ApiPath normalization

ApiPathInstanceIdentifierCodec is a distraction which should not be
used.

ApiPathNormalizer acts as a ApiPath->YangInstanceIdentifier conversion
utility and therefore can handle instance identifiers internally, by
parsing them into ApiPath and invoking normalizeDataPath().

JIRA: NETCONF-1265
Change-Id: If9dca1a8b7f14f64ed7cf3f704b2bd9356922ed0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoBump versions to 7.0.4-SNAPSHOT 81/110881/1
Robert Varga [Tue, 19 Mar 2024 23:59:26 +0000 (00:59 +0100)]
Bump versions to 7.0.4-SNAPSHOT

This starts the next development iteration.

Change-Id: I406a944f630c9be6738586bfa576e0fe3afe6836
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoRelease netconf v7.0.3
jenkins-releng [Tue, 19 Mar 2024 20:15:14 +0000 (20:15 +0000)]
Release netconf

6 weeks agoFixup YangLibraryContentBuilderUtil javadoc 66/110866/1
Robert Varga [Tue, 19 Mar 2024 12:05:44 +0000 (13:05 +0100)]
Fixup YangLibraryContentBuilderUtil javadoc

Clean up missing parameters and update wording a bit.

JIRA: NETCONF-1277
Change-Id: I2fadfb2ae8cd4dfe5ee7ce2702f7af96d2da959f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoAlways clean up modules-state 62/110862/2
Robert Varga [Tue, 19 Mar 2024 07:54:03 +0000 (08:54 +0100)]
Always clean up modules-state

Make sure we clean up module-state even when we are not writing it.

JIRA: NETCONF-1277
Change-Id: Ia65340f790f5ceefe8208f73df424f7d2f6f58d9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoUse yanglib-mdsal-writer is a cluster-wide singleton 61/110861/2
Robert Varga [Tue, 19 Mar 2024 06:34:43 +0000 (07:34 +0100)]
Use yanglib-mdsal-writer is a cluster-wide singleton

Writing to ietf-yang-library could be a source of datastore conflicts in
a cluster. Make sure we register run the updates only on one of the
cluster nodes.

JIRA: NETCONF-1277
Change-Id: I4fa03ea01fd205cb8e48497db3c93f3b8c58218e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoUse transaction in YangLibraryWriter 57/110857/2
Robert Varga [Tue, 19 Mar 2024 06:21:58 +0000 (07:21 +0100)]
Use transaction in YangLibraryWriter

Rapid updates could see us issue concurrent transaction, which in turn
would fail. Improve the situation by maintaining a transaction chain.

JIRA: NETCONF-1277
Change-Id: Ib5d7b9344404a22665d5123e4c3a8d0f2bf5216a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoClean up yanglib-mdsal-writer dependencies 56/110856/2
Robert Varga [Tue, 19 Mar 2024 05:55:43 +0000 (06:55 +0100)]
Clean up yanglib-mdsal-writer dependencies

We have a ton of dependencies we do not mention, leading to a warning.
Fix them up and enable strict dependency enforcement.

JIRA: NETCONF-1277
Change-Id: Iadd97732a8e93683243300695ce857a863b71e9f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoFixup yanglib-mdsal-writer 52/110852/3
Robert Varga [Mon, 18 Mar 2024 15:10:59 +0000 (16:10 +0100)]
Fixup yanglib-mdsal-writer

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

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

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

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

JIRA: NETCONF-1277
Change-Id: I8cbb2af5e4e7b8ec713126bad981fb5a38c4240f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoOptimize data merge decision 51/110851/2
Robert Varga [Mon, 18 Mar 2024 22:13:26 +0000 (23:13 +0100)]
Optimize data merge decision

We have duplicate checking for configData == null. Rework the logic to
have fewer comparisons.

Change-Id: I61e040e972a177e86d77506b76f35a3ac2133e64
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoRemove odl-yanglib 47/110847/1
Robert Varga [Mon, 18 Mar 2024 15:21:24 +0000 (16:21 +0100)]
Remove odl-yanglib

This is an experimental feature which is ill-designed and cannot
reasonably work -- causing needless warnings.

JIRA: NETCONF-1068
Change-Id: I31434ca00742f79a7c0c44f0414aa0b06f8926b7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoMigrate yanglib-mdsal-writer QNameModule method users 82/110782/3
Robert Varga [Sat, 16 Mar 2024 15:17:05 +0000 (16:17 +0100)]
Migrate yanglib-mdsal-writer QNameModule method users

We have an Optional-free QNameModule.revision() method, which makes
things a tad easier on the eyes.

Change-Id: Ie1c040d54e6ec51ad05ca337e50154c0865a98a5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoMigrate netconf-client-mdsal use of QNameModule.create() 14/110814/2
Robert Varga [Sun, 17 Mar 2024 17:52:30 +0000 (18:52 +0100)]
Migrate netconf-client-mdsal use of QNameModule.create()

Use simpler QNameModule.ofRevision() instead.

Change-Id: Ia272342b22adc889123d83af792e178659991a7d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoEliminate NcmountRpcs 07/110807/8
Robert Varga [Sun, 17 Mar 2024 08:48:26 +0000 (09:48 +0100)]
Eliminate NcmountRpcs

There is no need for a dedicated class -- just integrate it into
EndtoendTestService, removing the use of ClassToInstanceMap in the
process of doing so.

Change-Id: I64b15c6ff55c5e389de990096f56c1cde61ec26c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoBump versions to 7.0.3-SNAPSHOT 27/110827/1
Robert Varga [Sun, 17 Mar 2024 22:03:19 +0000 (23:03 +0100)]
Bump versions to 7.0.3-SNAPSHOT

This starts the next deveopment iteration.

Change-Id: I56d3812afc885b46c498709ac037f6342503a620
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoRelease netconf v7.0.2
jenkins-releng [Sun, 17 Mar 2024 20:20:06 +0000 (20:20 +0000)]
Release netconf

6 weeks agoUse more modern QNameModule methods in restconf-nb 83/110783/3
Robert Varga [Sat, 16 Mar 2024 15:27:50 +0000 (16:27 +0100)]
Use more modern QNameModule methods in restconf-nb

We can use better methods to express what we really need. Migrate over.

Change-Id: Ic3eea4484800468e331d30127671675a68834013
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoMigrate Builders references 09/110809/3
Robert Varga [Sun, 17 Mar 2024 08:58:35 +0000 (09:58 +0100)]
Migrate Builders references

We have a few easy-to-migrate references to Builders, replace them with
ImmutableNodes.

Change-Id: I2087f816f35c9861aebbd5c39ff82df0df355a4f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoApplication Protocol Negotiation support for TLS 97/110397/5
Ruslan Kashapov [Thu, 29 Feb 2024 06:40:48 +0000 (08:40 +0200)]
Application Protocol Negotiation support for TLS

HTTP/2 client and server require APN configured when
communicating over TLS transport

JIRA: NETCONF-1248
Change-Id: Ideada66d6528f6ecd4407c63b63d5db1cc8ec505
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoModernize netconf-topology 08/110808/3
Robert Varga [Sun, 17 Mar 2024 08:54:34 +0000 (09:54 +0100)]
Modernize netconf-topology

We have a better way of registering RPCs, use that instead of
ClassToInstanceMap. Also migrate an ImmutableNodes reference.

Change-Id: Ifac89c697e6a984af2f1edd240194cb55bf3b695
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoMigrate keystore-legacy RPC registration 06/110806/2
Robert Varga [Sun, 17 Mar 2024 08:41:26 +0000 (09:41 +0100)]
Migrate keystore-legacy RPC registration

We have an improved registerRpcImplementations(), use that to cut down
on ceremony.

Change-Id: Ib1b4278b422dc2ec8cdf676db2598f033b321ce1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoFactor out MdsalDatabindProvider 05/110805/2
Robert Varga [Sun, 17 Mar 2024 08:06:34 +0000 (09:06 +0100)]
Factor out MdsalDatabindProvider

RpcImplementations require an instance of DatabindProvider, which is
provided by MdsalRestconfServer, which in turn takes RpcImplementations.
This leads to circular dependency during component activation.

Break this cycle by introducing MdsalDatabindProvider, which acts as a
common intermediary and update the component wiring accordingly.

JIRA: NETCONF-1236
Change-Id: Iec6e8dba67785b920274825d70c2a7171edef6e2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoImprove NetconfNodeHandlerTest 16/110516/5
Ivan Hrasko [Thu, 7 Mar 2024 09:15:23 +0000 (10:15 +0100)]
Improve NetconfNodeHandlerTest

Improve code style and add more precise asserts.

JIRA: NETCONF-1250
Change-Id: I101e1147fbdd0f12c4645ecdf8c0197164c4cccc
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
6 weeks agoBump upstreams 81/110781/2
Robert Varga [Sat, 16 Mar 2024 15:05:32 +0000 (16:05 +0100)]
Bump upstreams

Adopt:
- odlparent-13.0.11
- infrautils-6.0.6
- yangtools-13.0.2
- mdsal-13.0.1
- controller-9.0.1
- aaa-0.19.2

Change-Id: I8e755e313ab0a69a1c25e776d5daefbd4d0a8320
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoEnsure successful registration of SubscribeDeviceNotificationRpc 36/110736/5
Yaroslav Lastivka [Thu, 14 Mar 2024 15:30:29 +0000 (17:30 +0200)]
Ensure successful registration of SubscribeDeviceNotificationRpc

Added service attribute to the @Component annotation within
SubscribeDeviceNotificationRpc implementation of
the RpcImplementation interface.
This addition ensures these class is successfully
registered within MdsalRestconfServer.

JIRA: NETCONF-1236
Change-Id: I5da8ebe9b5085195d718f833b6cbd79cb33ba867
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
7 weeks agoDocument RESTCONF base path configuration 78/110278/5
Samuel Schneider [Wed, 21 Feb 2024 16:23:56 +0000 (17:23 +0100)]
Document RESTCONF base path configuration

Add new configuration field "restconf" introduced by NETCONF-1218
to the documentation of restconf northbound configuration.

JIRA: NETCONF-1231
Change-Id: I8382182a0009a5de1ce5556734b81eb4b1232060
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
7 weeks agoSmall refactor of NetconfRestconfStrategy class 34/110734/1
Ivan Hrasko [Thu, 14 Mar 2024 13:28:56 +0000 (14:28 +0100)]
Small refactor of NetconfRestconfStrategy class

Make small refactoring changes in NetconfRestconfStrategy class:
- NetconfFieldsTranslator.translate return type is NonNull thus 'tmp'
cannot be null, remove null check
- fix javadoc parameters and typos
- use diamond operator where possible

Change-Id: I6efc489d8e5a8352d0c2867ea4937d1df7829876
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
7 weeks agoFix callhome device "DISCONNECTED" status 37/110637/3
Oleksandr Zharov [Mon, 11 Mar 2024 15:58:51 +0000 (16:58 +0100)]
Fix callhome device "DISCONNECTED" status

Fixed error when callhome device always has status "DISCONNECTED"
after adding it to allowed devices. This issue arose after refactoring
AuthorizedKeysDecoder class to use plain KeyStore access to acquire
provides. New code did not specify what exact provider we want to use
and thus caused confusion - instead of Bouncy Castle KeyFactory that
was used before new code returned Sun KeyFactory. That result in next
issue with searching for valid host key when adding new device and
all other errors that described in logs attached to Jira ticket.

JIRA: NETCONF-1249
Change-Id: I5689fa6ad173a5b7cd99f0210a366b77db74b0d5
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 weeks agoOpenAPI: Add test for inner action schema 07/110407/12
lubos-cicut [Thu, 29 Feb 2024 21:31:49 +0000 (22:31 +0100)]
OpenAPI: Add test for inner action schema

Add test case to verify that schema for action which is nested
inside multiple containers is correctly referenced.

JIRA: NETCONF-1259
Change-Id: I98266506f24354cf3a3fb764bfee8d7ee6c74393
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
7 weeks agoOpenAPI: netopeer2 wrong schemas for actions 04/110404/14
lubos-cicut [Thu, 29 Feb 2024 14:32:28 +0000 (15:32 +0100)]
OpenAPI: netopeer2 wrong schemas for actions

Schemas for actions weren't generated correctly. There were
missing parent node name. In path ref if action was nested in more
containers were missing all parent nodes.

Edit of expected documents was necessary due to changes.

JIRA: NETCONF-1259
Change-Id: I0cf4769122ab00e62687ec01399d5de1b3bb3baf
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
8 weeks agoOpenAPI: netopeer2 duplicated mapping key test 06/110406/4
lubos-cicut [Thu, 29 Feb 2024 21:35:56 +0000 (22:35 +0100)]
OpenAPI: netopeer2 duplicated mapping key test

Tests if schema with same name has picked expected discriminator.

JIRA: NETCONF-1254
Change-Id: Ib741a9096ef52ab5c066a52aecb398c745628eab
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
8 weeks agoOpenAPI: netopeer2 duplicated mapping key 62/110262/7
lubos-cicut [Mon, 19 Feb 2024 10:24:21 +0000 (11:24 +0100)]
OpenAPI: netopeer2 duplicated mapping key

When we load netopeer2 modules, OpenAPI in browser returns duplicated
mapping key error. This change add discriminator to schemas which are
duplicated.

JIRA: NETCONF-1254
Change-Id: Ieaa5913bcf56cddbee0dcb2df9ad17cb1af078bd
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
8 weeks agoBump json to version 20240303 49/110549/1
Ivan Hrasko [Thu, 7 Mar 2024 16:00:50 +0000 (17:00 +0100)]
Bump json to version 20240303

https://github.com/stleary/JSON-java/releases/tag/20240303
https://github.com/stleary/JSON-java/releases/tag/20240205
https://github.com/stleary/JSON-java/releases/tag/20231013

Change-Id: I44b916a971e5ea8aab3c13c03ce248fb1fe4e07f
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
8 weeks agoFix RTD configuration 40/110540/1
Robert Varga [Thu, 7 Mar 2024 14:25:02 +0000 (15:25 +0100)]
Fix RTD configuration

We need more configuration, make sure this matches other projects.

Change-Id: I86fc9fa7c96133ffd9a23f498d4b870458f1c734
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoFix rtd build 21/110521/1
Robert Varga [Thu, 7 Mar 2024 12:17:04 +0000 (13:17 +0100)]
Fix rtd build

build.os is a required variable, otherwise the build is failing.

Change-Id: I8e94c93ce6948618b136523bb692b98806ff46e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoDo not use ISE in XmlNormalizedNodeBodyWriter 12/110512/1
Robert Varga [Thu, 7 Mar 2024 05:13:03 +0000 (06:13 +0100)]
Do not use ISE in XmlNormalizedNodeBodyWriter

We can safely throw IOException, so prefer that to throwing and
unchecked IllegalStateException.

Change-Id: Ib57512055a7a2698db5a568b8856ac5010d52f91
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoThrow correct exception when keypair is not found 86/110486/4
Samuel Schneider [Wed, 6 Mar 2024 08:28:22 +0000 (09:28 +0100)]
Throw correct exception when keypair is not found

Throw UnsupportedConfigurationException when no keypair found
with given keyId. So the failure is handled properly.

JIRA: NETCONF-1250
Change-Id: I63b1f73b4c2bc13daf09507ace852ec49f9176c2
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
8 weeks agoBump versions to 7.0.2-SNAPSHOT 96/110496/1
Robert Varga [Wed, 6 Mar 2024 15:19:45 +0000 (16:19 +0100)]
Bump versions to 7.0.2-SNAPSHOT

This starts the next development iteration.

Change-Id: I46124371b6e85c6e742ca585eb756ec09d68b17d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoRelease netconf v7.0.1
jenkins-releng [Wed, 6 Mar 2024 13:43:15 +0000 (13:43 +0000)]
Release netconf

8 weeks agoOpenAPI: netopeer2 NPE because stack is null 63/110263/4
lubos-cicut [Mon, 19 Feb 2024 10:33:44 +0000 (11:33 +0100)]
OpenAPI: netopeer2 NPE because stack is null

When we load netopeer2 modules, in karaf.log we get NullPointException.
It is because stack was transported to PropertyEntity#processTypeDef
as null.

JIRA: NETCONF-1254
Change-Id: I319313919568f8b9756ed63a3a92d670bf349b72
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
8 weeks agoFix RPC/action output writeout 87/110487/5
Robert Varga [Wed, 6 Mar 2024 09:40:42 +0000 (10:40 +0100)]
Fix RPC/action output writeout

AbstractNormalizedNodeBodyWriter's dispatch logic falls through to
writeData(), which ends up wrecking the output.

Add missing return statements and improve tests to cover these.

JIRA: NETCONF-1266
Change-Id: I5ab83bf7b6b79d54dedc76ce4785f120dfe61304
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoMigrate constructor caller 88/110488/1
Robert Varga [Wed, 6 Mar 2024 10:26:03 +0000 (11:26 +0100)]
Migrate constructor caller

Use DOMDataTreeIdentifier.of() instead.

Change-Id: I43bc9b490736968cdde7fa4a44225ff6dce60fc4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 weeks agoRemove useless warning about rounding 79/110479/2
Robert Varga [Tue, 5 Mar 2024 13:21:05 +0000 (14:21 +0100)]
Remove useless warning about rounding

We are warning when we round the time -- assuming we have
millisecond-precision time.

We have switched to nanosecond-precision in commit
 efe35f12ce37107c814a5d8bb245e5f9ed9ba073, hence this warning is
completely superfluous.

JIRA: NETCONF-1262
Change-Id: I76377a078d13c9256ae55bc41439a1ff2bc24564
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoBump versions to 7.0.1-SNAPSHOT 96/110396/1
Robert Varga [Wed, 28 Feb 2024 20:57:57 +0000 (21:57 +0100)]
Bump versions to 7.0.1-SNAPSHOT

This starts the next development iteration.

Change-Id: I26291846a465b68c5fcc03343892811ecaa38045
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoRelease netconf v7.0.0
jenkins-releng [Wed, 28 Feb 2024 10:12:50 +0000 (10:12 +0000)]
Release netconf

2 months agoDo no implement invokeNetconf() as a default method 92/110392/4
Robert Varga [Wed, 28 Feb 2024 07:15:36 +0000 (08:15 +0100)]
Do no implement invokeNetconf() as a default method

We need to split the invokeRpc() and invokeNetconf() implementations,
this takes the first step.

JIRA: NETCONF-806
Change-Id: I4b6af534dcdf733c29e6dfc03e379a040e72aa8b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoUpdate to Swagger UI v5.11.8 17/110317/4
Oleksandr Zharov [Fri, 23 Feb 2024 16:31:21 +0000 (17:31 +0100)]
Update to Swagger UI v5.11.8

Updated Swager UI from 5.9.0 to latest current version:
https://github.com/swagger-api/swagger-ui/releases/tag/v5.10.0
https://github.com/swagger-api/swagger-ui/releases/tag/v5.11.0
https://github.com/swagger-api/swagger-ui/releases/tag/v5.11.1
https://github.com/swagger-api/swagger-ui/releases/tag/v5.11.2
https://github.com/swagger-api/swagger-ui/releases/tag/v5.11.3
https://github.com/swagger-api/swagger-ui/releases/tag/v5.11.4
https://github.com/swagger-api/swagger-ui/releases/tag/v5.11.5
https://github.com/swagger-api/swagger-ui/releases/tag/v5.11.6
https://github.com/swagger-api/swagger-ui/releases/tag/v5.11.7
https://github.com/swagger-api/swagger-ui/releases/tag/v5.11.8

All ODL adjustments perserved.

JIRA: NETCONF-1255
Change-Id: I17600e718e9748027579ff2d82929c39af6db409
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
2 months agoRefactor NetconfDeviceSchemas 63/110363/6
Robert Varga [Mon, 26 Feb 2024 16:55:14 +0000 (17:55 +0100)]
Refactor NetconfDeviceSchemas

NetconfDeviceSchemas is currently largely useless, as of its two
implementations only one really works.

This patch reworks it to be a record holding information about how the
EffectiveModelContext is to be assembled and moves processing to
NetconfStateSchemasResolverImpl, making it a private detail in process
of doing so.

The checks for yang-library are disabled and will be re-enabled with a
new implementation, which will act as a counter-balance to the current
HELLO+Monitoring implementation.

JIRA: NETCONF-840
Change-Id: Ie0e46656ae022cffbe6724738bd982d51e3d80da
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoEliminate SchemasStream.EntityType 84/110084/11
lubos-cicut [Mon, 29 Jan 2024 18:48:29 +0000 (19:48 +0100)]
Eliminate SchemasStream.EntityType

We were using SchemasStream.EntityType to distinguish if
SchemaEntity is node or RPC. Eliminated this enum and created
a class hierarchy structure, so we now have NodeSchemaEntity and
RpcSchemaEntity

JIRA: NETCONF-1226
Change-Id: I70a9f48de0528443831b95d16e83dd513a73bc13
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
2 months agoImprove monitoring access to revision-less schemas 55/110355/1
Robert Varga [Mon, 26 Feb 2024 13:57:20 +0000 (14:57 +0100)]
Improve monitoring access to revision-less schemas

The server may support multiple versions of YANG schema, which one of
which may not actually have a revision. In this case we really want to
specify an empty version, as that is the entry are after -- rather than
any version, which would incur data-not-unique error.

JIRA: NETCONF-840
Change-Id: I5b705971369cbffa81c0c0464569f8caac2f8e6d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoMove MonitoringSchemaSourceProvider 54/110354/1
Robert Varga [Mon, 26 Feb 2024 11:02:18 +0000 (12:02 +0100)]
Move MonitoringSchemaSourceProvider

Hide the ietf-netconf-monitoring schema provider, in preparation for it
being revamped a bit.

JIRA: NETCONF-840
Change-Id: Ie291c30b7f877937a28a52217ba23b69cf50eff0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoRemove CachedYangTextSchemaSource 52/110352/1
Robert Varga [Mon, 26 Feb 2024 10:52:06 +0000 (11:52 +0100)]
Remove CachedYangTextSchemaSource

There is no point in having this subclass -- just use plain
StringYangTextSource instead.

JIRA: NETCONF-840
Change-Id: I8e0a39391323726d50f0c9c769dc4bfba1a9461c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoPush down STATE_SCHEMAS_RESOLVER 44/110344/1
Robert Varga [Sun, 25 Feb 2024 17:37:24 +0000 (18:37 +0100)]
Push down STATE_SCHEMAS_RESOLVER

We are most likely going to inline the resolver back, make sure tests'
exposure is minimal.

JIRA: NETCONF-840
Change-Id: I5d713e0b9349b3dedad33f19a37c06bd5f7f27b3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoEliminate SchemaResourcesDTO 73/110273/16
Robert Varga [Wed, 21 Feb 2024 10:27:47 +0000 (11:27 +0100)]
Eliminate SchemaResourcesDTO

The process of setting up EffectiveModelContext is rather arcane, going
through multiple indirections, most of which are not really necessary.

This patch introduces DeviceNetconfSchemaProvider to replace the plain
SchemaResourcesDTO, centralizing the process into a single class.

As we now have a stricter lifecycle, we end up using invokeNetconf()
instead of invokeRpc(), making it clear we are only invoking base RPCs.

JIRA: NETCONF-840
Change-Id: I14d41f9f78332d2da9681de89a931dc01cd0829f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoNetconfClientFactoryImpl should propagate stack failure 06/110306/5
Robert Varga [Sun, 25 Feb 2024 14:01:46 +0000 (15:01 +0100)]
NetconfClientFactoryImpl should propagate stack failure

createClient() is ignoring failures to set up the transport stack,
leading to the future not completing on, for example, refused
connection.

Fix this by making ClientTransportChannelListener also a FutureCallback,
routing such failures to the returned future.

JIRA: NETCONF-1252
Change-Id: I3abc1faed94ee793ac6116eaca56a3cf473d8261
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>