netconf.git
20 months agoRelease netconf v4.0.0
jenkins-releng [Fri, 29 Jul 2022 10:57:42 +0000 (10:57 +0000)]
Release netconf

20 months agoReuse encoder 94/101894/1
Robert Varga [Fri, 29 Jul 2022 09:59:50 +0000 (11:59 +0200)]
Reuse encoder

This is a tiny improvement: reuse the encoder for initilization of all
three byte arrays.

Change-Id: Ic01e9fcf1667ca6f28e089dae291f9a7acfecd30
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
20 months agoUse multi-line string literals 85/101885/3
Robert Varga [Thu, 28 Jul 2022 20:54:45 +0000 (22:54 +0200)]
Use multi-line string literals

We have JDK17, use mulit-line literals for the test.

Change-Id: Ibe46846fe96b75bc9156c85a2014df842968f5a2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
20 months agoGet rid of Netty's DelimiterBasedFrameDecoder 90/75490/15
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>
20 months agoRemove NetconfMessageConstants 86/101886/4
Robert Varga [Thu, 28 Jul 2022 20:43:57 +0000 (22:43 +0200)]
Remove NetconfMessageConstants

MessageParts are really something related to FramingMechanism, without
much further value. Get rid of it by moving interesting constants to
FramingMechanism.

Change-Id: I1e92dbc771876a53c12e8f60f4beed35de747529
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
20 months agoRename restconf-nb-rfc8040 to restconf-nb 81/101881/2
Robert Varga [Thu, 28 Jul 2022 17:10:50 +0000 (19:10 +0200)]
Rename restconf-nb-rfc8040 to restconf-nb

We only have RFC-compliant version of the northbound plugin, ditch the
rfc8040 qualifier.

JIRA: NETCONF-893
Change-Id: I75a9a7fd59bd23063662256a9c15309fb25fd966
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
20 months agoReduce exception guard 82/101382/7
Robert Varga [Tue, 31 May 2022 19:04:53 +0000 (21:04 +0200)]
Reduce exception guard

We really should not be catching Exceptions here and once connect()
returns we should be completely asynchronous. Reduce the amount of
code protected by the try/catch block.

Change-Id: I673cc4f0a52cefd2659a5db5a96417e00fd89422
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
20 months agoSplit out strategy decision error handling 81/101381/7
Robert Varga [Tue, 31 May 2022 18:59:29 +0000 (20:59 +0200)]
Split out strategy decision error handling

When the strategy determines that a connection attempt should not be
made it will throw an exception. Peel this case out of the rest of
connection handling and add a dedicated message.

Change-Id: I9dd897f487421ba096240ebc9e3d999a7a5d7489
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
20 months agoTurn NetconfMessageConstants into a final class 84/101884/2
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>
20 months agoUse strict String->byte[] conversion 83/101883/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>
20 months agoMessageParts should be a class 82/101882/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>
20 months agoMove SchemaExportContext 80/101880/1
Robert Varga [Thu, 28 Jul 2022 16:14:54 +0000 (18:14 +0200)]
Move SchemaExportContext

This class is tied to RestconfSchemaService, co-locate it in the same
package.

JIRA: NETCONF-837
Change-Id: I0961bc939230a028a0c3915cf1f9c3d9668063b6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
20 months agoMove restconf.common.util 79/101879/1
Robert Varga [Thu, 28 Jul 2022 15:57:48 +0000 (17:57 +0200)]
Move restconf.common.util

The contents of this package is only used by
RestconfOperationsServiceImpl, move them there and mark them as
reprecated.

JIRA: NETCONF-837
Change-Id: I8624be2d6d55f78e01004da718d93c30399f31f1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoClean up ietf-netconf-monitoring-extension 57/101857/4
Robert Varga [Sun, 17 Jul 2022 22:26:43 +0000 (00:26 +0200)]
Clean up ietf-netconf-monitoring-extension

Use a proper OpenDaylight namespace in both module name and namespace.

JIRA: NETCONF-891
Change-Id: I5853e33134fc6c0dcea3b4635d36f7c85c9de35e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoMove ietf-netconf-monitoring-extension 55/101855/5
Robert Varga [Sun, 17 Jul 2022 15:40:24 +0000 (17:40 +0200)]
Move ietf-netconf-monitoring-extension

This is an implementation detail, let's make sure we treat it that way.

JIRA: NETCONF-891
Change-Id: I2de2dbf7c348f1790f9e2cec21db8b9cbfa0a2d2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoDo not depend on ietf-netconf-monitoring-extension 56/101856/1
Robert Varga [Sun, 17 Jul 2022 22:16:15 +0000 (00:16 +0200)]
Do not depend on ietf-netconf-monitoring-extension

Since we are filtering content, there is no point to bring the
monitoring extension into the picture. Remove this dependency.

JIRA: NETCONF-881
Change-Id: Ib13baa2750671cbb6ebddc679c75b4de580d569d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoFilter non-standard nodes from NETCONF monitoring schemas 50/101850/5
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>
21 months agoCleanup models/rfc6470 dependencies 54/101854/1
Robert Varga [Sun, 17 Jul 2022 15:18:20 +0000 (17:18 +0200)]
Cleanup models/rfc6470 dependencies

We have both unused and used dependencies, clean them up.

Change-Id: Ia0bcf3b3bf882b0bc49da87acdd3324422dc38b3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoFixups for model movement 43/101843/1
Robert Varga [Tue, 12 Jul 2022 22:34:59 +0000 (00:34 +0200)]
Fixups for model movement

Add references for RFC5277 models and fix RFC6022 description.

JIRA: NETCONF-890
Change-Id: I2d24ae830bc283538751f4efd7741287896cc540
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoRefactor standard model placement 41/101841/11
Robert Varga [Tue, 12 Jul 2022 15:31:27 +0000 (17:31 +0200)]
Refactor standard model placement

Rather than having standards models scattered throughout the repository,
dedicate a namespace, org.opendaylight.netconf.model, and a top-level
directory to hold them.

JIRA: NETCONF-890
Change-Id: I4bc667a3b4977bc00b929e6c03472952f6d3dcad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoAdd ietf-subscribed-notifications 74/97874/3
Robert Varga [Wed, 13 Oct 2021 10:58:13 +0000 (12:58 +0200)]
Add ietf-subscribed-notifications

RFC8639 defines baseline structures for subscribed notifications. Make
sure we package the corresponding model.

JIRA: NETCONF-814
Change-Id: I103c8bb64f51f837c85956d3ac091ff74e19573f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoDisable creating reduced netconf-testtol pom 17/101717/5
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>
21 months agoUse a simple immutable leaf node 05/101505/7
Robert Varga [Wed, 8 Jun 2022 14:41:35 +0000 (16:41 +0200)]
Use a simple immutable leaf node

Remove a bit of redundancy and a reference to NormalizedNodeBuilder.

Change-Id: I5a62f1283a449f62c586a403992e3615a64f19a8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoUse aaa-0.16.0 64/101764/1
Robert Varga [Wed, 6 Jul 2022 22:58:21 +0000 (00:58 +0200)]
Use aaa-0.16.0

Use the release version instead of snapshots.

Change-Id: I3253325939fb251341ca2ada037c8fe3fd0a5566
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoUse instanceof patterns in netconf-util 28/101728/2
Robert Varga [Mon, 4 Jul 2022 20:40:37 +0000 (22:40 +0200)]
Use instanceof patterns in netconf-util

We can improve expressiveness here, eliminating casts.

Change-Id: I0f4a43b9bbbf019dbf98f36037b7d1e8db47cae9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoUse instanceof pattern in netconf-impl 27/101727/2
Robert Varga [Mon, 4 Jul 2022 20:35:13 +0000 (22:35 +0200)]
Use instanceof pattern in netconf-impl

We can reduce verbosity by using a pattern match, use it.

Change-Id: Id92bda676d8c02f5670ae1aeacb526e20e6af03b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoUse instanceof pattern in RemoteNetconfCommand 26/101726/2
Robert Varga [Mon, 4 Jul 2022 20:31:12 +0000 (22:31 +0200)]
Use instanceof pattern in RemoteNetconfCommand

Remove duplicate casts, improving expressiveness.

Change-Id: I662686d163217a28d8d1c2d44e8ad1f7c3a7de4f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoUse of instanceof pattern match in XmlElement 25/101725/2
Robert Varga [Mon, 4 Jul 2022 20:28:08 +0000 (22:28 +0200)]
Use of instanceof pattern match in XmlElement

Improve expressiveness through check-and-cast mechanics.

Change-Id: Id837cf0e8f1791d1a4dae5a28b468209566a308f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoBump upstream versions 30/101630/7
Robert Varga [Mon, 27 Jun 2022 09:13:41 +0000 (11:13 +0200)]
Bump upstream versions

Adopt:
- odlparent-11.0.0
- infrautils-4.0.0
- yangtools-9.0.0
- mdsal-10.0.0
- controller-6.0.0
- aaa-0.16.0-SNAPSHOT

Change-Id: I2541823f98942f6cf03331416a57777539dfb9f8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoModernize ParameterAwareNormalizedNodeWriterDepthTest 13/101713/1
Robert Varga [Sun, 3 Jul 2022 20:43:04 +0000 (22:43 +0200)]
Modernize ParameterAwareNormalizedNodeWriterDepthTest

Use List/Set.of() and System{LeafSet,Map}Node.

Change-Id: I40bea558245e060853e6a0f63092dcd96fa98ed1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoModerinize ParameterAwareNormalizedNodeWriterFieldsTest 12/101712/1
Robert Varga [Sun, 3 Jul 2022 20:40:49 +0000 (22:40 +0200)]
Moderinize ParameterAwareNormalizedNodeWriterFieldsTest

Uses System{LeafList,Map}Node, static imports and List/Set.of().

Change-Id: I754e39a4e409f4697fdb2510e4a211510595500d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoCleanup ParameterAwareNormalizedNodeWriterParametersTest 11/101711/1
Robert Varga [Sun, 3 Jul 2022 20:36:24 +0000 (22:36 +0200)]
Cleanup ParameterAwareNormalizedNodeWriterParametersTest

Use SystemLeafSetNode, static imports and Set/List.of().

Change-Id: Ida264c88e7121449bb191f6238114c7c30866c74
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoClean up SshClient factories 08/101608/2
Robert Varga [Mon, 20 Jun 2022 09:29:37 +0000 (11:29 +0200)]
Clean up SshClient factories

We really have only a single factory, remove the constant and inline
it to its sole caller. Also remove an unused factory.

Change-Id: I13523654e3ee4556365c3d809bcdf9f613aa6900
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoRemove use of yangtools.concepts.Builder 07/101607/3
Robert Varga [Mon, 20 Jun 2022 08:58:59 +0000 (10:58 +0200)]
Remove use of yangtools.concepts.Builder

This concept has been deprecated, let's not use it.

Change-Id: I25abbedb5bf9530d517e976c4e1bc1cded65d724
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoUse a local for nodeId 06/101606/2
Robert Varga [Mon, 20 Jun 2022 08:53:56 +0000 (10:53 +0200)]
Use a local for nodeId

We are accessing it twice, let's just use a local for it.

Change-Id: I7d221ed6ff34bdbea6b0d30f6309f8d1162effe2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoFix error message typo 04/101604/3
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

22 months agoHide AbstractGet 47/101547/2
Robert Varga [Thu, 9 Jun 2022 15:28:19 +0000 (17:28 +0200)]
Hide AbstractGet

This is an implementation detail, do not expose it outside the package.

Change-Id: Ia910a8cfe0f995cef38ccff382257275b61ab626
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoCorrect root vs. nested writeout 46/101546/3
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>
22 months agoSimplify trimming 04/101504/1
Robert Varga [Wed, 8 Jun 2022 14:31:14 +0000 (16:31 +0200)]
Simplify trimming

We have needlessly complicated if/else flows, simplify them.

Change-Id: I358482f477cce6f889895537572ed1ca2b4942f0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoDo not use SchemaAwareBuilders in CreateStreamUtilTest 03/101503/1
Robert Varga [Wed, 8 Jun 2022 14:21:14 +0000 (16:21 +0200)]
Do not use SchemaAwareBuilders in CreateStreamUtilTest

The use of builders is clunky at best. Just use plain builders.

Change-Id: Id198e4a52ff54acf3296537d18e6768c5b6f54c9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoFix AbstractGet.transformNormalizedNode() 98/101498/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>
22 months agoCleanup Netconf538Test 97/101497/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>
22 months agoClean up MdsalOperationProvider 95/101495/2
Robert Varga [Wed, 8 Jun 2022 10:36:36 +0000 (12:36 +0200)]
Clean up MdsalOperationProvider

Basic formatting fixes.

Change-Id: Ibcca569248dc6104ef13e6ae850cab27281557eb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoRemove Netconf(Client)SessionPreferences 47/101447/3
Robert Varga [Thu, 2 Jun 2022 18:40:16 +0000 (20:40 +0200)]
Remove Netconf(Client)SessionPreferences

These NetconfClientSessionPreferences are a strictly netconf-client thing,
remove it and adjust its users. This also renders
NetconfSessionPreferences useless, hence those are removed as well.

JIRA: NETCONF-590
Change-Id: I72c5718182751cb869c13318b4b0133bdbd197ea
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoRemove NetconfServerSessionPreferences 46/101446/4
Robert Varga [Thu, 2 Jun 2022 19:22:31 +0000 (21:22 +0200)]
Remove NetconfServerSessionPreferences

This class is a pure DTO used only internally in netconf-impl. Remove it
and adjust users accordingly.

JIRA: NETCONF-590
Change-Id: I1f99fbea705ce4a6128413ff7f68d782744bd68a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoAbstractNetconfSessionNegotiator uses only NetconfHelloMessage 43/101443/3
Robert Varga [Thu, 2 Jun 2022 18:24:23 +0000 (20:24 +0200)]
AbstractNetconfSessionNegotiator uses only NetconfHelloMessage

We have a bit over-zealous use of NetconfSessionPreferences. We really
just need the hello message for negotiation -- reducing the need to
have a generic parameter, which is only causing issues with SpotBugs.

JIRA: NETCONF-590
Change-Id: I7437fda181a447fe740aeed514c0eb3a779002e8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoCleanup restconf-common dependencies 40/101440/2
Robert Varga [Thu, 2 Jun 2022 17:05:48 +0000 (19:05 +0200)]
Cleanup restconf-common dependencies

We have quite a few warnings with some unused large dependencies, clean
all of that up.

Change-Id: Id908c23400437892ce181613286e98ce620ad54b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoCleanup restconf-nb-rfc8040 dependencies 39/101439/2
Robert Varga [Thu, 2 Jun 2022 16:44:06 +0000 (18:44 +0200)]
Cleanup restconf-nb-rfc8040 dependencies

We have a number of warnings here, clean them up as much as possible.

Change-Id: I6f75390c49171430de0da09f0c4c98a849e7c459
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoCleanup netconf-netty-util dependencies 38/101438/2
Robert Varga [Thu, 2 Jun 2022 16:09:08 +0000 (18:09 +0200)]
Cleanup netconf-netty-util dependencies

We have a few warnings here, clean them up.

Change-Id: I78ceb34fa252e3df4fb6e236b6fa45902501622c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoServerChannelInitializer should be final 37/101437/5
Robert Varga [Thu, 2 Jun 2022 09:51:59 +0000 (11:51 +0200)]
ServerChannelInitializer should be final

This is a simple implementation class, make sure it is final to keep
its interactions well-defined.

Change-Id: I7e276e85cf7c08e470657c46b5c2d394bee65a8d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoAdd AbstractClientChannelInitializer 36/101436/5
Robert Varga [Thu, 2 Jun 2022 09:47:20 +0000 (11:47 +0200)]
Add AbstractClientChannelInitializer

We have three distinct classes doing essentially the same thing,
add an intermediate abstract class to handle common functionality.

Change-Id: I107e91cbd1c333279a5c9e2f282b8ef1403a7c48
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoHide NetconfClientSessionNegotiator 34/101434/2
Robert Varga [Thu, 2 Jun 2022 09:16:58 +0000 (11:16 +0200)]
Hide NetconfClientSessionNegotiator

This is an implementation class, make sure we do not expose it.

Change-Id: I9605d827122a3c1f47ba687e1449383a71e0b0a1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoHide NAME_OF_EXCEPTION_HANDLER 33/101433/1
Robert Varga [Thu, 2 Jun 2022 09:09:07 +0000 (11:09 +0200)]
Hide NAME_OF_EXCEPTION_HANDLER

Do not expose NAME_OF_EXCEPTION_HANDLER as it is only used internally.

Change-Id: Icae01cfa0aeed0dd4c670d319beb5c5e11e3c299
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoRemove a unused suppression 19/101419/1
Robert Varga [Wed, 1 Jun 2022 18:31:34 +0000 (20:31 +0200)]
Remove a unused suppression

Abstract methods do not hide fields, remove the suppression.

Change-Id: Ie5c250fee15d73294e6e8d9242094d19dee1bec7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoMake getSessionPreferences() final 18/101418/1
Robert Varga [Wed, 1 Jun 2022 18:07:18 +0000 (20:07 +0200)]
Make getSessionPreferences() final

This method should be final so we can rely on it.

Change-Id: I5b3c75a65ade7147e6e65528a64bbbc9a1467d6c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoClean up NetconfServerSessionNegotiator 17/101417/1
Robert Varga [Wed, 1 Jun 2022 18:01:31 +0000 (20:01 +0200)]
Clean up NetconfServerSessionNegotiator

We have quite outdated and verbose formatting, adjust to JDK11
capabilities.

Change-Id: Iefa1ed5b7e86f9cc1bb97a564cd36dfbe89d1bdf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoMove logging out of try/catch block 16/101416/1
Robert Varga [Wed, 1 Jun 2022 16:55:31 +0000 (18:55 +0200)]
Move logging out of try/catch block

We are catching just IOException, there is no point to include logging
in the block.

Change-Id: I4650513ea444b506068182586153a627bfaff2b9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoGuard connectPromise not being null 15/101415/1
Robert Varga [Wed, 1 Jun 2022 16:52:45 +0000 (18:52 +0200)]
Guard connectPromise not being null

Make sure that we validated the passed promise to not be null. Also fix
debug output, which would show up null.

Change-Id: Id7490dc57480192f135bf688a973713c3d30ea9c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoFix a raw type warning 14/101414/2
Robert Varga [Wed, 1 Jun 2022 16:47:56 +0000 (18:47 +0200)]
Fix a raw type warning

Use a FutureListener<Object> instead of a raw GenericFutureListener.

Change-Id: Ie378ee8e7c3b38f781f48cc4ee6857834a14adc9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoMove PendingWriteRequest.pend() 13/101413/1
Robert Varga [Wed, 1 Jun 2022 16:31:43 +0000 (18:31 +0200)]
Move PendingWriteRequest.pend()

PendingWriteRequest should be a dumb DTO, move channel state checking
away.

Change-Id: I6b7a1d38ed4182a5c16373e1f6abc0386da9e2d8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoImprove write dequeing 12/101412/1
Robert Varga [Wed, 1 Jun 2022 16:28:38 +0000 (18:28 +0200)]
Improve write dequeing

We should be peeking only once to see the actual result.

Change-Id: Idaa132178f58253dcafca7b2bb4d09d9823ee453
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoFix another state-keeping thinko 80/101380/6
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>
22 months agoFix state transition thinko 79/101379/7
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>
22 months agoExplain SuppressFBWarnings 83/101383/3
Robert Varga [Tue, 31 May 2022 20:24:36 +0000 (22:24 +0200)]
Explain SuppressFBWarnings

We are accessing a generic field and SpotBugs does not grok the cast is
safe.

Change-Id: I39b1f4377545d1187de611fc1b9e2bfe3a862c0c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoUse a simple future 85/101385/3
Robert Varga [Tue, 31 May 2022 20:30:11 +0000 (22:30 +0200)]
Use a simple future

Channel is an invariant, hence we do not need to dereference
ChannelFuture, allowing us to reduce verbosity quite a bit.

Change-Id: Ifa9b9b89e1841479f3e66141e02b2619492f3900
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoFix session logging 84/101384/2
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>
22 months agoEliminate ReconnectingStrategyListener 78/101378/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>
22 months agoEliminate BootstrapConnectListener 77/101377/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>
22 months agoReduce ReconnectingStrategyListener nesting 76/101376/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>
22 months agoRemove superfluous this. qualifier 75/101375/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>
23 months agoCentralize NetconfNode/InetSocketAddress conversion 14/100814/4
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>
23 months agoCleanup ActorProxyNetconfServiceFacade 74/101174/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>
23 months agoPrefer java.time.Duration 73/101173/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>
23 months agoFix PATCH request issue with top-level container as target 03/101003/5
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 90/101090/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>
(cherry picked from commit 8d6fa34398b79786d92cb5ba707edd74a63b9ec2)

23 months agoBump upstream versions 89/101089/1
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>
(cherry picked from commit 8030cefc9a73619d4a06ff0e5251b3817650cba1)

23 months agoFix checkstyle 84/100984/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>
(cherry picked from commit 2ae7e8a14d82519cc500aea570e3bc8f496944b7)

23 months agoBump argparse4j to 0.9.0 83/100983/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>
(cherry picked from commit 465720aa537e95d51540529e8fed773a345e87eb)

23 months agoDo not access model context multiple times 12/101012/2
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>
23 months agoRemove Bierman02 support from sal-rest-docgen 37/100937/3
Robert Varga [Tue, 3 May 2022 13:31:15 +0000 (15:31 +0200)]
Remove Bierman02 support from sal-rest-docgen

sal-rest-docgen still has references to bierman02, remove them. Since we
are touching blueprint, ditch ODL extension reference.

JIRA: NETCONF-837
Change-Id: If9b89c40779dc9a87e9e26b38ca2bc2ba0dc5500
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoBump upstream versions 85/100785/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>
23 months agoModernize sal-rest-docgen tests a bit 78/100678/1
Robert Varga [Wed, 20 Apr 2022 18:04:07 +0000 (20:04 +0200)]
Modernize sal-rest-docgen tests a bit

Add an abstract base class to reuse EffectiveModelContext and schema
service. Also use static imports and simplify assertions.

Change-Id: Ib1558ca32efbf5fe9862ff41c5214d090eeedd6c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoFix docgen for action types 72/100672/3
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>
2 years agoMove streams support classes 59/100559/3
Robert Varga [Tue, 12 Apr 2022 16:44:09 +0000 (18:44 +0200)]
Move streams support classes

All these classes are used only by the streams/listeners package,
make sure to relocate them to the same package and are a properly-hidden
implementation detail.

JIRA: NETCONF-837
Change-Id: Ib9d979ef408c36e8c5b9d2cf617dc07c887fa622
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMove OperationsContent 58/100558/3
Robert Varga [Tue, 12 Apr 2022 16:31:09 +0000 (18:31 +0200)]
Move OperationsContent

This is a purely server-side implementation thing, move it to its sole
user.

JIRA: NETCONF-837
Change-Id: I545f9f444c548a8366b6cf6bb0ac85c859ef632c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMove SimpleUriInfo 43/100543/5
Robert Varga [Tue, 12 Apr 2022 11:56:04 +0000 (13:56 +0200)]
Move SimpleUriInfo

This class is used only in tests, move it and hide it. Also rename it to
LocalUriInfo and mark its sole user for future evolution, e.g. use
mocks.

JIRA: NETCONF-837
Change-Id: If3ecdbf332cd3c18bdb8822d2f5396c3d59df3b4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove restconf-nb-bierman02 28/100528/5
Robert Varga [Mon, 11 Apr 2022 09:29:53 +0000 (11:29 +0200)]
Remove restconf-nb-bierman02

We have a replacement in RFC8040 northbound and this implementation has
been deprecated for a long time. Remove it now. Also remove parts of
restconf-common which are no longer used.

JIRA: NETCONF-837
Change-Id: I5430bbbe398e2ea23e510726259f2f5ffaae936d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 4.0.0-SNAPSHOT 27/100627/1
Robert Varga [Thu, 14 Apr 2022 18:59:19 +0000 (20:59 +0200)]
Bump versions to 4.0.0-SNAPSHOT

This starts the next major development iteration.

Change-Id: If406715f7d02b9d3d7f093f371e2d3efa3382fe7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
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>