netconf.git
2 years agoBump versions to 1.13.9-SNAPSHOT 77/99477/1 1.13.x
Robert Varga [Wed, 26 Jan 2022 16:39:20 +0000 (17:39 +0100)]
Bump versions to 1.13.9-SNAPSHOT

This starts the next development iteration.

Change-Id: I5d3112dee4dc8ac5f00e094dca5e936eff60197a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump upstream versions 76/99476/1
Robert Varga [Wed, 26 Jan 2022 16:38:32 +0000 (17:38 +0100)]
Bump upstream versions

Adopt:
- odlparent-8.1.9
- yangtools-6.0.12
- infrautils-1.9.15
- mdsal-7.0.14
- controller-3.0.16
- aaa-0.13.11

Change-Id: I3de6acbf3621f51af29bbb9e4c21eea9f25f0869
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDo not reuse inactive handler 67/99467/1
Robert Varga [Wed, 26 Jan 2022 09:09:21 +0000 (10:09 +0100)]
Do not reuse inactive handler

We have a simple event dispatch handler here, which is stateless and can
be reused, except Netty's defences are rejecting such reuse. Since it is
a very simple object, just do not bother with its reuse.

JIRA: NETCONF-852
Change-Id: I40b48b0a8e14a0a271043bb9fb4b471cfd56a8e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 438ed86b4a3e80cd18f52b40e6faf4260e14d6ac)

2 years agoBump versions to 1.13.8-SNAPSHOT 88/99388/1
Robert Varga [Wed, 19 Jan 2022 14:34:22 +0000 (15:34 +0100)]
Bump versions to 1.13.8-SNAPSHOT

This starts the next development iteration.

Change-Id: Ib1fd2f7ec5f1ffcb4d5eb56f5cb9af19348203df
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump upstream versions 87/99387/1
Robert Varga [Wed, 19 Jan 2022 14:33:40 +0000 (15:33 +0100)]
Bump upstream versions

Adopt:
- odlparent-8.1.8
- yangtools-6.0.11
- infrautils-1.9.14
- mdsal-7.0.13
- controller-3.0.15
- aaa-0.13.10

Change-Id: I18e693ff8d1688767c9cca7f93f3b1a417ab52d9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 1.13.7-SNAPSHOT 48/99248/1
Robert Varga [Mon, 10 Jan 2022 11:32:13 +0000 (12:32 +0100)]
Bump versions to 1.13.7-SNAPSHOT

This starts the next development iteration.

Change-Id: I03e4203404368f59091c80301e73c6274375ee73
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump upstream versions 33/99233/1
Robert Varga [Sun, 9 Jan 2022 21:15:44 +0000 (22:15 +0100)]
Bump upstream versions

Adopt:
- odlparent-8.1.6
- yangtools-6.0.10
- infrautils-1.9.12
- mdsal-7.0.12
- controller-3.0.14
- aaa-0.13.9

Change-Id: I0045e320299b4ce30569977d4ae092a4768a74e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix the showing up mounted devices in apidocs Swagger 32/99232/1
Dominik Vrbovsky [Wed, 5 Jan 2022 09:19:17 +0000 (10:19 +0100)]
Fix the showing up mounted devices in apidocs Swagger

Currently all mounted devices show up in the drop down list as
"topology-netconfnode". If there are many mounted devices
there is no way to find the mounted node you are looking for
without clicking on each selection on the list. Fix this to
show up particular node ID instead of "topology-netconfnode".

JIRA: NETCONF-843
Change-Id: Iecbc2e27f66719d2a9a7024ab9813077ff7cfdb3
Signed-off-by: Dominik Vrbovsky <dominik.vrbovsky@pantheon.tech>
(cherry picked from commit b67affb6c2694fffa9f99ca3abc6a657068002c1)

2 years agoBump upstream versions 60/99160/1
Robert Varga [Fri, 24 Dec 2021 20:51:23 +0000 (21:51 +0100)]
Bump upstream versions

Adopt:
- odlparent-8.1.5
- yangtools-6.0.9
- infrautils-1.9.11
- mdsal-7.0.11
- controller-3.0.13
- aaa-0.13.8

Change-Id: I64fd04bb95749e3d3d726ad5c44f3269ac8309ef
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRefactor NETCONF node defaults 33/99133/3
Ivan Hrasko [Mon, 6 Dec 2021 10:58:02 +0000 (11:58 +0100)]
Refactor NETCONF node defaults

In fact, the difference between devices connected by call-home and
created manually in NETCONF topology is that call-home devices do
not have any data in configuration data-store.

Configuration data is used during the connection setup.

We can create full default configuration node for call-home connected
device to unify the processing of both kind of devices.

In addition, MDSAL now supports default values in data-store so we
can remove those values from AbstractNetconfTopology.

JIRA: NETCONF-832
Change-Id: Ib58ca344a7d74612cb7d049805a3e3c9279986d4
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 2dfc7efb77c6704a0cd397dbd82c2709b14d29ee)

2 years agoPackage jquery internally 34/99034/2
Robert Varga [Wed, 22 Dec 2021 11:05:16 +0000 (12:05 +0100)]
Package jquery internally

We are referencing code.jquery.com, but we can load a minified
version internally. Package jquery-3.6.0.min.js and refer to it.

JIRA: NETCONF-764
Change-Id: Id9abaed8a8bc732066778dad2025ebba5c6a9b0f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 05cc8a3f5839d4138e3ba1f50227c09368385ddb)

2 years agoBump sshd to 2.8.0 34/99134/1
Robert Varga [Tue, 21 Dec 2021 10:01:42 +0000 (11:01 +0100)]
Bump sshd to 2.8.0

https://github.com/apache/mina-sshd/blob/master/docs/changes/2.8.0.md

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

2 years agoDo not leak Promises 32/99132/1
Robert Varga [Wed, 15 Sep 2021 21:43:15 +0000 (23:43 +0200)]
Do not leak Promises

We want to propagate only a read-only view of the connection process,
return a Future, not a Promise.

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

2 years agoUpgrade automaton to 1.12-3 33/99033/1
Robert Varga [Mon, 20 Dec 2021 12:13:23 +0000 (13:13 +0100)]
Upgrade automaton to 1.12-3

Fixed RegExp.toString() and built for Java 11.

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

2 years agoCleanup ReconnectPromise a bit 05/98605/1
Robert Varga [Sat, 4 Sep 2021 00:48:41 +0000 (02:48 +0200)]
Cleanup ReconnectPromise a bit

ClosedChannelHandler is really a stateless object used by
ReconnectPromise wiring. Acknowledge that fact by removing the class in
favor of a field initialized by an anonoymous inner class.

While we are here, also document locking rules and generally tighten
things up, eliminating a SpotBugs suppression in the process.

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

2 years agoRework createReconnectingClient() 73/98573/1
Robert Varga [Fri, 3 Sep 2021 11:10:24 +0000 (13:10 +0200)]
Rework createReconnectingClient()

We seem to have competing interests going on, where we want some
information from the first connection attempt propagated outwards.

JIRA: NETCONF-784
Change-Id: I232d523b60c36de85fea909c6405b1d7cac39c57
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove unused dependency 32/98332/1
Robert Varga [Sun, 7 Nov 2021 13:12:32 +0000 (14:12 +0100)]
Remove unused dependency

netconf-util is not using netty-common, ditch that dependency.

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

2 years agoBump sshd to 2.7.0 31/98331/1
Robert Varga [Thu, 4 Nov 2021 11:40:14 +0000 (12:40 +0100)]
Bump sshd to 2.7.0

https://github.com/apache/mina-sshd/blob/master/docs/changes/2.7.0.md

JIRA: NETCONF-829
Change-Id: I8ff777f3f8ec97d710e743bb5486b31ec54fe27f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 09c20c1cd62407e13abf3d13490884faef68673c)

2 years agoImplement NodeContainerProxy.getPath() 92/98292/3
Robert Varga [Thu, 4 Nov 2021 13:43:31 +0000 (14:43 +0100)]
Implement NodeContainerProxy.getPath()

getPath() is being used for diagnostics in XML parser, let's implement
it in the obviously-correct way to get some more information.

Also modermize NodeContainerProxyTest and move it netconf-util, so it
is co-located with the class it is testing.

JIRA: NETCONF-828
Change-Id: Idfac9d779366d3465db29dcadc27af51dc16b956
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 1.13.6-SNAPSHOT 53/98053/2
Robert Varga [Fri, 22 Oct 2021 20:32:34 +0000 (22:32 +0200)]
Bump versions to 1.13.6-SNAPSHOT

This starts the next development iteration.

Change-Id: I2886c3e0c3de95640a0a07e121f676430552b621
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove StreamingContext diagnostics 24/97824/1
Robert Varga [Fri, 22 Oct 2021 15:59:43 +0000 (17:59 +0200)]
Improve StreamingContext diagnostics

When we encounter a wrong nested child we end up throwing an opaque
ClassCastException. Add an explicit check to improve diagnostics.

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

2 years agoBump MRI upstreams 12/98012/3
Robert Varga [Wed, 20 Oct 2021 20:10:05 +0000 (22:10 +0200)]
Bump MRI upstreams

Adopt following versions:
- odlparent-8.1.4
- infrautils-1.9.10
- yangtools-6.0.8
- mdsal-7.0.8
- controller-3.0.12
- aaa-0.13.7

Change-Id: I60dd18eb02a97a21a69055fe5e13d44dc6d30f0b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse simple concat in createParsingException() 96/97796/1
Robert Varga [Wed, 6 Oct 2021 11:33:14 +0000 (13:33 +0200)]
Use simple concat in createParsingException()

String.format() is wasteful as we can use JEP280 to make things
a lot more performant.

Change-Id: Iab3d462b7133e656d30e50c6a08f58e798fa4b9f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove YangInstanceIdentifierDeserializer.checkValid() 90/97790/4
Robert Varga [Wed, 6 Oct 2021 08:18:23 +0000 (10:18 +0200)]
Improve YangInstanceIdentifierDeserializer.checkValid()

The current implementation is slow due to always playing with arguments,
even when we do not use them. As it turns out, a bit of restructuring
allows us to make this a lot saner and performant.

Change-Id: Ic5de0d473fe203703470252b32e54b2e3c325f5e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoReduce use of StringModuleInstanceIdentifierCodec 33/97233/1
Robert Varga [Sat, 14 Aug 2021 00:33:45 +0000 (02:33 +0200)]
Reduce use of StringModuleInstanceIdentifierCodec

JsonPatchBodyReader internally does not really need the entire codec,
just the underlying DataSchemaContextTree.

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

2 years agoFix patch target parsing 32/97232/1
Robert Varga [Fri, 13 Aug 2021 20:28:24 +0000 (22:28 +0200)]
Fix patch target parsing

Our tests were not updated for RFC8040, hence they are written with
weird codecs which utterly do not match RFC8072 definition of
yang-patch.

The problem is that patch edit's target is interpreted in terms of an
extension to the URL, i.e. it does NOT follow JSON nor XML parsing
rules, nor is it anything in-between -- we must use ParserIdentifier's
facilities.

Update the parsers and the test suites, ditching a lot of complexity
in process of doing so.

JIRA: NETCONF-804
Change-Id: If9d9c77e0e2397ffdcb8e8c0f0fef0b9b02bac8b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 845f511527e22741a1cf1053b04250d16bf7f6a0)

2 years agoFix XmlPatchBodyReader revision handling 31/97231/1
Robert Varga [Fri, 13 Aug 2021 20:14:41 +0000 (22:14 +0200)]
Fix XmlPatchBodyReader revision handling

There is a nullness bug around the conversions through string and
calling Revision.of(). Our current interfaces allow us to do better,
with fewer objects.

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

2 years agoLower codec instantiation scope 30/97230/1
Robert Varga [Fri, 13 Aug 2021 19:59:42 +0000 (21:59 +0200)]
Lower codec instantiation scope

Do not instantiate codec until we really need it. This also
short-circuits some of the other setup code.

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

2 years agoCleanup StringModuleInstanceIdentifierCodec a bit 29/97229/1
Robert Varga [Fri, 13 Aug 2021 19:25:23 +0000 (21:25 +0200)]
Cleanup StringModuleInstanceIdentifierCodec a bit

Compact the implementation a bit by reusing code paths. Also we do not
really allow null defaultPrefix, but check for it being empty.

Make this.defaultPrefix nullable, which allows us to simplify the check
in moduleForPrefix() down to a simple null check.

JIRA: NETCONF-804
Change-Id: Ifa01017613761466a32e371d56b0bb6521145115
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 63eba7f355bacfe2aa1f20112cf2a7f98bd2928c)

2 years agoCleanup ObjectCodec a bit 28/97228/1
Robert Varga [Fri, 13 Aug 2021 19:33:58 +0000 (21:33 +0200)]
Cleanup ObjectCodec a bit

Use a return expression and do not use the useless this.obviously
field references.

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

2 years agoReport bad document on empty body 04/97204/1
Robert Varga [Fri, 13 Aug 2021 14:00:38 +0000 (16:00 +0200)]
Report bad document on empty body

If we do not get a PatchContext report a 400 bad request instead
of 500 server failure.

JIRA: NETCONF-803
Change-Id: Ic314273cfa6074da16cf0b9182c94641358ccf38
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 3467bab21a5a061fe00e4f5cb9826da4e60d8e53)

2 years agoBump versions to 1.13.5-SNAPSHOT 73/97173/1
Robert Varga [Wed, 11 Aug 2021 18:32:29 +0000 (20:32 +0200)]
Bump versions to 1.13.5-SNAPSHOT

This starts the next development iteration.

Change-Id: I64767325a405d2d718f0511d95350e11edbd212f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump upstreams 72/97172/1
Robert Varga [Wed, 11 Aug 2021 18:30:58 +0000 (20:30 +0200)]
Bump upstreams

mdsal-7.0.9
controller-3.0.10
aaa-0.13.5

Change-Id: I79f248eeaee7c02ab566b2ce05e11fd905979ce7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoReport data-missing when an invalid stream is requested 43/97143/1
Robert Varga [Wed, 11 Aug 2021 13:41:54 +0000 (15:41 +0200)]
Report data-missing when an invalid stream is requested

We should not be throwing a random IAE, but rather use a
RestconfDocumentedException to report the correct status.

JIRA: NETCONF-802
Change-Id: I4ac0a24f0acb059f08d14ab0abd4021e91b0d07b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 587da7df15b8d971bb434a5e96023cb982b09939)

2 years agoDo not use YIID parser for writing 33/97133/1
Robert Varga [Mon, 31 May 2021 11:43:14 +0000 (13:43 +0200)]
Do not use YIID parser for writing

We are using instance identifier parser in contexts which have
a fixed structure. Use a simple YangInstanceIdentifier factory
instead.

JIRA: NETCONF-726
JIRA: NETCONF-800
Change-Id: Idff625265f5240e8331a7eb289b3098916d10c98
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 4eba0cde9be1d0767679bd365a8de27844c50554)

2 years agoClose transaction chain on failures 27/97127/1
Robert Varga [Tue, 10 Aug 2021 12:37:02 +0000 (14:37 +0200)]
Close transaction chain on failures

If the transaction fails we end fail to close it. Fix it by using
try-with-resources.

Change-Id: I863c40903c3dba16b661aff1bda6459ba23c0997
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse well-known Status enumeration 10/97110/2
Robert Varga [Mon, 9 Aug 2021 13:08:01 +0000 (15:08 +0200)]
Use well-known Status enumeration

Response.status() can be used with an int, but that ends up walking all
Status.values() in an attempt to find the corresponding constant. While
we end up hitting the first element, use Status.OK explicitly to speed
things up a bit.

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

2 years agoDo not report failure on empty action output 09/97109/2
PeterSuna [Tue, 27 Jul 2021 12:47:11 +0000 (14:47 +0200)]
Do not report failure on empty action output

When an action invocation results in an empty container
we should be emitting a normal 204 response, not go through
the error path -- as per RFC8040 section 6.3.

JIRA: NETCONF-799
Change-Id: Ie8f3d098fc65828998b088bfed5ca89e2f438828
Signed-off-by: PeterSuna <Peter.Suna@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 916a6a5cb7e3ac5148f9cf6bb1a24bf7298ea9f6)

2 years agoLog full exception when we are missing errors 75/96975/1
Robert Varga [Tue, 20 Jul 2021 11:09:07 +0000 (13:09 +0200)]
Log full exception when we are missing errors

Our current logging does not identify the source of the offending
exception. Make sure we log the entire input exception, so that
offenders may be fixed up.

JIRA: NETCONF-789
Change-Id: I30a24a615ce221a838e1ad95f6b11263e2d6f8f5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 8dc035c90ba706efceb66ced5fa51408b4c494f9)

2 years agoMake ListenersBroker.getInstance() lockless 18/96618/2
Robert Varga [Thu, 8 Jul 2021 18:55:25 +0000 (20:55 +0200)]
Make ListenersBroker.getInstance() lockless

While this is a huge antipattern in terms of retained global state,
we do not need to bounce a global lock to access it.

Use Initialization-on-demand holder idiom to make the access completely
lockless.

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

2 years agoFix checkArgument() use 17/96617/1
Robert Varga [Thu, 8 Jul 2021 16:59:01 +0000 (18:59 +0200)]
Fix checkArgument() use

We do not want to concat the strings here, use a proper formatting
string -- speeding things up.

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

2 years agoFix field count check 16/96616/1
Robert Varga [Thu, 8 Jul 2021 12:36:52 +0000 (14:36 +0200)]
Fix field count check

This is a simple copy&paste error which slipped past review, fix it up.

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

2 years agoBump versions to 1.13.4-SNAPSHOT 32/96832/1
Robert Varga [Thu, 8 Jul 2021 09:28:57 +0000 (11:28 +0200)]
Bump versions to 1.13.4-SNAPSHOT

This starts the next development iteration.

Change-Id: Ia5c89be62f3d73d1ade397a2fe39e3da4fcb37af
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump MRI upstreams 31/96831/2
Robert Varga [Thu, 8 Jul 2021 07:22:20 +0000 (09:22 +0200)]
Bump MRI upstreams

Adopt following versions:
- odlparent-8.1.3
- infrautils-1.9.8
- yangtools-6.0.7
- mdsal-7.0.8
- controller-3.0.9
- aaa-0.13.4

Change-Id: I4ca6c2cbaf9415b53576638d4168f6c3540a9f92
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUpdate RESTCONF error mapping 09/96709/1
Robert Varga [Fri, 25 Jun 2021 21:26:01 +0000 (23:26 +0200)]
Update RESTCONF error mapping

yang.common.YangError is an attachment used to propagate RFC6020-defined
failure modes enforced by YANG Tools as exceptions. One such example is
YangInvalidValueException, which is reporting YANG constraint
violations.

Recognize these when mapping to RestconfDocumentedException, so that
their error-app-tag and error-message are properly propagated.

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

2 years agoFix multiple keys path in RFC8040 swagger 74/96474/1
Ivan Hrasko [Tue, 15 Jun 2021 07:46:05 +0000 (09:46 +0200)]
Fix multiple keys path in RFC8040 swagger

ListPathBuilder for RFC8040 needs to change its state
when processing multiple keys (= to ,) thus we have
to create it before the iteration over all list keys.

JIRA: NETCONF-708
Change-Id: If617ff1508e63b1001ab7857e3b3fdebff287f74
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit f17385e68a590b369cec43752af7f5b42943908b)

2 years agoHandle NetconfDocumentedExceptions correctly 18/96318/1
Tomas Cere [Tue, 1 Jun 2021 08:41:51 +0000 (10:41 +0200)]
Handle NetconfDocumentedExceptions correctly

These need to be wrapped in TransactionCommitFailedException
so they are handled correctly, so restconf can map these and
return correct status code on failure.

JIRA: NETCONF-777
Change-Id: Id4833bfe46da6f97a216163452dd2a44af599063
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 6003f0788533a61a3e2a0f16dff94f618379677b)

2 years agoReuse MD-SAL transation for existence check 93/96393/2
Robert Varga [Mon, 31 May 2021 10:08:26 +0000 (12:08 +0200)]
Reuse MD-SAL transation for existence check

We should not be allocating a new transaction for the existence
check, but rather reuse the existing transaction.

JIRA: NETCONF-781
Change-Id: I8daca2bda91dfe8e99ef3e29686e10276a77387d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoEnable TCP_NODELAY for SSH client/server 08/96308/1
Robert Varga [Mon, 17 May 2021 15:10:45 +0000 (17:10 +0200)]
Enable TCP_NODELAY for SSH client/server

Both NETCONF northbound (SshProxyServer) and southbound
(AsyncSshHandler) plugins exhibit latencies caused by Nagle's algorithm.
These are superfluous, as we typically work in request-response manner,
with reasonable level of buffering going on in the intermediate layers.

Set TCP_NODELAY flag to get rid of these artifacts.

JIRA: NETCONF-776
Change-Id: I68a87cc2bef4f0032e104833b8d241f5b1f7566b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 726ee92c6052437074062ffe790743eab58de2af)

2 years agoAdd support for RFC8072 media types 87/96287/1
Robert Varga [Thu, 20 May 2021 11:52:41 +0000 (13:52 +0200)]
Add support for RFC8072 media types

The media type assignments have changed in draft-ietf-netconf-yang-patch-09,
make sure we support the new assignements.

JIRA: NETCONF-780
Change-Id: I00484ccf2536c598bca54207154025006742aea8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSwitch to using SseEventSink 81/96281/1
Robert Varga [Mon, 17 May 2021 14:00:42 +0000 (16:00 +0200)]
Switch to using SseEventSink

JAX-RS 2.1 has a standard way of working with SSE, do not use
Jersey-specific APIs (except in test).

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

2 years agoUse MediaType.SERVER_SENT_EVENTS 80/96280/1
Robert Varga [Mon, 17 May 2021 12:47:31 +0000 (14:47 +0200)]
Use MediaType.SERVER_SENT_EVENTS

We are using JAX-RS 2.1, hence we have SSE support built-in. Reduce
dependency surface by using MediaType constant instead of Jersey's
Feature.

JIRA: NETCONF-775
Change-Id: I27338775dd3cd92681a4c1f953f71145100f24ef
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 40ee93670e3e1eba406b2a22cd96de03a0b77dd0)

2 years agoImprove event fragmentation 79/96279/1
Robert Varga [Mon, 17 May 2021 14:03:41 +0000 (16:03 +0200)]
Improve event fragmentation

Rather than instantiating String objects, use StrinBuilder's ability to
append CharSequence parts.

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

2 years agoUse a simple isEmpty() check 78/96278/1
Robert Varga [Wed, 19 May 2021 19:10:44 +0000 (21:10 +0200)]
Use a simple isEmpty() check

Rather than checking size() == 0, use isEmpty(), which is clearer
and potentially fasterUse a simple isEmpty() check

Rather than checking size() == 0, use isEmpty(), which is clearer
and potentially faster.

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

2 years agoDo not use schema-aware builders in RestconfMappingNodeUtil 41/96141/5
Robert Varga [Thu, 13 May 2021 05:22:36 +0000 (07:22 +0200)]
Do not use schema-aware builders in RestconfMappingNodeUtil

These builders are going away as they bring little to the table for the
cost they force upon us.

Change-Id: I2359ab28dd6c3632cd0a4f6eeaadf62af517d72d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUpdate RestconfDataServiceImpl stream lifecycle 57/96157/1
Robert Varga [Thu, 13 May 2021 08:26:21 +0000 (10:26 +0200)]
Update RestconfDataServiceImpl stream lifecycle

This is a follow-up patch to cleanup more checkExist() invocations,
which are no longer needed, as the datastore handles container/list
lifecycle.

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

2 years agoMinimize another set of dependencies 39/96139/2
Robert Varga [Wed, 12 May 2021 22:36:45 +0000 (00:36 +0200)]
Minimize another set of dependencies

MWe are not exposing the repo as part of running contrary to upstream.
Each to their own.

Change-Id: I301ff878ea7f4a1d01ecefbaf3a39804fee3cf13
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 1.13.3-SNAPSHOT 40/96140/1
Robert Varga [Wed, 12 May 2021 22:48:21 +0000 (00:48 +0200)]
Bump versions to 1.13.3-SNAPSHOT

This starts the next development iteration.

Change-Id: Iad0085c6bf0eed251ead9622c4aee4e56ad926db
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdded full YIID to ietf-restconf-monitoring DS 84/83284/23
Jaroslav Tóth [Tue, 16 Jul 2019 11:14:31 +0000 (13:14 +0200)]
Added full YIID to ietf-restconf-monitoring DS

- Currently local-name of the QName is used as key to the list
  of created streams - that is a bug because local-name doesn't
  have to be unique in scope of one module or whole schema context.
- This fix puts the whole serialized YIID to DS as stream name.

JIRA: NETCONF-726
Change-Id: I28012a478b958b933af993c2ede5f91c2eb8e211
Signed-off-by: Jaroslav Tóth <jtoth@frinx.io>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup datastore interactions 35/96135/4
Robert Varga [Wed, 12 May 2021 20:01:05 +0000 (22:01 +0200)]
Cleanup datastore interactions

Datastore handles lifecycle of non-semantic portions, hence we do not
need utterly ugly special-cases dealing with container/list
initialization. This removes a chunk of crud, makes things more
type-safe and more straightforward.

Change-Id: I7fe72a0c37cd0a1ef94f2921fb3c66800eccfa26
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFurther dependency cleanups 38/96138/1
Robert Varga [Wed, 12 May 2021 21:32:14 +0000 (23:32 +0200)]
Further dependency cleanups

We have two other unused dependencies, remove them as well.

Change-Id: I2870ffd2450ce7783609bf58b1b26209adbde0fb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup dependencies a bit 37/96137/1
Robert Varga [Wed, 12 May 2021 21:14:18 +0000 (23:14 +0200)]
Cleanup dependencies a bit

There are a number of unnecessary dependencies we are using, which are
getting flagged by odlparent-9. Clean the most obvious ones, reducing
our footprint.

Change-Id: I0881d82f4928505998254088c4c729057c86bb7d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix infrautils version 36/96136/2
Robert Varga [Wed, 12 May 2021 20:16:28 +0000 (22:16 +0200)]
Fix infrautils version

We have a misaligned version here, make sure it is 1.9.8, as it should
be.

Change-Id: I677f9f0ad89e61e6664bb239e09a844f970e2c8a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUpgrade restconf-nb-rfc8040 to use RFC8525 46/93046/8
Robert Varga [Wed, 14 Oct 2020 10:47:41 +0000 (12:47 +0200)]
Upgrade restconf-nb-rfc8040 to use RFC8525

Ditch the old yang library and just use the new one instead.

JIRA: NETCONF-725
Change-Id: I99c9678146ef58d525dda626087a5e74b0e270e4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse schemaless builders in RestconfMappingNodeUtil 34/96134/1
Robert Varga [Wed, 12 May 2021 18:36:09 +0000 (20:36 +0200)]
Use schemaless builders in RestconfMappingNodeUtil

The code here is extremely flaky, relying very much on declared layout
of ietf-yang-library -- which is utterly wrong, as we should be using
effective model.

Schema-aware builders are going away anyway, so just use normal
builders, forgoing all the unneeded complexity.

JIRA: NETCONF-725
Change-Id: I2454a7872341fb2a977463513a5a1a6a3937c8d1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdded doc for fields filtering 87/95687/4
Jaroslav Tóth [Wed, 7 Apr 2021 06:53:43 +0000 (08:53 +0200)]
Added doc for fields filtering

- User guide - using fields query parameter to leverage NETCONF
  subtree filtering with selected multiple subtrees.
- Developer guide - tutorial for using:
  a. NetconfDOMDataBrokerFieldsExtension
  b. NetconfDataTreeService with added methods

JIRA: NETCONF-735
Change-Id: I8fed93dc45b626ddc99447f0656e671890ad8f17
Signed-off-by: Jaroslav Tóth <jtoth@frinx.io>
2 years agoIntegration of RESTCONF fields to NETCONF filters 90/93390/16
mhurban [Wed, 25 Nov 2020 19:02:01 +0000 (20:02 +0100)]
Integration of RESTCONF fields to NETCONF filters

Added:
- NETCONF subtree filtering aware parser (ParserFieldsParameter)
- check if get request is for mountpoint data (ReadDataTransactionUtil)
- new mountpoint fields parameter (WriterParameters)

JIRA: NETCONF-735
Change-Id: I293993958893df866908fa5f16992bf38bd6b085
Signed-off-by: mhurban <mar.hurban@gmail.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Jaroslav Tóth <jtoth@frinx.io>
2 years agoRework mdsal-netconf-yang-library 31/96131/1
Robert Varga [Wed, 12 May 2021 10:40:38 +0000 (12:40 +0200)]
Rework mdsal-netconf-yang-library

The primary intent here is elimination of blueprint, but while we
are at it, we also remove duplicated code and unify the two exporters
into a single class.

JIRA: NETCONF-770
Change-Id: I70bba28b1776001d6c71e367b10d87d59399c13a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMerge OSGiCredentialServiceAuthProvider 30/96130/1
Robert Varga [Wed, 12 May 2021 09:00:14 +0000 (11:00 +0200)]
Merge OSGiCredentialServiceAuthProvider

We now have OSGi R7, hence we can safely use constructor injection,
eliminating the need for an extra class.

Change-Id: I41a1bc06d6aec1be89979327e9b530952cd673ce
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUpdate testtool arguments 82/95182/13
Illia [Mon, 15 Feb 2021 21:19:41 +0000 (23:19 +0200)]
Update testtool arguments

1. Remove edit-content argument. Instead of using node config template
in form of file node config will be created, modified by corresponding
Java models and than converted to request body string with GSON.
2. Split auth argument to controller-auth-username,
controller-auth-password. Add default value(admin) for them.
3. Split controller-destination argument to controller-ip,
controller-port.

JIRA: NETCONF-758
Change-Id: Iccf19c9482727b88d3f21a85008d13f554a8da08
Signed-off-by: Illia <illia.ihushev@pantheon.tech>
2 years agoAdd GSON models for device registration 77/95177/9
Illia [Mon, 15 Feb 2021 18:03:51 +0000 (20:03 +0200)]
Add GSON models for device registration

Intention is to use the PATCH method for node registration(no matter if
that's a single node registration or multiple nodes).

JIRA: NETCONF-758
Change-Id: Ia624cfe2f953f6f5dc7a4ebd0d7cfbb0c0185f1a
Signed-off-by: Illia <illia.ihushev@pantheon.tech>
2 years agoEndToEnd test tool 35/95335/11
Iaroslav [Wed, 10 Feb 2021 10:31:08 +0000 (12:31 +0200)]
EndToEnd test tool

Added EndToEnd test tool for adding routes to test device using REST.
Part of feature: features-netconf-testing.

Test tool implements endpoint from ncmount.yang, finds device from
provided payload, transforms and sent routes from payload to target device.

Write route processing provides by REST endpoint:
/rests/operations/ncmount:write-routes
with a payload which contains the device name and route.

JIRA: NETCONF-759
Change-Id: Iba141c91a315b3d13d1890b8315dd17bb899cda9
Signed-off-by: Iaroslav <iaroslav.kholiavko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse Optional.isEmpty() 63/95263/3
Jaroslav Tóth [Mon, 22 Feb 2021 08:04:13 +0000 (09:04 +0100)]
Use Optional.isEmpty()

Java 11 introduced Optional.isEmpty(), which allows us to convert
!Optional.isPresent() callsites. Perform this conversion across the
entire repostitory.

Change-Id: I515a550bb6aa56b6d89cea020f5399ca27884833
Signed-off-by: Jaroslav Tóth <jtoth@frinx.io>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse ReadOperations.exists() to check existence 13/96113/1
Robert Varga [Tue, 11 May 2021 11:35:20 +0000 (13:35 +0200)]
Use ReadOperations.exists() to check existence

There is no point transferring all the data, just invoke the exists()
operation instead.

Change-Id: I54db6026ee641703196b6a8120245c4e60a60aa2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMigrate javax.inject artifact references 01/96101/1
Robert Varga [Sun, 9 May 2021 20:25:49 +0000 (22:25 +0200)]
Migrate javax.inject artifact references

We are using GuicedEE instead of the ancient (and broken) javax.inject
jar. Migrate references.

Change-Id: I262c155b97aefced7a834de3db0efd839cf45fbf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMigrate osgi.core references 00/96100/1
Robert Varga [Sun, 9 May 2021 20:24:19 +0000 (22:24 +0200)]
Migrate osgi.core references

OSGi R7's core artifact has been renamed, use that as the dependency.

Change-Id: Idbf50537a9e2f9ea9a486d2bb76f37752caa496e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDeprecate JSONRestconfService 94/96094/1
Robert Varga [Sun, 9 May 2021 08:08:40 +0000 (10:08 +0200)]
Deprecate JSONRestconfService

This service is type-unsafe and does not have users in OpenDaylight
proper. The contract is actively hurtful as it seeks to steer users
towards opaque blobs, not expressing their service and data
dependencies. Furthermore the implementation structure forces an ugly
interface on the actual RESTCONF services, preventing reasonable
refactors.

Deprecate the service for removal, so that we can get rid of this burden
in the next major release.

Change-Id: I96d3fd86ba773fa8986454d1ac4825723b15152d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump MRI upstreams 93/96093/4
Robert Varga [Sun, 9 May 2021 05:47:39 +0000 (07:47 +0200)]
Bump MRI upstreams

Adopt following versions:
- odlparent-8.1.2
- infrautils-1.9.8
- yangtools-6.0.6
- mdsal-7.0.7
- controller-3.0.8
- aaa-0.13.3

Change-Id: Ib48792875c6c54a1f328e466a5de47d7d2af8850
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoUse project.version for all artifact declarations 37/95937/1
Robert Varga [Mon, 26 Apr 2021 11:05:43 +0000 (13:05 +0200)]
Use project.version for all artifact declarations

We have a coordinated version for all artifacts, hence we can use a
simple project.version -- making things a tad more consistent.

Change-Id: I16f07a512bcf2facd33a2272f8397539a9480407
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBinary data shall be emitted in the form of hexa numbers. 60/92760/7
Iaroslav [Tue, 29 Sep 2020 09:05:03 +0000 (12:05 +0300)]
Binary data shall be emitted in the form of hexa numbers.

Added converter character->to HEX in AsyncSshHandlerWriter class logging.

JIRA: NETCONF-135
Change-Id: I462baf94eecbc67221ca349f2b900eedf80ea483
Signed-off-by: Iaroslav <iaroslav.kholiavko@pantheon.tech>
3 years agoStream name should be used instead of BASE_STREAM_NAME 67/92767/10
Iaroslav [Tue, 29 Sep 2020 09:43:41 +0000 (12:43 +0300)]
Stream name should be used instead of BASE_STREAM_NAME

Refactored onNotification method to use stream parameter instead of "BASE_STREAM_NAME".
Fix ConcurrentModificationException while closing listeners/publishers.

JIRA: NETCONF-306
Change-Id: I3f08a294adf53e34c31dd23ca8d9627a46fb585c
Signed-off-by: Iaroslav <iaroslav.kholiavko@pantheon.tech>
Signed-off-by: Vladyslav Marchenko <vladyslav.marchenko@pantheon.tech>
3 years agoReduce memory usage of perf-client 95/95395/7
Iaroslav [Mon, 1 Mar 2021 11:06:02 +0000 (13:06 +0200)]
Reduce memory usage of perf-client

Moved payload creation from test tool start to message send. It will
prevent store huge amount of the objects and reduce memory usage.

JIRA: NETCONF-762
Change-Id: I4932f259391af5770edf8d941f9dc27f022f2277
Signed-off-by: Iaroslav <iaroslav.kholiavko@pantheon.tech>
3 years agoMissing notification model. 84/95284/4
Iaroslav [Mon, 22 Feb 2021 16:33:17 +0000 (18:33 +0200)]
Missing notification model.

In case server provides schema it should check if notifications
supported by the remote session. According to this it should provide schema
with notifications or without.

JIRA: NETCONF-754
Change-Id: Ifc37ebded7051aabf9150f9f49ecadaf81746261
Signed-off-by: Iaroslav <iaroslav.kholiavko@pantheon.tech>
3 years agoBump versions to 1.13.2-SNAPSHOT 25/95425/2
Robert Varga [Mon, 8 Mar 2021 20:24:13 +0000 (21:24 +0100)]
Bump versions to 1.13.2-SNAPSHOT

THis starts the next development iteration.

Change-Id: I49f970edb50f658cc5f1534c09351d9dae584f7a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd diffie-hellman-group14-sha1 to the list of default key exchange algorithms 60/95460/2
Oleksii Mozghovyi [Wed, 10 Mar 2021 10:47:55 +0000 (12:47 +0200)]
Add diffie-hellman-group14-sha1 to the list of default key exchange algorithms

The list of key exchange algorithms enabled by default has been changed
with a Mina SSHD uplift to the version of 2.6.0, leaving some of the
SHA1 algorithms disabled by default. Some the devices might still use
this algorithm, so this change brings back the
'diffie-hellman-group14-sha1' algorithm to the list.

JIRA: NETCONF-765
Change-Id: Iea58448981e19f1632799d05dbda8784415ebf1f
Signed-off-by: Oleksii Mozghovyi <oleksii.mozghovyi@pantheon.tech>
3 years agoFix lock/unlock/commit issues for the NetconfRestconfTransactions 59/95359/26
Oleksii Mozghovyi [Wed, 24 Feb 2021 20:11:04 +0000 (22:11 +0200)]
Fix lock/unlock/commit issues for the NetconfRestconfTransactions

- Fix the problem when one transaction could suddenly remove
configuration-lock created by another one.
- Fix the problem when transaction without successful lock operation
could execute edit-config operations
- Fix the problem when failure to acquire a lock on a candidate could
lead to unexpected unlocking of the running configuration
- Fix the problem when commit didn't take into account results of
previous operations
- Execute operation futures in a chain to guarantee the correct order of
operations inside the transaction
- Fix the problem when commit operation was executed for yang-patch even
if some operations failed (JIRA: NETCONF-746)

JIRA: NETCONF-705
Change-Id: I588c6e2788983aef20b92726463930038abde3c9
Signed-off-by: Oleksii Mozghovyi <oleksii.mozghovyi@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix permanent lock on the running configuration via RESTconf 58/95358/3
Oleksii Mozghovyi [Wed, 24 Feb 2021 21:41:34 +0000 (23:41 +0200)]
Fix permanent lock on the running configuration via RESTconf

This resolves the issue when the NETCONF device with both
:writable-running and :candidate capabilities gets permanently
locked after the commit happens via RESTconf.

JIRA: NETCONF-705
Change-Id: I90c6ec104a9309dd25fc66cd74f469c2f033ee5f
Signed-off-by: Oleksii Mozghovyi <oleksii.mozghovyi@pantheon.tech>
3 years agoBump MRI upstreams 69/95369/1
Robert Varga [Fri, 26 Feb 2021 15:18:30 +0000 (16:18 +0100)]
Bump MRI upstreams

Adopt following versions:
- odlparent-8.1.1
- infrautils-1.9.6
- yangtools-6.0.5
- mdsal-7.0.6
- controller-3.0.7
- aaa-0.13.2

Change-Id: Id8e35132aeb7eb902514e3373ef14c6d2b26cd18
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoUse java.nio.file for file operations 43/95243/3
Robert Varga [Sun, 21 Feb 2021 15:55:05 +0000 (16:55 +0100)]
Use java.nio.file for file operations

java.nio.file is more expressive than java.io.File, use it to
perform reads and atomic renames.

Also clean up constant use and assertions a bit.

JIRA: NETCONF-756
Change-Id: Ia42c61f8cca4253a7db297e188053fcf2b63ec35
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix futures handling in the NetconfRestconfTransaction 27/95327/2
Oleksii Mozghovyi [Tue, 23 Feb 2021 16:06:05 +0000 (18:06 +0200)]
Fix futures handling in the NetconfRestconfTransaction

This change solves the problem when the NetconfDataTreeService.lock()
returns an immutable list of futures, and the NetconfRestconfTransaction
wrapper can't change items on the list.

JIRA: NETCONF-705
Change-Id: Ie98f23382660683e269d3c1cdad6419be72545e5
Signed-off-by: Oleksii Mozghovyi <oleksii.mozghovyi@pantheon.tech>
3 years agoBump versions to 0.13.1-SNAPSHOT 55/95255/1
Robert Varga [Sun, 21 Feb 2021 18:16:42 +0000 (19:16 +0100)]
Bump versions to 0.13.1-SNAPSHOT

This starts the next development iteration.

Change-Id: I0802546c10d5c845869a19bb7b150fe8c823aa21
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd feature-parent 25/83825/17
Robert Varga [Tue, 20 Aug 2019 18:16:15 +0000 (20:16 +0200)]
Add feature-parent

This centralizes a feature-parent pom.xml for reuse in single
feature artifacts.

Change-Id: I7153166a86721dea9d732e5a13174f82865e24c4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump project version 23/83823/13
Robert Varga [Sun, 21 Feb 2021 16:56:25 +0000 (17:56 +0100)]
Bump project version

This bumps project version to 1.13.0-SNAPSHOT in preparation for unifying
artifact versions.

Change-Id: I4a230e8e0cadb23e34ba57ed77c365ae302cea6b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFixed reading whole list/leaf-list using GET/GET-CONFIG RPC 21/94921/7
Jaroslav Tóth [Mon, 25 Jan 2021 15:00:20 +0000 (16:00 +0100)]
Fixed reading whole list/leaf-list using GET/GET-CONFIG RPC

- The source of the issue was in skipping of empty list/leaf-list
  nodes in XMLStreamNormalizedNodeStreamWriter - the NETCONF
  filter structure was created correctly, but it wasn't correctly
  serialized into XML. However, in NETCONF, it is valid to read
  whole list/leaf-list - we must be able to build NormalizedNode
  structure from subtree-filter which "ends" by list/leaf-list.
- Fixed by introduction EmptyListXmlWriter which is responsible
  for serialization of empty list/leaf-list. Other operations
  are delegated to XMLStreamNormalizedNodeStreamWriter
  implementation.

JIRA: NETCONF-744
Change-Id: Id4b665aa45a397ab25a53e12f4eb7c1a6539d428
Signed-off-by: Jaroslav Tóth <jtoth@frinx.io>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdded schemaless creation of filter structure 52/93352/12
Jaroslav Tóth [Sun, 25 Oct 2020 18:31:56 +0000 (19:31 +0100)]
Added schemaless creation of filter structure

- Added procedure for creation of filter structure for schemaless
  mountpoints.
- Added two unit tests that cover most of the cases.

JIRA: NETCONF-735
Change-Id: Ib276ddaf79e5306ff6c2193a03a8b0f57f005991
Signed-off-by: Jaroslav Tóth <jtoth@frinx.io>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoExplicit reading of list keys using subtree filtering 51/93351/12
Jaroslav Tóth [Sun, 25 Oct 2020 07:43:08 +0000 (08:43 +0100)]
Explicit reading of list keys using subtree filtering

- According to RFC-6241, section 6.2.5, NETCONF server doesn't
  have to provide values of list keys, if NETCONF client doesn't
  ask for these fields; see following statement:

  o  If any sibling nodes of the selection node are instance
     identifier components for a conceptual data structure (e.g.,
     list key leaf), then they MAY also be included
     in the filter output.

JIRA: NETCONF-735
Change-Id: I9bb048010578fd89190f616664e2175c3d3326ae
Signed-off-by: Jaroslav Tóth <jtoth@frinx.io>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoImplement subtree filtering using fields 54/93154/19
Jaroslav Tóth [Mon, 19 Oct 2020 07:28:13 +0000 (09:28 +0200)]
Implement subtree filtering using fields

- Fields are used for selection of specific subtrees under
  parent path - this way it is possible to limit requested
  data to specific entities without the necessity to send
  multiple get/get-config RPCs.
- Look at added unit tests to understand the functionality.

JIRA: NETCONF-735
Change-Id: I17cd364e11f8c8e61e5537fcff71a7ecedefdba3
Signed-off-by: Jaroslav Tóth <jtoth@frinx.io>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFile should be closed before rename 06/95106/10
Iaroslav [Wed, 10 Feb 2021 09:47:03 +0000 (11:47 +0200)]
File should be closed before rename

Rename file will make clone of file with new name and remove initial
file. This file not closed while removing so it will make impossible
file deletion on Windows due to default locking.

JIRA: NETCONF-756
Change-Id: I0f81507285811607a7ee8d40c0b50018603dd557
Signed-off-by: Iaroslav Kholiavko <iaroslav.kholiavko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd tool to measure southbound notification performance 15/94915/7
Oleksii Mozghovyi [Wed, 27 Jan 2021 12:37:19 +0000 (14:37 +0200)]
Add tool to measure southbound notification performance

This is an updated version of the tool existed in coretutorials project,
aligned with the latest API changes
- Tool is packaged into a new feature odl-netconf-test-tools
- For the testing purposes models from the original coretutorials
project are used
- Tool listens for mounted devices with prefix "perf-"
- Notification counter is only applied for devices that end with the following
pattern '*-notif-([0-9]+)', and the number after notif suffix indicates
how many notifications should be counted
- Once the mounted device is ready tool invokes create subscription
  request towards device, and counts incoming notifications

JIRA: NETCONF-759
Change-Id: I5a584032dca9a40e90dec23186562543f8752bad
Signed-off-by: Oleksii Mozghovyi <oleksii.mozghovyi@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoUpgrade sshd to 2.6.0 64/94964/8
Iaroslav [Tue, 2 Feb 2021 14:31:46 +0000 (16:31 +0200)]
Upgrade sshd to 2.6.0

Upgrade sshd to version 2.6.0

JIRA: NETCONF-752
Change-Id: Iaf6fd1ab232458aeb58636590bc84d3d8d2036f6
Signed-off-by: Iaroslav <iaroslav.kholiavko@pantheon.tech>