netconf.git
17 months agoRelease netconf v3.0.7
jenkins-releng [Thu, 3 Nov 2022 01:49:57 +0000 (01:49 +0000)]
Release netconf

17 months agoBump sshd to 2.9.1 25/103025/1
Robert Varga [Fri, 29 Jul 2022 11:23:16 +0000 (13:23 +0200)]
Bump sshd to 2.9.1

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

JIRA: NETCONF-894
Change-Id: I54ecf8d02d4adfea742ce47ac6e164b1df2f6615
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 05b961d762dcf1d101d82f60ac89b99e6c802bf6)

17 months agoUse property setters 24/103024/1
Robert Varga [Wed, 2 Nov 2022 12:23:54 +0000 (13:23 +0100)]
Use property setters

SSHD configuration properties can be nicely set via a type-safe system,
make sure we use that instead of mucking with maps directly.

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

17 months agoFix mdsal-netconf-ssh shutdown 41/102641/1
Ivan Hrasko [Fri, 7 Oct 2022 18:32:15 +0000 (20:32 +0200)]
Fix mdsal-netconf-ssh shutdown

Initialize AsynchronousChannelGroup thread pool with
ForwardingExecutorService with NO-OP shutdown method
in order to prevent throwing UnsupportedOperationException
from OSGiGlobalEventExecutor.

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

17 months agoBump upstream versions 60/102960/2
Robert Varga [Sat, 29 Oct 2022 19:35:57 +0000 (21:35 +0200)]
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: I33db276d6c15b926cfda33bfc868905c311b420b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
17 months agoBump org.json/json to 20220924 13/102913/1
Robert Varga [Fri, 28 Oct 2022 09:14:10 +0000 (11:14 +0200)]
Bump org.json/json to 20220924

This version is in public domain, resolving potential licensing issues
around "do no evil" restriction. Also update other testing frameworks.

Change-Id: I55c4ba72c53bad8a33ba42c712db84e8bfece57c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
17 months agoRemove explicit org.json from feature 12/102912/1
Robert Varga [Fri, 28 Oct 2022 09:07:54 +0000 (11:07 +0200)]
Remove explicit org.json from feature

The package will be pulled in as needed, there is no point in mentioning
it separately.

Change-Id: I988db3fa3ce42f055ff151e9888811da2a19678e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
17 months agoFix docgen failure on multi-level choice definition 76/102876/1
Robert Varga [Mon, 24 Oct 2022 19:55:19 +0000 (21:55 +0200)]
Fix docgen failure on multi-level choice definition

+ minor refactoring: duplicate code replaced with recursive function

JIRA: NETCONF-883
Change-Id: Ie577f930fe7fc104bc92a93286a2788b93c04ac6
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 402b85932413b91a7dd16efce6d566a580f1e1eb)

18 months agoRemove OSGiBaseNetconfSchemas 74/102774/2
Robert Varga [Wed, 19 Oct 2022 11:47:15 +0000 (13:47 +0200)]
Remove OSGiBaseNetconfSchemas

We have constructor injection and therefore can easily reuse
DefaultBaseNetconfSchemas in OSGi environment as well.

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

18 months agoTie together model namespace 73/102773/2
Robert Varga [Tue, 18 Oct 2022 17:40:39 +0000 (19:40 +0200)]
Tie together model namespace

We have a well-known constant at the ready which defines the model
revision we are bound to. Cross reference to ensure things work out
okay.

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

18 months agoReplace replaceHelloMessageOutboundHandler() 72/102772/2
Robert Varga [Tue, 18 Oct 2022 21:07:52 +0000 (23:07 +0200)]
Replace replaceHelloMessageOutboundHandler()

This is a utility method to manipulate pipeline, with a single caller.
Inline the method so the manipulations are clearly visible.

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

18 months agoSimplify error checking in writeWithPendingDetection() 71/102771/2
Robert Varga [Tue, 18 Oct 2022 21:33:28 +0000 (23:33 +0200)]
Simplify error checking in writeWithPendingDetection()

We are only interested in seeing the failure, as we are guarateed to see
a completed future.

JIRA: NETCONF-905
Change-Id: I3fa0236592ff785be49e0cb69a20d7c08b9432e9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 7f08b1035520fcc0f60ab6c6ab6536366510a45f)

18 months agoIgnore incoming messages in State.FAILED 70/102770/2
Robert Varga [Tue, 18 Oct 2022 23:45:41 +0000 (01:45 +0200)]
Ignore incoming messages in State.FAILED

Once we transition to FAILED state, we should not process any other
messages, as we just waiting for close() to complete.

JIRA: NETCONF-905
Change-Id: Id7d7f657e50bb7c7ad25c1445fa0b69e1e57cdb9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 06c94657833f0ed7110a40af31af20f869cca19d)

18 months agoCheck for early message send failures 69/102769/2
Robert Varga [Tue, 18 Oct 2022 19:37:29 +0000 (21:37 +0200)]
Check for early message send failures

The transition to start session negotiation does not truly start if we
fail to send the hello message. Check for this condition before
manipulating any other channel state.

JIRA: NETCONF-905
Change-Id: I024a39abc8c6219019531c2abedaf124a25b3f27
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 815f175ed380271ef32d04bf223f4a1b2a70bcb1)

18 months agoClean up netconf-client tests 68/102768/2
Robert Varga [Tue, 18 Oct 2022 20:23:01 +0000 (22:23 +0200)]
Clean up netconf-client tests

Remove unneeded throws declarations and do not use mockito internals.

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

18 months agoSequence state transitions during negotiation start 67/102767/2
Robert Varga [Tue, 18 Oct 2022 19:27:51 +0000 (21:27 +0200)]
Sequence state transitions during negotiation start

If we fail to write out the initial proposal, we will end up running
listener actions before other negotiation start transitions -- hence
messing up our state.

Inline sendMessage() and dispatch the listener as a last operation of
start().

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

18 months agoSimplify isStateChangePermitted() 66/102766/1
Robert Varga [Wed, 19 Oct 2022 00:01:35 +0000 (02:01 +0200)]
Simplify isStateChangePermitted()

We have a duplicate check of old state value, merge two 'if' statements
together.

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

18 months agoClean up netconf-api tests 65/102765/1
Robert Varga [Tue, 18 Oct 2022 20:16:48 +0000 (22:16 +0200)]
Clean up netconf-api tests

Remove unneeded throws declaration, @Before instantiation and use of
mockito internals.

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

18 months agoUse Future.cause() for error checking 64/102764/1
Robert Varga [Tue, 18 Oct 2022 18:59:34 +0000 (20:59 +0200)]
Use Future.cause() for error checking

Include error trace when terminating session.

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

18 months agoUse a simple future 63/102763/1
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>
(cherry picked from commit bebb527a997ac93766c4639c9ee04c2ac7b2995b)

18 months agoUse Future.cause() for completion checking 62/102762/1
Robert Varga [Tue, 18 Oct 2022 18:45:14 +0000 (20:45 +0200)]
Use Future.cause() for completion checking

We know the future has completed, hence nullability of Future.cause()
is a quicker check for success.

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

18 months agoCheck disconnected flag on each operation 31/102631/1
Robert Varga [Tue, 18 Oct 2022 14:44:39 +0000 (16:44 +0200)]
Check disconnected flag on each operation

We are performing a staggered setup during which we may encounter an
asynchronous disconnect. We have an atomic flag guarding this, which is
always flipped before disconnect enters critical region.

Check the flag at each synchronized connect stage and abort connection
if it is observed as flipped -- ensuring we cannot accidentally signal
channel activation after the channel has been close()d.

Also ditch the AtomicBoolean and instead use a simple VarHandle, saving
a few bytes of overhead.

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

18 months agoRun AsyncSshHandler.onOpenComplete() on event loop 37/102737/1
Robert Varga [Tue, 18 Oct 2022 11:24:39 +0000 (13:24 +0200)]
Run AsyncSshHandler.onOpenComplete() on event loop

onOpenComplete() runs ctx.fireChannelActive(), which in turn talks to
other handlers. Netty silently delays the invocation if it is called
from a different thread.

Make sure we run onOpenComplete() on the appropriate executor, so that
the state transition and handler updates run synchronously.

JIRA: NETCONF-905
Change-Id: Id8c2f4cb1e045d5d5bb446801deec341ccb27e87
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 5038dde5cdb878badaa4328e3956409917f1eaf4)

18 months agoRework AsyncSshHandler callback locking 36/102736/1
Robert Varga [Tue, 18 Oct 2022 09:15:33 +0000 (11:15 +0200)]
Rework AsyncSshHandler callback locking

We have top-half and bottom-half dispatch going on here, with both paths
acquiring the object lock. Unify callbacks and lock object before
deciding which path to take.

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

18 months agoRun safelyDisconnect() on event loop 35/102735/1
Robert Varga [Tue, 18 Oct 2022 09:10:15 +0000 (11:10 +0200)]
Run safelyDisconnect() on event loop

The disconnect() operation needs to inform handlers of state
transitions, which should not be delayed. Netty provides indirects these
calls silently on thread mismatch, which we do not want.

Make sure to schedule safelyDisconnect() on the event loop, so that that
it cannot run concurrently with other channel tasks.

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

18 months agoRename AsyncSshHandler.handleSshSetupFailure() 34/102734/1
Robert Varga [Tue, 18 Oct 2022 09:02:06 +0000 (11:02 +0200)]
Rename AsyncSshHandler.handleSshSetupFailure()

Rename this method to onOpenFailure() and move it to a more appropriate
place.

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

18 months agoRemove AsyncSshHandler.handleSshChanelOpened() 33/102733/1
Robert Varga [Tue, 18 Oct 2022 08:58:35 +0000 (10:58 +0200)]
Remove AsyncSshHandler.handleSshChanelOpened()

This is the locked bottom of onOpenComplete(), rename it and co-locate
it with its sole caller, making the code progression linear.

JIRA: NETCONF-905
Change-Id: I5a8fba44767535fb1e59bf48e3f4a422c0db3b59
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 2610ec1df534fed79964b764dba8a656ae950aee)

18 months agoRemove AsyncSshHandler.handleSshAuthenticated() 32/102732/1
Robert Varga [Tue, 18 Oct 2022 08:55:29 +0000 (10:55 +0200)]
Remove AsyncSshHandler.handleSshAuthenticated()

This method is the locked bottom of onAuthComplete(), rename it and
split out onOpenComplete(), making the flow more linear. Also switch
to use getException() to discern success/failure, fixing up badly-named
mocks.

JIRA: NETCONF-905
Change-Id: I7a0c20b872b19b66e99144d0ce83636d6b4cd400
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 6de37782ed59747d2ad803e3b9836f6ed25d6986)

18 months agoRemove AsyncSshHandler.handleSshSessionCreated() 31/102731/1
Robert Varga [Tue, 18 Oct 2022 08:44:52 +0000 (10:44 +0200)]
Remove AsyncSshHandler.handleSshSessionCreated()

This method is the synchronized part of onConnectComplete(), move it
closer to its source and split out onAuthComplete(). Also switch to
using getException() to check for success/failure.

JIRA: NETCONF-905
Change-Id: Ic8a49491afa92d68cb0585538a3fc9ffb044e9cb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 811508380706eea604bab58f3725bc9bf64790aa)

18 months agoAdd AsyncSshHandler.onConnectComplete() 30/102730/1
Robert Varga [Tue, 18 Oct 2022 08:27:19 +0000 (10:27 +0200)]
Add AsyncSshHandler.onConnectComplete()

Rather than using an anonymous listener, document the lifecycle event,
allowing us to refactor locking and extraction in the future. Also use
getException() to check for success.

JIRA: NETCONF-905
Change-Id: I8569ca007aefad634aff54294b475e565ac4f669
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 9b3050377a785f809f71dd6722a596e2fdbc4c65)

18 months agoInline AsyncSshHandler.startSsh() 29/102729/1
Robert Varga [Mon, 17 Oct 2022 18:51:13 +0000 (20:51 +0200)]
Inline AsyncSshHandler.startSsh()

There is just no reason to have this method split out, inline it to its
sole user -- which is making interactions a bit clearer. We also see
that there is a blocking call, holding up the caller until the
connection succeeds.

JIRA: NETCONF-905
Change-Id: Iae781a743e670498c9329162bb05a7475f32d370
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 350a98cd443038597784197888d664f7e0dca9f8)

18 months agoGuard connectPromise not being null 28/102728/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>
(cherry picked from commit eaace15120044a3e602fd3093b2412be03fd2133)

18 months agoFix a raw type warning 27/102727/1
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>
(cherry picked from commit 6e662cfa5ed236a16ae47e4917fe6f847e0a9598)

18 months agoMove logging out of try/catch block 26/102726/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>
(cherry picked from commit 22755ee880d798830f42cc0d60e84c8602fe3794)

18 months agoExpire negotiation on event loop 68/102668/1
Robert Varga [Wed, 12 Oct 2022 11:54:06 +0000 (13:54 +0200)]
Expire negotiation on event loop

Rather than having to completely synchronize state transitions, make
sure we run expiry on the event loop.

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

18 months agoDo not use Optional for SslHandler 67/102667/1
Robert Varga [Wed, 12 Oct 2022 09:50:31 +0000 (11:50 +0200)]
Do not use Optional for SslHandler

Use a simple @Nullable return instead wrapping and unwrapping it again.

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

19 months agoBump jquery to 3.6.1 72/102272/1
Robert Varga [Mon, 12 Sep 2022 13:31:28 +0000 (15:31 +0200)]
Bump jquery to 3.6.1

https://blog.jquery.com/2022/08/26/jquery-3-6-1-maintenance-release/

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

19 months agoBump versions to 3.0.7-SNAPSHOT 08/102208/2
Robert Varga [Mon, 22 Aug 2022 15:44:15 +0000 (17:44 +0200)]
Bump versions to 3.0.7-SNAPSHOT

This starts the next development iteration.

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