yangtools.git
2 weeks agoMove StatementNamespace to yang.binding.contract
Robert Varga [Tue, 14 Nov 2023 14:17:12 +0000 (15:17 +0100)]
Move StatementNamespace to yang.binding.contract

This enumeration forms a part of the binding naming contract, move it to
yang-binding.

Change-Id: I8fe170d5791ff36c5c1728b0ea7112b178e3d808
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRemove support for composite NotificationListener
Robert Varga [Tue, 14 Nov 2023 11:53:58 +0000 (12:53 +0100)]
Remove support for composite NotificationListener

We have a much more flexible mechanism for dealing with notifications
via the Notification interface, which is a proper FunctionalInterface.

Remove support for aggregated moduled-level FooListener interfaces.

JIRA: MDSAL-497
Change-Id: I7dd82c477de6ca836cce84354c016d5ebd21022d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRemove yang.binding.RpcService
Robert Varga [Thu, 26 Oct 2023 22:35:19 +0000 (00:35 +0200)]
Remove yang.binding.RpcService

RpcService is a base marker for generated interfaces representing
the collection of 'rpc' statements in a module.

This interface and its uses have been deprecated, as their design
assumptions are based on Java 7, that is do not consider lambdas.

Since we have yang.binding.Rpc and related interfaces to cleanly
represent RPCs in lambda-cognizant world, remove RpcService and all its
related codegen/runtime support.

JIRA: MDSAL-772
Change-Id: I41b3c6513869a43b6373ad588336ebed2dc873d4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump versions to 13.0.0-SNAPSHOT
Robert Varga [Mon, 13 Nov 2023 15:47:23 +0000 (16:47 +0100)]
Bump versions to 13.0.0-SNAPSHOT

This starts the next major development version.

Change-Id: I4f549a7b19adea7ab284fea0278db79468ef20c0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump versions to 12.0.4-SNAPSHOT
Robert Varga [Mon, 30 Oct 2023 21:21:28 +0000 (22:21 +0100)]
Bump versions to 12.0.4-SNAPSHOT

This starts the next development iteration.

Change-Id: I22fefd3c8ae76998cd879391b322adeb61a0c9b8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump upstreams
Robert Varga [Mon, 30 Oct 2023 16:12:11 +0000 (17:12 +0100)]
Bump upstreams

Adopt:
- odlparent-13.0.7
- yangtools-11.0.4

Change-Id: Iaa314dfdca3513a67d9a1b8cb895554172071441
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump upstreams
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>
2 weeks agoBump versions to 12.0.3-SNAPSHOT
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>
2 weeks agoRelease mdsal
jenkins-releng [Sun, 17 Sep 2023 09:11:11 +0000 (09:11 +0000)]
Release mdsal

2 weeks agoBump yangtools to 11.0.2
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>
2 weeks agoBump versions to 12.0.2-SNAPSHOT
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>
2 weeks agoRelease mdsal
jenkins-releng [Wed, 30 Aug 2023 14:41:47 +0000 (14:41 +0000)]
Release mdsal

2 weeks agoBump upstreams
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>
2 weeks agoClean up dependencies
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>
2 weeks agoMerge if() statements
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>
2 weeks agoBind to org.eclipse.jdt.annotation
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>
2 weeks agoBump xtend to 2.32.0
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>
2 weeks agoRemove CommonDataObjectCodecContext.namespace()
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>
2 weeks agoUnify yangPathArgumentChild()
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>
2 weeks agoUnify streamChild() implementations
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>
2 weeks agoUnify getStreamChild() implementations
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>
2 weeks agoFix mdsal-binding-dom-codec dependencies
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>
2 weeks agoRemove superfluous documentation
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>
2 weeks agoRemove PMD/CPD configuration
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>
2 weeks agoSharpen DataContainerCodecContext generics
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>
2 weeks agoFold RootCodecContext into BindingCodecContext
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>
2 weeks agoBump versions to 12.0.1-SNAPSHOT
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>
2 weeks agoRelease mdsal
jenkins-releng [Thu, 29 Jun 2023 22:25:23 +0000 (22:25 +0000)]
Release mdsal

2 weeks agoAdd interfaces for (Normalized)YangData codec
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>
2 weeks agoSplit up CodecDataObjectAnalysis
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>
2 weeks agoReduce unchecked warnings
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>
2 weeks agoSplit out BindingDataContainerCodecTreeNode
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>
2 weeks agoReuse cached factory
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>
2 weeks agoFix YangDataRuntimeTypes not being available
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>
2 weeks agoDo not require DataObject for streaming
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>
2 weeks agoReduce explicit casts in DataObjectStreamerGenerator
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>
2 weeks agoFixup dom-codec a bit
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>
2 weeks agoRename CaseNodeCodecContext
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>
2 weeks agoSplit up DataObjectCodecPrototype
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>
2 weeks agoRename ContainerNodeCodecContext
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>
2 weeks agoRename NonPresenceContainerNodeCodecContext
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>
2 weeks agoSplit up OpaqueNodeCodecContext
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>
2 weeks agoPromote RuntimeType interface hierarchy
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>
2 weeks agoPromote BindingIdentityCodec
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>
2 weeks agoAdd CodecWithPath documentation
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>
2 weeks agoDrop @Beta from BindingCodecTree methods
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>
2 weeks agoDo not use BindingReflections in mdsal-binding-dom-codec-api
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>
2 weeks agoReduce use of BindingReflections in BindingNormalizedNodeSerializer
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>
2 weeks agoRemove BindingReflections.getQName(BaseIdentity)
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>
2 weeks agoFix output's NodeIdentifier
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>
2 weeks agoImprove binding-parent
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>
2 weeks agoDo not require spotbugs transitively
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>
2 weeks agoBump upstreams
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>
2 weeks agoDo not use BindingReflections in ModuleInfoSnapshotBuilder
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>
2 weeks agoDo not use BindingReflections in IdentityCodec
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>
2 weeks agoRemove BindingReflections.getQName(Rpc)
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>
2 weeks agoHide BindingReflections.isRpcType()
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>
2 weeks agoRename yang.binding.{Identifiable,Identifier}
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>
2 weeks agoMove BindingReflections.isNotificationCallback()
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>
2 weeks agoRemove BindingReflections.isRpcMethod()
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>
2 weeks agoRemove BindingReflections.getModuleInfoClassName()
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>
2 weeks agoRemove BindingReflections.loadModuleInfos()
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>
2 weeks agoMove BindingReflections.cacheModuleInfos()
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>
2 weeks agoMove BindingReflections.findAugmentationTarget()
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>
2 weeks agoHide BindingReflections.getModuleInfo()
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>
2 weeks agoRemove BindingReflections.getModelRootPackageName()
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>
2 weeks agoRemove DataObjectReadingUtil
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>
2 weeks agoAdd simple data listeners
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>
2 weeks agoClean up mdsal-binding-runtime-spi dependencies
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>
2 weeks agoFix BindingRuntimeHelper.extractYangModuleInfo()
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>
2 weeks agoClean up dependencies
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>
2 weeks agoEliminate DataObjectSerializerImplementation
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>
2 weeks agoHide DataObjectSerializer
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>
2 weeks agoFix BindingToNormalizedStreamWriter.enter()
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>
2 weeks agoAdd BindingDataObjectCodecTreeParent.getStream{Augmentation,DataObject}
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>
2 weeks agoAdd CommonDataObjectCodecTreeNode.stream{Augmentation,DataObject}
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>
2 weeks agoRehost BindingReflections.loadModuleInfos()
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>
2 weeks agoPromote AbstractBindingLazyContainerNode
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>
2 weeks agoRemove unused dependency
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>
2 weeks agoIntroduce AbstractBaseTemplate
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>
2 weeks agoHide DataContainerCodecContext.getType()
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>
2 weeks agoConvert mdsal-binding-runtime-osgi to a JPMS module
Robert Varga [Fri, 16 Jun 2023 09:57:12 +0000 (11:57 +0200)]
Convert mdsal-binding-runtime-osgi to a JPMS module

Ditch Automatic-Module-Name and instead provide a proper module.

JIRA: MDSAL-619
Change-Id: I940072ba15c14a73b918f41c11c80a85e31aa872
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoClean up mdsal-binding-model-api dependencies
Robert Varga [Thu, 15 Jun 2023 13:09:49 +0000 (15:09 +0200)]
Clean up mdsal-binding-model-api dependencies

We are not using yang-common here, fix that up.

Change-Id: I7ebc0e7983710bb870a90d0c6697baf8822d0034
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoExport org.opendaylight.mdsal.binding.dom.codec.impl
Robert Varga [Thu, 15 Jun 2023 08:49:19 +0000 (10:49 +0200)]
Export org.opendaylight.mdsal.binding.dom.codec.impl

As a stop-gap measure, expose the entire top-level artifact. This will
be tied down in later patches.

JIRA: MDSAL-828
Change-Id: I5fb61aa595ee2b66e99f3833cfc6935d8d529ffb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump xtend to 2.31.0
Robert Varga [Wed, 14 Jun 2023 20:53:49 +0000 (22:53 +0200)]
Bump xtend to 2.31.0

https://www.eclipse.org/xtend/releasenotes.html#/releasenotes/2023/05/29/version-2-31-0

Change-Id: Icbb185327e80d55d0b8306ed786ccc2be6f1ef6a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRefactor streamChild() methods
Robert Varga [Wed, 14 Jun 2023 22:05:02 +0000 (00:05 +0200)]
Refactor streamChild() methods

We have a tad confusing naming, where the individual methods are
related. Unify naming.

Change-Id: Iba8c725f611308da65761fce9a4249642963901a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoClean up addYangPathArgument()
Robert Varga [Wed, 14 Jun 2023 20:38:45 +0000 (22:38 +0200)]
Clean up addYangPathArgument()

The nullability is confused here. Make sure we separate the two
invocation paths, so that we check builder for non-null as few times as
practicable.

Change-Id: Iceafa279fb3b69ffdaa54d4250ecf370edaa2622
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRename AugmentatioNodeContext
Robert Varga [Wed, 14 Jun 2023 19:54:08 +0000 (21:54 +0200)]
Rename AugmentatioNodeContext

The 'Node' word does not really tell us much. Rename to
AugmentationCodecContext.

JIRA: MDSAL-828
Change-Id: Ib2e0487cfda365570bf01e9bcd474a59c8bc42d2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoFix code generation with leafrefs pointing to optional members
Robert Varga [Tue, 13 Jun 2023 14:57:25 +0000 (16:57 +0200)]
Fix code generation with leafrefs pointing to optional members

When we have a typedef which points to a location disabled by
if-feature, we need to accept this fact -- but do not allow that typedef
to be referenced.

JIRA: MDSAL-829
Change-Id: Ibde28faa2f96904dc16fcc6f5a922edc6bcffebb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoGuard against null augmentations
Robert Varga [Tue, 13 Jun 2023 14:17:59 +0000 (16:17 +0200)]
Guard against null augmentations

Do not populate the augmentations map with null values.

JIRA: MDSAL-820
Change-Id: I3258337f1c9dd782b840e9ebad4e154428afc53b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRemove an unnecessary cast
Robert Varga [Tue, 13 Jun 2023 14:10:38 +0000 (16:10 +0200)]
Remove an unnecessary cast

We know the getDomPathArgument() always returns NodeIdentifier, there is
no need to cast it.

Change-Id: Ic525f0938e692251a8bff0c80dd90e40966d926f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRename ChoiceNodeCodecContext
Robert Varga [Tue, 13 Jun 2023 13:25:40 +0000 (15:25 +0200)]
Rename ChoiceNodeCodecContext

ChoiceCodecContext is a better and shorter name, as the 'Node' part does
not really make any sense.

JIRA: MDSAL-828
Change-Id: Ied868e2cecda87ccdd69dae9f6688c7d70cac924
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRename SchemaRootCodecContext
Robert Varga [Tue, 13 Jun 2023 13:23:40 +0000 (15:23 +0200)]
Rename SchemaRootCodecContext

SchemaRoot is too long a name, shorten in to RootCodecContext.

JIRA: MDSAL-828
Change-Id: I01a7d87e20ec4c073624a2cf1367ab2c369cb574
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoHide CodecOpaqueObject constructor
Robert Varga [Tue, 13 Jun 2023 12:43:41 +0000 (14:43 +0200)]
Hide CodecOpaqueObject constructor

We no longer use Javassist, hence we can just make the constructor
protected.

Change-Id: I760fc93f613c3593e72373b12c904cd6d149d525
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoImprove AbstractOpaque{Data,Object}.equals()
Robert Varga [Tue, 13 Jun 2023 12:40:39 +0000 (14:40 +0200)]
Improve AbstractOpaque{Data,Object}.equals()

Use instanceof pattern to simplify equals() method.

Change-Id: I04f8262428b0a6a1ef8d35c21793c51306b9ed81
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRename NodeCodecContext
Robert Varga [Tue, 13 Jun 2023 12:09:34 +0000 (14:09 +0200)]
Rename NodeCodecContext

This name is awefully long and the 'Node' part does not convey any
meaning. Rename it to CodecContext.

JIRA: MDSAL-828
Change-Id: I31e93a49d79f31e3d43bc803639393c8e9e6c8d9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoSeal NodeCodecContext hierarchy
Robert Varga [Tue, 13 Jun 2023 11:53:05 +0000 (13:53 +0200)]
Seal NodeCodecContext hierarchy

We are about split out some of the contexts to public places. Before we
do that, though, make sure the hierarchy is sealed, so we do not get
accidental subclasses.

JIRA: MDSAL-828
Change-Id: Iaa1f0954eb1e571b08dbe8760157a996c1905143
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoSplit out CodecContextFactory
Robert Varga [Tue, 13 Jun 2023 11:31:35 +0000 (13:31 +0200)]
Split out CodecContextFactory

The coupling of CodecContextFactory to NodeCodecContext prevents proper
splitting the individual concerns. Promote CodecContextFactory to a
top-level class.

JIRA: MDSAL-828
Change-Id: Ic3cc54380e7db76e92c116103b84af209625e97b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoSeal IdentifiableItemCodec
Robert Varga [Tue, 13 Jun 2023 10:48:19 +0000 (12:48 +0200)]
Seal IdentifiableItemCodec

We have only two concrete subclasses, make sure the JVM knows that.

Change-Id: Ic9121d08ce6ca6140918bac001132ba68681b32e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoAdjust to YangTextSchemaSource being a CharSource
Robert Varga [Tue, 13 Jun 2023 10:18:39 +0000 (12:18 +0200)]
Adjust to YangTextSchemaSource being a CharSource

YANGTOOLS-1508 changed the interface here, adjust to it by using
delegateForCharSource() instead.

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