mdsal.git
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>
10 months agoConvert mdsal-binding-runtime-osgi to a JPMS module 02/106502/2
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>
10 months agoConvert mdsal-rfc8294-netty to an explicit module 01/106501/2
Robert Varga [Fri, 16 Jun 2023 09:36:43 +0000 (11:36 +0200)]
Convert mdsal-rfc8294-netty to an explicit module

This is a straightforward module, just convert it.

JIRA: MDSAL-619
Change-Id: Iaa9148e4103489e18bc5462716720e9858c320af
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoConvert mdsal-dom-broker to a JPMS module 43/105743/11
Samuel Schneider [Fri, 28 Apr 2023 15:59:06 +0000 (17:59 +0200)]
Convert mdsal-dom-broker to a JPMS module

Convert to a JPMS to prevent reflective access.
For compatibility, we still need to export the implementation details.

JIRA: MDSAL-749
Change-Id: I85baf0f41c415d02fe2d7b02a70e2b57b502ad9f
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoClean up mdsal-binding-model-api dependencies 98/106498/1
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>
10 months agoConvert mdsal-eos-binding-adapter to a JPMS module 88/105988/11
Oleksandr Panasiuk [Tue, 16 May 2023 05:27:39 +0000 (08:27 +0300)]
Convert mdsal-eos-binding-adapter to a JPMS module

This adapter is rather simple. Convert it so its internals are
(semi)-well encapsulated.

JIRA: MDSAL-751
Change-Id: I4d636838f46aee2cd142310d7ca94ea1f9c9ca64
Signed-off-by: Oleksandr Panasiuk <oleksandr.panasiuk@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoConvert mdsal-binding-dom-adapter to a JPMS module 86/105886/14
Samuel Schneider [Wed, 10 May 2023 15:25:26 +0000 (17:25 +0200)]
Convert mdsal-binding-dom-adapter to a JPMS module

Convert to a JPMS module to hide internals from the outside world.

JIRA: MDSAL-750
Change-Id: Ibdc5ff8cd6ad4512865d3ffc58ebcc5ecd428aac
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoConvert mdsal-eos-binding-api to a module 95/106495/2
Robert Varga [Thu, 15 Jun 2023 09:29:29 +0000 (11:29 +0200)]
Convert mdsal-eos-binding-api to a module

This is a rather simple API, convert it to a Java module.

JIRA: MDSAL-751
Change-Id: Ic43a4d3a801721c202909c813d68ca52b2da18e8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoExport org.opendaylight.mdsal.binding.dom.codec.impl 94/106494/1
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>
10 months agoBump byte-buddy to 1.14.5 93/106493/1
Robert Varga [Thu, 15 Jun 2023 08:48:02 +0000 (10:48 +0200)]
Bump byte-buddy to 1.14.5

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

Change-Id: Ic3fd18b67d32515a2a86acc5813141efab1f867b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoBump xtend to 2.31.0 88/106488/2
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>
10 months agoRefactor streamChild() methods 89/106489/1
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>
10 months agoClean up addYangPathArgument() 87/106487/1
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>
10 months agoRename AugmentatioNodeContext 86/106486/1
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>
10 months agoFix code generation with leafrefs pointing to optional members 75/106475/6
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>
10 months agoGuard against null augmentations 74/106474/1
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>
10 months agoRemove an unnecessary cast 73/106473/1
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>
10 months agoRename ChoiceNodeCodecContext 71/106471/1
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>
10 months agoRename SchemaRootCodecContext 70/106470/1
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>
10 months agoHide CodecOpaqueObject constructor 69/106469/1
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>
10 months agoImprove AbstractOpaque{Data,Object}.equals() 68/106468/1
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>
10 months agoRename NodeCodecContext 67/106467/1
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>
10 months agoSeal NodeCodecContext hierarchy 64/106464/1
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>
10 months agoSplit out CodecContextFactory 63/106463/2
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>
10 months agoSeal IdentifiableItemCodec 60/106460/1
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>
10 months agoAdjust to YangTextSchemaSource being a CharSource 59/106459/1
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>
10 months agoRename CaseNodeCodecContext.Prototype 81/106381/2
Robert Varga [Mon, 5 Jun 2023 08:05:39 +0000 (10:05 +0200)]
Rename CaseNodeCodecContext.Prototype

Split this class out into CaseCodecPrototype top-level class.

Change-Id: I9b94a07f5b78bdec684d17ed0831e67a06cf0c0e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoBump odlparent to 13.0.1 86/106386/2
Robert Varga [Mon, 5 Jun 2023 11:13:14 +0000 (13:13 +0200)]
Bump odlparent to 13.0.1

Pick up feature packaging fixes.

Change-Id: If20eb9b3a71221cecc5c57d78daf874bc6946a7a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoSplit out CaseNodeCodecContext.Prototype 79/106379/2
Robert Varga [Sun, 4 Jun 2023 22:47:14 +0000 (00:47 +0200)]
Split out CaseNodeCodecContext.Prototype

Add an explicit subclass of DataObjectCodecProtype to serve case nodes.

Change-Id: I77a752be75673d1ffa768c5d76c422f082e03880
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoSplit out NotificationCodecContext.Prototype 78/106378/2
Robert Varga [Sun, 4 Jun 2023 21:47:46 +0000 (23:47 +0200)]
Split out NotificationCodecContext.Prototype

Notifications require a special context, split them out and guard
against re-instantiation.

Change-Id: I7eede21b2aeab92c02ae451a4c5e341361563bca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoSplit out SchemaRootCodecContext.Prototype 77/106377/3
Robert Varga [Sun, 4 Jun 2023 21:13:49 +0000 (23:13 +0200)]
Split out SchemaRootCodecContext.Prototype

This prototype is rather special, split it out, making the dependency
graph a tad simpler.

Change-Id: I8da7e556fdb73f729b054bfb28dbcaa57e577aeb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoSplit out DataContainerCodecPrototype subclasses 76/106376/2
Robert Varga [Sun, 4 Jun 2023 20:57:06 +0000 (22:57 +0200)]
Split out DataContainerCodecPrototype subclasses

We are going to ditch the Regular specialization in favor of providing
proper specializations. Take the first step and promote the two
specializations to top-level classes.

Change-Id: I0d350c0f1b0c1e364cd4330a39a51ec01e9c9dbd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoUse instanceof patterns in KeyedListNodeCodecContext 75/106375/1
Robert Varga [Sun, 4 Jun 2023 20:15:11 +0000 (22:15 +0200)]
Use instanceof patterns in KeyedListNodeCodecContext

Reduce explicit casts by using instanceof expressions.

Change-Id: I04c15c70b0c9b23680aeb07892cc11c1b167b07f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoUse instanceof patterns in CodecDataObject 74/106374/1
Robert Varga [Sun, 4 Jun 2023 20:13:50 +0000 (22:13 +0200)]
Use instanceof patterns in CodecDataObject

Throw explicit VerifyExceptions instead of verify(... instanceof ...),
so we make it obvious what is going on.

Change-Id: I2fef6be328eb99b2f7c5e6082ad637be0374a17f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoSharpen CodecDataObject.data 73/106373/2
Robert Varga [Sun, 4 Jun 2023 19:51:49 +0000 (21:51 +0200)]
Sharpen CodecDataObject.data

Since we do not have AugmentationNodes, we now know that all
DistinctNodeContainers backing CodecDataObject are DataContainerNodes.
Sharpen the contract, which gets rid of some ugliness around generic
arguments.

Change-Id: I097e6fda0ca312fc808f2ac2d4e0bbc6ac679315
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoModernize dom-codec-api a bit 72/106372/4
Robert Varga [Sun, 4 Jun 2023 19:11:18 +0000 (21:11 +0200)]
Modernize dom-codec-api a bit

With AugmentationNode out of the picture, we know that
DataContainerChild nodes are identified by NodeIdentifier. Codify that
instead of working with plain PathArguments.

Change-Id: I50501e16ac33d3d4e49768b6ff8275603820fb3b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoModernize ChoiceNodeCodecContext 71/106371/1
Robert Varga [Sun, 4 Jun 2023 18:59:58 +0000 (20:59 +0200)]
Modernize ChoiceNodeCodecContext

We know that Choice's components can only be addressable by
NodeIdentifier, make sure we reflect in the byYangCaseChild Map.
Also use local variable type inference and a text block.

Change-Id: I7ac024b5791247685ecf05e9f77040919eec1219
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoBump odlparent to 13.0.0 11/106311/2
Robert Varga [Tue, 30 May 2023 20:01:55 +0000 (22:01 +0200)]
Bump odlparent to 13.0.0

Align the version with the version used by yangtools-11. Also fixes up
dependencies to pull in optional annotations.

Change-Id: Ia2ef118df94d7ca6c87de28834e1977d3fc41a13
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoCorrect AbstractDataObjectModification memoization 16/106216/3
Robert Varga [Sun, 28 May 2023 20:24:49 +0000 (22:24 +0200)]
Correct AbstractDataObjectModification memoization

Memoization here is not nice where nulls are concerned: if the result is
null, we end up round-tripping to the codec. Fix that by explicitly
masking null values with a sentinel object.

While we are at it, also relax access: instead of volatile read/writes,
use getAcquire()/setRelease() mechanics. Since the resulting DataObjects
are presumably previous, the set side is actually a CAS, reusing any
results of concurrent computation.

Change-Id: I77285e0842588b1882ef2eb09677d96395911a85
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoRelax AbstractDataObjectModification.childNodesCache 15/106215/3
Robert Varga [Sun, 28 May 2023 20:04:12 +0000 (22:04 +0200)]
Relax AbstractDataObjectModification.childNodesCache

This is quite a critical part of computation: use
getAcquire()/setRelease() mechanics. There is a twist, since the object
is an ImmutableList -- use compare-and-swap to ensure concurrent loads
result in the same list.

Change-Id: I4ea9773f415cd03bbba2e8068ce54367dd1d46de
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoRelax AbstractDataObjectModification.modificationType 14/106214/1
Robert Varga [Sun, 28 May 2023 19:51:58 +0000 (21:51 +0200)]
Relax AbstractDataObjectModification.modificationType

This is a performance-critical part, use getAcquire()/setRelease()
instead of volatile operations.

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