netconf.git
4 years agoReuse SchemaContext.NAME for base NETCONF data qname 13/89213/1
Robert Varga [Tue, 21 Apr 2020 08:46:50 +0000 (10:46 +0200)]
Reuse SchemaContext.NAME for base NETCONF data qname

This QName is a well-known constant available from SchemaContext,
do not use scattered definition.

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

4 years agoAdd a dedicated AuthenticationFailedException 64/89164/1
Robert Varga [Sun, 19 Apr 2020 11:18:47 +0000 (13:18 +0200)]
Add a dedicated AuthenticationFailedException

When we have a failure to authenticate, we want the client to be
able to discern this state.

Add a dedicated exception and report it instead of straight
exception from SSH (which may be anything) or a generic ISE.

JIRA: NETCONF-665
Change-Id: I1f113d5aaff6bf4482d9725adaa06b5d2479304c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 027c3087a288cc7291cdfe265711dfaaa907bf9b)

4 years agoFix defensive subscriber removal 89/88989/4
wsx25289 [Thu, 9 Apr 2020 07:29:44 +0000 (03:29 -0400)]
Fix defensive subscriber removal

Attempting to modify the collection while iterating over it
results in ConcurrentModificationException. Use an explicit
iterator and Iterator.remove() to prevent it.

JIRA: NETCONF-664
Change-Id: I6206dfdd896307f83420cfb3201d1125adbf9a07
Signed-off-by: Wsx25289 <10200860@zte.com.cn>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFiles should not be executable 62/89162/1
Robert Varga [Sun, 19 Apr 2020 13:32:33 +0000 (15:32 +0200)]
Files should not be executable

We do not want these to be executable, drop those permissions.

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

4 years agoDo not consider query depth in initial namespace 90/87390/4
wsx25289 [Mon, 3 Feb 2020 10:57:49 +0000 (05:57 -0500)]
Do not consider query depth in initial namespace

Initial namespace is independent of the maximum depth requested
by the user. This is a mixup with path depth introduced in the
previous fix for NETCONF-497.

Change-Id: I90fdcc60b2be0891082333490d77d681ecc4fc4a
Signed-off-by: Wsx25289 <10200860@zte.com.cn>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix default value check 22/88922/2
Magic_J [Mon, 9 Apr 2018 06:17:44 +0000 (14:17 +0800)]
Fix default value check

TypeDefinition.getDefaultValue() is returning an optional, which
results in it always being non-null. Fix the check for nullness
and make sure we use the correct value.

Change-Id: Id5aba6cd215d4e19f8b583a81e5599daa9bbe12d
Signed-off-by: Magic_J <panda.magic.j@gmail.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove references to sal-common-impl 35/88935/1
Robert Varga [Mon, 6 Apr 2020 11:25:15 +0000 (13:25 +0200)]
Remove references to sal-common-impl

We do not need anything from sal-common-impl, remove references
to it.

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

4 years agoMigrate Compendium reference 89/88789/1
Robert Varga [Mon, 6 Apr 2020 10:29:30 +0000 (12:29 +0200)]
Migrate Compendium reference

We are using OSGi R6, migrate the artifact reference.

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

4 years agoBring doc building up to python3 25/88625/1
Jamo Luhrsen [Wed, 26 Feb 2020 00:52:08 +0000 (16:52 -0800)]
Bring doc building up to python3

looks like readthedocs builds have been failing for a while
because python2 can't find some version of sphinx that is
now required by lfdocs-conf. Maybe an older version of
sphinx would still work, but it's time to catch up to
python3 anyway.

integration/test just added this same .readthedocs.yml
file which finally got it's rtd build to work after
having unknowingly been failing for a month:

https://git.opendaylight.org/gerrit/c/integration/test/+/88064
https://readthedocs.org/projects/odl-integrationtest/builds/?page=1

and netconf has been in the same boat:
https://readthedocs.org/projects/odl-netconf/builds/?page=1

Signed-off-by: Jamo Luhrsen <jluhrsen@gmail.com>
Change-Id: I63c01d8d9805ee492ebeb4d1b65723ab8a2d59b9
(cherry picked from commit bca11c23ab24a7119a3972e4629f46e9e0565abd)

4 years agoBump odlparent/yangtools/mdsal to 5.0.6/3.0.10/4.0.13 51/88351/4
Robert Varga [Sat, 7 Mar 2020 07:53:52 +0000 (08:53 +0100)]
Bump odlparent/yangtools/mdsal to 5.0.6/3.0.10/4.0.13

This picks up latest upgrades, which necessitate a few fixes for
checkstyle violations.

Change-Id: I8e23365e32756793d7a17225c46f7bde79858fbe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoNETCONF-125 connection timeout and between timeout are fixed 96/88296/1
Sarguna Dharani [Mon, 10 Feb 2020 11:55:44 +0000 (17:25 +0530)]
NETCONF-125 connection timeout and between timeout are fixed

Signed-off-by: Sarguna Dharani <sarguna.dharani@verizon.com>
Change-Id: I56275dfa10dcfd4ed1a30fbb6c34169e301269db
(cherry picked from commit fe5d5bcfdc2dff7c6fe83e1c6b7dbb69d386f06c)
(cherry picked from commit 14a729f9688c77c6163fc44ee830e425d432e0e8)

4 years agoRemove unneeded override 50/88350/1
Robert Varga [Sat, 7 Mar 2020 07:52:55 +0000 (08:52 +0100)]
Remove unneeded override

We have versions correctly propagated out of odlparent, make sure
to not override them.

Change-Id: Ib2b0dcfbee8e78f280bef53503225b10d26a2474
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoReject multiple sessions with the same host key 45/88245/1
Manoj Chokka [Mon, 10 Feb 2020 18:15:34 +0000 (23:45 +0530)]
Reject multiple sessions with the same host key

SSH host key is supposed to be unique among devices. If there is an
attempt to establish a session with the same key, terminate the new
session.

Since that rules out the possibility of multiple remotes for a key,
refactor the code to use a ConcurrentMap instead of a Multimap --
removing the need for any locking.

As we really want to use CallHomeProtocolSessionContext in logging,
make it implement a toString() method and clean it up a bit.

JIRA: NETCONF-653
Change-Id: I2d78b9aa34ee4b16d0c6d2ed2ac172942c575851
Signed-off-by: Manoj Chokka <manoj.chokka@verizon.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 547c1ddb9d8794c4cd40b16a88a28e337dfb7730)

4 years agoDo not attempt to parse empty RPC/action reply 72/87972/3
Sanjana B [Mon, 10 Feb 2020 11:26:59 +0000 (16:56 +0530)]
Do not attempt to parse empty RPC/action reply

An RPC or action can legally result in an empty reply,
even if it has some optional content in its schema.

Detect </ok> reply and do not attempt to parse it as
YANG data.

JIRA: NETCONF-568
JIRA: NETCONF-644
Change-Id: I1f0b5c349f418824b9b0b3e1f01f16824b1b8df4
Signed-off-by: Anna Bencurova <Anna.Bencurova@pantheon.tech>
Signed-off-by: Sanjana B <sanjana.b@verizon.com>
Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
(cherry picked from commit df25a540e0985695d3d0f93c68a977a4de729329)

4 years agoAdd option to provide custom SshClient for netconf-client 70/87970/1
Tibor Král [Mon, 24 Feb 2020 15:28:11 +0000 (16:28 +0100)]
Add option to provide custom SshClient for netconf-client

When creating netconf-client the DEFAULT SshClient is
used on the background by the AsyncSshHandler. This adds
the option to provide custom SshClient to be used instead.

JIRA: NETCONF-641
Change-Id: I99b1c2e882353732a2e55d0523ee6adbd1ca8cc0
Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 995f11a17da91d69a4c6650016ff4b6afafc1259)

4 years agoCustom scheme-cache-directory yang models are not replicated among 93/83593/2
Jakub Toth [Thu, 8 Aug 2019 12:15:17 +0000 (08:15 -0400)]
Custom scheme-cache-directory yang models are not replicated among
cluster members

The problem was talking about the MissingSchemaSources, where in
the master wasn't setup schema repo & schema registry correctly
based on the data from NetconfNode (from NetconfTopologySetup).
Espacially if the node was using the specific schema cache directory.
According to, slaves were trying to ask the master for sources
(YangTextSchemaSource). In this way, master was trying to resolve
sources from the empty schema repo and it was failing there.

JIRA: NETCONF-610
Change-Id: I84290c085b8a54a9758a85b68113c18aee284a1c
Signed-off-by: Jakub Toth <jtoth@luminanetworks.com>
(cherry picked from commit 7506ce46c6c1045d98fa3bef735e60649dabc009)

4 years agoBump versions by x.y.(z+1) 03/87603/1
jenkins-releng [Wed, 12 Feb 2020 02:32:15 +0000 (02:32 +0000)]
Bump versions by x.y.(z+1)

Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Change-Id: I811781c49c71b9158d573c3c3e35c2bd1f5237aa

4 years agoFixed wrong exception types 29/87129/1
Jaroslav Tóth [Mon, 12 Aug 2019 14:38:38 +0000 (16:38 +0200)]
Fixed wrong exception types

- After implementation of exception mapper we can throw on error
  events RestconfDocumentedException that will be automatically
  mapped to response errors container.
- This patch changes IAE or NPE during serialization/deserialition
  of instance identifier to right RDE types - HTTP method invoked
  on non-existing/malformed IID will lead to returned errors
  container (compliancy against spec.) and not status code 500
  without any description.

Change-Id: I0982e89b90d4a254656b2b9dcdab87fcbb4a8103
Signed-off-by: Jaroslav Tóth <jtoth@frinx.io>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit d30aa7c5024c62e90cac699d1d243940cb3f0ded)

4 years agoBump to odlparent-5.0.5/yangtools-3.0.9/mdsal-4.0.11 27/86927/5
Robert Varga [Wed, 15 Jan 2020 13:22:35 +0000 (14:22 +0100)]
Bump to odlparent-5.0.5/yangtools-3.0.9/mdsal-4.0.11

Pick up latest fixes.

Change-Id: I47616137b95c16c497cee6df963a437378b4bd91
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd namespace to action request XML 12/86812/1
Anna Bencurova [Wed, 8 Jan 2020 14:33:05 +0000 (15:33 +0100)]
Add namespace to action request XML

JIRA: NETCONF-652
Change-Id: I7a7b52d6db821f82995432c3f75ba24fe8e86067
Signed-off-by: Anna Bencurova <Anna.Bencurova@pantheon.tech>
(cherry picked from commit 5c1a60c355f60de1d5473a83989bb38151bffce4)

4 years agoRemove jsr173-ri from dependencies 86/86486/2
Robert Varga [Wed, 18 Dec 2019 14:36:17 +0000 (15:36 +0100)]
Remove jsr173-ri from dependencies

JSR173 is part of JRE, hence there is no point to inherit this
dependency. It also helps to have our releases consumable from
Central (which does not carry the .jar).

Change-Id: Iba78f955c8da0b9f0f49ebfa7893094ce8f6931c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove websocket-server override 87/86487/1
Robert Varga [Wed, 18 Dec 2019 14:35:20 +0000 (15:35 +0100)]
Remove websocket-server override

odlparent-5.0.4 is providing this declaration, remote it.

Change-Id: Id90d9b07031263d966a17e00e03f7d71b501044c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump odlparent/yangtools/mdsal to 5.0.4/3.0.7/4.0.8 87/86387/1
Robert Varga [Thu, 12 Dec 2019 07:31:45 +0000 (08:31 +0100)]
Bump odlparent/yangtools/mdsal to 5.0.4/3.0.7/4.0.8

Pick up the latest upgrades and fixes.

Change-Id: If96deb06f325f9a9ec417442eec3360c27931f63
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump to odlparent-5.0.3/yangtools-3.0.6/mdsal-4.0.7 13/85513/6
Robert Varga [Sun, 3 Nov 2019 07:45:24 +0000 (08:45 +0100)]
Bump to odlparent-5.0.3/yangtools-3.0.6/mdsal-4.0.7

This picks up latest upgrades and fixes.

Change-Id: I5e4d4536f156b55d2d1288820814c3b4297fd58c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUpdate for sshd-2.3.0 changes 21/85521/5
Robert Varga [Mon, 16 Sep 2019 02:24:45 +0000 (04:24 +0200)]
Update for sshd-2.3.0 changes

sshd-2.3.0 changed APIs slightly, this makes the simple migration
of our code.

Change-Id: Ic525b317356a8d9ee3b0ad0b8a0fa78e10d2b482
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 74a5603f11edae5a6c071d35e8a2c33845440df9)
(cherry picked from commit 9778e2be7f4ae45cbb246b36ee8ddb9318e564d2)

4 years agoCorrectly close NormalizedNodeStreamWriters 72/85572/2
Robert Varga [Tue, 5 Nov 2019 06:50:48 +0000 (07:50 +0100)]
Correctly close NormalizedNodeStreamWriters

This code ends up not not closing the stream writer correctly,
which means some state may end up being unfinished. Fix that up.

Change-Id: Icad45cd12d30e44dabe4f86e73a6790bd5137154
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoProperly close stream writer 47/85547/2
Robert Varga [Sun, 20 Oct 2019 09:23:48 +0000 (11:23 +0200)]
Properly close stream writer

Failing to close the streamwriter means it will not output its
trailer in all cases. Fix that.

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

4 years agoDo not use toString() in looging messages 35/85535/2
Robert Varga [Mon, 28 Oct 2019 12:45:05 +0000 (13:45 +0100)]
Do not use toString() in looging messages

This eliminates unnecessary toString() calls, as logging implementation
will call it when necessary.

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

4 years agoFix config/oper reconciliation for leaf-lists 37/85537/1
wsx25289 [Tue, 15 Oct 2019 08:01:30 +0000 (04:01 -0400)]
Fix config/oper reconciliation for leaf-lists

When config and operational datastore both have same data, then if
we get data which has a leaf-list node by rests/data, it will fail,
because there is no code to process leaf-list.

Change-Id: I4724447158bf0a1a12e87145dcb361e8196b1170
Signed-off-by: Wsx25289 <10200860@zte.com.cn>
(cherry picked from commit cf8760f55d752af8abafbf09d0f4f9116b9c753b)

4 years agoLower visibility to package 22/84922/2
Robert Varga [Tue, 1 Oct 2019 21:13:35 +0000 (23:13 +0200)]
Lower visibility to package

This is a private-class method, it is fair game to declare it as
package-private, as noone can observe it outside of the nest.

Remove the need for shenanigans and lower access to the sole
method.

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

4 years agoAcquire RFC8528 mount point map 49/84749/7
Robert Varga [Thu, 26 Sep 2019 15:58:35 +0000 (17:58 +0200)]
Acquire RFC8528 mount point map

This adds the logic to create a mountpoint map, without supporting
inline schemas and recursion.

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

4 years agoApply modernizations 88/85288/2
Robert Varga [Sun, 6 Oct 2019 16:41:47 +0000 (18:41 +0200)]
Apply modernizations

Replace Guava constructs with their Java 8 equivalents.

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

4 years agoUntangle NetconfDevice setup 87/85287/2
Robert Varga [Thu, 26 Sep 2019 12:08:40 +0000 (14:08 +0200)]
Untangle NetconfDevice setup

NetconfDevice sets up the device connection in multiple stages,
which is all done in a messy way. Untangle the setup procedure,
so that we can properly hook up into it.

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

4 years agoConvert to using requireNonNull() 86/85286/2
Robert Varga [Wed, 4 Sep 2019 06:30:56 +0000 (08:30 +0200)]
Convert to using requireNonNull()

This is a second pass to migrate further Preconditions users
to java.util.Objects.requireNonNull().

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

4 years agoBump versions by x.y.(z+1) 70/85470/1
jenkins-releng [Fri, 1 Nov 2019 06:04:49 +0000 (06:04 +0000)]
Bump versions by x.y.(z+1)

Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Change-Id: I5b12c177c45f024229f7efa39dd58dd44b8392f6

4 years agoAdd pagination for mounted resources of apidocs 79/84979/1
Jie Han [Thu, 22 Aug 2019 12:06:24 +0000 (20:06 +0800)]
Add pagination for mounted resources of apidocs

Only show 20 yang resource for one page when there're
large amount yang resoures from a mount point such that
the explorer would not clash.

Change-Id: I7f7180ae7464407933cee49bd4fe8d24db216f77
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit c8f621b97a42a68e42b7b4df49312a9d5048d59d)

4 years agoReorganize transactionChainHandler usage. 78/84978/1
PeterSuna [Mon, 9 Sep 2019 11:45:43 +0000 (13:45 +0200)]
Reorganize transactionChainHandler usage.

Update transactionChainHandler to conform dependecny injection pattern.
Update DOMtransactionChain to be used multiple time.

JIRA: NETCONF-352
Change-Id: I26da73992ed2772f4f84e2a09788600b808283b3
Signed-off-by: PeterSuna <peter.suna@pantheon.tech>
(cherry picked from commit 0a8ab4d8188442b3d6ec7ccb14f413b06a448aa1)

4 years agoMigrate YangInstanceIdentifier.EMPTY users 77/84977/1
Robert Varga [Tue, 3 Sep 2019 10:27:41 +0000 (12:27 +0200)]
Migrate YangInstanceIdentifier.EMPTY users

This moves over to use the replacement empty() method.

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

4 years agoRemove use NodeIdentifierWithPredices.getKeyValues() 76/84976/1
Robert Varga [Tue, 3 Sep 2019 07:39:54 +0000 (09:39 +0200)]
Remove use NodeIdentifierWithPredices.getKeyValues()

This method has been superseded by plain access, update accordingly.

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

4 years agoSeparate out DeviceSources(Resolver) 75/84975/1
Robert Varga [Mon, 26 Aug 2019 13:38:45 +0000 (15:38 +0200)]
Separate out DeviceSources(Resolver)

NetconfDevice is quite overloaded, making it unclear what methods
participate on each stage of context assebly. This separates out
DeviceSourcesResolver, so that the logic inside it is well contained
outside of NetconfDevice.

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

4 years agoSimplify base schema lookups 74/84974/1
Robert Varga [Mon, 26 Aug 2019 13:20:06 +0000 (15:20 +0200)]
Simplify base schema lookups

We are checking for notification support multiple times, this
refactors the code to that only once.

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

4 years agoFix choice action request test 73/84973/1
Anna Bencurova [Wed, 28 Aug 2019 13:30:49 +0000 (15:30 +0200)]
Fix choice action request test

JIRA: NETCONF-639

Change-Id: Ic1d3a5b18ff64708fe9b55c3aa243b6a2db5c803
Signed-off-by: Anna Bencurova <Anna.Bencurova@pantheon.tech>
(cherry picked from commit 271121d0d00b56e5169923fb0225f6c64391bfb2)

4 years agoPropagate MountPointContext to NetconfMessageTransformer 72/84972/1
Robert Varga [Mon, 26 Aug 2019 10:58:10 +0000 (12:58 +0200)]
Propagate MountPointContext to NetconfMessageTransformer

In order to deal with NETCONF mount points, the transformer needs
to understand the execution context here. This patch updates the APIs
to pass the context down and implementations to use an empty mount
point context.

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

4 years agoUpdate NodeIdentifierWithPredicates construction 71/84971/1
Robert Varga [Wed, 28 Aug 2019 12:10:30 +0000 (14:10 +0200)]
Update NodeIdentifierWithPredicates construction

Direct constructors are going away, use factory methods instead.

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

4 years agoFix action lookups 70/84970/1
Robert Varga [Fri, 23 Aug 2019 16:05:42 +0000 (18:05 +0200)]
Fix action lookups

Actions, unlike RPCs, are not uniquely identified by their last
component, simply because they can be defined at any nest level --
and while their names can be equal, they can be completely different
things.

JIRA: NETCONF-639
Change-Id: Ic9f1df106240a26dd14a5f34de34a198945355c3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 4dc751203f52b31c4327ad8793956047691ff9fb)

4 years agoTeach BaseSchema about schema mounts 58/84958/2
Robert Varga [Mon, 26 Aug 2019 11:04:46 +0000 (13:04 +0200)]
Teach BaseSchema about schema mounts

We are moving towards the ability to interpret mount points, make
sure base schema interprets them as empty.

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

4 years agoMore SchemaContext reuse 57/84957/2
Robert Varga [Mon, 26 Aug 2019 10:41:47 +0000 (12:41 +0200)]
More SchemaContext reuse

This reuses SchemaContext across test invocations, speeding up
testing a bit.

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

4 years agoReuse schemacontext in ListenerAdapterTest 56/84956/2
Robert Varga [Mon, 26 Aug 2019 10:35:10 +0000 (12:35 +0200)]
Reuse schemacontext in ListenerAdapterTest

SchemaContext is an invariant here, make sure we reuse it across
tests.

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

4 years agoReuse SchemaContext in RuntimeRpcTest 55/84955/2
Robert Varga [Mon, 26 Aug 2019 10:31:14 +0000 (12:31 +0200)]
Reuse SchemaContext in RuntimeRpcTest

This reuses SchemaContext across multiple invocations, saving some
time.

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

4 years agoReuse schemaContext in mdsal-netconf-connector tests 54/84954/2
Robert Varga [Mon, 26 Aug 2019 10:26:28 +0000 (12:26 +0200)]
Reuse schemaContext in mdsal-netconf-connector tests

SchemaContext is well-known invariant, make sure we reuse it.

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

4 years agoReuse SchemaContext in NetconfCommandsImplTest 53/84953/2
Robert Varga [Mon, 26 Aug 2019 10:21:58 +0000 (12:21 +0200)]
Reuse SchemaContext in NetconfCommandsImplTest

SchemaContext is an invariant here, make sure we reuse it across
tests.

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

4 years agoReuse SchemaContext in NetconfDeviceTopologyAdapterTest 52/84952/2
Robert Varga [Mon, 26 Aug 2019 10:21:33 +0000 (12:21 +0200)]
Reuse SchemaContext in NetconfDeviceTopologyAdapterTest

The SchemaContext is an invariant, make sure we reuse it across
tests.

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

4 years agoShare test model SchemaContext 51/84951/2
Robert Varga [Mon, 26 Aug 2019 10:14:28 +0000 (12:14 +0200)]
Share test model SchemaContext

There is no point really to construct this context multiple times,
as it is an invariant. This shaves off some time from test execution.

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

4 years agoClose module URL stream as soon as possible 49/84949/2
Robert Varga [Fri, 23 Aug 2019 14:43:58 +0000 (16:43 +0200)]
Close module URL stream as soon as possible

This refactors LibraryModulesSchemas.createFromURLConnection()
to close the stream before doing any further processing. This
lowers resource needs as well as makes for simpler code.

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

4 years agoUse constant NodeIdentifiers in LibraryModulesSchemas 48/84948/2
Robert Varga [Fri, 23 Aug 2019 14:31:33 +0000 (16:31 +0200)]
Use constant NodeIdentifiers in LibraryModulesSchemas

There is no point in re-creating these constants each time we need
them -- promote them to proper constants.

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

4 years agoReduce code duplication in LibraryModulesSchemas 47/84947/2
Robert Varga [Fri, 23 Aug 2019 14:08:47 +0000 (16:08 +0200)]
Reduce code duplication in LibraryModulesSchemas

The entry derivation code is shared among two cases, merge it
into a utility method.

Also removes a thinko where each entry would actually be created
twice. Furthermore the Optional use for internal utility is removed
in favor of a nullable return.

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

4 years agoShorten nested class references 46/84946/2
Robert Varga [Fri, 23 Aug 2019 13:47:02 +0000 (15:47 +0200)]
Shorten nested class references

Both Entry and NodeIdentifier are unique in this source, there is no
point wasting terminal space in spelling them out.

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

4 years agoSimplify guessJsonFromFileName() 45/84945/2
Robert Varga [Fri, 23 Aug 2019 13:25:21 +0000 (15:25 +0200)]
Simplify guessJsonFromFileName()

46 here means '.', so the logic is:
- if there is no '.', return false
- if there is, return true IFF the string after the last '.' equals
  to ".json" in whatever case combination

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

4 years agoLibraryModulesSchemas.availableModels is immutable 44/84944/2
Robert Varga [Fri, 23 Aug 2019 13:15:23 +0000 (15:15 +0200)]
LibraryModulesSchemas.availableModels is immutable

This field holds an ImmutableMap, which is initialized to either
empty or a result of ImmutableMap.Builder. Make this contract
explicit by requiring the field to be ImmutableMap.

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

4 years agoCleanup state checking 43/84943/2
Robert Varga [Fri, 23 Aug 2019 13:09:50 +0000 (15:09 +0200)]
Cleanup state checking

This cleans up checks to make it clear we are talking about
the same instance when we look at an Optional. Furthermore migrate
away from checkNotNull().

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

4 years agoCentralize NETCONF_(DATA)_QNAME 42/84942/2
Robert Varga [Fri, 23 Aug 2019 12:04:09 +0000 (14:04 +0200)]
Centralize NETCONF_(DATA)_QNAME

This constant is already defined in netconf-util, it does make
sense to use it from there rather than brewing our own. Also
updates a few users which were ignoring existence of
NETCONF_DATA_NODEID.

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

4 years agoSimplify GET_SCHEMAS_RPC initialization 41/84941/2
Robert Varga [Fri, 23 Aug 2019 11:49:04 +0000 (13:49 +0200)]
Simplify GET_SCHEMAS_RPC initialization

There is no need for static initializer, as we are using a simple
builder.

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

4 years agoImprove action lookup 40/84940/2
Robert Varga [Fri, 23 Aug 2019 15:55:06 +0000 (17:55 +0200)]
Improve action lookup

The code here is extremely twisty, but at the end of the day it
ends up creating the path to an action's input -- which we can
readily get from schema. Simplify the logic, speeding it up
significantly.

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

4 years agoMake NetconfMessageTransformer.getActions() static 39/84939/2
Robert Varga [Fri, 23 Aug 2019 15:34:09 +0000 (17:34 +0200)]
Make NetconfMessageTransformer.getActions() static

This method only requires a SchemaContext, hence we can easily
make it static.

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

4 years agoReuse schema in NetconfMessageTransformerTest 50/84950/2
Robert Varga [Fri, 23 Aug 2019 15:31:12 +0000 (17:31 +0200)]
Reuse schema in NetconfMessageTransformerTest

SchemaContext is an invariant, and hence it does not make sense
to re-create it for each test case. Use @{before,after}Class to
initialize it exactly once -- saving about a second from execution
time.

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

4 years agoRemove unneeded type arguments 38/84938/1
Robert Varga [Fri, 23 Aug 2019 12:28:47 +0000 (14:28 +0200)]
Remove unneeded type arguments

Type inference is able to deduce the arguments here, remove them.

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

4 years agoCleanup toRpcResult() 37/84937/1
Robert Varga [Fri, 23 Aug 2019 12:32:11 +0000 (14:32 +0200)]
Cleanup toRpcResult()

We have a NETCONF_RPC_REPLY_NODEID readily available, there is no
point in recreating its equivalent. Also use proper nested builder
pattern to get rid of some useless temporary variables.

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

4 years agoMake mappedRpcs an ImmutableMap 36/84936/1
Robert Varga [Fri, 23 Aug 2019 11:50:12 +0000 (13:50 +0200)]
Make mappedRpcs an ImmutableMap

This map is known to be immutable in all cases, make sure we
propagate that knowledge.

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

4 years agoMake notification filter a simple lambda 35/84935/1
Robert Varga [Mon, 26 Aug 2019 12:57:31 +0000 (14:57 +0200)]
Make notification filter a simple lambda

There is no real value in having a variable for this piece of code,
make it a simple lambda.

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

4 years agoFix schema source registrations not being cleared 34/84934/1
Robert Varga [Mon, 26 Aug 2019 12:48:01 +0000 (14:48 +0200)]
Fix schema source registrations not being cleared

When a device goes down, we need to clear the registration list, so
we do not touch them multiple times.

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

4 years agoIntroduce CREATE_SUBSCRIPTION_RPC_PATH 33/84933/1
Robert Varga [Mon, 26 Aug 2019 12:49:34 +0000 (14:49 +0200)]
Introduce CREATE_SUBSCRIPTION_RPC_PATH

This path is used multiple times, it does not really make sense
to create it each and every time.

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

4 years agoFix mdsal reference 39/84739/1
Robert Varga [Thu, 26 Sep 2019 09:04:48 +0000 (11:04 +0200)]
Fix mdsal reference

We have missed an update to restconf-parent, this fixes it up.

Change-Id: I21d46c9e27f45b794dbb69cd80a19e7e1766b41d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump mdsal to 4.0.6 29/84629/4
Robert Varga [Sat, 14 Sep 2019 02:04:27 +0000 (04:04 +0200)]
Bump mdsal to 4.0.6

This picks up latest fixes.

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

4 years agoBump yangtools to 3.0.5 28/84628/4
Robert Varga [Sat, 14 Sep 2019 02:04:05 +0000 (04:04 +0200)]
Bump yangtools to 3.0.5

This picks up latest fixes.

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

4 years agoBump odlparent to 5.0.2 27/84627/4
Robert Varga [Mon, 2 Sep 2019 17:27:15 +0000 (19:27 +0200)]
Bump odlparent to 5.0.2

This bumps odlparent to pick up latest references.

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

4 years agoTeach RFC8040 restconf about actions 75/84275/3
ajay.dp001 [Wed, 10 Jul 2019 11:23:05 +0000 (12:23 +0100)]
Teach RFC8040 restconf about actions

This adds the handlers to route action requests through
DOMActionService and return results.

JIRA: NETCONF-618
Change-Id: I9d72fa5939b73beefbbb2e8030b1fa0a1f4ff935
Signed-off-by: ajay.dp001 <ajay.deep.singh@ericsson.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit a63d5a2325c8a730a84256d2e68258af9d872a49)

4 years agoFix checkstyle 73/84673/1
Robert Varga [Wed, 4 Sep 2019 06:59:26 +0000 (08:59 +0200)]
Fix checkstyle

This updates more checkstyle issues identified.

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

4 years agoFix checkstyle 64/84664/1
Robert Varga [Tue, 3 Sep 2019 07:20:52 +0000 (09:20 +0200)]
Fix checkstyle

Updated checkstyle is finding some issues, fix them up.

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

4 years agoTeach NETCONF about YANG 1.1 actions in cluster topology 16/84316/3
ajay_dp001 [Tue, 10 Sep 2019 23:29:09 +0000 (00:29 +0100)]
Teach NETCONF about YANG 1.1 actions in cluster topology

NETCONF allows invocation of actions but only in Non-cluster
topology which works absolutly fine but when invoked in cluster
topology it failed, usecase was not supported.

This patch provides support for Yang 1.1 action in cluster topology
NETCONF code base is updated to support action, can be invoked in
cluster topology.

JIRA: NETCONF-635
Change-Id: Id7f5c9ef4a515c28d5da8bab29724bb353c10d13
Signed-off-by: ajay_dp001 <ajay.deep.singh@est.tech>
4 years agoTeach AbstractGet how to transform MapNodes 31/84031/2
Mario Abraham [Wed, 21 Aug 2019 13:23:52 +0000 (15:23 +0200)]
Teach AbstractGet how to transform MapNodes

Added case for MapNode interface in transformNormalizedNode() method

Issue-ID: NETCONF-538
Signed-off-by: Mario Abraham <mario.abraham@pantheon.tech>
Change-Id: I9fa1d7f364d3d68d715aab73473096795da4ed6b
(cherry picked from commit ca7514e21fca4d18104d5a09d547d540a32d2e2e)

4 years agoSimplify RestconfValidationUtils users 90/83790/3
Robert Varga [Mon, 19 Aug 2019 13:26:19 +0000 (15:26 +0200)]
Simplify RestconfValidationUtils users

Rather than having users to immediate formatting of the String
value, introduce a simple alternative to throw exceptions.

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

4 years agoBump versions by x.y.(z+1) 24/84524/1
jenkins-releng [Wed, 18 Sep 2019 09:13:25 +0000 (09:13 +0000)]
Bump versions by x.y.(z+1)

Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Change-Id: I73b0b7e89fae7bb0a7ccbdf9eebbceb93cc13684

4 years agoAdded ExceptionMapper to RFC-8040 impl 89/83789/2
Jaroslav Tóth [Thu, 8 Aug 2019 15:01:13 +0000 (17:01 +0200)]
Added ExceptionMapper to RFC-8040 impl

It is similar to draft-02 implementation but with several diffs
that had to be made because of compliancy against specification,
different revisions of QNames, and need for refactoring:
- Response must have yang-data+json or yang-data+xml types, the
  parsing of request content type and acceptable media types was
  adjusted accordingly.
- Schema context was used as feed to NormalizedNode builders -
  this approach is useless.
- Anonymous classes used for special serializaton with disabled
  validation of error-info leaf were moved to distinct classes
  (they share some lines of code, so the abstract parent class
  is added).
- Added error-path leaf to serialized JSON/XML data (it was in
  todo tag for unknown reasons).
- Next small fixes and refactoring of code by extraction of
  methods.
- Unit test was written from scratch, because of changes done
  to parsing of status code and media type.

Change-Id: I9c17229e8df1b382a37ca588a506128040c6d42f
Signed-off-by: Jaroslav Tóth <jtoth@frinx.io>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 1b6442243f1ad2107c764a7f61d0bca9e21864c1)

4 years agoChange in the version name 77/83777/2
Anushka Bhandari [Mon, 19 Aug 2019 19:38:11 +0000 (01:08 +0530)]
Change in the version name

Signed-off-by: Anushka Bhandari <anushka16134@iiitd.ac.in>
Change-Id: I7161745536fda8acb47f2ea4c677269c970c8b2e

4 years agoFix NPE after invoking of GET on /rests/data 61/83761/2
Jaroslav Tóth [Thu, 1 Aug 2019 18:42:28 +0000 (20:42 +0200)]
Fix NPE after invoking of GET on /rests/data

- NPE was caused by comparing of identifier with various stream
  paths.
- Resolved by adding identifier != null checks.
- Added unit test.

Change-Id: Ieca8adf0f6686b67e3ddfee53b7f3d47cd1d9f3e
Signed-off-by: Jaroslav Tóth <jtoth@frinx.io>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 17a709f581167067651f0b978d2f6feefa0302a9)

4 years agoFixed response errors for HTTP PUT 60/83760/3
Jaroslav Tóth [Mon, 12 Aug 2019 15:10:52 +0000 (17:10 +0200)]
Fixed response errors for HTTP PUT

- Added correct error types and tags that previously weren't
  specified at all so it always returned 500 status code.

Change-Id: Ie77d324ee6b2fc149714e24451f40b01b3e47827
Signed-off-by: Jaroslav Tóth <jtoth@frinx.io>
(cherry picked from commit 0c41499f46507f3e59f472aa955eaccf3f21f67e)

4 years agoFixed POST data error response 58/83758/2
Jaroslav Tóth [Mon, 12 Aug 2019 14:55:05 +0000 (16:55 +0200)]
Fixed POST data error response

- Added correct error types and tags that previously weren't
  specified at all so it always returned 500 status code.

Change-Id: I911fcd04546d2c2884f52e197c44cde67ed214a8
Signed-off-by: Jaroslav Tóth <jtoth@frinx.io>
(cherry picked from commit 03fc9bee15c61a8d1cdc0768ef7c3bdfb781514b)

4 years agoBump mdsal to 4.0.4 46/83646/2
Robert Varga [Thu, 15 Aug 2019 08:33:07 +0000 (10:33 +0200)]
Bump mdsal to 4.0.4

This brings in latest fixes.

Change-Id: I59f89ef4fe76ef16fcdc9b59f8d9b50aa0849847
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix mapping of Revision in Deviations 01/83701/1
Tibor Král [Thu, 15 Aug 2019 15:13:28 +0000 (17:13 +0200)]
Fix mapping of Revision in Deviations

"IllegalArgumentException: Unknown value type Optional" exception
is thrown during initialization of RESTCONF with yang model containing
deviation.

JIRA: NETCONF-637
Change-Id: I8c19eb39d06ff38e691ea9a079507dab40311341
Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUpdate user-guide.rst 30/83630/1
Mario Abraham [Wed, 14 Aug 2019 10:18:22 +0000 (12:18 +0200)]
Update user-guide.rst

- added info about 2 different endpoints
related to RESTCONF

Issue-ID: NETCONF-500
Signed-off-by: Mario Abraham <mario.abraham@pantheon.tech>
Change-Id: I3ab9517e6ac2afe3e061eb31dfa8b642e1d34614
(cherry picked from commit 5bc455ab7471a308b77e1455da43f1d8202aa89c)

4 years agoUpdate .gitreview to stable/sodium 70/83570/1
jenkins-releng [Tue, 13 Aug 2019 02:47:26 +0000 (02:47 +0000)]
Update .gitreview to stable/sodium

Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Change-Id: Ic7caadd484d3bde742e3a7bd8956c19a4b90f570

4 years agoAdd checkValidIdentifierStart() 37/83337/3
Robert Varga [Wed, 31 Jul 2019 09:09:16 +0000 (11:09 +0200)]
Add checkValidIdentifierStart()

We have slight code duplicate, fix this by adding a utility method.

Change-Id: I696fdba4df956066fe0ebb8226d00ea6c1e0a416
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse String.indexOf() to check for percent 36/83336/3
Robert Varga [Wed, 31 Jul 2019 09:06:39 +0000 (11:06 +0200)]
Use String.indexOf() to check for percent

Rather than using String-based lookup, use a simple indexOf(),
which is faster.

Change-Id: Ic2ece2e69e4bb00a492ad129e10dc1ca0422fcbb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse static imports for constants 35/83335/3
Robert Varga [Wed, 31 Jul 2019 09:01:40 +0000 (11:01 +0200)]
Use static imports for constants

Current code is needlessly verbose in its references to simple
constants. Fix this by using static imports, reducing clutter.

Change-Id: I4b0e80a518e10de98a1a75ed8f80d3440e6a3f38
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFold MainVarsWrapper 30/83330/3
Robert Varga [Wed, 31 Jul 2019 00:41:17 +0000 (02:41 +0200)]
Fold MainVarsWrapper

It does not make any sense to keep a separate object to keep
state, while YangInstanceIdentifierDeserializer is pure static.

Eliminate MainVarsWrapper as a separate subclass, encapsulating
it in an YangInstanceIdentifierDeserializer instead. This allows
us manipulate state data freely, without having to go through
accessors, and thus make it much easier to follow as to what is
happening.

Change-Id: Ifa241c7343e13fe524ad8cf7d05cb3a6bbd6a18b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMove validArg() 28/83328/3
Robert Varga [Wed, 31 Jul 2019 00:00:55 +0000 (02:00 +0200)]
Move validArg()

This method has a single caller, which just passes it the state --
which really makes the method an instance method.

Change-Id: I8346e53e7b4f47e6da458fdef936812f914d2ef2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump mdsal to 4.0.3 02/83102/7
Robert Varga [Thu, 18 Jul 2019 10:35:23 +0000 (12:35 +0200)]
Bump mdsal to 4.0.3

This bumps mdsal to 4.0.3, bringing in latest fixes and improvements.

Change-Id: Ie8e03aab1f31edf80bc9f1d7896c334c9d83be8d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump yangtools to 3.0.4 01/83101/7
Robert Varga [Thu, 18 Jul 2019 10:35:09 +0000 (12:35 +0200)]
Bump yangtools to 3.0.4

This picks up latest fixes and improvements.

Change-Id: I03201927d23762acf641c1ab0ff3419ba8b94969
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump odlparent to 5.0.1 00/83100/5
Robert Varga [Thu, 18 Jul 2019 10:34:53 +0000 (12:34 +0200)]
Bump odlparent to 5.0.1

This picks up the latest upgrades.

Change-Id: If6006a94197839a9718cd5eae16b0a025913af93
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMigrate nextIdentifierFromNextSequence() 27/83327/2
Robert Varga [Tue, 30 Jul 2019 23:57:55 +0000 (01:57 +0200)]
Migrate nextIdentifierFromNextSequence()

This method is very simple and operates on state. Move it into
the state object, allowing us to eliminate some amount of verbosity.

Change-Id: I07dbb5a612a63d6dd7a1f428138a6750c91c1e3e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>