mdsal.git
6 months agoMigrate ietf-type-util to JUnit5 00/108500/1
Robert Varga [Wed, 18 Oct 2023 15:57:41 +0000 (17:57 +0200)]
Migrate ietf-type-util to JUnit5

This is a straightforward automated conversion.

Change-Id: I307c021985090c59e8d41fc833427c0da9e7842f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoFix links in README 38/106938/4
matus.matok [Thu, 20 Jul 2023 07:26:31 +0000 (09:26 +0200)]
Fix links in README

Fixed the links in README.md to use the correct markdown syntax.

JIRA: MDSAL-832
Change-Id: Iba195c6ee9191480b8cfb4c888fb82904ba3f37a
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
6 months agoBump byte-buddy to 1.14.9 75/108475/1
Robert Varga [Tue, 17 Oct 2023 12:18:08 +0000 (14:18 +0200)]
Bump byte-buddy to 1.14.9

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

Change-Id: I254907a6467e8d3d76d165bd4f3c22a379545eb7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoAdd docs for model registration with OSGi 86/104986/13
Šimon Ukuš [Wed, 22 Mar 2023 14:43:40 +0000 (15:43 +0100)]
Add docs for model registration with OSGi

JIRA: MDSAL-9
Change-Id: Id0c6c2071c14977caad31743253bbae8b6436755
Signed-off-by: Šimon Ukuš <simon.ukus@pantheon.tech>
7 months agoBump upstreams 08/108108/2
Robert Varga [Sun, 1 Oct 2023 23:29:00 +0000 (01:29 +0200)]
Bump upstreams

Adopt:
- odlparent-13.0.5
- yangtools-11.0.3

Change-Id: Ic5ae3e0bfa2359087ad4c8818794746489ab2e20
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoFix NotificationListenerInvokerTest on Java 19+ 64/108064/1
Robert Varga [Fri, 29 Sep 2023 16:03:18 +0000 (18:03 +0200)]
Fix NotificationListenerInvokerTest on Java 19+

We cannot mock MethodHandle, as it is a sealed class on Java 19+. Adjust
the test to use String.toString() as the source of the MH.

Change-Id: Ieab28fdec5c703c2fcad8b14cd95ea3f49bd2a21
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoBump versions to 12.0.3-SNAPSHOT 98/107898/1
Robert Varga [Sun, 17 Sep 2023 11:53:18 +0000 (13:53 +0200)]
Bump versions to 12.0.3-SNAPSHOT

This starts the next development iteration.

Change-Id: Id25ee91d56adadb4dda0b0dbb57555a5f0a31b7a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoRelease mdsal v12.0.2
jenkins-releng [Sun, 17 Sep 2023 09:11:11 +0000 (09:11 +0000)]
Release mdsal

7 months agoBump byte-buddy to 1.14.8 91/107891/1
Robert Varga [Sat, 16 Sep 2023 11:11:17 +0000 (13:11 +0200)]
Bump byte-buddy to 1.14.8

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

Change-Id: Ica0c4632f81b6d11303409303ebe30245b63cc22
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoBump yangtools to 11.0.2 90/107890/1
Robert Varga [Sat, 16 Sep 2023 11:10:35 +0000 (13:10 +0200)]
Bump yangtools to 11.0.2

Pick up fixes and improvements from upstream.

Change-Id: I25d4724ac546438db4470925bb73e30c7f9cccea
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoMake AbstractPingPongTransactionChain.close() idempotent 76/107676/2
Robert Varga [Sun, 3 Sep 2023 19:59:41 +0000 (21:59 +0200)]
Make AbstractPingPongTransactionChain.close() idempotent

Expend one byte of state to track close() method, making sure it is
idempotent.

JIRA: MDSAL-838
Change-Id: Ie7bccb2c12ad9eadd948fc15244cc2b2b150a256
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoMigrate callers of deprecated DataTreeCandidateNode methods 77/107677/1
Robert Varga [Sun, 3 Sep 2023 20:13:23 +0000 (22:13 +0200)]
Migrate callers of deprecated DataTreeCandidateNode methods

DataTreeCandidateNode has deprecated a number of methods, migrate its
callers.

Change-Id: Ie190e4bfa6c4e37c3f242d9b6220a5dcc9e3d20d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoMigrate mdsal-dom-api to JUnit5 01/107601/4
Robert Varga [Wed, 30 Aug 2023 17:52:31 +0000 (19:52 +0200)]
Migrate mdsal-dom-api to JUnit5

Migrate and clean up tests.

Change-Id: Id437ae4ca4e93ca2b8ec38ed46a760fe2db4d157
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoMigrate mdsal-common-api to JUnit5 02/107602/3
Robert Varga [Wed, 30 Aug 2023 19:19:39 +0000 (21:19 +0200)]
Migrate mdsal-common-api to JUnit5

This is mostly a trivial conversion, but we also expand the test suite
to increase coverage and assertions.

Change-Id: I6ad81c99cc153e2fee3cd937dba42371a98ea047
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoMigrate mdsal-binding-api to JUnit5 00/107600/2
Robert Varga [Wed, 30 Aug 2023 17:35:26 +0000 (19:35 +0200)]
Migrate mdsal-binding-api to JUnit5

Remove DataObjectModificationTest and migrate other tests to use JUnit5.

Change-Id: Ie341ae97344066a0627225e7ee56162bc27927ac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoBump versions to 12.0.2-SNAPSHOT 99/107599/1
Robert Varga [Wed, 30 Aug 2023 19:26:19 +0000 (21:26 +0200)]
Bump versions to 12.0.2-SNAPSHOT

This starts the next developement iteration.

Change-Id: I1cab2e06404eb6de3fb589fb07ba34f1695f98b4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoRelease mdsal v12.0.1
jenkins-releng [Wed, 30 Aug 2023 14:41:47 +0000 (14:41 +0000)]
Release mdsal

8 months agoBump upstreams 84/107584/2
Robert Varga [Wed, 30 Aug 2023 12:07:25 +0000 (14:07 +0200)]
Bump upstreams

Adopt:
- odlparent-13.0.4
- yangtools-11.0.1

Change-Id: I292e6adbf213017d4dc9316e32ba60111ad7e60b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoFix mdsal-binding-dom-adapter checkstyle 83/107583/1
Robert Varga [Wed, 30 Aug 2023 13:06:45 +0000 (15:06 +0200)]
Fix mdsal-binding-dom-adapter checkstyle

Upgraded checkstyle is finding a few issues, fix them up.

Change-Id: Ifdafb339f112749b891ef288420e28af124b306e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoFix mergeParentStructure{Merge,Put} with augmentations 66/107566/4
Robert Varga [Wed, 30 Aug 2023 08:35:26 +0000 (10:35 +0200)]
Fix mergeParentStructure{Merge,Put} with augmentations

We need to pay attention to the result of normalization, as
AugmentationResult points to the parent YangInstanceIdentifier --
and hence we should just use it instead of peeling its last component.

JIRA: MDSAL-837
Change-Id: I7f108a6dff96a010f029b38b2cbba5548551b56e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoClean up dependencies 72/107572/1
Robert Varga [Wed, 30 Aug 2023 09:47:20 +0000 (11:47 +0200)]
Clean up dependencies

We have quite a few warnings about used undeclared dependencies, clean
them up.

Change-Id: I768629694f426f99aaa32a53d19b18642b88a0bd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoSplit out OperationInvocation 65/107565/2
Robert Varga [Tue, 29 Aug 2023 19:11:37 +0000 (21:11 +0200)]
Split out OperationInvocation

This should be a top-level class, even when it is a utility. Changes the
logger identity, but fixes a Sonar warning.

Change-Id: Id7777ac73b8e765df86349384f5f911f48562c00
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoQualify nested interfaces 64/107564/1
Robert Varga [Tue, 29 Aug 2023 18:59:56 +0000 (20:59 +0200)]
Qualify nested interfaces

Fix Sonar warnings stemming from differing import policies:
Eclipse requires these references to be imported, whereas Sonar flags
them.

Use qualified refernces to eliminate the ambiguity.

Change-Id: Iac509fdd28b7520220a9f171b0d5fff0df306663
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoMerge if() statements 63/107563/1
Robert Varga [Tue, 29 Aug 2023 18:58:51 +0000 (20:58 +0200)]
Merge if() statements

There is no point in having nested if() statements, merge them,
eliminating a Sonar warning.

Change-Id: I9a1e325c6366446858fe47fd4956d0754f9b9f19
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoBind to org.eclipse.jdt.annotation 62/107562/1
Robert Varga [Tue, 29 Aug 2023 18:57:32 +0000 (20:57 +0200)]
Bind to org.eclipse.jdt.annotation

We are using these annotations with scope=compile, hence we can safely
binding to the classes at runtime. Fixes a few Sonar warnings.

Change-Id: I793b847d9d25086e32158f333d8c5c155e554568
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoBump xtend to 2.32.0 50/107550/1
Robert Varga [Tue, 29 Aug 2023 07:06:32 +0000 (09:06 +0200)]
Bump xtend to 2.32.0

https://eclipse.dev/Xtext/xtend/releasenotes.html#/releasenotes/2023/08/27/version-2-32-0

Change-Id: I1179a8129e379fe833a6e6487d22d6c7abad5362
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoBump byte-buddy to 1.14.7 27/107527/1
Robert Varga [Mon, 28 Aug 2023 11:43:11 +0000 (13:43 +0200)]
Bump byte-buddy to 1.14.7

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.14.6
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.14.7

Change-Id: Ia547a6bc735f5efa6d0420dc0261442f077e815d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRemove CommonDataObjectCodecContext.namespace() 53/106853/1
Robert Varga [Mon, 10 Jul 2023 12:14:27 +0000 (14:14 +0200)]
Remove CommonDataObjectCodecContext.namespace()

This method is not used anywhere, remove it. This cascades to
CommonDataObjectCodecPrototype.getNamespace(), which is also unused and
removed -- trimming down the overall memory cost and the need to make up
a namespace.

Change-Id: Iefe432de785d0c7400dd5be87797c849e56c2f9d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoUnify yangPathArgumentChild() 52/106852/3
Robert Varga [Mon, 10 Jul 2023 11:42:31 +0000 (13:42 +0200)]
Unify yangPathArgumentChild()

We have two implementations which are doing essentially the same thing
-- except ChoiceCodecContext performs lookup twice. Reduce the amount of
codec duplication.

JIRA: MDSAL-805
Change-Id: I834bf66d92f8bf3ad8621be28ba3fbb39f52f9fc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoUnify streamChild() implementations 51/106851/2
Robert Varga [Mon, 10 Jul 2023 11:27:33 +0000 (13:27 +0200)]
Unify streamChild() implementations

The two implementations we have perform essentially the same thing, tie
them together.

JIRA: MDSAL-805
Change-Id: I303ae152987b4d478862874b4d9ee3fc8db4f7db
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRevert "Convert model.ietf.rfc8040 to JPMS" 45/106845/2
Robert Varga [Mon, 10 Jul 2023 08:03:04 +0000 (10:03 +0200)]
Revert "Convert model.ietf.rfc8040 to JPMS"

This reverts commit f22f321bc45e37db18af4d3b1056d6fb24f29943. We are not
ready for this just now.

Change-Id: If9f58fb27747aef2c02bd9e291322d15b7be1ac7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoUnify getStreamChild() implementations 49/106849/2
Robert Varga [Mon, 10 Jul 2023 10:00:28 +0000 (12:00 +0200)]
Unify getStreamChild() implementations

We have two implementations, which essentially do the same thing. Unify
them in DataContainerCodecContext.

JIRA: MDSAL-805
Change-Id: I97db0a356c51472a30b206151426921f5ad550cf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoFix mdsal-binding-dom-codec dependencies 50/106850/1
Robert Varga [Mon, 10 Jul 2023 11:12:15 +0000 (13:12 +0200)]
Fix mdsal-binding-dom-codec dependencies

We are using JDT annotations, declare that.

Change-Id: I1c4a6d112da9015fb3885e40c33bf27cd31246ee
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRemove superfluous documentation 48/106848/2
Robert Varga [Mon, 10 Jul 2023 09:43:40 +0000 (11:43 +0200)]
Remove superfluous documentation

DataContainerCodecContext implements contracts, there is no need to
re-state the same contract.

Change-Id: Ie1694ff61c61933df8811dcc39b23eca41cf6319
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoConvert model.ietf.rfc8040 to JPMS 37/106837/1
Robert Varga [Thu, 6 Jul 2023 00:51:22 +0000 (02:51 +0200)]
Convert model.ietf.rfc8040 to JPMS

Rather than being an automatic module, make this an explicit module.

Change-Id: Ifa58df2d9a3279252a1fb453fc7a3b7b49f1c620
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRemove PMD/CPD configuration 35/106835/1
Robert Varga [Thu, 6 Jul 2023 00:13:32 +0000 (02:13 +0200)]
Remove PMD/CPD configuration

We do not have PMD/CPD plugins configured, there is no need to disable
them.

Change-Id: I05a7ed5978eb54440b6d6009a9ea26af9b29926e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoDo not require ListeningExecutorService 10/106810/2
Robert Varga [Tue, 4 Jul 2023 19:32:17 +0000 (21:32 +0200)]
Do not require ListeningExecutorService

SerializedDOMDataBroker can easily operate on any Executor with the
help of Futures.submit(). Drop the requirement to have a
ListeningExecutorService and operate on plain Executor.

Change-Id: I5e5bc1f0c7bfa93f443bc18755d48beafc22f7f0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoSharpen DataContainerCodecContext generics 59/106759/4
Robert Varga [Thu, 29 Jun 2023 21:31:58 +0000 (23:31 +0200)]
Sharpen DataContainerCodecContext generics

Now that RootCodecContext is gone, we can sharpen T to require
CompositeRuntimeType, eliminating a bit of weirdness.

Change-Id: I9f430ceeaa59baedcb7ea2b0e69ad279964eb6ea
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoFold RootCodecContext into BindingCodecContext 58/106758/4
Robert Varga [Thu, 29 Jun 2023 20:51:28 +0000 (22:51 +0200)]
Fold RootCodecContext into BindingCodecContext

RootCodecContext exists only for two purposes:
- return for an empty YangInstanceIdentifier lookup
- ease of InstanceIdentifier lookup

In order to fulfill these two roles, it ends up twisting the
BindingDataObjectCodecTreeNode contract in rather nonsensical ways,
preventing a number of further evolutions of the API.

Fold its functionality into BindingCodecContext, eliminating it from the
class hierarchy.

Change-Id: I44a49b78ed9ae418c5c85e48e9441fa1ec1e9862
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoBump versions to 12.0.1-SNAPSHOT 64/106764/1
Robert Varga [Fri, 30 Jun 2023 08:11:01 +0000 (10:11 +0200)]
Bump versions to 12.0.1-SNAPSHOT

This starts the next development iteration.

Change-Id: I7a73013e69e31b3bea46a44afa9e5e7a05b4a711
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRelease mdsal v12.0.0
jenkins-releng [Thu, 29 Jun 2023 22:25:23 +0000 (22:25 +0000)]
Release mdsal

10 months agoAdd interfaces for (Normalized)YangData codec 56/106756/1
Robert Varga [Thu, 29 Jun 2023 19:01:03 +0000 (21:01 +0200)]
Add interfaces for (Normalized)YangData codec

We are lacking the ability to transcode yang.binding.YangData to
NormalizedYangData. This patch adds the baseline interfaces required
along with disabled tests.

JIRA: MDSAL-805
Change-Id: I026240e553ffe3415466f94cb1e3f206eb5a3a0c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoSplit up CodecDataObjectAnalysis 53/106753/3
Robert Varga [Thu, 29 Jun 2023 14:47:16 +0000 (16:47 +0200)]
Split up CodecDataObjectAnalysis

CodecDataObjectAnalysis contains two things: the indexing of children
and then the generated class. We need to split these up, so we can
actually plugin in YangData (which needs to former) into the mix.

JIRA: MDSAL-805
Change-Id: Ic38cbf1be4b4011ae5dd983d1826e020a67620c4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoReduce unchecked warnings 52/106752/1
Robert Varga [Thu, 29 Jun 2023 14:39:19 +0000 (16:39 +0200)]
Reduce unchecked warnings

We do not need DataObject specialization, which solves a few warnings
around casting.

JIRA: MDSAL-805
Change-Id: I1d4ef9938ae75bff182e4f1bfad8d7caaae4a313
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoSplit out BindingDataContainerCodecTreeNode 27/106727/16
Robert Varga [Tue, 27 Jun 2023 16:23:02 +0000 (18:23 +0200)]
Split out BindingDataContainerCodecTreeNode

DataContainer contract is well-known and used all over the place. Split
it out so it can be implemented separately. This also reworks codec's
internal type hierarchy to make place for
BindingDataContainerCodecTreeNodes which are not DataObjects.

JIRA: MDSAL-805
Change-Id: I225bb02f2c2a1d9caa6e435a4c2ef8f8f62574bd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoReuse cached factory 51/106751/1
Robert Varga [Thu, 29 Jun 2023 12:07:41 +0000 (14:07 +0200)]
Reuse cached factory

We can take advantage of local factory to get the loader. This
simplifies things a bit.

Change-Id: Ic1b71c553bc2640697163a544809e1f5de873979
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoFix YangDataRuntimeTypes not being available 50/106750/2
Robert Varga [Thu, 29 Jun 2023 11:18:03 +0000 (13:18 +0200)]
Fix YangDataRuntimeTypes not being available

CompositeRuntimeType children are always indexed only through
SchemaTree, which means we need to make another pass to get at
YangDataRuntimeTypes.

JIRA: MDSAL-805
Change-Id: I68cfc7fad2c1a7cb3333e48e9b435bc681992641
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoDo not require DataObject for streaming 36/106736/2
Robert Varga [Wed, 28 Jun 2023 09:47:28 +0000 (11:47 +0200)]
Do not require DataObject for streaming

DataContainer is completely sufficient, require just that.

JIRA: MDSAL-805
Change-Id: Iff55143f2c3bcc8a4b678649285f170f0353db5c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoReduce explicit casts in DataObjectStreamerGenerator 34/106734/1
Robert Varga [Wed, 28 Jun 2023 09:20:20 +0000 (11:20 +0200)]
Reduce explicit casts in DataObjectStreamerGenerator

Use instanceof patterns to reduce casts.

Change-Id: I3d1e0f8ea5d4b14135e1604b6f902d9e5193941c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoFixup dom-codec a bit 32/106732/1
Robert Varga [Wed, 28 Jun 2023 07:23:49 +0000 (09:23 +0200)]
Fixup dom-codec a bit

With all the moves we can tighten formatting a bit. Also remove a site
with raw types.

Change-Id: Id3b13500598a595517dbbfe9f98893517cd77aa2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRename CaseNodeCodecContext 29/106729/2
Robert Varga [Tue, 27 Jun 2023 22:06:41 +0000 (00:06 +0200)]
Rename CaseNodeCodecContext

'CaseCodecContext' is a better name, matching the CaseCodecPrototype we
already have.

Change-Id: I5b3f8501e92f65824d63da282b54b10751424208
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoSplit up DataObjectCodecPrototype 28/106728/8
Robert Varga [Tue, 27 Jun 2023 19:20:37 +0000 (21:20 +0200)]
Split up DataObjectCodecPrototype

Having a type-based dispatch during createInstance() is not exactly
nice. This patch splits up DataObjectCodecPrototype.createInstance()
into individual prototypes, so that we have a prototype for pretty-much
each CodecContext type.

This also improves type safety, as CodecContexts now can be directly
instantiated (and create a prototype internally).

Change-Id: If740949bc15890f0ce4bfa5b59cda030b33e66a1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRename ContainerNodeCodecContext 26/106726/1
Robert Varga [Tue, 27 Jun 2023 19:04:40 +0000 (21:04 +0200)]
Rename ContainerNodeCodecContext

A better name is 'ContainerLikeCodecContext', mirroring binding to
ContainerLikeRuntimeType.

Change-Id: Ie2579010a4b7da15df8192c0bd8690b84d769ccd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRename NonPresenceContainerNodeCodecContext 25/106725/1
Robert Varga [Tue, 27 Jun 2023 19:02:53 +0000 (21:02 +0200)]
Rename NonPresenceContainerNodeCodecContext

'StructuralContainerCodecContext' is a better name overall.

Change-Id: I8cec640b209b96929f1a9bc33bbfa6af3dde81e1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoSplit up OpaqueNodeCodecContext 24/106724/1
Robert Varga [Tue, 27 Jun 2023 15:38:01 +0000 (17:38 +0200)]
Split up OpaqueNodeCodecContext

We have two specializations, make promote them to top-level classes and
rename OpaqueNodeCodecContext to AbstractOpaqueCodecContext.

Change-Id: Ibe18324a5e5a408cfcf8bbbe6b77065f19a3bfa5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoPromote RuntimeType interface hierarchy 11/106711/1
Robert Varga [Mon, 26 Jun 2023 21:48:01 +0000 (23:48 +0200)]
Promote RuntimeType interface hierarchy

Basic types have stood the test of time so far, drop @Beta annotations.

Change-Id: Icd8e8957706eb78678715a17653615de4b09d948
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoPromote BindingIdentityCodec 09/106709/1
Robert Varga [Mon, 26 Jun 2023 20:25:29 +0000 (22:25 +0200)]
Promote BindingIdentityCodec

There is nothing @Beta about this interface anymore, remove the
annotation.

Change-Id: I6e8bedbc73b704566fce5ce06a9fb9316573cf5f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoAdd CodecWithPath documentation 08/106708/1
Robert Varga [Mon, 26 Jun 2023 20:11:40 +0000 (22:11 +0200)]
Add CodecWithPath documentation

Document the two parts of this record.

Change-Id: Ia665ccda22f53944f760e1b3f22816e96b40faf1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoDrop @Beta from BindingCodecTree methods 07/106707/1
Robert Varga [Mon, 26 Jun 2023 20:09:15 +0000 (22:09 +0200)]
Drop @Beta from BindingCodecTree methods

These methods are well-established, they are no longer @Beta.

Change-Id: I83770212cc6de6adf3d9f9c4d7880d923d5da00f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoDo not use BindingReflections in mdsal-binding-dom-codec-api 06/106706/2
Robert Varga [Mon, 26 Jun 2023 18:33:35 +0000 (20:33 +0200)]
Do not use BindingReflections in mdsal-binding-dom-codec-api

The exact mechanics of now an Action's QNameModule is resolved should
not be dependent on reflection. Eliminate this assumption from API and
shift it down to implementation.

JIRA: MDSAL-781
Change-Id: I6c3a18c41ee8189c315be3cc2888c092f06bb6ec
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoReduce use of BindingReflections in BindingNormalizedNodeSerializer 04/106704/3
Robert Varga [Mon, 26 Jun 2023 18:16:25 +0000 (20:16 +0200)]
Reduce use of BindingReflections in BindingNormalizedNodeSerializer

BindingNormalizedNodeSerializer's codec implementation can easily
process some of these methods and we therefore do not have to use
BindingReflections to acquire their NodeIdentifiers.

JIRA: MDSAL-781
Change-Id: If928d896e785fe8782ddbde7fb898464c40adb17
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRemove BindingReflections.getQName(BaseIdentity) 03/106703/2
Robert Varga [Mon, 26 Jun 2023 18:03:02 +0000 (20:03 +0200)]
Remove BindingReflections.getQName(BaseIdentity)

All users (including downstreams) have been eliminated, remove this
method.

JIRA: MDSAL-781
Change-Id: I66a7dc55d86be4e863cff675f4feb230c5e4c531
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoFix output's NodeIdentifier 05/106705/2
Robert Varga [Mon, 26 Jun 2023 18:36:32 +0000 (20:36 +0200)]
Fix output's NodeIdentifier

We are mis-representing the output as input, fix that.

Change-Id: Ic5eee44575e42b30ad60d75c3dd3256426ca9137
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoClean up dependencies 80/106680/5
Robert Varga [Mon, 26 Jun 2023 13:03:02 +0000 (15:03 +0200)]
Clean up dependencies

Clean up dependencies of mdsal-trace-impl, mdsal-eos-binding-api,
mdsal-dom-spi and mdsal-rfc8294-netty.

Change-Id: Ic3be075e80a2700207abe3628d4d3f972818e64c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoImprove binding-parent 79/106679/5
Robert Varga [Mon, 26 Jun 2023 12:42:24 +0000 (14:42 +0200)]
Improve binding-parent

Require basic things for generated code and make sure
maven-dependency-plugin does not trip over optional parts.

Change-Id: I98d11bd165f5f85d324d27039e4c1b75974ee3ee
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoDo not require spotbugs transitively 78/106678/3
Robert Varga [Mon, 26 Jun 2023 11:48:45 +0000 (13:48 +0200)]
Do not require spotbugs transitively

Clean up dependencies, eliminating unused declared dependencies on
spotbugs-annotations. Also clean up dependency confusion between
mdsal-binding-dom-adapter and mdsal-binding-test-utils.

Change-Id: Iaa6681c3e53ca8b9bd9e63abecf199b316fa9b4d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoUpdate documentation links 77/106677/1
Robert Varga [Mon, 26 Jun 2023 12:12:25 +0000 (14:12 +0200)]
Update documentation links

Used HTTPS and point to correct relase of Guava.

Change-Id: I578a1dd4d3ed0b957f0aeba3425f974fe2a2cc2d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoBump upstreams 68/106668/2
Robert Varga [Mon, 26 Jun 2023 08:36:01 +0000 (10:36 +0200)]
Bump upstreams

Adopt
- odlparent-13.0.3
- yangtools-11.0.0

Change-Id: Ie3277c61866d649a8c8c8bbde9320a0375cd65ab
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoDo not use BindingReflections in ModuleInfoSnapshotBuilder 31/106631/1
Robert Varga [Thu, 22 Jun 2023 15:53:32 +0000 (17:53 +0200)]
Do not use BindingReflections in ModuleInfoSnapshotBuilder

We have YangModuleInfos, which expose both the root package and the
corresponding namespace. Use that information to resolve QNameModule
for a particular root without relying on reflective access.

JIRA: MDSAL-783
Change-Id: If8b14cb49118f5d97c65783f29f1aa77bcc4eada
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoDo not use BindingReflections in IdentityCodec 21/106621/2
Robert Varga [Thu, 22 Jun 2023 12:14:22 +0000 (14:14 +0200)]
Do not use BindingReflections in IdentityCodec

Instantiate a dedicated cache for holding object->QName mapping and use
that to service translation requests.

JIRA: MDSAL-783
Change-Id: I414a12f5f2a2e602a904d5dff0360ab0773dd26d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRemove BindingReflections.getQName(Rpc) 22/106622/2
Robert Varga [Thu, 22 Jun 2023 12:53:29 +0000 (14:53 +0200)]
Remove BindingReflections.getQName(Rpc)

This method is not used anywhere, remove it.

JIRA: MDSAL-783
Change-Id: I2b76a8fd91bc99382933311cc0eb6aa3c2c72dd4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoHide BindingReflections.isRpcType() 18/106618/1
Robert Varga [Thu, 22 Jun 2023 10:32:01 +0000 (12:32 +0200)]
Hide BindingReflections.isRpcType()

This method is only used internally, do not expose it to the outside
world.

JIRA: MDSAL-781
Change-Id: If3dd90eaa24179559e830ebbded5a206ff76082a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRename yang.binding.{Identifiable,Identifier} 97/106597/6
Robert Varga [Wed, 21 Jun 2023 15:14:27 +0000 (17:14 +0200)]
Rename yang.binding.{Identifiable,Identifier}

Key represents the base to which we usually bind, implying also
Map.get(key). KeyAware is a good name for an interface defining key()
method.

JIRA: MDSAL-830
Change-Id: I7e5b6e3a8f50daed6799164425a7f394b82fdef5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoAdjust for DataTreeCandidateNode API change 06/106606/2
Robert Varga [Wed, 21 Jun 2023 18:11:53 +0000 (20:11 +0200)]
Adjust for DataTreeCandidateNode API change

The return types have changed, adjust to that.

Change-Id: I97b60e91319c14664d7cfcad63b899cab792f87f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRequire failureaccess 07/106607/1
Robert Varga [Wed, 21 Jun 2023 18:19:33 +0000 (20:19 +0200)]
Require failureaccess

Eclipse is not happy about not being able to access

Change-Id: Iaf8345ed9ae7bce941a257058807fcc7f12f90ed
JIRA: MDSAL-750
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoModernize AbstractDataObjectModification 04/106604/1
Robert Varga [Wed, 21 Jun 2023 16:50:29 +0000 (18:50 +0200)]
Modernize AbstractDataObjectModification

We are using deprecated methods here. Migrating to their replacement
makes for a more fluent codebase.

Change-Id: Ic0a1f1653f13d0bb12ec97f2ef5bd2d6d4e388e3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoMove BindingReflections.isNotificationCallback() 93/106593/4
Robert Varga [Wed, 21 Jun 2023 12:49:39 +0000 (14:49 +0200)]
Move BindingReflections.isNotificationCallback()

This method has only one user, mdsal-binding-dom-adapter. Move it there.

JIRA: MDSAL-781
Change-Id: I128d588d58a75e00b63ebdbba6f503dd261646c7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRemove BindingReflections.isRpcMethod() 91/106591/3
Robert Varga [Wed, 21 Jun 2023 12:40:58 +0000 (14:40 +0200)]
Remove BindingReflections.isRpcMethod()

This method is not used anywhere, remove it.

JIRA: MDSAL-781
Change-Id: I706eac66d496ae8f52c9a98b004d1906e6165e43
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRemove BindingReflections.getModuleInfoClassName() 90/106590/5
Robert Varga [Wed, 21 Jun 2023 12:35:52 +0000 (14:35 +0200)]
Remove BindingReflections.getModuleInfoClassName()

This is a trivial method, used only internally. Remove it by inlining it
into its sole user.

JIRA: MDSAL-781
Change-Id: Iaf39afde3ef7463744d06691e9cbcc2dc43de672
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRemove BindingReflections.loadModuleInfos() 89/106589/5
Robert Varga [Wed, 21 Jun 2023 12:19:38 +0000 (14:19 +0200)]
Remove BindingReflections.loadModuleInfos()

The only user here has been migrated BindingRuntimeHelpers, remove the
binding-spec-util conterpart.

JIRA: MDSAL-781
Change-Id: I14e61e7a45f80a78c3d508e22d9555105817afbe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoMove BindingReflections.cacheModuleInfos() 88/106588/5
Robert Varga [Wed, 21 Jun 2023 12:16:30 +0000 (14:16 +0200)]
Move BindingReflections.cacheModuleInfos()

This caching is only used in AbstractSchemaAwareTest, move them there.

JIRA: MDSAL-781
Change-Id: Id0f9d16f5ec046e7b545486aabbfca7e706b9f2e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoMove BindingReflections.findAugmentationTarget() 87/106587/3
Robert Varga [Wed, 21 Jun 2023 12:07:53 +0000 (14:07 +0200)]
Move BindingReflections.findAugmentationTarget()

This method is only used in mdsal-binding-dom-codec, move it there.

JIRA: MDSAL-781
Change-Id: I0ee82715a0d69ddcf2f7daaca1ec7e7a2b2012bd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoHide BindingReflections.getModuleInfo() 85/106585/2
Robert Varga [Wed, 21 Jun 2023 11:45:57 +0000 (13:45 +0200)]
Hide BindingReflections.getModuleInfo()

We have a replacement in BindingRuntimeHelpers.getYangModuleInfo(). This
patch migrates users and eliminates getModuleInfo() from public view.

JIRA: MDSAL-781
Change-Id: Ifd1cdbee440e8f14c1f53b2432b3b8cf3a7fc8df
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRemove BindingReflections.getModelRootPackageName() 84/106584/2
Robert Varga [Wed, 21 Jun 2023 11:32:58 +0000 (13:32 +0200)]
Remove BindingReflections.getModelRootPackageName()

This method was moved to yang.binding.contract.Naming, remove it.

JIRA: MDSAL-781
Change-Id: I300363accd91908a648cb78294ffc7043f93e812
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRemove DataObjectReadingUtil 82/106582/2
Robert Varga [Wed, 21 Jun 2023 11:18:17 +0000 (13:18 +0200)]
Remove DataObjectReadingUtil

This class has been deprecated for quite some time and has no users.
Remove it.

JIRA: MDSAL-801
Change-Id: I3f29ab770f696f4fa75092ddc0af93d665c004ec
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoAdd simple data listeners 80/105080/10
Oleksandr Panasiuk [Tue, 28 Mar 2023 09:36:14 +0000 (12:36 +0300)]
Add simple data listeners

DataTreeChangeListener is a rather complex contract, where users
sometimes want to receive only the latest state or the delta of the
state.

Add DataListener, which reports the current value and
DataChangeListener, which reports changes.

JIRA: MDSAL-813
Change-Id: I7db024f76709b9d4afcc0db5cbca3f1d35218e3f
Signed-off-by: Oleksandr Panasiuk <oleksandr.panasiuk@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoClean up mdsal-binding-runtime-spi dependencies 66/106566/1
Robert Varga [Tue, 20 Jun 2023 22:23:01 +0000 (00:23 +0200)]
Clean up mdsal-binding-runtime-spi dependencies

We are using JDT annotations, make that explicit.

Change-Id: Ib31a9e7920fdd765a442a9ed778881b8477ac778
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoFix BindingRuntimeHelper.extractYangModuleInfo() 64/106564/4
Robert Varga [Tue, 20 Jun 2023 21:39:16 +0000 (23:39 +0200)]
Fix BindingRuntimeHelper.extractYangModuleInfo()

Previous patch has broken the extraction facility in multi-classloader
environments: when we have a Class, we should be using its ClassLoader,
not TCCL, to locate its sibling.

JIRA: MDSAL-803
Change-Id: Ie3684a6defeaf51c6c98efcf48791b677b2ef2f1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoClean up dependencies 55/106555/3
Robert Varga [Tue, 20 Jun 2023 12:42:53 +0000 (14:42 +0200)]
Clean up dependencies

We have a ton of warnings, reign some of them in.

Change-Id: I4aa0b3871f9416c09fb17fe5f9325015231ac40a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoEliminate DataObjectSerializerImplementation 51/106551/3
Robert Varga [Tue, 20 Jun 2023 10:14:57 +0000 (12:14 +0200)]
Eliminate DataObjectSerializerImplementation

We do not need the intermediate interface and can just have
DataObjectStreamer as the main entrypoint.

Change-Id: I14b01652baf5c0c6bd86ffe3951255717b2bd831
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoHide DataObjectSerializer 50/106550/1
Robert Varga [Tue, 20 Jun 2023 10:09:14 +0000 (12:09 +0200)]
Hide DataObjectSerializer

Promote this class to a hidden implementation detail.

Change-Id: Ibf48f98cd9b9175b8a22eca102bbeb6162ccac67
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoFix BindingToNormalizedStreamWriter.enter() 49/106549/2
Robert Varga [Tue, 20 Jun 2023 09:46:01 +0000 (11:46 +0200)]
Fix BindingToNormalizedStreamWriter.enter()

We have a blind cast which does not handle augmentations' children. Fix
the cast to work for augmentations as well.

JIRA: MDSAL-820
Change-Id: Ib32a65e475d5d786bcc0d353f5fe044c147e4c07
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoAdd BindingDataObjectCodecTreeParent.getStream{Augmentation,DataObject} 47/106547/1
Robert Varga [Tue, 20 Jun 2023 01:08:25 +0000 (03:08 +0200)]
Add BindingDataObjectCodecTreeParent.getStream{Augmentation,DataObject}

When we know we are streaming to a particular type, we can improve the
user experience by returning a friendly interface.

JIRA: MDSAL-820
Change-Id: Iadb85de866a0446934f636bb870e1df5f4c81a4b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoAdd CommonDataObjectCodecTreeNode.stream{Augmentation,DataObject} 45/106545/1
Robert Varga [Tue, 20 Jun 2023 01:08:25 +0000 (03:08 +0200)]
Add CommonDataObjectCodecTreeNode.stream{Augmentation,DataObject}

When we know we are streaming to a particular type, we can improve the
user experience by returning a friendly interface.

JIRA: MDSAL-820
Change-Id: I89d8dbed493919a72db7195213c5cf688b9ecb5a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRehost BindingReflections.loadModuleInfos() 77/104877/4
Oleksandr Panasiuk [Tue, 14 Mar 2023 16:06:33 +0000 (18:06 +0200)]
Rehost BindingReflections.loadModuleInfos()

Use ServiceLoader to locate all module infos instead. This reduces the
proliferation of BindingReflections just a tiny bit.

JIRA: MDSAL-803
Change-Id: I5d76f6c8eddc1d689ebd8fcbe9cbf23350b465cf
Signed-off-by: Oleksandr Panasiuk <oleksandr.panasiuk@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoPromote AbstractBindingLazyContainerNode 85/106485/2
Robert Varga [Wed, 14 Jun 2023 19:41:09 +0000 (21:41 +0200)]
Promote AbstractBindingLazyContainerNode

This is a well-proven class, drop the @Beta annotation and clean in up a
bit.

Change-Id: I7d6bd3e4717dd969695c58fe52e71d38911a4a24
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRemove unused dependency 82/106482/2
Robert Varga [Wed, 14 Jun 2023 13:33:57 +0000 (15:33 +0200)]
Remove unused dependency

mdsal-binding-spec-util is not used by mdsal-binding-generator, remove
the dependency.

Change-Id: I3ac0264bc32f52ab311c1e1c951293bc49b7a789
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoIntroduce AbstractBaseTemplate 78/106278/3
Robert Varga [Sun, 28 May 2023 20:24:49 +0000 (22:24 +0200)]
Introduce AbstractBaseTemplate

Pull down some of the more obvious methods from BaseTemplate to an
abstract class. This improves things by introducing static methods
and having them in Java.

JIRA: MDSAL-562
Change-Id: I1b04477695c7a966e7a829e67d0340c8a551d7f6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoHide DataContainerCodecContext.getType() 99/106499/2
Robert Varga [Thu, 15 Jun 2023 14:08:37 +0000 (16:08 +0200)]
Hide DataContainerCodecContext.getType()

This method is used only internally, hide it from public view.

Change-Id: Id1700333937155fb5eff6cecca630fcff7c6bced
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoConvert mdsal-yanglib-rfc8525 to a JPMS module 03/106503/1
Robert Varga [Fri, 16 Jun 2023 10:21:42 +0000 (12:21 +0200)]
Convert mdsal-yanglib-rfc8525 to a JPMS module

This is a simplistic module, convert it.

JIRA: MDSAL-619
Change-Id: I84ab4664d0c4441b9d250b6b876d16860b396ed0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>