netconf.git
19 months agoRelease netconf v3.0.6
jenkins-releng [Fri, 26 Aug 2022 07:35:10 +0000 (07:35 +0000)]
Release netconf

19 months agoFix periodic NETCONF Call Home connection dropping 28/101828/1
ivan.martiniak [Tue, 28 Jun 2022 05:00:58 +0000 (07:00 +0200)]
Fix periodic NETCONF Call Home connection dropping

Callhome devices make reconnection every hour due to key re-exchange,
which is part of SSHD implementation.

When a specific session is authenticated and activated,
in case of key re-exchange, authentication (invoking of doAuth() method)
does not need to be made again.

While we are at it, also make sure CallHomeSessionContext's constructor
does not have side-effects -- while this cannot quite happen since we do
not reuse ClientSessions, it is a needless leak.

JIRA: NETCONF-681
Change-Id: I824c92d230c7570570d5eed21d489c435bdc8b22
Signed-off-by: Ivan Martiniak <ivan.martiniak@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 31560e352e65522fdbc64c2f863f90628d6ef772)

20 months agoDo not embed netconf-impl 27/101827/1
Robert Varga [Mon, 22 Aug 2022 11:00:57 +0000 (13:00 +0200)]
Do not embed netconf-impl

Rather than embedding the dependency, use proper imports to satisfy the
needs of blueprint container.

JIRA: NETCONF-899
Change-Id: Iee2e2564384d3aa2660169c99ff375358b949a15
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 0d0781f97cf2cf9b7957c878ca93e94c7fbe82ec)

20 months agoPass maximum chunk size to AbstractNetconfSessionNegotiator 99/102199/1
Robert Varga [Fri, 29 Jul 2022 16:27:21 +0000 (18:27 +0200)]
Pass maximum chunk size to AbstractNetconfSessionNegotiator

We want to be able to control incoming maximum chunk size on a
session-by-session basis. This patch allows session negotiators
to specify this value for each instance.

JIRA: NETCONF-888
Change-Id: Ib001942ada2d5445a558f30efc8b6ec2a12395d0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit e7b911225b8b7178aac2c94e0bf552cb24dd6409)

20 months agoFix incorrect level assignment during fields parsing 98/102198/1
Peter Puškár [Mon, 24 Jan 2022 11:30:39 +0000 (12:30 +0100)]
Fix incorrect level assignment during fields parsing

Everytime a sub-selector is encountered, new level is created.
This behaviour is not in accordance to the one described in Javadoc.
Side effects of this issue are missing data in RESTCONF, for NETCONF
mount-points it will fail with NullPointerException because LinkedPathElement is expected on previous level but it cannot be found.
Add proper level tracking and test-cases.
Example:
fields=security:objects(zones/zone);application-identification(user-defined-applications/user-defined-application/app-name)

incorrect structure before:
0 = security:objects, application-identification
1 = zones
2 = zone
3 = user-defined-applications
4 = user-defined-application
5 = app-name

correct structure after:

0 = security:objects, application-identification
1 = zones, user-defined-applications
2 = zone, user-defined-application
3 = app-name

JIRA: NETCONF-660
Signed-off-by: Peter Puškár <ppuskar@frinx.io>
Change-Id: Icaf7c181b23ce9f7110cd6f63f17b55b4c1bc322
(cherry picked from commit b09e4a54fe5f4d5d409996e00eee21818225ef4d)

20 months agoDeprecate DEFAULT_MAXIMUM_CHUNK_SIZE 97/102197/1
Robert Varga [Fri, 29 Jul 2022 15:56:58 +0000 (17:56 +0200)]
Deprecate DEFAULT_MAXIMUM_CHUNK_SIZE

This is an artificial global limit. We provide the ability to specify
this limit on a per-instance basis and callers should be taking
advantage of that instead.

Change-Id: I3abbed74c37b4f9a9e820adf0c38fba160a8dc88
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 14adff2aa1c1a88371693ee9ecd0ce27b227f24e)

20 months agoAllow NetconfChunkAggregator's maximum size to be adjusted 96/102196/1
DanielCV [Tue, 19 Jul 2022 13:39:05 +0000 (19:09 +0530)]
Allow NetconfChunkAggregator's maximum size to be adjusted

There are devices which send out arbitrarily-large chunks, requiring
a potentially large buffer to hold the incoming message.

This patch allows each instance to have a the chunk size specified
as well as control over the default size via a system property.

JIRA: NETCONF-888
Change-Id: Iec041a4ba9c8886cceb44fa86d07320bb5ae942b
Signed-off-by: DanielCV <daniel.viswanathan@verizon.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit b48e597dad44046da6af9ada1b22df0b51aa3a9a)

20 months agoBump upstreams 95/102195/1
Robert Varga [Sun, 21 Aug 2022 20:28:39 +0000 (22:28 +0200)]
Bump upstreams

Bump upstream versions

Adopt:
- odlparent-10.0.3
- infrautils-3.0.2
- yangtools-8.0.6
- mdsal-9.0.5
- controller-5.0.6
- aaa-0.15.6

Change-Id: I309bd98e87d528b2ecc76b0c17d32398737ef0eb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
20 months agoGet rid of Netty's DelimiterBasedFrameDecoder 92/101892/1
Jakub Morvay [Thu, 16 Aug 2018 12:02:02 +0000 (14:02 +0200)]
Get rid of Netty's DelimiterBasedFrameDecoder

Netty's DelimiterBasedFrameDecoder is not really effective when dealing
with huge NETCONF messages and reading them in just really small parts
at a time.

DelimiterBasedFrameDecoder always searches whole input ByteBuf for
delimiter when new input bytes are available. It performs the search
also on bytes already checked in previous tries. Obviously, this can be
really ineffective when reading large messages by very small parts at
a time.

Replace Netty's DelimiterBasedFrameDecoder by our own frame detection
implementation. The implementation remembers already checked part of
the input ByteBuf and searches the delimiter just in a new bytes
available.

JIRA: NETCONF-889
Change-Id: If5e78f4373d767f4cf465024313eeac873c1621d
Signed-off-by: Jakub Morvay <jmorvay@frinx.io>
Signed-off-by: Maros Marsalek <mmarsalek@frinx.io>
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 5c92f1730eafb59a22c6ba160eb8e87b9aee4d4a)

20 months agoTurn NetconfMessageConstants into a final class 91/101891/1
Robert Varga [Thu, 28 Jul 2022 18:24:50 +0000 (20:24 +0200)]
Turn NetconfMessageConstants into a final class

Keeping constants in an interface is an antipattern, correct that.

Change-Id: I71a49126ec05107dc09ff05e47d16ba461d92e9d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 4c49398a85911278e3a5ac5a6ce3d5f3261b65a6)

20 months agoUse strict String->byte[] conversion 90/101890/1
Robert Varga [Thu, 28 Jul 2022 18:15:30 +0000 (20:15 +0200)]
Use strict String->byte[] conversion

Improve defensiveness around constant encoding: the strings are expected
to be be ASCII-only, so enforce that by using a properly-configured
coder.

Change-Id: I991640d6ad6e4c928b64fdabcbe7f0b60418c7af
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 44926051c90f28ca6d6015ff57f5a4cbf9f716d4)

20 months agoMessageParts should be a class 89/101889/1
Robert Varga [Thu, 28 Jul 2022 18:00:15 +0000 (20:00 +0200)]
MessageParts should be a class

Using interface to hold constants is an antipattern, ditch it.

Change-Id: I4b77c5d1ca6021f4381a17245ac3286ea36a08ac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 9110c5921ba8f05ceafefb784bf95b1b1655d6d2)

21 months agoFilter non-standard nodes from NETCONF monitoring schemas 58/101858/1
Sangwook Ha [Thu, 14 Jul 2022 08:03:54 +0000 (01:03 -0700)]
Filter non-standard nodes from NETCONF monitoring schemas

Some NETCONF servers use augmented netconf-monitoring schema and
controller fails to parse XML with strict parsing requirement.

Add a filtering function based on the namespace of the XML node,
and filter out any node not in the netconf-monitoring namespace to
prevent parsing failure.

JIRA: NETCONF-881
Change-Id: I93b7da0baf00de59613d970fd4ec89e47eb26e58
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit c3d40c5e4485e95b9307fcdff1833ca1568f9321)

21 months agoDisable creating reduced netconf-testtol pom 10/101810/1
Peter Suna [Mon, 4 Jul 2022 11:29:06 +0000 (13:29 +0200)]
Disable creating reduced netconf-testtol pom

When dependency reduced pom for netconf-testtool is generated, it gets
overridden with scale-util pom.
Fix that by disabling creating reduced dependency pom.

https://maven.apache.org/plugins/maven-shade-plugin/shade-mojo.html#createDependencyReducedPom

JIRA: NETCONF-884
Change-Id: Iea5269782261d2d550cb534fa405ec0fadaced46
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
(cherry picked from commit c83d51f95b5de398dda926edc17fcda273588ae2)

22 months agoFix error message typo 67/101167/1
Peter Puškár [Mon, 20 Jun 2022 06:53:26 +0000 (08:53 +0200)]
Fix error message typo

The correct string is 'nonconfig', not 'non-config'.

JIRA: NETCONF-886
Signed-off-by: Peter Puškár <ppuskar@frinx.io>
Change-Id: If5b77c64f8f17885977c8700195ba6b910197e26
(cherry picked from commit 7c1d84b96f8bb38a9dad250339a4ffabcdff515f)

22 months agoBump versions to 3.0.6-SNAPSHOT 52/101552/1
Robert Varga [Thu, 9 Jun 2022 18:48:12 +0000 (20:48 +0200)]
Bump versions to 3.0.6-SNAPSHOT

This starts the next development iteration.

Change-Id: I65a127b09c238f80f3496200a38f71fd03edf34a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoCorrect root vs. nested writeout 49/101549/1
Robert Varga [Thu, 9 Jun 2022 15:08:28 +0000 (17:08 +0200)]
Correct root vs. nested writeout

The instance identifier we are getting points to the data node, not to
its parent. Make sure we adjust event streaming accordingly.

JIRA: NETCONF-879
Change-Id: I198ff72674660dd7053a5224030c154a625c44e4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 81fe6df18b2f554be7d9f73d56fdc8a14ec71411)

22 months agoCleanup Netconf538Test 48/101548/1
Robert Varga [Wed, 8 Jun 2022 11:12:13 +0000 (13:12 +0200)]
Cleanup Netconf538Test

Improve NormalizedNode structure allocation and import assertions.

Change-Id: I63156f3efcd63f8cdb56b2bd2fe6bab4e1f4131a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit a689055266c8f6d1cadc4bbe3f3151fb1e95c96a)

22 months agoBump versions to 3.0.5-SNAPSHOT 00/101500/1
Robert Varga [Wed, 8 Jun 2022 12:39:28 +0000 (14:39 +0200)]
Bump versions to 3.0.5-SNAPSHOT

This starts the next development iteration.

Change-Id: I5c5b62ac2449091c7027fadb1517b59055fdb474
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoFix AbstractGet.transformNormalizedNode() 65/101165/1
Robert Varga [Wed, 8 Jun 2022 11:21:03 +0000 (13:21 +0200)]
Fix AbstractGet.transformNormalizedNode()

We should not be adjusting the baseline twice. Make sure we only
pass the data identifier to downstream.

JIRA: NETCONF-879
Change-Id: Iec2cf9bd227b84c8c4651012695f2c296e5c3f25
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit e1060dacd16e7f65f7a5ac67b0440a998ab85807)

22 months agoFix another state-keeping thinko 08/101408/1
Robert Varga [Tue, 31 May 2022 18:54:42 +0000 (20:54 +0200)]
Fix another state-keeping thinko

We need to update pending before we add a listener, as the future
may have already completed and thus we could observe pending being
either null or point to the bad value.

Also update the corresponding checkState() to use identity comparison
and include a proper message.

JIRA: NETCONF-827
Change-Id: If79d7ce71480bab6b35eec6fab63671f949c6cf9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit d1a112edda4fa487522010a6330f67defe6359a4)

22 months agoFix state transition thinko 07/101407/1
Robert Varga [Tue, 31 May 2022 18:37:29 +0000 (20:37 +0200)]
Fix state transition thinko

The future returned from reconnect strategy may have completed before
we add a listener. Make sure we record the future before adding the
listener.

Also change checkState() to a verify() with a proper identity check
to work with nulls and a proper message.

JIRA: NETCONF-827
Change-Id: Ica152cd1445e797c122e542aa1138232f11c6736
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 5e9f3517718f4475c3026acba0a5afb6f19388fa)

22 months agoFix session logging 06/101406/1
Robert Varga [Tue, 31 May 2022 20:27:53 +0000 (22:27 +0200)]
Fix session logging

We are using 'this' for session name -- that refers to the anonymous
class, leading to confusing logs. Fix that by passing the proper
session. This allows us to use a simple lambda instead.

Change-Id: I10080ef1f55d260af3a1ca8b62a58510d0feec87
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 1581d8d1ac5205e45409ab48c1034a23d8b8a7ee)

22 months agoEliminate ReconnectingStrategyListener 89/101389/1
Robert Varga [Tue, 31 May 2022 18:35:08 +0000 (20:35 +0200)]
Eliminate ReconnectingStrategyListener

Use a private method and a lambda to make the lifecycle cleared.

Change-Id: Ie57025a7fe60830ca2711272748b1ed6ea84dbdf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 0cca635f76cb935c3a8d8bb62abe3e9383276a0c)

22 months agoEliminate BootstrapConnectListener 88/101388/1
Robert Varga [Tue, 31 May 2022 18:29:24 +0000 (20:29 +0200)]
Eliminate BootstrapConnectListener

Use a simple method and a method handle instead of an explicit
class. This makes things a tad simpler on synchronization side of
things.

Change-Id: Id341b8a3ff124bd95a1e4e14f60721e6b443f72b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit a33c469af7ba77c86a89fb1637c6e65bc9cf234b)

22 months agoReduce ReconnectingStrategyListener nesting 87/101387/1
Robert Varga [Tue, 31 May 2022 18:25:03 +0000 (20:25 +0200)]
Reduce ReconnectingStrategyListener nesting

We do not need to nest the two listeners into each other. This is the
first step to eliminating both of them.

Change-Id: I3af5797dcccc3e82e9c28731b082e1f4014aba74
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 3b229907bacd02c1a37174d84945a34c468c1d95)

22 months agoRemove superfluous this. qualifier 86/101386/1
Robert Varga [Tue, 31 May 2022 18:21:31 +0000 (20:21 +0200)]
Remove superfluous this. qualifier

We have some unnecessary verbosity here, ditch it to simplify access.

Change-Id: Idf94706a60169741e7e5a4deec0f17cf87a313d8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit d31802bfa8ab119aa41c4a859446764480424d9d)

22 months agoBump upstreams 17/101317/1
Robert Varga [Sat, 28 May 2022 06:54:41 +0000 (08:54 +0200)]
Bump upstreams

Adopt:
- yangtools-8.0.6
- mdsal-9.0.4
- controller-5.0.5
- aaa-0.15.5

Change-Id: Idad1e66535b85f9e309cca32e0d7294f706170fe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoCentralize NetconfNode/InetSocketAddress conversion 79/101179/1
Robert Varga [Tue, 17 May 2022 09:53:23 +0000 (11:53 +0200)]
Centralize NetconfNode/InetSocketAddress conversion

The process of creating a RemoteDeviceId and/or the target
InetSocketAddress is duplicated in a number of places, each slightly
different.

Centralize conversion in netconf.topology.spi and use it from there,
which leads us to topology-singleton being able to use non-IP addresses.

JIRA: NETCONF-875
Change-Id: I5c4a610eb4f4b3cd6586198d5e9a4b84b476d351
Signed-off-by: Rohini.Ambika <rohini.ambika@infosys.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 90dcdd5d040eb22b74e87baccffd70a30d93bfc0)

23 months agoCleanup ActorProxyNetconfServiceFacade 78/101178/1
Robert Varga [Tue, 17 May 2022 09:35:35 +0000 (11:35 +0200)]
Cleanup ActorProxyNetconfServiceFacade

Use Futures.immediateFuture(), but mark a FIXME, where we should really
be getting a response.

Change-Id: I73e1f1620df83b76d266ed8980d86bb40634a614
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 622b6917095076cbdb8478863cdd5fad2988f65a)

23 months agoPrefer java.time.Duration 77/101177/1
Robert Varga [Tue, 17 May 2022 09:11:48 +0000 (11:11 +0200)]
Prefer java.time.Duration

Use Java 8 Duration instead of Scala's version. Actors then convert
to Scala as needed.

Change-Id: Id1301c9c67a8a301aa20aafafdbd387865c2cf3b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 7d83179b4d81e63eeb5c1c1adf4794c6e74c5709)

23 months agoBump versions to 3.0.4-SNAPSHOT 95/101095/1
Robert Varga [Fri, 13 May 2022 05:56:41 +0000 (07:56 +0200)]
Bump versions to 3.0.4-SNAPSHOT

This starts the next development iteration.

Change-Id: I725e62f32d850cb2c65064740d593ff50b968b0a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoFix PATCH request issue with top-level container as target 85/100985/1
Sangwook Ha [Fri, 6 May 2022 17:14:04 +0000 (10:14 -0700)]
Fix PATCH request issue with top-level container as target

PATCH request to the data root with a top-level container as
target does not work because JsonPatchBodyReader and
XmlPatchBodyReader expect a parent statement in the stack.

Address the issue by setting target schema node to the path
schema context when stack is empty and add test cases for
JsonPatchBodyReader and XmlPatchBodyReader.

JIRA: NETCONF-877
Change-Id: Ibb65ccdf3f03d8a9a9023d75bf288e5e4416ca50
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
23 months agoBump json-unit-assertj to 2.35.0 88/101088/1
Robert Varga [Thu, 12 May 2022 20:25:23 +0000 (22:25 +0200)]
Bump json-unit-assertj to 2.35.0

No explicit release notes.

Change-Id: I7f8236f2784984d0913e505fddcb2fbaa65f00d4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoBump upstream versions 85/101085/4
Robert Varga [Thu, 12 May 2022 14:23:19 +0000 (16:23 +0200)]
Bump upstream versions

Adopt:
- odlparent-10.0.2
- infrautils-3.0.1
- yangtools-8.0.5
- mdsal-9.0.3
- controller-5.0.5
- aaa-0.15.4

Change-Id: I9d78b5a9538801854910a0621a9ebab60fac0414
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoFix checkstyle 87/101087/2
Robert Varga [Thu, 12 May 2022 15:31:47 +0000 (17:31 +0200)]
Fix checkstyle

There are a few violations, fix them up.

Change-Id: I2c6b766692725975e216c714f7d46b2e833cf80e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoBump argparse4j to 0.9.0 86/101086/1
Robert Varga [Thu, 12 May 2022 15:21:16 +0000 (17:21 +0200)]
Bump argparse4j to 0.9.0

https://github.com/argparse4j/argparse4j/releases/tag/argparse4j-0.9.0

Change-Id: Iba7c6c0612ab39060ec0a7e4672d4b6a1b584477
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoDo not access model context multiple times 76/100976/1
Robert Varga [Mon, 9 May 2022 09:20:42 +0000 (11:20 +0200)]
Do not access model context multiple times

InstanceIdentifierContext has a capture of the model context, use it
from there instead of accessing it multiple times.

Change-Id: Ia29bf5a3e80d164c08ef338649080cb4f48ce4a5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 365a4ee24f4760a4e09b72d4959f618479dccf2a)

23 months agoBump versions to 3.0.3-SNAPSHOT 87/100787/1
Robert Varga [Sun, 24 Apr 2022 23:43:26 +0000 (01:43 +0200)]
Bump versions to 3.0.3-SNAPSHOT

This starts the next development iteration.

Change-Id: Ic48dc72fe4455a60ac54a901f14966b576e4cd51
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoBump upstream versions 86/100786/1
Robert Varga [Sun, 24 Apr 2022 23:41:56 +0000 (01:41 +0200)]
Bump upstream versions

Adopt:
- controller-5.0.3
- aaa-0.15.3

Change-Id: I3de5aed583bd97806c54a314d91f1efd96ff5f25
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix docgen for action types 94/100594/1
Peter Suna [Wed, 20 Apr 2022 13:10:07 +0000 (15:10 +0200)]
Fix docgen for action types

When we are processing actions we need to adjust the stack to enter
each of them for the duration of traversal. Also add the corresponding
test.

JIRA: NETCONF-872
Change-Id: I5aae78380073c4d5c876b888b22cd41a2657db2d
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit c071cca8814ea78b05ca45defa6d74ed5a2c4029)

2 years agoBump versions to 3.0.2-SNAPSHOT 15/100615/1
Robert Varga [Thu, 14 Apr 2022 13:54:51 +0000 (15:54 +0200)]
Bump versions to 3.0.2-SNAPSHOT

This starts the next development iteration.

Change-Id: If73d3e904751ad95cac65395a3ade3d680c5ea22
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump upstreams 14/100614/2
Robert Varga [Thu, 14 Apr 2022 12:25:13 +0000 (14:25 +0200)]
Bump upstreams

Adopt:
- yangtools-8.0.3
- mdsal-9.0.2
- controller-5.0.2
- aaa-0.15.2

Change-Id: I085f1c8f3e6cc694ae43a3d43dc38c726c8a0f0e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDo not use RestUtil.resolveBaseTypeFrom() 57/100557/1
Robert Varga [Tue, 12 Apr 2022 16:06:10 +0000 (18:06 +0200)]
Do not use RestUtil.resolveBaseTypeFrom()

Derived types have been using their proper type for a long time now
and there is essentially cannot be a semantic difference between a
derived/restricted type which would make any difference during
resolution. Ditch the base type lookup and just use the type at hand.

JIRA: NETCONF-837
Change-Id: I21afc3ac15c954358f62070065531e75ff360924
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove RestCodec 56/100556/1
Robert Varga [Tue, 12 Apr 2022 16:04:06 +0000 (18:04 +0200)]
Remove RestCodec

Inline the final simple type handling into prepareValueByType(),
rendering RestCodec superfluous.

JIRA: NETCONF-871
Change-Id: Ie649e28d4333e3c57b49a3593c639474a0c930ad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMove StringModuleInstanceIdentifierCodec 55/100555/1
Robert Varga [Tue, 12 Apr 2022 15:56:40 +0000 (17:56 +0200)]
Move StringModuleInstanceIdentifierCodec

Peel the instance-identifier case from RestCodec to prepareValueByType()
and move StringModuleInstanceIdentifierCodec to be co-located with its
sole user.

JIRA: NETCONF-871
Change-Id: If731522204427b5467c3575c91944737fc18e1bc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove RestCodec's identityref handling 54/100554/1
Robert Varga [Tue, 12 Apr 2022 15:47:46 +0000 (17:47 +0200)]
Remove RestCodec's identityref handling

The sole caller is intercepting IdentityrefTypeDefinition before
invoking this method, so this code is dead. Remove it.

JIRA: NETCONF-871
Change-Id: I1f2a9b2f343c7b802e8c61c755a9f2a4c5b56394
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove IdentityrefCodecImpl and rename ObjectCodec 53/100553/2
Robert Varga [Tue, 12 Apr 2022 15:28:28 +0000 (17:28 +0200)]
Remove IdentityrefCodecImpl and rename ObjectCodec

IdentityrefCodecImpl is not referenced anywhere and removing it makes
RestCodec empty. Move ObjectCodec into its place instead and squash it
to a single static method.

JIRA: NETCONF-871
Change-Id: Idbb072c1dcfbeebfd80cdc73751adf81ad9816f5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove IdentityrefCodecImpl 52/100552/2
Robert Varga [Tue, 12 Apr 2022 15:25:00 +0000 (17:25 +0200)]
Remove IdentityrefCodecImpl

This class is completely unreferenced, remove it.

JIRA: NETCONF-871
Change-Id: Ifbeedeebe8d3f308a3405ce0eddf7ce5f0a1ce27
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove InstanceIdentifierCodecImpl 51/100551/2
Robert Varga [Tue, 12 Apr 2022 15:23:36 +0000 (17:23 +0200)]
Remove InstanceIdentifierCodecImpl

This class is completely unused now. Remove it along all utility methods
it is referencing.

JIRA: NETCONF-871
Change-Id: I549293c108a1a2f92dc9204b843bb1e803ce7166
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoPropagate invariants of ObjectCodec callers 50/100550/2
Robert Varga [Tue, 12 Apr 2022 15:20:04 +0000 (17:20 +0200)]
Propagate invariants of ObjectCodec callers

The serialize() method is never called, hence we can just remove it.
The deserialize() method always gets a String, hence we can just bypass
the dance with references and whatnot.

JIRA: NETCONF-871
Change-Id: I405306e5e5aacf2f15f9a936f77b3ab841cc98d4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoObjectCodec does not need a mount point 49/100549/2
Robert Varga [Tue, 12 Apr 2022 14:59:03 +0000 (16:59 +0200)]
ObjectCodec does not need a mount point

There is only one caller and that caller is not passing a mount point,
propagate that invariant.

JIRA: NETCONF-871
Change-Id: I4a5a312cce87be3176b9757e5bfdde6538c229d0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMove ObjectCodec to its own file 48/100548/2
Robert Varga [Tue, 12 Apr 2022 14:54:08 +0000 (16:54 +0200)]
Move ObjectCodec to its own file

This the beef of RestCodec, make sure it is a top-level construct.

JIRA: NETCONF-871
Change-Id: I314cc3f91ca3c5e7e2d4e6d7310507541e1cd843
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix CCE in DefinitionGenerator 12/100412/2
Robert Varga [Tue, 5 Apr 2022 10:47:03 +0000 (12:47 +0200)]
Fix CCE in DefinitionGenerator

decimal64 is mapped to its own type, not BigDecimal. Adjust the cast
and convert to BigDecimal.

JIRA: NETCONF-870
Change-Id: Idce468ed2728f472431ed325ab8dcb2a1e449118
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSimplify SSE mocking 86/100386/1
Robert Varga [Mon, 4 Apr 2022 19:38:35 +0000 (21:38 +0200)]
Simplify SSE mocking

The springboard through interface default method does not quite work,
rework the mock to not use it.

Change-Id: Iec36b42762c901ae7f0fc83072abbb6c2e12c553
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove unused spying 84/100384/1
Robert Varga [Mon, 4 Apr 2022 14:59:45 +0000 (16:59 +0200)]
Remove unused spying

KeepaliveSalFacadeTest has a bit of useless mocking/spying. This is
failing with JDK17. While we would want to mock the behavior exactly
without delays, use real executor for now.

Change-Id: I462852fb8ed56ed5370d7036bc2c3c862129dce1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse SoftSchemaSourceCache 82/100382/1
Robert Varga [Mon, 4 Apr 2022 12:48:33 +0000 (14:48 +0200)]
Use SoftSchemaSourceCache

GuavaSchemaSourceCache is deprecated, use SoftSchemaSourceCache instead.

Change-Id: Ie7334e28eafefc60e3e4b7521b8c685df3b25e97
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoTrim NodeIdentifierWithPredicates from post path 78/100378/3
Robert Varga [Mon, 4 Apr 2022 08:28:07 +0000 (10:28 +0200)]
Trim NodeIdentifierWithPredicates from post path

The identifier we are getting from DataSchemaContextTree does not have
correct predicates filled it. Make sure to trim it, as we are restoring
it properly after parse.

JIRA: NETCONF-869
Change-Id: Ia5103e25d0c2790c5c31bea356a29b69f43618b6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 3.0.1-SNAPSHOT 88/100288/1
Robert Varga [Wed, 30 Mar 2022 14:06:51 +0000 (16:06 +0200)]
Bump versions to 3.0.1-SNAPSHOT

This starts the next development iteration.

Change-Id: Ic2634d0b2f04a17f2b451f7004783475a8ce421b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoReject consecutive slashes 79/100279/2
Robert Varga [Sun, 27 Mar 2022 14:51:43 +0000 (16:51 +0200)]
Reject consecutive slashes

Tweak are default handling of consecutive slashes to be compliant with
RFC8040.

JIRA: NETCONF-867
Change-Id: Iff654d24d6107bdd9dc1e670e51dca6d042d0574
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump upstreams to SNAPSHOTs 07/99507/57
Robert Varga [Thu, 27 Jan 2022 19:17:12 +0000 (20:17 +0100)]
Bump upstreams to SNAPSHOTs

Adopt:
- odlparent-10.0.0
- infrautils-3.0.0
- yangtools-8.0.2
- mdsal-9.0.1
- controller-5.0.1
- aaa-0.15.1

This also ditches last references to SchemaNode.getPath(), replacing
such references with SchemaInferenceStack.Inference and related
operations.

JIRA: NETCONF-818
Change-Id: I99a02e3b4e831d32013fa722d2bda3932c873ffc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
2 years agoFixup processing reporting 84/100284/1
Robert Varga [Mon, 28 Mar 2022 22:24:54 +0000 (00:24 +0200)]
Fixup processing reporting

We need to report the events as done even if the downstream writer does
not accept the object model. If we do not, we will get confused about
how the node should be processed.

JIRA: NETCONF-868
Change-Id: I5a76c5a2af79ecaaf4c80f832774b08d60d03379
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSupport AnydataNode in ParameterAwareNormalizedNodeWriter 80/100280/1
Sangwook Ha [Sun, 27 Mar 2022 22:15:29 +0000 (15:15 -0700)]
Support AnydataNode in ParameterAwareNormalizedNodeWriter

AnydataNode is not processed in ParameterAwareNormalizedNodeWriter
throwing IllegalStateException. Add a step to check/process AnydataNode
in wasProcessAsSimpleNode().

JIRA: NETCONF-868
Change-Id: I637890ff6779d0a532ee6d4182e4c36baa4f5231
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
2 years agoReconstruct inference stack during normalization 70/100270/15
Robert Varga [Fri, 25 Mar 2022 19:12:22 +0000 (20:12 +0100)]
Reconstruct inference stack during normalization

Centralize allocation of Inference, adjusting tests to take advantage of
this facility. This also hides the public InstanceIdentifierContext, so
that we get clarity as to the actual context in which we are executing.

AbstractFieldsTranslatorTest is refactored to remove mocking and
correctly bind to the undelying model.

This temporarily picks up yang-model-util-7.0.15 for
restconf-{common,nb-rfc8040}, so as to gain access to new methods of
DataSchemaContext{Node,Tree}.

JIRA: NETCONF-818
Change-Id: Iaf3362877261f3caaebfb4ec98ef6de792139f12
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDo not re-acquire global schema context 76/100276/4
Robert Varga [Fri, 25 Mar 2022 23:44:17 +0000 (00:44 +0100)]
Do not re-acquire global schema context

The context is bound at NormalizedNodeContext creation time, let's
make sure we do not change that.

JIRA: NETCONF-818
Change-Id: I7ec6296c2703b3689aa0c464874ede37695d9065
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoPeel rfc8040 tests from InstanceIdentifierContext constructor 75/100275/2
Robert Varga [Fri, 25 Mar 2022 22:28:48 +0000 (23:28 +0100)]
Peel rfc8040 tests from InstanceIdentifierContext constructor

Migrate more callers to replacement methods.

JIRA: NETCONF-818
Change-Id: Iac89d4cfa19d15ff525078776ce73a9ee2bfc7df
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDo not expose YangInstanceIdentifier on output 74/100274/1
Robert Varga [Fri, 25 Mar 2022 22:31:16 +0000 (23:31 +0100)]
Do not expose YangInstanceIdentifier on output

Output codecs do not care about this information, do not fill it in.

JIRA: NETCONF-818
Change-Id: I6aeaa68d244958960ac455d34247816852220d5a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse Builders.containerBuilder() 73/100273/1
Robert Varga [Fri, 25 Mar 2022 21:55:49 +0000 (22:55 +0100)]
Use Builders.containerBuilder()

Ditch the direct reference to implementation and use Builders
indirection instead.

Change-Id: Ic05d64b63100e9e8b6eb5dacafa787ad2b49e52d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoNo not create YangInstanceIdentifier for a response 71/100271/2
Robert Varga [Fri, 25 Mar 2022 21:27:24 +0000 (22:27 +0100)]
No not create YangInstanceIdentifier for a response

In the output path nobody cares about the instance identifier, simplify
the code instead.

Change-Id: Ib8ec7d8a27d295724d994f3f855b6e0062188435
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFinish bierman02 test migration 72/100272/2
Robert Varga [Fri, 25 Mar 2022 21:33:40 +0000 (22:33 +0100)]
Finish bierman02 test migration

Eliminate last callers of public InstanceIdentifierContext constructor.

JIRA: NETCONF-818
Change-Id: I175c9d556c1922b0fdfee611517c8a47d52826d7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoPeel another RPC invocation site 69/100269/4
Robert Varga [Fri, 25 Mar 2022 19:01:28 +0000 (20:01 +0100)]
Peel another RPC invocation site

Another site with pure RPCs, make sure to peel it off.

JIRA: NETCONF-818
Change-Id: I7d5e3aa473b5641a6efa902394b6d9f39a8e7278
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoPeel of RPC invocation InstanceIdentifierContext 68/100268/3
Robert Varga [Fri, 25 Mar 2022 18:35:11 +0000 (19:35 +0100)]
Peel of RPC invocation InstanceIdentifierContext

Here is a confusing site, which could ned up holding an
InstanceIdentifier, which is not valid. Peel it off.

JIRA: NETCONF-818
Change-Id: I2184afd2d5e750b60b471f7d5d009e038b4b7017
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove RFC8040 tests 64/100264/1
Robert Varga [Fri, 25 Mar 2022 17:44:30 +0000 (18:44 +0100)]
Improve RFC8040 tests

We have a few tests using @Test(expected), improve them by using
assertThrows() and performing some assertions.

Change-Id: I378c1108c43e42f7af2b0dc54bab23263a2acae3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd two more InstanceIdentifierContext conversions 63/100263/1
Robert Varga [Fri, 25 Mar 2022 17:35:13 +0000 (18:35 +0100)]
Add two more InstanceIdentifierContext conversions

We have two more callers which can we easily migrated, do that.

JIRA: NETCONF-818
Change-Id: I8aa8563de7cd82300abb026cfd706257e55a1efb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDo not propagate mountpoint in RestconfImpl.getModules() 61/100261/1
Robert Varga [Fri, 25 Mar 2022 15:40:18 +0000 (16:40 +0100)]
Do not propagate mountpoint in RestconfImpl.getModules()

The mount point reference is ignored, just do not propagate it.

JIRA: NETCONF-818
Change-Id: Ibdd27795725357c41b19cd942a4f701aab3f88ce
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoPeel DataSchemaNode-only users of InstanceIdentifierContext 59/100259/3
Robert Varga [Fri, 25 Mar 2022 14:50:57 +0000 (15:50 +0100)]
Peel DataSchemaNode-only users of InstanceIdentifierContext

A number of callers are not providing a YangInstanceIdentifier, peel
them off into a separate instantiation method.

JIRA: NETCONF-818
Change-Id: Ic92cbc469d66e3e8ad957bde73c2f858b0daa8f2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoPeel bierman02 local RPC test invocations 58/100258/1
Robert Varga [Fri, 25 Mar 2022 14:21:39 +0000 (15:21 +0100)]
Peel bierman02 local RPC test invocations

We have a few callers dealing with RPCs. Peel them to a new factory
method. Also fixes and enables a previously-disabled test.

JIRA: NETCONF-818
Change-Id: I888069dee94307003905bfa615b03ecccc202c11
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSimplify RestconfImplTest mocking 57/100257/1
Robert Varga [Fri, 25 Mar 2022 14:03:30 +0000 (15:03 +0100)]
Simplify RestconfImplTest mocking

Mocking here is ... interesting. Simplify to base interfaces.

JIRA: NETCONF-818
Change-Id: I6cf6be6f53a7085019798e048dc202adb79bdf7c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoIntegrate DataNormalizationOperation with SchemaInferenceStack 41/100241/6
Robert Varga [Thu, 24 Mar 2022 13:31:42 +0000 (14:31 +0100)]
Integrate DataNormalizationOperation with SchemaInferenceStack

This is a backport of changes made for YANGTOOLS-1412, adjusted to the
legacy code in bierman02. These will allow us to use a proper inference.

JIRA: NETCONF-818
Change-Id: Ia3234443e26ff985b823e92d942262dfdeeef29e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix Stackoverflow in sal-rest-docgen 44/99944/10
Samuel Schneider [Thu, 3 Mar 2022 09:14:22 +0000 (10:14 +0100)]
Fix Stackoverflow in sal-rest-docgen

Add escaping of chars which underlying library
consider as special characters (and we do not).

JIRA: NETCONF-713
Change-Id: Ife63c31cd9c4912a74db10562b9f927623bc4695
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
2 years agoImprove DataNormalizer performance 49/100249/1
Robert Varga [Thu, 24 Mar 2022 20:36:43 +0000 (21:36 +0100)]
Improve DataNormalizer performance

We are using ImmutableList.Builder and build() at each step to pass
arguments down to checkArgument(). That's wasteful, let's rather pay
the cost of a single ImmutableList.copyOf() -- which breaks even at
three path arguments.

Change-Id: I586761f5e8f8e39f1be3c85bc5e9181c1681e6fd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix DataNormalizationOperation with nested choices 38/100238/1
Robert Varga [Thu, 24 Mar 2022 12:40:10 +0000 (13:40 +0100)]
Fix DataNormalizationOperation with nested choices

This is a port of YANGTOOLS-1411 to the legacy codebase.

Change-Id: Iff3ac515f4bd763c1c7b7905508fca3b5dc277c7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDo not shuffle PathArguments needlessly 37/100237/1
Robert Varga [Thu, 24 Mar 2022 12:30:16 +0000 (13:30 +0100)]
Do not shuffle PathArguments needlessly

There is no point in creating a separate collection if we are not
doing anything with it.

Change-Id: I3199c7232c63464b315eff8f69aac98181946ebd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix notification serialization with odl-leaf-nodes-only 06/99806/8
Peter Puškár [Mon, 14 Feb 2022 12:44:52 +0000 (13:44 +0100)]
Fix notification serialization with odl-leaf-nodes-only

Rather than attempting to roll a SchemaPath from PathArguments, use the
provided tool to perform that function -- in a centralized manner.

Add tests to cover serialization of augmentation and choice nodes.

JIRA: NETCONF-848
Change-Id: I9f6dffd9532bd3d52021bbac58473c3cf3b58937
Signed-off-by: Peter Puškár <ppuskar@frinx.io>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoConsider RPC/Actions terminal nodes 23/100223/1
Robert Varga [Wed, 23 Mar 2022 08:54:08 +0000 (09:54 +0100)]
Consider RPC/Actions terminal nodes

Our treatment of RPCs and Actions is rather funky, disregarding
namespaces and not stopping intepretation when we bind a request path
step to one of them. Such request URIs are strictly illegal, so reject
them and clean up internal structure to not go off into unexplained
states.

JIRA: NETCONF-866
Change-Id: Iae23db7e48b21309757fbaa1ad0dea627e6ea533
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSeparate out more constructor callers 16/100216/1
Robert Varga [Tue, 22 Mar 2022 11:16:10 +0000 (12:16 +0100)]
Separate out more constructor callers

We have four call sites which create a new InstanceIdentifierContext
with equal state, but with a concatenated YangInstanceIdentifier.

Centralize that concat operation, which will makes things easier down
the line.

JIRA: NETCONF-818
Change-Id: I2d0da91756cd9ebf451343454f20485d0d8b0978
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove use of DOMRpcRouter.create() 15/100215/1
Robert Varga [Tue, 22 Mar 2022 09:00:44 +0000 (10:00 +0100)]
Remove use of DOMRpcRouter.create()

We should be using plain constructor, migrate away.

Change-Id: Idef7be1ba633c2d54e5f7f0a62e7e3996edf0813
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDitch use of RpcDefintion.getOutput().getPath() 14/100214/1
Robert Varga [Tue, 22 Mar 2022 08:57:05 +0000 (09:57 +0100)]
Ditch use of RpcDefintion.getOutput().getPath()

This does not solve much, but reduces clutter a bit.

JIRA: NETCONF-818
Change-Id: I2028703449459f1fac7ee8774dd26125420b7308
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRevert "Revert "Replace #getPath in processInstanceIdentifierType"" 13/100213/1
Robert Varga [Tue, 22 Mar 2022 07:37:29 +0000 (08:37 +0100)]
Revert "Revert "Replace #getPath in processInstanceIdentifierType""

This reverts commit 91ca58fe53758c0909f3e2ebea9c206768348410,
reinstating 445e898b86ffe443776037e0fc769ddce3d19f58.

Change-Id: I656a50b3f1d38511ebb432f294611f0a788820c2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDeprecate public InstanceIdentifierContext 12/100212/2
Robert Varga [Mon, 21 Mar 2022 21:27:15 +0000 (22:27 +0100)]
Deprecate public InstanceIdentifierContext

We need to reign in semantics of what different combinations of callers
we have and what are they trying to achieve. Deprecate the public
constructor and expose static methods to create instances with
appropriate shape.

JIRA: NETCONF-818
Change-Id: I452e92cd5e7f46bccb9b00799894aa7ee375cc48
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMake InstanceIdentifierContext final 11/100211/1
Robert Varga [Mon, 21 Mar 2022 19:27:08 +0000 (20:27 +0100)]
Make InstanceIdentifierContext final

In order to deal with SchemaNode.getPath() going away, we have to keep
a very good handle on InstanceIdentifierContext and what the actual
possibilities are. As a first step, make it final and do not allow it to
be mocked.

JIRA: NETCONF-818
Change-Id: I1666e28c3d1801943f623d80a934079d5ff08b51
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBuild Absolute schema node identifier along with YangInstanceIdentifier 09/100209/2
Robert Varga [Mon, 21 Mar 2022 16:29:03 +0000 (17:29 +0100)]
Build Absolute schema node identifier along with YangInstanceIdentifier

The nested notification transformation algorithm is rather lacking -- it
does not really deal with anything but 'container' and 'list'. This
makes it borderline-trivial to eliminate the use of SchemaNode.getPath()
by keeping a List<QName> which is a companion to
YangInstanceIdentifierBuilder.

JIRA: NETCONF-817
Change-Id: I95290d7399ae1d729bb68e76e3bf902a930add4f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMove SchemaNodeIdentifier construction 08/100208/2
Robert Varga [Mon, 21 Mar 2022 16:17:42 +0000 (17:17 +0100)]
Move SchemaNodeIdentifier construction

We allocate the Absolute identifier in the context where we should
have equivalent information. Also clean up field names a make proper
assertions on element type.

JIRA: NETCONF-817
Change-Id: I70fe78c079d50eaa73e1038d001c3c6abb8a0ecc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRework NetconfMessageTransformer.toNotification() 07/100207/1
Robert Varga [Mon, 21 Mar 2022 16:02:50 +0000 (17:02 +0100)]
Rework NetconfMessageTransformer.toNotification()

The logic here is quite convoluted, separate out the individual
concern, which makes is easy to see we need getPath() only for nested
notifications. For those we are already creating a
YangInstanceIdentifier, hence adding the proper path should be a breeze.

JIRA: NETCONF-817
Change-Id: Iea59a24d485f138064063dc92e2862dbd21a69b1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove a superfluous groupId declaration 04/100204/1
Robert Varga [Mon, 21 Mar 2022 15:25:18 +0000 (16:25 +0100)]
Remove a superfluous groupId declaration

We are inheriting groupId from parent, remove the declaration.

Change-Id: I1264e314cb47855331f0add3f2f12b57bc92600d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAbstractNotificationsData.writeNormalizedNode() should take inference 03/100203/1
Robert Varga [Mon, 21 Mar 2022 14:45:22 +0000 (15:45 +0100)]
AbstractNotificationsData.writeNormalizedNode() should take inference

We have pretty much all the moving bits ready here, require callers to
provide the correct context. Also ditches some amount of SchemePath
wrangling.

Change-Id: I18a8366cffb9c4f45434ee505f767ad38d799f0a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove unneeded warning suppressions 02/100202/1
Robert Varga [Mon, 21 Mar 2022 14:22:06 +0000 (15:22 +0100)]
Remove unneeded warning suppressions

Baselines have lost some generic arguments, leading to cleaner code.
Eclipse is pointing out some superfluous suppressions -- remove them.

Change-Id: Ide247a3f88f0ae866794b22a7ab81fc5e81fe66c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoInstanceIdentifierContext does not take generics 01/100201/1
Robert Varga [Mon, 21 Mar 2022 14:05:48 +0000 (15:05 +0100)]
InstanceIdentifierContext does not take generics

The generic attribute here is completely useless and only has the
function of tying EffectiveModelContext to being a SchemaNode -- nothing
else. Remove the argument and adjust callers.

Change-Id: Ic70482786ad1141bb20123ecca2f25c40e83eaf8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDo not reference SchemaNode.getPath() for operation results 99/100199/1
Robert Varga [Mon, 21 Mar 2022 11:21:58 +0000 (12:21 +0100)]
Do not reference SchemaNode.getPath() for operation results

The request is either an RPC or an action. We have the path for the
latter readily-available and construct it for the former. Update the
dispatch and clean up the source code a bit as well.

JIRA: NETCONF-817
Change-Id: Ie4e273e0eb499498c0d6b833fb11e4ca115ca989
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRework action indexing 97/100197/1
Robert Varga [Mon, 21 Mar 2022 10:54:05 +0000 (11:54 +0100)]
Rework action indexing

Rather than relying on SchemaNode.getPath(), maintain a stack of QNames
representing the SchemaNodeIdentifier path.

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