mdsal.git
2 years agoRelease mdsal v9.0.2
jenkins-releng [Thu, 14 Apr 2022 07:39:01 +0000 (07:39 +0000)]
Release mdsal

2 years agoBump yangtools to 8.0.3 72/100572/1
Robert Varga [Thu, 14 Apr 2022 06:53:33 +0000 (08:53 +0200)]
Bump yangtools to 8.0.3

Pick up fixes from upstream.

Change-Id: I1bb83612ef0c9ad474c2ec4e893c90e2455d62dc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSchemaUnawareCodec is AbstractIllegalArgumentCodec 41/100541/1
Robert Varga [Tue, 12 Apr 2022 09:45:28 +0000 (11:45 +0200)]
SchemaUnawareCodec is AbstractIllegalArgumentCodec

AbstractIllegalArgumentCodec is null-hostile, just as really all
SchemaUnawareCodecs are. Express this in a the type hierarchy,
coalescing things to a place where we can do a like-for like
replacement.

JIRA: MDSAL-704
Change-Id: I44cc2a0d0e5abcb7ea696eeba65dfe892c5daafb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSwitch SchemaUnawareCodec to an abstract class 40/100540/1
Robert Varga [Tue, 12 Apr 2022 09:32:00 +0000 (11:32 +0200)]
Switch SchemaUnawareCodec to an abstract class

We have four implementations here, three of which are indirected via
ValueTypeCodec. Switch the type hierarchy a bit, which leaves only
two codecs still using ValueTypeCodec.

JIRA: MDSAL-704
Change-Id: I4c92f15f7de2678a51792e60431947e4c6acbd6f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDo not indirect UnionLoading through Callable 39/100539/1
Robert Varga [Mon, 11 Apr 2022 17:58:59 +0000 (19:58 +0200)]
Do not indirect UnionLoading through Callable

Let's just declare Exception to be thrown, forcing the caller to deal
with it -- which it already does.

JIRA: MDSAL-704
Change-Id: I21e26b4f40814bb62a03b5e4a46eed3c29f27882
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove ReflectionBaseCodec 38/100538/1
Robert Varga [Mon, 11 Apr 2022 15:06:18 +0000 (17:06 +0200)]
Remove ReflectionBaseCodec

This base class has no real function, remove it.

JIRA: MDSAL-704
Change-Id: I1c79e861bc55133ed16745d4744b29588326eee5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDisconnect BitsCodec from ReflectionBasedCodec 37/100537/1
Robert Varga [Mon, 11 Apr 2022 14:51:01 +0000 (16:51 +0200)]
Disconnect BitsCodec from ReflectionBasedCodec

There is just no need to retain the target class here, as we'll never
access it.

JIRA: MDSAL-704
Change-Id: I1d01af3a16d2a4de5d8bd899428960875280493a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoEliminate ValueTypeCodec.encapsulatedValueCodecFor() 36/100536/1
Robert Varga [Mon, 11 Apr 2022 14:29:53 +0000 (16:29 +0200)]
Eliminate ValueTypeCodec.encapsulatedValueCodecFor()

There are only two call sites in the same method, inline it and remove
the unnecessary indirection through ValueTypeCodec -- which any reason
for existence except binding IllegalArgumentCodec vtable.

JIRA: MDSAL-704
Change-Id: I11cd0b4f08a1cb8dacd1f66fec9070102ba47889
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDisconnect EncapsulatedValueCodec from ReflectionBasedCodec 35/100535/2
Robert Varga [Mon, 11 Apr 2022 14:23:18 +0000 (16:23 +0200)]
Disconnect EncapsulatedValueCodec from ReflectionBasedCodec

While are not looking at the class after we have created our
MethodHandles, hence retaining the Class reference and the baggage
from ReflectionBasedCodec is completely unnecessary. This also
simplifies the class hierarchy a bit.

JIRA: MDSAL-704
Change-Id: Ifc0a9d98d892ab6fa72fd8c91ee3d4a61b1740a1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoEncapsulatedValueCodec does not use TypeDefinition 34/100534/1
Robert Varga [Mon, 11 Apr 2022 14:18:06 +0000 (16:18 +0200)]
EncapsulatedValueCodec does not use TypeDefinition

The class does not use the definition at all, hence we can neatly
switch to using a LoadingCache, making things a lot clearer.

JIRA: MDSAL-704
Change-Id: I6563e7f97c168fc9a06bcddc0668060104ea0f0a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoPromote SchemaUnawareCodec to a top-level construct 33/100533/1
Robert Varga [Mon, 11 Apr 2022 14:09:15 +0000 (16:09 +0200)]
Promote SchemaUnawareCodec to a top-level construct

The encapsulation in ValueTypeCodec seems to be rather unfortunate,
as it is obscuring what codec classes there are.

Change-Id: I25a3cf02b952da9293ad6c4937646c3198fbd6e6
JIRA: MDSAL-704
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSplit STATIC_CODECS into per-type caches 32/100532/1
Robert Varga [Mon, 11 Apr 2022 13:57:28 +0000 (15:57 +0200)]
Split STATIC_CODECS into per-type caches

We have a rather sorry tangle of call sites due to the fact we one
instance of a cache with multiple loaders. Split the cache up separately
for each type, co-locating the cache and the loader. This makes it a tad
clearer as to what the type hierarchy looks like: ValueTypeCodec really
is just a useless holder.

JIRA: MDSAL-704
Change-Id: Ia334d373090a119297e7b9c92bccb166e80bcac6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDisconnect IdentifiableItemCodec from IllegalArgumentCodec 30/100530/1
Robert Varga [Mon, 11 Apr 2022 11:57:24 +0000 (13:57 +0200)]
Disconnect IdentifiableItemCodec from IllegalArgumentCodec

IdentifiableItemCodec is only used by KeyedListNodeCodecContext
and it is used directly. Detach it from IllegalArgumentCodec, making
peeling off one possibility from the class tree.

JIRA: MDSAL-704
Change-Id: I25a818eabe80d5bb3f6b4ff2d152e7ca002a93a1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd InstanceNotification(Publish)ServiceAdapter 35/100435/10
Robert Varga [Wed, 6 Apr 2022 14:58:07 +0000 (16:58 +0200)]
Add InstanceNotification(Publish)ServiceAdapter

Add the binding/dom adapter to route requests towards the DOM service.
This necessitates a bit of work on the codec side to allow generic
notification translation service.

JIRA: MDSAL-494
Change-Id: I6f98304aa475717ae4a0fb0e8fb2fb5b5a659336
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove superfluous @NonNull 26/100526/1
Robert Varga [Sun, 10 Apr 2022 22:51:29 +0000 (00:51 +0200)]
Remove superfluous @NonNull

Nullness is specified by the contract, no need to repeat it.

Change-Id: I27d846125faea0b5cd083f342b61f269cefec257
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRequire yang.binding 25/100525/1
Robert Varga [Sun, 10 Apr 2022 22:48:53 +0000 (00:48 +0200)]
Require yang.binding

We are referencing yang.binding constructs, make sure we require them
transitively.

Change-Id: I84ab5f4e585f469fea05fa91298a035921c79322
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCentralize MoreObjects import 88/100488/3
Robert Varga [Fri, 8 Apr 2022 14:31:57 +0000 (16:31 +0200)]
Centralize MoreObjects import

We are importing MoreObjects through Class, let's go through
JavaTypeName, centralized in JavaFileTemplate. Also use 'var' to elide
the need to refer to it twice.

Change-Id: Id7fa0625e8d939195654b710e5f9847303c33861
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImport java.lang.reflect.Type 89/100489/1
Robert Varga [Fri, 8 Apr 2022 15:05:15 +0000 (17:05 +0200)]
Import java.lang.reflect.Type

Simplify references to make things a tad easier.

Change-Id: I920b633b48b496156eaca2e90ed388adeba41d7e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove unused lines 87/100487/1
Robert Varga [Fri, 8 Apr 2022 14:04:19 +0000 (16:04 +0200)]
Remove unused lines

We have commented-out imports and a superfluous empty line. Remove them.

Change-Id: I91b8dca0041b50baefa032ccff2e4d02a781605a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImport yang-binding 86/100486/1
Robert Varga [Fri, 8 Apr 2022 13:18:50 +0000 (15:18 +0200)]
Import yang-binding

We are referencing a number of constructs here, make sure we also
import the module.

Change-Id: I8b1823046c762e33cc99e1471ee5965ab57e233b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSplit out isBitsType() 81/100481/1
Robert Varga [Fri, 8 Apr 2022 10:38:44 +0000 (12:38 +0200)]
Split out isBitsType()

Simplify dispatch of checking to a separate method.

Change-Id: I59e3baf22bf99ead66f43c7df0fd62ab2b030894
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix Automatic-Module-Name declarations 34/100434/2
Robert Varga [Wed, 6 Apr 2022 14:57:27 +0000 (16:57 +0200)]
Fix Automatic-Module-Name declarations

The declaration should be in <instructions/>, otherwise it is not
effective.

Change-Id: I82aeeaf9c68791ea171853f238afc6a9bafe9661
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDrop a few FIXMEs into mdsal-binding-dom-adapter 33/100433/1
Robert Varga [Wed, 6 Apr 2022 14:36:45 +0000 (16:36 +0200)]
Drop a few FIXMEs into mdsal-binding-dom-adapter

We should have final classes and similar things.

Change-Id: Ie60973456464367db6396906fd079b76f5cfc3dd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd InstanceNotificationService 23/86323/21
Robert Varga [Tue, 10 Dec 2019 10:38:57 +0000 (11:38 +0100)]
Add InstanceNotificationService

InstanceNotificationService provides access to YANG 1.1 nested
notifications, i.e. those defined in a container or a list.

JIRA: MDSAL-494
Change-Id: If308adb3a26964cea90456f8fb020b7364c937db
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix javadoc compatibility 73/96873/8
Robert Varga [Mon, 12 Jul 2021 09:15:54 +0000 (11:15 +0200)]
Fix javadoc compatibility

JDK13+ is much stricter about what is considered valid Javadoc. Fixup
to make compilation pass on JDK17. This breaks linting on JDK11, hence
we also disable it for now.

Change-Id: I4ee650e13a135349c9522ad74fe098f088c09e5d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix RetryingManagedNewTransactionRunner javadoc 20/100420/1
Robert Varga [Tue, 5 Apr 2022 15:45:30 +0000 (17:45 +0200)]
Fix RetryingManagedNewTransactionRunner javadoc

JDK13+ requires H2, JDK11 does not care. Fix it up.

Change-Id: Id3898df1112797d8e026934fdc5cae20860871ed
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix NotificationService javadoc 19/100419/1
Robert Varga [Tue, 5 Apr 2022 15:33:09 +0000 (17:33 +0200)]
Fix NotificationService javadoc

We have an invalid @param here, fix that up.

Change-Id: I737c78114863ab5ca5f3a3485dd38fb6c441b3ca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFixup BindingStreamEventWriter javadoc 18/100418/1
Robert Varga [Tue, 5 Apr 2022 15:31:10 +0000 (17:31 +0200)]
Fixup BindingStreamEventWriter javadoc

JDK17 is picky and the class documentation is a mess anyway. Fix it up.

Change-Id: If7e656b9f3336b9a0cffcc9f64c17eb9853fc919
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSuppress warning around pathArgument 17/100417/1
Robert Varga [Tue, 5 Apr 2022 15:05:15 +0000 (17:05 +0200)]
Suppress warning around pathArgument

For some strange reason SE_BAD_FIELD is triggered with JDK17. The
warning is a false positive, as we are handling serialization via
Externalizable proxy.

Change-Id: I4035194852f6b0a914d76929124d92ca8d3039fe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd DOMInstanceNotificationService 28/98528/9
Robert Varga [Mon, 15 Nov 2021 08:03:27 +0000 (09:03 +0100)]
Add DOMInstanceNotificationService

DOMNotificationService provides a means to subscribe to top-level
notifications, as defined by YANG 1.0. RFC7950 (YANG 1.1) extended
this construct with the notion that notifications can be bound to
a datastore instance.

Define a set of DOMInstanceNotification* interfaces which cover provide
a conterpart to DOMNotification* interfaces and cover the extensions
introduced in YANG 1.1.

JIRA: MDSAL-494
Change-Id: I610f761bfcb9fb292709dd12618ec5bcb9b843c2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix a few javadoc warnings 55/100355/2
Robert Varga [Fri, 1 Apr 2022 17:31:49 +0000 (19:31 +0200)]
Fix a few javadoc warnings

JDK17 is quite picky about these, fix them up.

Change-Id: Id24515f036ec89f24bfb5027ad5d17c37f4b8fa5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoInject RPC input QName into LazySerializedContainerNode 82/100282/9
Dominik Vrbovsky [Wed, 30 Mar 2022 17:53:53 +0000 (19:53 +0200)]
Inject RPC input QName into LazySerializedContainerNode

When ExecuteRpc message is sent with LazySerializedContainerNode
as 'input' parameter, during serialization is invoked its
getIdentifier() method that returns NodeIdentfier of rpc,
not input. So OpsInvoker receives the message with incorrect 'input'
parameter and  we get error downstream because of it.

We need to inject rpc input Qname into LazySerializedContainerNode
to get NodeIdentifier of rpc input from getIdentifier() method. While we
are at it, let's pass a NodeIdentifier, which saves us the cost of
NodeIdentifier.create() in the fast path.

JIRA: MDSAL-739
Change-Id: I77c870fe91a758037bd27e54607e778255d611fc
Signed-off-by: Dominik Vrbovsky <dominik.vrbovsky@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix union stringValue() with Decimal64 09/100309/4
Robert Varga [Thu, 31 Mar 2022 20:25:15 +0000 (22:25 +0200)]
Fix union stringValue() with Decimal64

UnionTemplate still things decimal64 maps to java.math.BigInteger,
resulting in string conversion which does not compile. Fix the template
to recognize Decimal64 as a proper CanonicalValue.

JIRA: MDSAL-738
Change-Id: I0f161b62887f4aea6e0c625d105e48a20c8dc048
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix a typo in UnionTemplate 14/100314/1
Robert Varga [Fri, 1 Apr 2022 08:45:57 +0000 (10:45 +0200)]
Fix a typo in UnionTemplate

We have an extra empty line and mis-spelled 'assigned'.

Change-Id: I058213a3408780ea13249679c0cca4ba21e8a9e8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 9.0.2-SNAPSHOT 56/100256/1
Robert Varga [Fri, 25 Mar 2022 13:40:17 +0000 (14:40 +0100)]
Bump versions to 9.0.2-SNAPSHOT

This starts the next development iteration.

Change-Id: I93eac4d2cf3607265434359543ba5d8808815446
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd YANG Module Tags models 54/100254/1
Robert Varga [Fri, 25 Mar 2022 09:25:08 +0000 (10:25 +0100)]
Add YANG Module Tags models

Add modules from RFC8819.

JIRA: MDSAL-684
Change-Id: Idb8a1e925a6062598dcd5b1ef06e6a6e39ed808e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump yangtools to 8.0.2 45/100245/1
Robert Varga [Thu, 24 Mar 2022 15:42:10 +0000 (16:42 +0100)]
Bump yangtools to 8.0.2

Pick up bugfixes and features from upstream.

Change-Id: I714d308d6a602c075aa59000650296d8b5cfd2d2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 9.0.1-SNAPSHOT 53/100153/2
Robert Varga [Sat, 19 Mar 2022 12:38:01 +0000 (13:38 +0100)]
Bump versions to 9.0.1-SNAPSHOT

This starts the next development iteration.

Change-Id: I7fed52e8ddd7348e1e0aac90e2af7ac792ca5226
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoIgnore empty augmentations at runtime 56/100156/1
Robert Varga [Sun, 20 Mar 2022 11:11:34 +0000 (12:11 +0100)]
Ignore empty augmentations at runtime

We may end up generating an augmentation for a semantically-empty
construct, which in turn will not have a valid AugmentationIdentifier.
Ignore sure augmentations in codec.

JIRA: MDSAL-735
Change-Id: Ibb279a6b554c49857d0ee2ae0108d4d424939d02
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUpdate mdsal-binding-dom-codec-api modele-info 52/100152/1
Robert Varga [Sat, 19 Mar 2022 10:43:38 +0000 (11:43 +0100)]
Update mdsal-binding-dom-codec-api modele-info

We are exposing yang.model.api to users, make sure we require it
transitively.

Change-Id: I97e28c4f080ca3e40869b532ad2cf9b6ff96d07f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse declared statements to resolve augments 51/100151/2
Robert Varga [Fri, 18 Mar 2022 18:37:28 +0000 (19:37 +0100)]
Use declared statements to resolve augments

When trying to map effective instantiated model back to our Generator
hierarchy we need to not get confused by namespaces. The simplest way
to do that is to pick out augmentations first -- as those are the only
ones what can actually differ in namespace. The rest can be taken care
of just based on localName, as we are dealing with
SchemaTreeEffectiveStatements.

In general we can make the connection by tracing back the path we have
taken towards the instantiation site when seeing an
AugmentEffectiveStatement and match it to the corresponding
AbstractAugmentGenerator. Normally we could do this via straight
comparison of AugmentEffectiveStatements, but unfortunately their
equality contract does not give us that.

The reason for that is that we reuse things across groupings, whereas
YANG parser creates separate instantiations -- hence this breaks down
with UsesAugmentGenerator. We deal with that by comparing the declared
view of the two statements -- and those are guaranteed to be unique.

JIRA: MDSAL-735
Change-Id: I4d8f0e50541b53620cc5b0a2170484e85e9cf717
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoOptimize AbstractCompositeRuntimeType storage 44/100144/4
Robert Varga [Thu, 17 Mar 2022 22:01:26 +0000 (23:01 +0100)]
Optimize AbstractCompositeRuntimeType storage

Storage on schema tree does not allow for duplicates. Rather than
allocating a full Map, let's use arrays and associated binary search.
This allows us to drop the storage requirements, especially for choices,
which would end up allocating an object to contain Map.values()
representation.

This results in O(log2(N)) lookups instead of O(1), plus some additional
code, but the lookups are one-off and so well worth the reduced
footprint. A further improvement is that we relax type safety down to
Object, which allows us to not allocate singleton arrays.

Change-Id: Ice6f07a7f853bd68c614a42eda6cc1d3fd2c184e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRework AugmentRuntimeType and Choice/Case linkage 22/100122/11
Robert Varga [Mon, 14 Mar 2022 19:36:49 +0000 (20:36 +0100)]
Rework AugmentRuntimeType and Choice/Case linkage

Augmentations and their interactions with runtime linkage are a strange
beast. Not through YANG semantics, which is very simple. The
complication is Binding Specification reusing statement interfaces
across 'grouping'/'uses' boundaries. This poses distinct challenges as
for a particular GeneratedType we may have multiple augmentations,
which:
- may be completely unrelated. Binding Spec does not provide its usual
  compile-time safety guarantees because it basically says transporting
  anything across grouping boundaries is mostly okay as long as you
  augment all instantiations of the grouping the same way. That is a
  very sensible trade-off, as it allows, for example, no-frills movement
  of data from RPC 'input'/'output' and 'notification' structures to
  and from the datastore. More importantly it allows transportation
  across datastore subtrees, which enables very easy derivation
  pipelines
- but they have to obey YANG namespacing rules, which means that when we
  are interfacing towards yang.data.api (or any YANG-conforming
  projection), we have to make sure the constructs are aligned and also
  perform automated repair & recovery based on Binding Spec assumptions.

Current code behaves incorrectly in this respect, as it does not perform
correct expanstion of 'uses/augments' in one part, and then considers
all augments in when trying to look up a statement -- easily wandering
off into augments which are not appropriate through the YANG scope.

Fix this by correctly tracking with augments are valid in a particular
scope and carefully resolving them.

As a further side-effect of this, the choice/case relationship is
reworked to prevent potential recursion problems and rather expose the
ambiguos linkages in BindingRuntimeTypes.

We also separate CompositeRuntimeType from AugmentableRuntimeType, so
there is a clear distinction which types can be targeted by Augmentable
interfaces and which cannot.

JIRA: MDSAL-731
Change-Id: I027bbfa4ea8315b11b9348f5e0928626de3103a0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove AbstractExplicitGenerator.recursiveRuntimeType() 11/100111/3
Robert Varga [Sun, 13 Mar 2022 23:05:02 +0000 (00:05 +0100)]
Remove AbstractExplicitGenerator.recursiveRuntimeType()

A potential identified in the bug report is repetitive creation
of the same runtime type, when it clearly should be reused.
Make sure we recognize when we are dealing with the same statement
and eliminate one Optional.map() indirection.

JIRA: MDSAL-735
Change-Id: Iaa97a04f58465b302666ca082a887fde9616282a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove Decimal64 range support 14/100114/1
Robert Varga [Sun, 13 Mar 2022 23:55:26 +0000 (00:55 +0100)]
Improve Decimal64 range support

We have classImporter available during generation, hence we can neatly
import Decimal64, reducing boiler plate in range and value declarations.

Decimal64 also exposes a fast instantiation type with scale and unscaled
value -- use those instead of parsing strings.

Change-Id: Ieba07af36fa3d03e20fda0c65754ec2dbfeee451
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump yangtools to 8.0.1 06/100106/5
Robert Varga [Sun, 13 Mar 2022 15:19:47 +0000 (16:19 +0100)]
Bump yangtools to 8.0.1

There is a YANGTOOLS release for the snapshots we are using, adopt it
in preparation for our release.

Change-Id: I81cc41ed615541c44efc256290167518d89b16a4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCorrect ActionService generics 43/99943/2
Robert Varga [Thu, 3 Mar 2022 08:49:24 +0000 (09:49 +0100)]
Correct ActionService generics

We need to allow for any Action, even for KeyedListAction. Make sure to
adjust generics accordingly and add a test.

JIRA: MDSAL-726
Change-Id: I04c8fdf1c8803647c8640bbdd10c19304336b915
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSplit out BindingDataObjectCodecTreeNode.streamChild() 93/100093/3
Robert Varga [Sat, 12 Mar 2022 13:17:40 +0000 (14:17 +0100)]
Split out BindingDataObjectCodecTreeNode.streamChild()

BindingCodecTree does not have a way of entering the tree without
specifying an InstanceIdentifier construct. This is a mistake, as we
need more powerful addressing capabilities to be able to deal with
Notifications and other constructs.

SchemaRootCodecContext is then taught to handle Notifications specially,
now that they cannot legally come from InstanceIdentifier.

JIRA: MDSAL-730
Change-Id: I970cab36d2794472ef801cd0e0d67c264bd169f4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRefactor InstanceIdentifier.create(Iterable) 92/100092/1
Robert Varga [Sat, 12 Mar 2022 12:41:25 +0000 (13:41 +0100)]
Refactor InstanceIdentifier.create(Iterable)

This method is for things like binding/dom codec and similar users who
know what they are doing. Rename the method to 'unsafeOf()', so that the
compilation failures from the change in InstanceIdentifier.create(Class)'s
signature do not produce confusing guidance by pointing to this arcane
method.

Also document this method's purpose, with significant warning and update
it to take a List.

JIRA: MDSAL-730
Change-Id: I9def3750f16d87c11d12809e0f067daf0bf352b9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix identityref wildcards 85/100085/7
Robert Varga [Fri, 11 Mar 2022 19:09:22 +0000 (20:09 +0100)]
Fix identityref wildcards

Identityref use Class<? extends Target> for their return types, hence
we mask unmask the ParameterizedType to Target's JavaTypeName.

JIRA: MDSAL-732
Change-Id: I96fd0ffcffcd65aa7c658ab9d881a950ba41c6cb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove CodeHelpers coverage 90/100090/1
Robert Varga [Sat, 12 Mar 2022 07:25:59 +0000 (08:25 +0100)]
Improve CodeHelpers coverage

We have introduced a new helper, make sure it is covered by UT.

JIRA: MDSAL-722
Change-Id: I5b949c5aac60cf1b90ba98b38afdce09dd08fff4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoReuse ownGetterType 86/100086/2
Robert Varga [Sat, 12 Mar 2022 01:30:15 +0000 (02:30 +0100)]
Reuse ownGetterType

There is no point in acquiring the type again, just use the local
variable.

Change-Id: If6ea83c6a0e4c0af4f4966a85abf9eff765abf18
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoInclude namespace manipulations in error report 88/100088/1
Robert Varga [Sat, 12 Mar 2022 03:41:11 +0000 (04:41 +0100)]
Include namespace manipulations in error report

We need squashing information to make sense of what the requirement
is attempting to do, include it in toString().

Change-Id: Ieeb913680990acb5ccd8690b28c55e4a72f5836e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoEnforce InstanceIdentifier creation 63/100063/6
Robert Varga [Fri, 11 Mar 2022 06:48:14 +0000 (07:48 +0100)]
Enforce InstanceIdentifier creation

We currently allow an InstanceIdentifier to be created for any
DataObject, which is wrong, as that includes raw RpcInputs,
Notifications and the like.

Update create() method to require proper relationship with DataRoot
instances. Alternatives can be worked through instantiating a proper
builder.

Also enforce individual items to always have the proper type.

JIRA: MDSAL-370
Change-Id: I38e83760c0ec29613a9ded24c0783bef940c9b7e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoModernize ExceptionReportingTest 64/100064/2
Robert Varga [Fri, 11 Mar 2022 08:05:22 +0000 (09:05 +0100)]
Modernize ExceptionReportingTest

Use assertThrows() instead of @Test(expected = ) and make sure we
do not perform active operations during class init.

Change-Id: I54b54ebe1f98d632878c9359e7dc42aa1d44d803
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove internal cast 62/100062/1
Robert Varga [Fri, 11 Mar 2022 06:39:17 +0000 (07:39 +0100)]
Improve internal cast

Checking for ImmutableCollection before going to Iterable is not quite
obvious, use a cast to ImmutableCollection.

Change-Id: I3e06a81126ed24310f78e2dc97ceab23be537141
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAlways generate DataRoot interface 25/100025/2
Robert Varga [Wed, 9 Mar 2022 15:17:45 +0000 (16:17 +0100)]
Always generate DataRoot interface

Having a reliable top-level interface is quite convenient for reasoning
about the modules generated. It also allows us to make further
assumption that a ModuleRuntimeType is always present, simplifying
things at runtime.

JIRA: MDSAL-729
Change-Id: Ia83e1910f80abb82ed32760afbd083b414033eb2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUpdate DOMStoreThreePhaseCommitCohort design 21/100021/1
Robert Varga [Wed, 9 Mar 2022 11:38:23 +0000 (12:38 +0100)]
Update DOMStoreThreePhaseCommitCohort design

Do not use ListenableFuture<Void>, which promotes propagation of nulls
across the system. Use instead yang.common.Empty, which has a non-null
singleton value. Also allow commit() to propagate more information
through CommitInfo.

Change-Id: Ib3874c2c84cadcf1f5fb386a38ae5d0a2cb796be
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix StatementRepresentation javadoc 08/100008/1
Robert Varga [Wed, 9 Mar 2022 04:53:17 +0000 (05:53 +0100)]
Fix StatementRepresentation javadoc

We have some outdated documentation, fix that up.

Change-Id: I305b58a92363830c473b1bb103dc1127de3bd3dc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdopt odlparent-10.0.0/yangtools-8.0.0-SNAPSHOT 79/97379/60
Robert Varga [Thu, 2 Sep 2021 19:23:37 +0000 (21:23 +0200)]
Adopt odlparent-10.0.0/yangtools-8.0.0-SNAPSHOT

Bump upstream versions to pick up dependency upgrades and major features
from yangtools. Also adjust code to package movements and fix test
models now that unique components are validated by YANG parser.

Change-Id: Id15dd16daea9fe80af030103069d999129b28cf6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRework BindingRuntimeTypes 45/98245/100
Robert Varga [Fri, 29 Oct 2021 16:06:01 +0000 (18:06 +0200)]
Rework BindingRuntimeTypes

BindingRuntimeTypes serves to bring together GeneratedTypes and
SchemaNodes. We do this in a a number of different ways, but a lot of
the times this ends up looking a Type and then finding the SchemaNode
which generated it -- and then perhaps inquire children by SchemaNode
(which again is looked up in some way).

Once we have done these cross-lookups, we resolve the Type to a Class
through BindingRuntimeContext and instantiate a
DataContainerCodecPrototype, which holds these (and other) bits
together.

Current code relies on DerivableSchemaNode and SchemaNode-based lookups
to resolve these due to historical reasons. Our Generator infrastructure
already has AbstractExplicitGenerator.getOriginal() to perform the
equivalent operation.

This patch defines a RuntimeType base interface which holds together an
EffectiveStatement and a Generated type. We also define a
RuntimeTypeContainer to expose lookup methods for inquiring child
RuntimeTypes as appropriate.

BindingRuntimeTypes serves as the root of a tree hierarchy, where
RuntimeType is a leaf node and CompositeRuntimeType is an interior
node.

NodeCodecContext and its subclasses are modified to maintain a reference
to their backing RuntimeType and issue appropriate localized lookups.

JIRA: MDSAL-696
Change-Id: I45850d320e01fce0b227512b9f5f7b19331df60e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDo not use BindingReflections to acquire augmentations 98/99998/2
Robert Varga [Mon, 7 Mar 2022 17:38:37 +0000 (18:38 +0100)]
Do not use BindingReflections to acquire augmentations

Augmentable interface exposes augmentations directly, hence we
can use it directly, without relying on reflection.

Change-Id: I21b86d581ff0a61db3975cf7655157e4e6678b1b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoTrack schema tree generator linkage 98/99798/17
Robert Varga [Fri, 18 Feb 2022 10:49:16 +0000 (11:49 +0100)]
Track schema tree generator linkage

Runtime information requires looking up target generator for a schema
tree particant, which means that AbstractCompositeGenerator needs to
resolve QName to the original instantiation.

We already have that mechanics for the most part, as we need to perform
the lookup to resolve augment statements target.

Introduce SchemaTree{Child,Parent} decomposition of the addressing
problem, and retrofit generators to support them. This will allow us to
support lookups along the schema tree axis.

JIRA: MDSAL-696
Change-Id: I619fe9e7c0896d6d3f0f33b04d5200ca8ec30340
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove information provided on failed linkage progress 69/99969/2
Robert Varga [Fri, 4 Mar 2022 18:53:05 +0000 (19:53 +0100)]
Improve information provided on failed linkage progress

Linkage algorithm seems to have a issue with a set of proprietary
models. Rather than throwing a simple exception, add debug logging
to track which items progress and report any remaining items as
suppressed exceptions.

Change-Id: Ia7f1efe498f1ac82de35facf0188d0a2972e2b09
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBindingRuntimeTypes should be an interface 77/99877/1
Robert Varga [Fri, 25 Feb 2022 16:06:13 +0000 (17:06 +0100)]
BindingRuntimeTypes should be an interface

We do not want to expose the internals of how this interface is
realized, make sure we split it into an interface and an implementation.

JIRA: MDSAL-696
Change-Id: Icc01bc2c66cbf57c8cbb2ff9c32ac30c373b899d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix javadoc warnings in mdsal-binding-util 57/99857/1
Robert Varga [Thu, 24 Feb 2022 15:37:46 +0000 (16:37 +0100)]
Fix javadoc warnings in mdsal-binding-util

We have a few undocumented generic parameters, fix that up.

Change-Id: Ifbe06d528b9333026c1bdc0bd6af73570940ade0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove OriginalLink safety 46/99846/3
Robert Varga [Thu, 24 Feb 2022 07:17:11 +0000 (08:17 +0100)]
Improve OriginalLink safety

The links to previous and original statement need to match our
statement, otherwise we are in trouble. While we do not verify this
at runtime (yet), improve type definitions to carry these around.

JIRA: MDSAL-696
Change-Id: I3bcc1c3b0d2e3f74a0727f8bfa6b2f1e1c578f67
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove is{List,Map}Type(Type) methods 98/99698/4
Robert Varga [Fri, 11 Feb 2022 18:45:12 +0000 (19:45 +0100)]
Remove is{List,Map}Type(Type) methods

These methods are not used anywhere anymore remove them.

Change-Id: I993a2baf48b2603f28559688a907d1b7d7780307
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMap system-ordered leaf-lists to Set<T> 97/99697/6
Robert Varga [Fri, 11 Feb 2022 16:35:19 +0000 (17:35 +0100)]
Map system-ordered leaf-lists to Set<T>

System-ordered leaf-lists can get re-ordered and hence the binding
mapping to java.util.List is not appropriate. Make sure we map them
to java.util.Set.

JIRA: MDSAL-722
Change-Id: I4c82736b3ef25fd1197c446aca2c9d22a59a3d96
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix an eclipse warning 11/99811/1
Robert Varga [Thu, 3 Feb 2022 15:09:32 +0000 (16:09 +0100)]
Fix an eclipse warning

<T extends Optional<?>> is not liked because of Optional being final.
Fix the warning by changing the prototype a bit.

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

2 years agoImprove DtaContainerCodecProtype.loadInstance() 44/99844/1
Robert Varga [Wed, 23 Feb 2022 13:04:54 +0000 (14:04 +0100)]
Improve DtaContainerCodecProtype.loadInstance()

We have a warning creeping here, fix it.

Change-Id: I94249f7cdc8f5fabdeee44084aaf0c325d62eb61
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoHide TypeBuilderFactory subclasses 43/99843/1
Robert Varga [Wed, 23 Feb 2022 08:54:42 +0000 (09:54 +0100)]
Hide TypeBuilderFactory subclasses

TypeBuilderFactory subclasses are being checked for Codegen subclass,
so as to add (or not) documentation. Refactor addCodegenInformation()
by moving it to the factory, with Runtime ignoring doing nothing.

Change-Id: I724bd304de0ec1a51520e59e64b21d1060d7e013
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoClean up BindingDOMRpcServiceAdapter a bit 40/99840/1
Robert Varga [Tue, 22 Feb 2022 16:59:48 +0000 (17:59 +0100)]
Clean up BindingDOMRpcServiceAdapter a bit

This class should be final. Also use requireNonNull() and Class.cast()
to clean up our act.

Change-Id: I9c47d8eb1e8ec76b50cc6f310e99e3db0605ee8f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove RpcMethodInvoker specializations 39/99839/2
Robert Varga [Tue, 22 Feb 2022 16:41:49 +0000 (17:41 +0100)]
Remove RpcMethodInvoker specializations

RPCs always contain an input, hence we do not need specializations.
Collapse the three classes into a single one.

Change-Id: Icdd126a8d6b1c6d352eaedf3efdd7b85e96c5f18
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSeparate out notification handling 31/99831/4
Robert Varga [Mon, 21 Feb 2022 13:34:38 +0000 (14:34 +0100)]
Separate out notification handling

This reverts another part of 7a17eba49deb73733bdbb9579d2edd672bb0d71e
as well as 576ae2cd595f0ce17abd1f33150b068b7f0f801d, hence not allowing
Notifications to be entered through streamChild().

JIRA: MDSAL-724
Change-Id: I1b37139fcb8bd8aaf92465943a46e71069e87f3e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSeparate out RPC input/output codecs 38/99838/3
Robert Varga [Tue, 22 Feb 2022 11:09:56 +0000 (12:09 +0100)]
Separate out RPC input/output codecs

This partially reverts 7a17eba49deb73733bdbb9579d2edd672bb0d71e, as
leads to false sharing and corresponding problems with invalid
InstanceIdentifiers not being caught.

JIRA: MDSAL-724
Change-Id: I0ddf62efffb23e793b6727e0afcf50303f7aea74
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMark DataContainerCodecPrototype.isChoice() for removal 35/99835/2
Robert Varga [Mon, 21 Feb 2022 17:04:44 +0000 (18:04 +0100)]
Mark DataContainerCodecPrototype.isChoice() for removal

This is an internal remnant from when we did not have a ChoiceIn
intermediate class. Mark it for removal.

JIRA: MDSAL-696
Change-Id: I50217ccfd6ff4c6c7db58e1085fa253779732e8f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd negative tests for instance identifier codec 30/99830/2
Robert Varga [Mon, 21 Feb 2022 13:03:13 +0000 (14:03 +0100)]
Add negative tests for instance identifier codec

We are about to refactor a few aspects of how things are being looked
up, make sure we cover cases which should be rejected.

JIRA: MDSAL-696
Change-Id: I8b0eddf05eadd4178951176480fa35b9753bc751
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove an unneeded line 05/99805/1
Robert Varga [Sun, 20 Feb 2022 15:00:16 +0000 (16:00 +0100)]
Remove an unneeded line

We are at the end of the loop, no need for a continue statement.

Change-Id: I79478fcbda4820c3923fae39dfec5fe7c47a0e70
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd some Generator documentation 78/99778/1
Robert Varga [Wed, 16 Feb 2022 18:23:22 +0000 (19:23 +0100)]
Add some Generator documentation

Add a bit of explanation on how the generator tree is organized and drop
a few FIXMEs for things we want to get rid of in the long term.

Change-Id: I7c7820aeadcce0e2a69ff3033d5c2efc75b2dda3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCorrect ActionProviderService method definition 61/99761/1
Peter Suna [Tue, 15 Feb 2022 17:08:35 +0000 (18:08 +0100)]
Correct ActionProviderService method definition

registerImplementation generics fail to account for KeyedListActions.
Fix that by making sure allow for KeyedInstanceIdentifiers as well as
InstanceIdentifiers.

JIRA: MDSAL-723
Change-Id: Iac402bb4390dbd1805fc930c2250b3c7c8343dc0
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
2 years agoPackage ietf-yang-patch 14/99714/1
Robert Varga [Mon, 14 Feb 2022 10:19:47 +0000 (11:19 +0100)]
Package ietf-yang-patch

ietf-yang-patch defines a useful structure for atomic datastore
operations. Package it so we can take advantage of it later.

JIRA: MDSAL-676
Change-Id: Ibd66c1e2b3676bb2c3948e47359de4c24a0b03e0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoPackage ietf-restconf 12/99712/2
Robert Varga [Mon, 14 Feb 2022 10:01:23 +0000 (11:01 +0100)]
Package ietf-restconf

ietf-restconf defines yang-data extension, which is a prerequisite for a
number of other documents. Package the model in mdsal.

JIRA: MDSAL-676
Change-Id: I4ae08b0c02b607a5585acbab31e8996907555ba8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix uses/augment linkage 72/99672/2
Robert Varga [Fri, 21 Jan 2022 06:10:37 +0000 (07:10 +0100)]
Fix uses/augment linkage

Our previous fix for MDSAL-715 switched the resolution logic to a unified
approach based on linked augmentation. Unfortunately it missed the fact
that linking the groupings also had the side-effect of setting the
augment target, which in turn populates 'augments' list.

Our failure to do so ends up wrecking lookups in the case where we have
an uses-augmented node further augmented by a module-augment.

Fix this by intertwining original and augment linkage, so that a subtree
root (such as module) pays attention to augments which need to resolve
before descending to recursive linkage.

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

2 years agoBump yangtools to 7.0.14 06/99706/1
Robert Varga [Sun, 13 Feb 2022 09:22:14 +0000 (10:22 +0100)]
Bump yangtools to 7.0.14

Pick up fixes from upstream.

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

2 years agoBump byte-buddy to 1.12.8 87/99687/9
Robert Varga [Thu, 10 Feb 2022 23:26:22 +0000 (00:26 +0100)]
Bump byte-buddy to 1.12.8

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.12.2
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.12.3
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.12.4
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.12.5
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.12.6
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.12.7
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.12.8

Change-Id: I660d0fff4a67b33202bdb70b56ee546d63ac15d3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove ActionProviderServiceAdapter defensiveness 81/99681/1
Robert Varga [Thu, 10 Feb 2022 10:51:39 +0000 (11:51 +0100)]
Improve ActionProviderServiceAdapter defensiveness

Do not throw unchecked exceptions when we encounter an invalid
path, but rather gracefully return an invocation error.

Change-Id: Ia5a32cad4a1785de430d6d9ab48a5fe4178c40a4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCorrect ActionSpec definition 80/99680/3
Robert Varga [Thu, 10 Feb 2022 10:38:25 +0000 (11:38 +0100)]
Correct ActionSpec definition

ActionSpec's generics fail to account for KeyedListActions. Fix that
by making sure allow for KeyedInstanceIdentifiers as well as
InstanceIdentifiers.

JIRA: MDSAL-721
Change-Id: I520e23e0294c38c37c6a15dd4d7f05c937476357
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoClarify ActionSpec documentation 77/99677/2
Robert Varga [Thu, 10 Feb 2022 09:21:45 +0000 (10:21 +0100)]
Clarify ActionSpec documentation

The documentation hints at wildcard InstanceIdentifier, but people have
trouble with the concept and what it means. Clarify that a bit.

JIRA: MDSAL-721
Change-Id: I9af71fbbfd2d27b4e4c4c12077975be1671647e3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDo not allow wildcards in Action.invoke() 78/99678/3
Robert Varga [Thu, 10 Feb 2022 09:32:22 +0000 (10:32 +0100)]
Do not allow wildcards in Action.invoke()

Wildcard invocations do not make sense, as they could match any number
of instances. Document such attempts as throwing IAE.

Change-Id: I23780fee31c2f6c60d883764c046703ee92687f2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove rfc7895 ietf-yang-library 63/99563/3
Robert Varga [Thu, 3 Feb 2022 09:13:40 +0000 (10:13 +0100)]
Remove rfc7895 ietf-yang-library

We have a replacement revision in rfc8525 which we support equally
well. Remove modules and yanglib implementation based on the old
revision.

JIRA: MDSAL-720
Change-Id: I20b84657876a83895eb35bf18b2878e129eece33
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoExamine supported features in yanglib 62/99562/4
Robert Varga [Thu, 3 Feb 2022 08:43:00 +0000 (09:43 +0100)]
Examine supported features in yanglib

yang-model-library exposes the features that are actually supported from
a particular module. Process this information and pass it to
SchemaContextResolver so that it can create a correct
EffectiveModelContext.

JIRA: MDSAL-719
Change-Id: I32af4cdec4acb823ad90f2608036f0d71210910b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse 'var' for local variables 60/99560/2
Robert Varga [Thu, 3 Feb 2022 07:29:05 +0000 (08:29 +0100)]
Use 'var' for local variables

We need to use long qualifiers because various we have simple name
overlaps. Use 'var' consistently so that we shorten these.

Change-Id: Ib49fef64bb2ed61d96edbe28a42588deb7b239ad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSimplify original tracking 46/99046/1
Robert Varga [Sun, 30 Jan 2022 00:22:23 +0000 (01:22 +0100)]
Simplify original tracking

Rather that having a quad-state 'prev' field typed to Object, potentially
containing an OriginalLink, make its state logically tri-state typed
with AbstractExplicitGenerator. The resolved generator is then carried in
an explicit field.

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

2 years agoEnforce explicit generator linkage 45/99045/1
Robert Varga [Fri, 28 Jan 2022 23:06:59 +0000 (00:06 +0100)]
Enforce explicit generator linkage

We are keeping the original pointer as a simple nullable field. This can
result in us confusing an unresolved generator with an original, leading
to potential badness.

Refactor the AbstractExplicitGenerator to track incremental resolution,
catching invalid accesses.

JIRA: MDSAL-718
Change-Id: Ie67fa4d08d0887f301948e3d03d846ed9ee1d628
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 40dd3e7e4793c0f04d8a4635f9d2d368e8e5214c)

2 years agoImprove AugmentedTypeTest 44/99044/1
Robert Varga [Sat, 29 Jan 2022 01:53:32 +0000 (02:53 +0100)]
Improve AugmentedTypeTest

Eclipse is warning of an always-false equality check in this test suite.
Fix this by performing a proper type comparison, eliminating use of
assertTrue().

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

2 years agoFixup AbstractDOMStoreTreeChangePublisher 03/99503/2
Robert Varga [Thu, 27 Jan 2022 18:01:43 +0000 (19:01 +0100)]
Fixup AbstractDOMStoreTreeChangePublisher

With DOMDataTreeChangeListener reporting lists, we need to adjust our
SPI to floow suite.

Change-Id: Ib3f5b98519e33ed28a3bfa276903c26e399ab9bd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump odlparent/yangtools to 9.0.13/7.0.13 75/99475/1
Robert Varga [Wed, 26 Jan 2022 16:32:38 +0000 (17:32 +0100)]
Bump odlparent/yangtools to 9.0.13/7.0.13

Pick up latest fixes from upstream.

Change-Id: I4cd88e9d8371b8cd3f4cfdc4f004d93f0eb3cf3b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoGeneratorReactor.linkOriginalGenerator() should be stateless 41/99441/1
Robert Varga [Tue, 25 Jan 2022 12:01:22 +0000 (13:01 +0100)]
GeneratorReactor.linkOriginalGenerator() should be stateless

linkOriginalGenerator() does not need to modify GeneratorReactor, make
it static, so that we can disconnect the state manipulation.

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

2 years agoRemove GeneratorReactor.leafGenerators 40/99440/1
Robert Varga [Tue, 25 Jan 2022 11:49:48 +0000 (12:49 +0100)]
Remove GeneratorReactor.leafGenerators

This field is completely unused, remove it.

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