mdsal.git
2 years agoBump versions to 6.0.13-SNAPSHOT 98/97998/1 6.0.x
Robert Varga [Wed, 20 Oct 2021 08:55:31 +0000 (10:55 +0200)]
Bump versions to 6.0.13-SNAPSHOT

This starts the next development iteration.

Change-Id: If47b828a2fc97217b2a041075b3f5783f0132a91
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix OSGiDOMSchemaService lifecycle 48/97548/1
Robert Varga [Mon, 20 Sep 2021 15:39:21 +0000 (17:39 +0200)]
Fix OSGiDOMSchemaService lifecycle

Original refactor specified rather invalid lifecycle for the
OSGiModuleInfoSnapshot dependency -- it is missing the dynamic
binding which was there in one version of the patch set.

Unfortunately the invalid instruction (FieldOption for a method) is not
caught and it is causing a rather weird state, where we end up with a
deactivated service still having listeners firing.

Fix injection lifecycle by having a property DYNAMIC and GREEDY
lifecycle -- which does exactly the right thing, except we need to track
a bit more state to make logging more sane.

JIRA: MDSAL-689
Change-Id: Ia027c45daab528821bee9ae93248d9d7e9ada85d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 7484e78692a8a26d02210917b7aec7c28fb317bb)

2 years agoBump versions to 6.0.12-SNAPSHOT 97/97197/1
Robert Varga [Thu, 12 Aug 2021 21:28:33 +0000 (23:28 +0200)]
Bump versions to 6.0.12-SNAPSHOT

This starts the next development iteration.

Change-Id: Ie1dfd948709ec51111d1c9b56e7afc2349fa4b3b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSupport DOMAction-level routing 93/97193/2
Robert Varga [Mon, 9 Aug 2021 20:36:05 +0000 (22:36 +0200)]
Support DOMAction-level routing

We have a distinct use case where we want to route actions across
a system. In this scenario, a next hop provider registers itself as the
local provider with the appropriate cost.

This capability is also exposed as the simplest way of registering
binding-level implementations -- where we want to register to all
actions on the operational datastore.

Add explicit documentation around how how the arguments are interpreted
and teach DOMRpcRouter about wildcards -- similar to how it deals with
RPCs.

JIRA: MDSAL-681
Change-Id: I6daf70b28347fab88c8dc467fce267d8ba71e57d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 205d444f07393587da4103bd92d0b2abbefea95b)

2 years agoFix ActionProviderService(Adapter) 38/97138/3
PeterSuna [Mon, 26 Jul 2021 11:19:32 +0000 (13:19 +0200)]
Fix ActionProviderService(Adapter)

ActionProviderServiceAdapter is always passing an empty set of
instances to DOMActionProviderService, which is a direct violation of
API contract. Unfortunately the implementation interprets empty set as
a no-op, resulting in the violation being ignored silently and routing
not working.

JIRA: MDSAL-679
Change-Id: I53a8977365166228ed30130519a2024372d89365
Signed-off-by: PeterSuna <Peter.Suna@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit cbf88a5bd758d3cab9652b02b4d91b43f3cc939b)

2 years agoImprove DOMRpcRouterTest 39/97139/2
Robert Varga [Wed, 11 Aug 2021 12:24:37 +0000 (14:24 +0200)]
Improve DOMRpcRouterTest

We have a ton of untested functionality, add a few tests to increase
coverage.

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

2 years agoUse a global comparator 36/97136/1
Robert Varga [Wed, 11 Aug 2021 12:01:40 +0000 (14:01 +0200)]
Use a global comparator

Rather than instantiating a new comparator every time, just reuse a
single instance.

Change-Id: Ida1e9c1f41c5ab67a2847173bdcad6a1cd780c0e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix a NPE on missing path 31/97131/1
Robert Varga [Tue, 10 Aug 2021 22:08:35 +0000 (00:08 +0200)]
Fix a NPE on missing path

If we have an action registration for a different path, we will end up
with a NPE. Handle this case and throw DOMActionNotAvailableException
instead of a NPE.

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

2 years agoUse builder fluently 20/97120/1
Robert Varga [Mon, 9 Aug 2021 21:46:53 +0000 (23:46 +0200)]
Use builder fluently

DOMRpcRouter should use ImmutableList.Builder()'s methods as fluent
to maximize expressiveness.

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

2 years agoAdd a single-instance registerActionImplementation() 19/97119/1
Robert Varga [Mon, 9 Aug 2021 20:25:35 +0000 (22:25 +0200)]
Add a single-instance registerActionImplementation()

Single instances are rather prevalent, make sure we add a faster
specialization.

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

2 years agoFix network-topology leafrefs 86/96986/1
Robert Varga [Wed, 21 Jul 2021 13:30:11 +0000 (15:30 +0200)]
Fix network-topology leafrefs

We are using leafref paths in a typedef. YANG XPath evaluation rules
mean that our use of unqualified names will pick up default namespace
from whereever we are referenced -- and thus we end up point not into
ietf-network namespace anymore.

JIRA: MDSAL-677
Change-Id: I4f55f766cdc304c70ee8d3675c2e5365654f613a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit a1f598593b14955b738cde6347c1ffd129c2f9e3)

2 years agoDo not use a static String reference in length enforcer 45/96345/1
Robert Varga [Fri, 21 May 2021 11:13:11 +0000 (13:13 +0200)]
Do not use a static String reference in length enforcer

LengthGenerator is making the mistake of having a static reference
to java.lang.String without FQCN. This breaks down if String is
overridden by definition context.

Fix this by using importedName(Type) to emit a properly-scoped
reference.

JIRA: MDSAL-664
Change-Id: I16b12865448bde807f0afd0d35e3145f8b6359c3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit b07c63ce93a839e806c8ce96b8ef659e658574e3)

2 years agoBump versions to 6.0.11-SNAPSHOT 33/96233/1
Robert Varga [Tue, 18 May 2021 07:39:45 +0000 (09:39 +0200)]
Bump versions to 6.0.11-SNAPSHOT

This starts the next development iteration.

Change-Id: Ie07fc77692e13df66abc9958c2bb29213958e86b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump to odlparent-7.0.10/yangtools-5.0.10 32/96232/1
Robert Varga [Tue, 18 May 2021 05:50:15 +0000 (07:50 +0200)]
Bump to odlparent-7.0.10/yangtools-5.0.10

Adopt latest fixes from upstream.

Change-Id: I18d49228a657507471ada47303dbf9ef6f1d470d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump versions to 6.0.10-SNAPSHOT 92/95392/1
Robert Varga [Mon, 1 Mar 2021 10:08:53 +0000 (11:08 +0100)]
Bump versions to 6.0.10-SNAPSHOT

This starts the next development iteration.

Change-Id: Ia2614c7c26c3836a9530ca374f8c3ff5eb562e94
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump yangtools to 5.0.9 91/95391/1
Robert Varga [Mon, 1 Mar 2021 10:00:21 +0000 (11:00 +0100)]
Bump yangtools to 5.0.9

Adopt latest updates from upstream.

Change-Id: Id7410e5712df8f134076d9f096ef3fc7aeafcfb6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix String length checker 55/95355/1
Robert Varga [Wed, 24 Feb 2021 00:11:08 +0000 (01:11 +0100)]
Fix String length checker

We are enforcing length restrictions on String.length(), which is
the wrong measure, as it returns the number of code units in the
String. We actually want to compare the number of code points, i.e.
we need to use String.codePointCount().

JIRA: MDSAL-661
Change-Id: I7291aabb67ec9d002cdeb52befd1723707113121
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 99a40d176c406d35d3d83e440a775a969e0d27d3)

3 years agoAdd query support for decimal64 92/94792/4
Robert Varga [Sun, 24 Jan 2021 13:27:22 +0000 (14:27 +0100)]
Add query support for decimal64

As it turns out we are also missing support for leaves based on
decimal64 type. Add it.

JIRA: MDSAL-652
Change-Id: Id9c8954341492348e0fc36434336c5e522915709
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 0a107ff4517877e73c9d4da7e20a32fc53abde1f)

3 years agoNested lists cannot be decoded 91/94791/4
Peter Suna [Fri, 22 Jan 2021 15:53:42 +0000 (16:53 +0100)]
Nested lists cannot be decoded

DOMQueryIterator is a bit confused about the path it is returning,
causing binding codec to fail. As it turns out, we have violated
expected invariants in various places.

JIRA: MDSAL-654
Change-Id: Ibf7466f6f390f517f1186a725c265a88e7266934
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 1bf83c56c076eab7ec7cc1f9d5e24cde925cfa08)

3 years agoFix DOMQueryPredicate comparable matches 90/94790/4
Peter Suna [Fri, 22 Jan 2021 15:12:05 +0000 (16:12 +0100)]
Fix DOMQueryPredicate comparable matches

Boundary condition checking is wrong here due negation brainfart:
gte/gt and lte/lt should include/exclude 0, not the other way around.

JIRA: MDSAL-653
Change-Id: Ieaaf5b4fe0367d9e59cd03a2c177898d909e6ce8
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 14cf7ecef0d125b84406c534662c932419d9dfa7)

3 years agoAdd MatchBuilderPath.BooleanLeafReference 89/94789/4
Robert Varga [Fri, 22 Jan 2021 21:12:12 +0000 (22:12 +0100)]
Add MatchBuilderPath.BooleanLeafReference

This is a notable omission from the interface, allow users to
target Boolean types.

JIRA: MDSAL-652
Change-Id: Ie62f6419bf3db57887797f7bc88f7ec5dfd5f203
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 13a90f1ae289ce710b4dd0eca733ff45379fed9a)

3 years agoFix Javadoc deprecation links 22/94522/1
Robert Varga [Sat, 9 Jan 2021 07:33:29 +0000 (08:33 +0100)]
Fix Javadoc deprecation links

There is a typo in specification of the reference, leading to
this bit being rendered without a link. Fix that.

Change-Id: Id58978511ef601471d76e8a8f962df96f2e26a4f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump versions to 6.0.9-SNAPSHOT 00/94500/2
Robert Varga [Fri, 8 Jan 2021 13:37:36 +0000 (14:37 +0100)]
Bump versions to 6.0.9-SNAPSHOT

This starts the next development iteration.

Change-Id: Ie327103ac2c8792a0bff27e5be17bb09eaa17314
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump to odlparent-7.0.9/yangtools-5.0.8 01/94501/1
Robert Varga [Fri, 8 Jan 2021 14:58:10 +0000 (15:58 +0100)]
Bump to odlparent-7.0.9/yangtools-5.0.8

Adopt latest upstreams.

Change-Id: I396ec095bf0ea037749af01e29a283e8de55cd64
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRefactor FileSearchUtil 81/94281/2
Illia [Wed, 4 Nov 2020 15:05:15 +0000 (17:05 +0200)]
Refactor FileSearchUtil

Migrate to Java 11.
Add method for verifying containment of consecutive lines.
Add methods which add different level indentation.

Change-Id: I54fff1d1f840375102eed479a3cb338085e03762
Signed-off-by: Illia <illia.ihushev@pantheon.tech>
(cherry picked from commit ac94e81de40c4cf03a25c63925d7a77b4f0dae90)

3 years agoCreate proper assertFileContains() 80/94280/2
Robert Varga [Tue, 29 Sep 2020 22:45:37 +0000 (00:45 +0200)]
Create proper assertFileContains()

We want to have a proper assertion, not just assertTrue(). Change
findInFile() to assertFileContains().

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

3 years agoFix FileSearchUtil.getFiles() 79/94279/2
Illia [Thu, 24 Sep 2020 11:18:25 +0000 (14:18 +0300)]
Fix FileSearchUtil.getFiles()

Do not skip files in the current folder after finding the first child
folder.

Change-Id: Ifba6071e431e18a0a4caa03c90d11b246ec2bc6b
Signed-off-by: Illia <illia.ihushev@pantheon.tech>
(cherry picked from commit e8f2de45b5db5ef10476621ffd355cb0621f03a8)

3 years agoMove common util methods to dedicated class 78/94278/2
illia.ihushev [Tue, 11 Aug 2020 11:47:27 +0000 (14:47 +0300)]
Move common util methods to dedicated class

This will make it easier to reuse them.

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

3 years agoRemove getter @Nullable annotations for non-List/Map types 46/94246/2
Iaroslav [Fri, 4 Dec 2020 10:36:44 +0000 (12:36 +0200)]
Remove getter @Nullable annotations for non-List/Map types

In generated types getter will no longer be marked @Nullable annotation
for non List and Map types.

Jira: MDSAL-603
Change-Id: I2ad00e625f652399e184fca1a7a00d3ed36d3dff
Signed-off-by: Iaroslav <iaroslav.kholiavko@pantheon.tech>
(cherry picked from commit ea81234d5429f36f687baee790fcfb884a8b96d1)

3 years agoFix replicate's parent version 44/94244/1
Robert Varga [Tue, 15 Dec 2020 08:25:51 +0000 (09:25 +0100)]
Fix replicate's parent version

We are referencing odlparent at wrong version here, fix that up.

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

3 years agoRemove mdsal-binding-generator-api's dependency on yang-binding 38/93638/1
Robert Varga [Fri, 6 Nov 2020 17:25:42 +0000 (18:25 +0100)]
Remove mdsal-binding-generator-api's dependency on yang-binding

mdsal-binding-generator-api is a standalone API with no requirement
on yang-binding. Remove the dependency.

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

3 years agoAdd support for formatting EffectiveModelContext 06/93606/2
Robert Varga [Thu, 15 Oct 2020 18:40:35 +0000 (20:40 +0200)]
Add support for formatting EffectiveModelContext

Introduce a fluent-builder like pattern so we have the
option to override various options of the resulting output.

JIRA: MDSAL-596
Change-Id: I1929664db4262b0428e078b4712844b4bc2679b9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
(cherry picked from commit 9771d77935524f7bfb54bcf5169cf600a3b3c71b)

3 years agoRefactor DOMQueryPredicate 44/93544/1
Robert Varga [Wed, 28 Oct 2020 16:50:24 +0000 (17:50 +0100)]
Refactor DOMQueryPredicate

Refactor aimed at allowing composite predicates without multiple
lookups. While the DOM language allows this use case, the binding
layer does not take advantage of it.

JIRA: MDSAL-617
Change-Id: Ib8a3f77ee660a8c2881d0a18bd0238c6ddce5ade
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 513eb8e5a624d9c09d9f051bbf59ac1ff856bdb7)

3 years agoUse Map.entry() instead of SimpleImmutableEntry 45/93445/1
Robert Varga [Wed, 28 Oct 2020 00:03:12 +0000 (01:03 +0100)]
Use Map.entry() instead of SimpleImmutableEntry

We are using these a dumb DTOs, hence using a value-based
non-serializable implementation is more appropriate.

JIRA: MDSAL-605
Change-Id: Ie36c397a6e265328f31b70dce05b8c72b8756584
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 6ef51407a2c1731520c3a246442386093e67aeeb)

3 years agoRename LazyDOMQueryResultIterator 44/93444/1
Robert Varga [Tue, 27 Oct 2020 22:55:47 +0000 (23:55 +0100)]
Rename LazyDOMQueryResultIterator

This is an implementation-internal class, shorten its name to
DOMQueryIterator. It is shorter and matches naming of others.

JIRA: MDSAL-605
Change-Id: I8413a20c4ba533c62bf6c5c3013b4d1bf8f841e2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 870ebfe9aef87e245f98bc377a8d8fb15f2b820f)

3 years agoAdd support for keyed entries 43/93443/1
Robert Varga [Mon, 26 Oct 2020 22:54:40 +0000 (23:54 +0100)]
Add support for keyed entries

When we enter a NodeIdentifierWithPredicates for a Map, we can
service that with a direct map lookup instead of iteration. As we
now have the tools to access this step, add a unit test and fix
the implementation.

These predicates add another dimension to matching, where we have
to deal with Maps, something that NormalizedNodes does not help
with.

Predicate matching is split into its own class with a clear entry
point, so as to separate it from other complex pieces. This also
solves the tension between Evaluator and Iterator by shifting
ownership to a third class.

Since a predicate now be matching multiple nodes, we have to also
introduce an explicit DOMQueryPredicate.Not, so that its effects
can be properly accounted for.

JIRA: MDSAL-612
Change-Id: I34511517c5746efc5d245a56da89083c44100752
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit d0e3e6654cc79d3725263b1f0ecfa2d79c2a3e47)

3 years agoAdd support for selecting exact items from lists 42/93442/1
Robert Varga [Tue, 27 Oct 2020 19:53:23 +0000 (20:53 +0100)]
Add support for selecting exact items from lists

The query language prototype was centered around wildcard matches,
while it ignored exact matches in building up the query. Add support
for specifying a list key, as one would in normal InstanceIdentifier.

JIRA: MDSAL-612
Change-Id: I0c63d6d4990a31888f33a86c9d798b09bb10c734
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 702435f43074c05a197975e6b15c4188e4981841)

3 years agoRefactor LazyDOMQueryResultIterator 04/93404/1
Robert Varga [Mon, 26 Oct 2020 18:29:11 +0000 (19:29 +0100)]
Refactor LazyDOMQueryResultIterator

Rework the logic to keep minimum stack allocations. Whereas we used
stack for keeping the decision state and traverse all entries, here
we keep an explicit stack with state.

We mutate the state using a "simple" sstateful dispatch, where we
are are carefully peeling the various possibilities. This logic is
one large method due to 'current' being manipulated and non-local
returns.

This improves test case performance by more than a factor-of-two,
easily beating linear search by a wide margin.

For clarity we have two classes of Frames, one dealing with MapNode's
children and the other one taking care of all the other nodes. While
this might cause bimorphic invocation of Frame.hasNext(), the overall
effect on clarity is immense.

We also change match() a bit, to take predicates, as it is all that
it should be interested in.

JIRA: MDSAL-610
Change-Id: I7136c6297cc66832539d1bb3d9f653968eb7bdb1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 9cea2c0be2e893075c4ad99142e6b5d7ca511527)

3 years agoAdd LazyDOMQueryResult 03/93403/1
Robert Varga [Mon, 26 Oct 2020 14:17:55 +0000 (15:17 +0100)]
Add LazyDOMQueryResult

Rehost the evaluation logic into a dedicated iterator class. This
does not make iteration lazy, but sets the stage by giving the state
being passed around a place to live.

JIRA: MDSAL-610
Change-Id: Ic23eb38d7e5a6bd1cf1b7637dec88eff552520d7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit dde3e63c454fe72ddb7e7b9689baf2618e6d1e67)

3 years agoBetter encapsulate search state 02/93402/1
Robert Varga [Mon, 26 Oct 2020 14:05:25 +0000 (15:05 +0100)]
Better encapsulate search state

'remaining' is a bit unclear, make sure to push down initialization
down a bit.

JIRA: MDSAL-610
Change-Id: Id607bd444e58eaaa288e8f0fc505d20ec31bed75
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 301b7c196bb7950f5ccc3ea1c1f4a915301e4730)

3 years agoHide EagerDOMQueryResult behind DOMQueryResult.of() 01/93401/1
Robert Varga [Mon, 26 Oct 2020 02:54:40 +0000 (03:54 +0100)]
Hide EagerDOMQueryResult behind DOMQueryResult.of()

Most users might not want to depend on dom.spi just for an immutable
holder. Add DOMQueryResult.of() methods and use them as replacements
for EagerDOMQueryResult.of().

JIRA: MDSAL-605
Change-Id: I96f81cc105b9890638769b2f2185e961c0fd1885
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit baa87cf697e8c5ba66804d68f88c469dd4cf32bc)

3 years agoQueryResults should be Iterable, Immutable 00/93400/1
Robert Varga [Mon, 26 Oct 2020 01:51:43 +0000 (02:51 +0100)]
QueryResults should be Iterable, Immutable

Each query result really is a holder of result items, in some
iteration order. Expose this by implementing Iterable, so that
we end up correctly implementing stream() et al.

JIRA: MDSAL-605
Change-Id: I4cf1cd29e74e8c640ee62126e4f1cb9efa956cce
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 74bf22cda1905fee5ab6d539a8a725a81c9ff826)

3 years agoAdd DOMDataTreeQueryOperations 75/93375/3
Robert Varga [Sun, 25 Oct 2020 17:17:42 +0000 (18:17 +0100)]
Add DOMDataTreeQueryOperations

DOMDataTreeQueryOperations exposes the ability to execute queries
on the backing datastore, much like one would execute a read.

mdsal-binding-dom-adapter is taught to recognize the interface and
use it to offload execution deeper. It still falls back to its
evaluation should the backing store not support this.

DOMStoreReadTransaction gained the ability to value expressions,
using a default implementation based om DOMQueryEvaluator.

Based on that capability, mdsal-dom-broker's transactions are
retrofitted to always provide evaluation locally.

JIRA: MDSAL-607
Change-Id: Ia20acf59870f47c8a84914e239dee82e2a56c1bb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit bd0e40b3221325dbc96b17fef191df2245954f44)

3 years agoAdd QueryOperations 74/93374/3
Robert Varga [Sun, 25 Oct 2020 14:30:08 +0000 (15:30 +0100)]
Add QueryOperations

Introduce QueryOperations, which support execution of QueryExpressions.
We implement these in the binding/dom adapter in terms of a read/eval
supported by DOMQueryEvaluator.

This allows users to execute queries no matter what the underlying
storage engine supports. This has the upside of instantiating fewer
Binding objects, as the result set is usually a subset of the overall
tree.

TypedTransactions get these unconditionally, throwing
UnsupportedOperationException if the backend does not provide them
(which the default implementation does).

JIRA: MDSAL-606
Change-Id: If68fbb027aa72b1a4b5eef1437e92c30974a1e12
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit be0308e28d334b32485ec68d7b6593b95db728ae)

3 years agoAdd DOMQueryResult streaming interfaces 73/93373/1
Robert Varga [Sun, 25 Oct 2020 23:40:40 +0000 (00:40 +0100)]
Add DOMQueryResult streaming interfaces

Current definition is really an implementation-specific. The API
exposed from DOMQueryResult is eager, not allowing for eager
termination of searching.

Fix this by turning DOMQueryResult into an interface and add
an eager implementation to match current behavior.

Also update DefaultQueryResult to take advantage of lazy
transformations.

JIRA: MDSAL-605
Change-Id: I8375954e09ce6139aad0f83e883ed75771faceab
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit b620c86025390e3f86eaade9f9c0f102ce6313fa)

3 years agoPeel predicate identifiers 72/93372/1
Robert Varga [Sun, 25 Oct 2020 22:03:48 +0000 (23:03 +0100)]
Peel predicate identifiers

Most of the time we will be treated with simple predicates, peel
them off, so we do not end up iterating.

JIRA: MDSAL-605
Change-Id: I1864c33c5aa34cd3a58171f8cfbe729dd325fb35
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 235b6e5b687a5b5fd9ca084f4e10758bbe400bb1)

3 years agoCreate YangInstanceIdentifier only for a match 71/93371/1
Robert Varga [Sun, 25 Oct 2020 19:19:48 +0000 (20:19 +0100)]
Create YangInstanceIdentifier only for a match

This is a classic performance tune up: do not create
YangInstanceIdentifier until we need it.

JIRA: MDSAL-605
Change-Id: Idf9f391d5e7d8080795ce3f6d9b943b5240fe21e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit f21384f24a4392abc1d4ddc60bf2fd9e79a4dd60)

3 years agoAdd DOMQueryResult 70/93370/1
Robert Varga [Sun, 25 Oct 2020 16:35:02 +0000 (17:35 +0100)]
Add DOMQueryResult

Working with DOMQueryEvaluator is clunky, introduce a DOMQueryResult,
which reigns it in a bit.

JIRA: MDSAL-605
Change-Id: I83c29c56d184ff880c22154bbb8a3b2bc4f9ec3d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 81e3838feb424a3fa63cd8251d7e9b2cfb26d083)

3 years agoExpose DefaultQuery class 69/93369/1
Robert Varga [Sun, 25 Oct 2020 14:43:54 +0000 (15:43 +0100)]
Expose DefaultQuery class

DefaultQuery captures the codec context, hence it is useful for
intra-implementation transforms. This includes the ability to
transform the result set from DOM.

JIRA: MDSAL-605
Change-Id: I565d1ec5070653d45bb6340e79799612fc06d61c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 770d5abb8be436769a9a1d7b80edb89e2955bf29)

3 years agoClarify DOMQueryEvaluator API 60/93360/1
Robert Varga [Sun, 25 Oct 2020 15:17:08 +0000 (16:17 +0100)]
Clarify DOMQueryEvaluator API

DOMQueryEvaluator has two modes of operation, each useful on its
own. Separate the two and document them.

JIRA: MDSAL-605
Change-Id: I6bc93b7098a18dc8d5c5886234fc0cf90772d15b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit a2592b21861882e07388f9a6ea501c9995be6665)

3 years agoAdd SimpleQueryExecutor 59/93359/1
Robert Varga [Fri, 23 Oct 2020 20:46:07 +0000 (22:46 +0200)]
Add SimpleQueryExecutor

This refactors the interace a bit and provides a basic evaluator.
The idea is that given a root object it will evaluate the query.

JIRA: MDSAL-605
Change-Id: Ifcf8880d502eed93fa243a2c1e2f50a116306fe5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 416da6503fff80cab299e727b5b8e1351daee98f)

3 years agoFix DOMQueryPredicate signature 37/93337/1
Robert Varga [Sat, 24 Oct 2020 20:34:01 +0000 (22:34 +0200)]
Fix DOMQueryPredicate signature

DOMQueryPredicates need to be operating on NormalizedNodes, not
plain objects. Internal implementations, which are value-based
need to check for appropriateness of the passed NormalizedNode
and dispatch to check its value.

JIRA: MDSAL-605
Change-Id: Id17400a799b6d14612d077113ba29be4f04a7b6e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 3f08d6577d82437ded20a3b97867079126a76e5a)

3 years agoAdd isNull() predicate to both DOM and Binding queries 36/93336/1
Robert Varga [Sat, 24 Oct 2020 20:24:23 +0000 (22:24 +0200)]
Add isNull() predicate to both DOM and Binding queries

We have a nonnull() predicate, this adds its counterpart.

JIRA: MDSAL-605
Change-Id: I76d8ac700c8844f71cfe6e24a6fab23d6212a145
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit e9bbc3f1dd175e2092abfc16edbe77e0a6ac8762)

3 years agoFix DOMQueryEvaluator bugs 35/93335/1
Robert Varga [Sat, 24 Oct 2020 16:23:12 +0000 (18:23 +0200)]
Fix DOMQueryEvaluator bugs

In case we are matching through a list node, we need to make
sure to match against all its children.

Also when evaluating a predicate, make sure to first perform
a lookup for its relative path.

JIRA: MDSAL-605
Change-Id: Iabe0f26206212a356ebae05162452d61f7c781af
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 720a57a5099da2bb3595e66fe49074776776880b)

3 years agoDOMQueryEvaluator is @NonNullByDefault 30/93330/1
Robert Varga [Sat, 24 Oct 2020 16:23:12 +0000 (18:23 +0200)]
DOMQueryEvaluator is @NonNullByDefault

Clarify that we are not dealing with nullable types.

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

3 years agoUpdate QueryResult design 24/93324/1
Robert Varga [Fri, 23 Oct 2020 19:19:20 +0000 (21:19 +0200)]
Update QueryResult design

A query needs to result in a set of path/object tuples, as we really
need to discern matches. Having a concrete path of matches helps
getting identifiers of parent objects for subquent queries.

DOMQueryResult already contains this capability, we just need to
propagate it.

JIRA: MDSAL-604
Change-Id: Iec9ad34aac105eeb45c26a31a24611c9e0f2bb82
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit eb1359241f3479661b4b317c05b3b2f96e8b6717)

3 years agoFix MatchBuilderPath documentation 23/93323/1
Robert Varga [Fri, 23 Oct 2020 21:58:58 +0000 (23:58 +0200)]
Fix MatchBuilderPath documentation

We have a sentence trailing off, fix it up. Since we are introducing
a new pointer, update LambdaDecoder documentation. QueryExpression
gets a free pass on whitespace.

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

3 years agoBump versions to 6.0.8-SNAPSHOT 55/93255/1
Robert Varga [Thu, 22 Oct 2020 12:00:53 +0000 (14:00 +0200)]
Bump versions to 6.0.8-SNAPSHOT

This starts the next development iteration.

Change-Id: I7389337eb1d4d798147e2a518501891b4d6f8b9f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix nullness errors reported by Eclipse 63/93163/1
Robert Varga [Sat, 26 Sep 2020 22:01:07 +0000 (00:01 +0200)]
Fix nullness errors reported by Eclipse

Eclipse provides a lot of noise around builders where we pass
down classes. This fixes them up by losening the contracts and
adding Class<@NonNull T> where generics are involved. Since we are
at it, also fixup the suite to generate fewer warnings.

JIRA: MDSAL-601
Change-Id: I7b21d88584a18cc1bed6ea776b22e82584484339
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 1fcf6b07a764c57aff7435cffd620c4995d1db40)

3 years agoRemove trailing comments 62/93162/1
Robert Varga [Mon, 19 Oct 2020 09:41:43 +0000 (11:41 +0200)]
Remove trailing comments

Trailing comments are frowned upon, remove them.

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

3 years agoProperly cache caseType class 61/93161/1
Robert Varga [Sun, 18 Oct 2020 20:21:01 +0000 (22:21 +0200)]
Properly cache caseType class

We lost this bit when we were switching annotations. Since we
require Java 11, we should no longer be exposed to the JDK issue.

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

3 years agoAdd ForwardingYangLibSupport 67/93067/1
Robert Varga [Wed, 14 Oct 2020 14:48:23 +0000 (16:48 +0200)]
Add ForwardingYangLibSupport

OSGi wiring for YangLibSupport is using forwarding in two
implementations. Simplify both by factoring out
ForwardingYangLibSupport.

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

3 years agoAdd YangLibSupport.implementedRevision() 66/93066/1
Robert Varga [Wed, 14 Oct 2020 14:41:40 +0000 (16:41 +0200)]
Add YangLibSupport.implementedRevision()

We want to decompose our services as much as possible, and RESTCONF
legally needs to know the version we are implementing. Expose that
version.

JIRA: MDSAL-595
Change-Id: Ic8dc27adf2c85658e364712af616db7ac558b595
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 74f4dd77a96fb84645892ee268a54f07491d84d2)

3 years agoBump versions to 6.0.7-SNAPSHOT 16/93016/1
Robert Varga [Sat, 10 Oct 2020 16:23:31 +0000 (18:23 +0200)]
Bump versions to 6.0.7-SNAPSHOT

This starts the next development iteration.

Change-Id: I02ad70aed47467295849a97dbd89f1e7961d2788
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump odlparent/yangtools to 7.0.7/5.0.7 14/93014/2
Robert Varga [Sat, 10 Oct 2020 16:21:04 +0000 (18:21 +0200)]
Bump odlparent/yangtools to 7.0.7/5.0.7

Pick up latest fixes from upstream.

Change-Id: I8a6c349f592996c4555a30f2b23cc310d829a7b2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump byte-buddy to 1.10.17 15/93015/2
Robert Varga [Thu, 8 Oct 2020 13:56:51 +0000 (15:56 +0200)]
Bump byte-buddy to 1.10.17

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.10.14
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.10.15
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.10.16
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.10.17

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

3 years agoAdd BindingMap helper class 96/92696/2
Robert Varga [Fri, 25 Sep 2020 16:20:22 +0000 (18:20 +0200)]
Add BindingMap helper class

Changing the mapping of keyed lists from List to Map made the baseline
generated builders hard to use, as there isn't an easy way to build
a map of entries in a fluent way.

BindingMap fills this role, providing both a direct way via
BindingMap.of(V...) as well as Builder-based interface via
BindingMap.Builder.

JIRA: MDSAL-553
Change-Id: Ieb3093c37b30f79666bffb50aa22a20922e41344
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Illia <illia.ihushev@pantheon.tech>
(cherry picked from commit 7c1b3bcc2d83999599e7fc613bdc53d272e2237c)

3 years agoAdd Replicator's config files to etc on startup 95/92795/1
Tibor Král [Wed, 19 Aug 2020 10:05:28 +0000 (12:05 +0200)]
Add Replicator's config files to etc on startup

Currently the configuration files don't reside inside
the etc folder when the bundle starts up. They either
have to be created manually or by editing via Karaf
Config CLI. This makes it more difficult for the
user to see the options and modify them as needed.

Add the files directly to the bundle stating all the
options and filled with default value. Then load them
inside the etc folder on bundle startup.

Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
Change-Id: If55316d89dcb5570d4f9f8a5b30fd5310ad90a48
(cherry picked from commit 6f149e51688bf6d9fee30b704af9ef4b7ac81a0f)

3 years agoRemove yanglib feature.xmls 92/92792/1
Robert Varga [Tue, 29 Sep 2020 15:32:04 +0000 (17:32 +0200)]
Remove yanglib feature.xmls

Our baseline already requires SCR installation, remove feature
overrides.

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

3 years agoUse QName.bindTo() instead of withModule() 90/92790/1
Robert Varga [Tue, 29 Sep 2020 14:56:01 +0000 (16:56 +0200)]
Use QName.bindTo() instead of withModule()

QName.withModule() has been deprecated, migrate to using
AbstractQName.bindTo().

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

3 years ago$YangModuleInfoImpl not generated for only extensions model 31/92531/2
Michal Banik [Thu, 13 Aug 2020 18:09:04 +0000 (20:09 +0200)]
$YangModuleInfoImpl not generated for only extensions model

This adds a minimal test case, which flushes out the problem
in test harness, but production code is actually fine.

JIRA: MDSAL-589
Change-Id: I93404702551546585812f8d1b5be6690cc38e750
Signed-off-by: Michal Banik <michal.banik@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 50855450c6fac03ca45636ab7d41f7c8dccfb02e)

3 years agoBump versions to 6.0.6-SNAPSHOT 80/92580/1
Robert Varga [Tue, 22 Sep 2020 08:26:07 +0000 (10:26 +0200)]
Bump versions to 6.0.6-SNAPSHOT

This starts the next development iteration.

Change-Id: I4742d3af1d30dd048237d2a1bca9d3e3586b4b2e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump odlparent/yangtools to 7.0.6/5.0.6 60/92560/2
Robert Varga [Mon, 21 Sep 2020 12:17:50 +0000 (14:17 +0200)]
Bump odlparent/yangtools to 7.0.6/5.0.6

Pick up latest updates from upstream.

Change-Id: I22dae6f3cc21e115f349d568d6d3b9943a330027
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove unused local variable 30/92530/1
Illia [Mon, 21 Sep 2020 10:13:45 +0000 (13:13 +0300)]
Remove unused local variable

Change-Id: I2452717e6141c1380d244bd66181440e249e21ad
Signed-off-by: Illia <illia.ihushev@pantheon.tech>
(cherry picked from commit 38dbc9a2dc81bbae83346e2eb1da6fbf38d57c36)

3 years agoRecord deactivation reason in adapted services 07/91807/2
Robert Varga [Fri, 31 Jul 2020 21:23:38 +0000 (23:23 +0200)]
Record deactivation reason in adapted services

This improves our ability to diagnose component deactivation by
reporting the reason for it.

Change-Id: I3de2e38dfe40863771328588ca07b6e0ccca148f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert mdsal-eos-binding-adapter to OSGi DS 02/91802/2
Robert Varga [Fri, 31 Jul 2020 12:00:34 +0000 (14:00 +0200)]
Convert mdsal-eos-binding-adapter to OSGi DS

This is very simple component, use OSGi DS to activate it. This
exposes our inability to test it, hence disable the corresponding
feature. That test was incomplete due to us relying on ODL blueprint
namespace, which was missing anyway.

JIRA: MDSAL-524
Change-Id: I06ad20c47ee357732d084389ada15b05d5a63b34
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 9059eae540a363aad5b2aa95b67cc1240d2609cc)

3 years agoBump byte-buddy to 2.10.13 03/91803/1
Robert Varga [Mon, 27 Jul 2020 15:07:25 +0000 (17:07 +0200)]
Bump byte-buddy to 2.10.13

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.10.12
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.10.13

Change-Id: I0966260bd0488abd08e9db0025bb1fd28d01f7e3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert mdsal-singleton-dom-impl to OSGi DS 01/91801/1
Robert Varga [Fri, 31 Jul 2020 11:44:05 +0000 (13:44 +0200)]
Convert mdsal-singleton-dom-impl to OSGi DS

This is very simple component, use OSGi DS to activate it. This
exposes our inability to test it, hence disable the corresponding
feature. That test was incomplete due to us relying on ODL blueprint
namespace, which was missing anyway.

JIRA: MDSAL-523
Change-Id: Icadaf0fddc1768d97ec74d22a26f079f1811f9b6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 8d15ccd6a7e51ee0106f2a8f0a6a85a67786240f)

3 years agoAdd binding adapter components for data services 86/91786/4
Robert Varga [Thu, 30 Jul 2020 21:59:36 +0000 (23:59 +0200)]
Add binding adapter components for data services

Rather than operating on service registry directly, create binding
adapters as dedicated components. This allows proper provides/requires
validation for downstream component users.

JIRA: MDSAL-587
Change-Id: I5c9c8140660ac5c7d7a82c25bcbf4e26fc8716be
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd binding adapter components for notification services 85/91785/1
Robert Varga [Thu, 30 Jul 2020 21:46:00 +0000 (23:46 +0200)]
Add binding adapter components for notification services

Rather than operating on service registry directly, create binding
adapters as dedicated components. This allows proper provides/requires
validation for downstream component users.

JIRA: MDSAL-585
Change-Id: I8a3ec440d9e74cfaecdc310812da32b4b8b28241
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd binding adapter components for action services 84/91784/1
Robert Varga [Thu, 30 Jul 2020 21:39:36 +0000 (23:39 +0200)]
Add binding adapter components for action services

Rather than operating on service registry directly, create binding
adapters as dedicated components. This allows proper provides/requires
validation for downstream component users.

JIRA: MDSAL-584
Change-Id: Ib6dbc8711f4b4789c542332a101dc391d28f8565
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd binding adapter components for MountPointService 82/91782/2
Robert Varga [Thu, 30 Jul 2020 21:02:39 +0000 (23:02 +0200)]
Add binding adapter components for MountPointService

Rather than operating on service registry directly, create binding
adapters as dedicated components. This allows proper provides/requires
validation for downstream component users.

JIRA: MDSAL-586
Change-Id: I8e27d8c0b73f69633d889476aeb7808a69d5825f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd binding adapter components for RPC services 81/91781/2
Robert Varga [Thu, 30 Jul 2020 20:10:35 +0000 (22:10 +0200)]
Add binding adapter components for RPC services

Rather than operating on service registry directly, create binding
adapters as dedicated components. This allows proper provides/requires
validation for downstream component users.

JIRA: MDSAL-583
Change-Id: If9680d2efe64535551b0c7a3df8058dac89375cf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump versions to 6.0.5-SNAPSHOT 00/91600/1
Robert Varga [Thu, 23 Jul 2020 21:04:11 +0000 (23:04 +0200)]
Bump versions to 6.0.5-SNAPSHOT

This starts the next development iteration.

Change-Id: I86902f678f4ef4d70eeff3f352b4d8f33ba76c27
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump odlparent/yangtools to 7.0.5/5.0.5 45/91545/1
Robert Varga [Tue, 21 Jul 2020 19:40:36 +0000 (21:40 +0200)]
Bump odlparent/yangtools to 7.0.5/5.0.5

Pick up upgrades needed for netty and also further 7.0.0 development.

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

3 years agoSimplify DOMNotificationService contract 66/91466/1
Robert Varga [Tue, 21 Jul 2020 10:24:30 +0000 (12:24 +0200)]
Simplify DOMNotificationService contract

One of the methods can be implemented as a default method, making
things easier on implementations. Address the FIXME.

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

3 years agoUse soft values in ValueTypeCodec 98/91498/1
Robert Varga [Tue, 21 Jul 2020 08:39:32 +0000 (10:39 +0200)]
Use soft values in ValueTypeCodec

Using strong value references in STATIC_CODECS cache leads to target
classes being strongly reachable through the codec itself -- hence
they will never be weakly reachable, hence they will not be GC'd.

Use soft values, which allows the classes to be GC'd as soon as the
JVM decides they have not been used for a while -- which is what
will happen when a class becomes almost-eligible for unloading.

JIRA: MDSAL-580
Change-Id: I7956d564c46a9a1d52ba85fbe61f3a19c507a902
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 0150ddd6c4e3c61a761dacb9161e84b3f38b748a)

3 years agoRemove use of deprecated setters 73/91073/1
Robert Varga [Mon, 20 Jul 2020 09:50:56 +0000 (11:50 +0200)]
Remove use of deprecated setters

Using lists to populate unordered maps is deprecated, do not use
those methods.

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

3 years agoUse ModuleInfoSnapshot instead of ModuleInfoBackedContext 38/91438/1
Robert Varga [Sun, 19 Jul 2020 21:52:36 +0000 (23:52 +0200)]
Use ModuleInfoSnapshot instead of ModuleInfoBackedContext

We do not need the entire dance around dynamic loading, use just
the bare minimum loader.

Change-Id: Ie04197083144fd24d11108edef013ec5941b2c90
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoDeprecate binding.runtime.spi constructs 72/91072/2
Robert Varga [Sun, 19 Jul 2020 15:23:37 +0000 (17:23 +0200)]
Deprecate binding.runtime.spi constructs

GeneratedClassLoadingStrategy is a relic, superseded by
ClassLoadingStrategy interface. Deprecate it for removal.

ModuleInfoBackedContext is an internal implementation detail, which
should not be used outside fo runtime-spi. Deprecate it for removal.

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

3 years agoRemove uses of deprecated Builder.addAugmentation() 71/91071/1
Robert Varga [Sun, 19 Jul 2020 15:04:18 +0000 (17:04 +0200)]
Remove uses of deprecated Builder.addAugmentation()

We have a few tests which are using the deprecated addAugmentation()
method, remove them.

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

3 years agoBump versions to 6.0.4-SNAPSHOT 00/91400/1
Robert Varga [Fri, 17 Jul 2020 21:13:30 +0000 (23:13 +0200)]
Bump versions to 6.0.4-SNAPSHOT

This starts the next development iteration.

Change-Id: Ie2e139ddea855c81f765e1b9b4dff02810230000
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoResolve generated type for leafrefs targetting unions 69/91369/5
Tomas Cere [Fri, 10 Jul 2020 11:51:54 +0000 (13:51 +0200)]
Resolve generated type for leafrefs targetting unions

We need to be able to resolve the generated type of unions
which are targeted by leafrefs during codegen.
Introduce a path that attempts this by consulting ModuleContext
for the generated types in case we are resolving a leafref.

JIRA: MDSAL-572
Change-Id: I40448a4c9f2fdf26280e0911ebb9dcc5fc60d3f1
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 8c4ab985c1723336640324789c65489e71deb4e0)

3 years agoBump odlparent/yangtools to 7.0.4/5.0.4 34/91334/4
Robert Varga [Wed, 15 Jul 2020 10:32:22 +0000 (12:32 +0200)]
Bump odlparent/yangtools to 7.0.4/5.0.4

Pick up latest fixes from upstream.

Change-Id: Ic6d8e45955d77401b0bbdc4535b0a9a5e3ca9732
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMake full type information accessible from InterfaceTemplate 35/91335/6
illia.ihushev [Wed, 15 Jul 2020 11:35:26 +0000 (14:35 +0300)]
Make full type information accessible from InterfaceTemplate

As we are gearing towards generating default methods in interfaces,
we need the ability to completely analyze all a target type from
a template, not from a generator.

This ability was previously available to Builder*Template, now it
is part of JavaFileTemplate and hence can be picked up by
InterfaceTemplate as needed.

JIRA: MDSAL-470
Change-Id: I5a9b35ae31bfa7ecbffa2b555587d70a97fab93e
Signed-off-by: illia.ihushev <illia.ihushev@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoSpeed up BuilderGenerator matcher 39/91339/2
Robert Varga [Wed, 15 Jul 2020 15:43:28 +0000 (17:43 +0200)]
Speed up BuilderGenerator matcher

We do not need to establish FQCN, as we can compare just JavaTypeNames,
which is faster.

Change-Id: I3c387e841fbf2d450195d864a928608bab8128ad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoGenerate implementedInterfaces method for DataRoot 47/91347/1
Tomas Cere [Thu, 16 Jul 2020 11:34:25 +0000 (13:34 +0200)]
Generate implementedInterfaces method for DataRoot

In case we have multiple top level uses statements we also
need to generate an override of implementedInterfaces() to prevent
clashes with the return types of the extended interfaces.

JIRA: MDSAL-573
Change-Id: I07ad3f6dc5a18369f0be4bdaba03c6c17072297b
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
3 years agoInline single-use locals 05/91305/3
Robert Varga [Mon, 13 Jul 2020 20:11:22 +0000 (22:11 +0200)]
Inline single-use locals

We are storing instrumented type in a local, and use that local
only once. Just inline the getter to trim down some generator
bytecode.

Change-Id: Ibfac0c2dc1d294643cbe2619d14e1672314d8bdf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoClean up CodecDataObjectGenerator documentation 04/91304/2
Robert Varga [Mon, 13 Jul 2020 20:06:45 +0000 (22:06 +0200)]
Clean up CodecDataObjectGenerator documentation

We have a few typos and opportunities for cleanup.

Change-Id: Ibb9f5804ccc05c1b58c51d0ba1ac03fbaef7b223
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd INFO.yaml for mdsal 46/91246/4
Anil Belur [Sun, 12 Jul 2020 00:46:02 +0000 (10:46 +1000)]
Add INFO.yaml for mdsal

Change-Id: Ib3e7c116d04b1c2afbda4ec472c4e31d3cfaf9b2
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>