yangtools.git
9 days agoRename opendaylight.mdsal.binding.runtime.api 38/112238/2
Robert Varga [Thu, 20 Jun 2024 13:55:55 +0000 (15:55 +0200)]
Rename opendaylight.mdsal.binding.runtime.api

Rename opendaylight.mdsal.binding.runtime.api to
opendaylight.yangtools.binding.runtime.api.

JIRA: YANGTOOLS-1576
Change-Id: Ie2b08520c5726a2452732f6fcf53e1a4c78caba8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 days agoRename opendaylight.mdsal.binding.model.ri 37/112237/4
Robert Varga [Thu, 20 Jun 2024 13:08:34 +0000 (15:08 +0200)]
Rename opendaylight.mdsal.binding.model.ri

Rename opendaylight.mdsal.binding.model.ri to
opendaylight.yangtools.binding.model.ri.

JIRA: YANGTOOLS-1576
Change-Id: I2c10421aa1b1bd923b22fff48e37b4d05815ff11
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 days agoRename opendaylight.mdsal.binding.model.api 36/112236/2
Robert Varga [Thu, 20 Jun 2024 12:27:23 +0000 (14:27 +0200)]
Rename opendaylight.mdsal.binding.model.api

Rename opendaylight.mdsal.binding.model.api to
opendaylight.yangtools.binding.model.api.

JIRA: YANGTOOLS-1576
Change-Id: I699ea8c7bc97128f87bd9159b8683e282a955645
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 days agoRename org.opendaylight.yangtools.yang.binding 35/112235/1
Robert Varga [Thu, 20 Jun 2024 12:15:38 +0000 (14:15 +0200)]
Rename org.opendaylight.yangtools.yang.binding

Rename org.opendaylight.yangtools.yang.binding to
org.opendaylight.yangtools.binding.lib and adjust downstreams.

JIRA: YANGTOOLS-1576
Change-Id: I489acc8d0e6e8c126ae0e5eadfdf9acfc3c68f58
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 days agoIntroduce odl-bytebuddy 34/112234/2
Robert Varga [Thu, 20 Jun 2024 11:48:14 +0000 (13:48 +0200)]
Introduce odl-bytebuddy

YANG Binding requires ByteBuddy in dynamic environments, so let's
package it.

JIRA: YANGTOOLS-1576
Change-Id: I44bf6cf56bd215b9a78da23356054a8e171e60e1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 days agoPlug binding/ into the build 32/112232/9
Robert Varga [Wed, 19 Jun 2024 20:30:15 +0000 (22:30 +0200)]
Plug binding/ into the build

This is the first step, with just yang-binding being brought to the
party. This requires we also start maintaining the ByteBuddy dependency.

As we are not quite ready with binding-test-model, the components which
need it are not enabled yet.

JIRA: YANGTOOLS-1576
Change-Id: I7a45ccf7b808b393a4151e5694dfc2eba6dc0b5c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 days agoAdopt binding/ components 33/112233/7
Robert Varga [Wed, 19 Jun 2024 09:05:58 +0000 (11:05 +0200)]
Adopt binding/ components

The artifacts are going to be released from YANG Tools, lets perform
some house cleaning:
- change groupId to org.opendaylight.yangtools, which we must do because
  of our Maven Central namespace assignment
- rename yang-binding to binding-lib (which it really is)
- rename mdsal-binding-dom-codec to binding-data-codec-dynamic (not dom)
- rename mdsal-binding-java-api-generator to binding-codegen (it is
  generating code)
- rename mdsal-binding-runtime-* to binding-runtime-
- rename mdsal-binding-loader to binding-runtime-dynamic (it is
  interfacing the dynamic, JIT-supported parts of a JVM)
- rename mdsal-binding-spec-util to binding-util (now that there is no
  correspoding binding-api)
- rename mdsal-binding-test-model to binding-test-model

JIRA: YANGTOOLS-1576
Change-Id: Ie6d4e64d472cd42314e62c1035d8fad6039cfafa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoBump versions to 14.0.0-SNAPSHOT
Robert Varga [Mon, 3 Jun 2024 17:40:43 +0000 (19:40 +0200)]
Bump versions to 14.0.0-SNAPSHOT

This starts the next major development iteration.

Change-Id: I530979d8f1f01d17720f69f9e7eb924a349eb9e2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoRemove unneeded serialVersionUID fields
Robert Varga [Mon, 3 Jun 2024 17:29:23 +0000 (19:29 +0200)]
Remove unneeded serialVersionUID fields

SpotBugs now recognizes records are special, hence we can remove the
workaround.

Change-Id: If237583a2bc340f14f9b4180ea5756494a259b22
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoBump versions to 13.0.5-SNAPSHOT
Robert Varga [Mon, 3 Jun 2024 17:35:17 +0000 (19:35 +0200)]
Bump versions to 13.0.5-SNAPSHOT

This starts the next development iteration.

Change-Id: I91385d77a436ec34d5f6d5fbaea7296bfa9b887a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoRelease mdsal
jenkins-releng [Mon, 3 Jun 2024 15:51:52 +0000 (15:51 +0000)]
Release mdsal

10 days agoBump upstreams
Robert Varga [Tue, 28 May 2024 12:16:16 +0000 (14:16 +0200)]
Bump upstreams

Adopt:
- odlparent-13.1.3
- yangtools-13.0.6

Change-Id: Iba9db31ef9900b60a766c1f5c4558a17e50001cc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoBump versions to 13.0.4-SNAPSHOT
Robert Varga [Sun, 5 May 2024 12:11:12 +0000 (14:11 +0200)]
Bump versions to 13.0.4-SNAPSHOT

This starts the next development iteration.

Change-Id: Id72d4d09cb11ca514e07d4d957d4a6d3674801b8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoRelease mdsal
jenkins-releng [Sun, 5 May 2024 03:40:52 +0000 (03:40 +0000)]
Release mdsal

10 days agoBump upstreams
Robert Varga [Sat, 4 May 2024 22:38:00 +0000 (00:38 +0200)]
Bump upstreams

Adopt:
- odlparent-13.1.2
- yangtools-13.0.5

Change-Id: Icf1bdfdeee82da4991aff6302a1ed1de7dec688d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoBump yangtools to 13.0.4
Robert Varga [Mon, 22 Apr 2024 09:55:48 +0000 (11:55 +0200)]
Bump yangtools to 13.0.4

Adopt the single fix from upstream.

Change-Id: I36b11da370af4dcc04f8c0a3ca6e9fff29dd66ba
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoBump versions to 13.0.3-SNAPSHOT
Robert Varga [Tue, 16 Apr 2024 11:53:43 +0000 (13:53 +0200)]
Bump versions to 13.0.3-SNAPSHOT

This starts the next development iteration.

Change-Id: I247882cc078d49b8410bc033f9e0bd3c09568c5e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoRelease mdsal
jenkins-releng [Tue, 16 Apr 2024 09:52:17 +0000 (09:52 +0000)]
Release mdsal

10 days agoBump upstreams
Robert Varga [Mon, 15 Apr 2024 11:00:36 +0000 (13:00 +0200)]
Bump upstreams

Adopt:
- odlparent-13.1.1
- yangtools-13.0.3

Change-Id: I2bc3240a8b2bf3915d7379fc700da6bb46908922
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoEliminate CodecItemFactory
Robert Varga [Fri, 12 Jan 2024 01:36:57 +0000 (02:36 +0100)]
Eliminate CodecItemFactory

This is a useless indirection, as we can simply pass the required
information down to where the case class is needed.

JIRA: MDSAL-815
Change-Id: I7413f33d0c4a76e29b180ef34623e7a0607c784f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoFixup checkstyle
Robert Varga [Mon, 15 Apr 2024 11:56:12 +0000 (13:56 +0200)]
Fixup checkstyle

Upgraded checkstyle is finding more violations, fix them up.

Change-Id: I96ab46cc8f370b39dd287d3a1717952a5685dce5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoBump versions to 13.0.2-SNAPSHOT
Robert Varga [Thu, 14 Mar 2024 08:41:53 +0000 (09:41 +0100)]
Bump versions to 13.0.2-SNAPSHOT

This starts the next development iteration.

Change-Id: Icc2713325cddcd655991c4e2d00be786370ea407
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoRelease mdsal
jenkins-releng [Thu, 14 Mar 2024 05:47:17 +0000 (05:47 +0000)]
Release mdsal

10 days agoVerify revision string
Robert Varga [Tue, 12 Mar 2024 21:37:39 +0000 (22:37 +0100)]
Verify revision string

yang.common.Revision has a guaranteed format, hence if toString() does
not match, it is not an IAE, but rather a VerifyException pointing out a
violation of our expectations.

Change-Id: Ieabc84f40df3c56bcc7690c2c277cd95583bf1de
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoMigrate users of deprecated yang.common methods
Robert Varga [Tue, 12 Mar 2024 17:07:04 +0000 (18:07 +0100)]
Migrate users of deprecated yang.common methods

QNameModule and QName have deprecated a few methods, migrate to their
replacements.

Change-Id: I458a58177db17efc0ae866b62ff77288ca910475
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoBump upstreams
Robert Varga [Tue, 12 Mar 2024 14:47:34 +0000 (15:47 +0100)]
Bump upstreams

Adopt:
- odlparent-13.0.11
- yangtools-13.0.2

This unfortunately breaks Xtend's magic 'get' prefix handling, so fix
that up.

Change-Id: I639738394f26c3bedaea82518e2e4d395e430022
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoRemove superfluouse @NonNull
Robert Varga [Tue, 12 Mar 2024 17:09:11 +0000 (18:09 +0100)]
Remove superfluouse @NonNull

We have @NonNullByDefault, hence we do not need an explicit @NonNull.

Change-Id: I6b546d685d7ffb27577e377987fafd97ee7c3d64
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoDo not generate prime when not needed
Robert Varga [Fri, 23 Feb 2024 22:30:47 +0000 (23:30 +0100)]
Do not generate prime when not needed

In case we do not have any properties we end up emitting a local
variable which we'll never use -- generating a compiler warning.

Improve InterfaceTemplate to check for this condition and emit the
prime only if there are actually at least one property.

Change-Id: I3341ca075e8c7c0b671a76f226b7bdb99cb12465
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoAdd yang.binding.contract documentation
Robert Varga [Mon, 22 Jan 2024 22:12:27 +0000 (23:12 +0100)]
Add yang.binding.contract documentation

Document the contents of the contract package.

Change-Id: I02cdf674fa591decc85339f8049ba281c4cd62a2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoBump versions to 13.0.1-SNAPSHOT
Robert Varga [Sat, 20 Jan 2024 16:32:22 +0000 (17:32 +0100)]
Bump versions to 13.0.1-SNAPSHOT

This starts the next development iteration.

Change-Id: Ia471501c5f24994491208d9776fd4e74e581f156
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoRelease mdsal
jenkins-releng [Sat, 20 Jan 2024 13:12:42 +0000 (13:12 +0000)]
Release mdsal

10 days agoClean up constant reference
Robert Varga [Fri, 19 Jan 2024 13:12:27 +0000 (14:12 +0100)]
Clean up constant reference

We have two methods with the same name, make sure we use the right
constant when referencing it.

JIRA: MDSAL-852
Change-Id: I7628d2c997e3c62895984d6d85672c65ff9f0ce7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit c112f99b13a8b337563a27761159f7f4bb9dbd94)
(cherry picked from commit edac194e791de33fd9f4a3338855113139ff9ad0)

10 days agoUse Locale.ROOT for toUpperCase
Robert Varga [Thu, 18 Jan 2024 16:41:27 +0000 (17:41 +0100)]
Use Locale.ROOT for toUpperCase

We can just assert this is the root locale, not a some particular
language.

Change-Id: Ibce067abf252162740a9c6ed88a3beff99f455b1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoExclude generated services from SpotBugs
Robert Varga [Thu, 18 Jan 2024 15:12:38 +0000 (16:12 +0100)]
Exclude generated services from SpotBugs

We have additional package root we want to exclude, update the list.

JIRA: MDSAL-836
Change-Id: If5e0e15b09570a4e8ff5e9e35d058e3bee018c2c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoFix ModuleInfoSnapshotResolver
Robert Varga [Thu, 18 Jan 2024 14:52:06 +0000 (15:52 +0100)]
Fix ModuleInfoSnapshotResolver

Previous update missed the ModuleInfoSnapshotResolver update, leading to
broker OSGi functionality.

Update both callsites to directly derive root package name from the
advertized namespace.

JIRA: MDSAL-836
Change-Id: I520824b59018afd2d7afdf06173889f90fd70449
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoBump yangtools to 13.0.1
Robert Varga [Thu, 18 Jan 2024 10:42:04 +0000 (11:42 +0100)]
Bump yangtools to 13.0.1

Adopt fixes from upstream that are needed downstream.

Change-Id: I5b31163fff4ab9c1206167f57815014e24010817
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoOverride Rpc/Action invoke method
Robert Varga [Thu, 18 Jan 2024 06:56:56 +0000 (07:56 +0100)]
Override Rpc/Action invoke method

Add a plain @Override method for Rpc/Action's invoke method, so that it
is manifested in the generated type.

JIRA: MDSAL-852
Change-Id: I7db7c9036bdb3051ae48a903b66df933fb338fae
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoChanged $Yang* generation package and name
Oleksandr Panasiuk [Tue, 5 Sep 2023 08:04:23 +0000 (11:04 +0300)]
Changed $Yang* generation package and name

The naming of these classes is rather unfortunate, as it starts with $
due to the requirement not to conflict with other generated classes. So
they were renemed to avoid dollar sign usage.
Also the root package for theese classes was changed from
org.opendaylight.yang.gen.v1 to org.opendaylight.yang.svc.v1.
A lot of test classes are touched in this patch but no logic were
changed there, its just providing a new path for YangModuleInfoImpl.

JIRA: MDSAL-836
Change-Id: If9e43d21063c2fc48d8adbf0ccfc2406fe760054
Signed-off-by: Oleksandr Panasiuk <oleksandr.panasiuk@pantheon.tech>
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoClean up AugmentationCodecContext
Robert Varga [Mon, 15 Jan 2024 16:02:59 +0000 (17:02 +0100)]
Clean up AugmentationCodecContext

Use A for Augmentation<?>, there is just no need to mix in DataObject.

JIRA: MDSAL-815
Change-Id: I8fc122a85e83878e7cda62420163ca0ed010299e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoCovert yang-binding to bnd-parent
Robert Varga [Sun, 14 Jan 2024 15:32:18 +0000 (16:32 +0100)]
Covert yang-binding to bnd-parent

There are just a few exported packages, switch to bnd-parent.

Change-Id: Iaabeff023f27d25739f08f31560f339df2ee6dde
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoClean up dependencies a bit
Robert Varga [Sun, 14 Jan 2024 14:44:48 +0000 (15:44 +0100)]
Clean up dependencies a bit

Eliminate yet another set of warnings.

Change-Id: I16f659072a1c794c28daac43ccb37ffca9c327bb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoMigrate users of Builders/ImmutableNodes
Robert Varga [Sun, 14 Jan 2024 10:15:30 +0000 (11:15 +0100)]
Migrate users of Builders/ImmutableNodes

Update references to use data.spi.node.ImmutableNodes.

Change-Id: Ide361652366ef8dc5ade34bb513219ce7cf448f3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoHide CodecContext methods
Robert Varga [Fri, 12 Jan 2024 11:24:34 +0000 (12:24 +0100)]
Hide CodecContext methods

There is no point having these protected, just make them
package-private.

While we are here, also centralize implementations, as otherwise we have
duplicates.

JIRA: MDSAL-815
Change-Id: I7d708c5d508f49fb8c3224463d8c36fd9cf5e021
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoSilence maven-javadoc-plugin
Robert Varga [Sat, 13 Jan 2024 22:12:46 +0000 (23:12 +0100)]
Silence maven-javadoc-plugin

Sprinkle lint suppressions for missing javadocs, cleaning up build
output and focusing on real issues.

Change-Id: I022b6a2f86ab5e21ff74a19a85c3802664b5c7de
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoPromote dom-parent to bundle-parent
Robert Varga [Sat, 13 Jan 2024 17:01:39 +0000 (18:01 +0100)]
Promote dom-parent to bundle-parent

This parent is used all over place. It really is MD-SAL's
'bundle-parent', so let's promote and rename it.

While we are at it, also switch its parent to yangtools' bundle-parent
and define correct SCM.

Change-Id: Idf72a16eb6ceb1c2816d79d28470efd7665b02ce
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoMake AugmentationCodecPrototype generic
Robert Varga [Thu, 11 Jan 2024 23:35:38 +0000 (00:35 +0100)]
Make AugmentationCodecPrototype generic

Augmentations should capture their target type, which eliminates the
need for quite a few casts.

JIRA: MDSAL-815
Change-Id: I3d9c8326ac2bb24135c66ecfe240ed95cea98318
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoDeprecate BindingCodecTreeNode.getSchema()
Robert Varga [Fri, 12 Jan 2024 20:07:11 +0000 (21:07 +0100)]
Deprecate BindingCodecTreeNode.getSchema()

The BindingCodecTreeNode hierarchy should be expressive enough so that
users do not need the underlying schema. Deprecate getSchema() for
removal.

Change-Id: I58c18075ce78b11db2a922f5de4d4859c256bd35
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoRefactor PathArgument to DataObjectStep
Robert Varga [Tue, 9 Jan 2024 20:14:59 +0000 (21:14 +0100)]
Refactor PathArgument to DataObjectStep

InstanceIdentifier.PathArgument is the basic modeling construct for
expressing a path composed of DataObject type references.

Extract it to a top-level construct, DataObjectStep, which has tree
specializations. AbstractPathArgument is kept around for serialization
complatibility.

This has the nice property of capturing the three possible addressing
states, so we can discern them when we see them.

Furthermore there is now only YangInstanceIdentifier.PathArgument, which
makes for cleaner method signatures and imports.

JIRA: MDSAL-815
Change-Id: I22706ccaecae4b70e8afe2644fc74057953c32b0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoReparent ChoiceCodecContext
Robert Varga [Thu, 11 Jan 2024 22:37:43 +0000 (23:37 +0100)]
Reparent ChoiceCodecContext

Choice as itself does not map to a DataObject, but rather to a ChoiceIn
-- it is the individual cases that also map to DataObject.

In this patch we reparent ChoiceCodecContext to be a subclass of
DataContainerCodecContext, which allows us to ditch the idea that a
there is a InstanceIdentifier.PathArgument corresponding to this
context.

A nice bonus is that we end up with exactly one serialization method,
which is delegating to the individual case.

Another nice thing is we have a natural place to host the case lookup
logic -- which fits squarely with
ChoiceCodecContext.bindingPathArgumentChild() contract.

JIRA: MDSAL-815
Change-Id: I12a80c849f6405e0e5723afc3f31704a2ad604a6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoRetain protype in DataContainerCodecContext
Robert Varga [Thu, 11 Jan 2024 18:42:26 +0000 (19:42 +0100)]
Retain protype in DataContainerCodecContext

Acknowledge that DataContainerCodecContext is always instantiated from a
prototype and retain it in the base class.

This ends up centralizing things enough to eliminate an ugly cast we are
using in AugmentationCodecContext.

JIRA: MDSAL-815
Change-Id: Ib604918c2d9e180fece0583331fc2486797cf546
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoLoosen BindingDataContainerCodecTreeNode.getBindingClass()
Robert Varga [Thu, 11 Jan 2024 17:56:57 +0000 (18:56 +0100)]
Loosen BindingDataContainerCodecTreeNode.getBindingClass()

Do not require BindingObject, as we stream navigation encounters
ChoiceIn interface, which is not a BindingObject -- it defers to its
constituent children to provide the BindingObject contract through their
DataObject inheritence.

JIRA: MDSAL-815
Change-Id: I76d1c2405138da2f6985216aef2dfa4580cea724
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoSeparate out DataContainerPrototype
Robert Varga [Thu, 11 Jan 2024 15:38:56 +0000 (16:38 +0100)]
Separate out DataContainerPrototype

We have CommonDataObjectCodecPrototype defining strict prerequisites
while providing awefully little in terms of API worth.

Split out DataContainerPrototype, which exposes a typed javaClass() and
the corresponding runtimeType().

JIRA: MDSAL-815
Change-Id: Icaca2603e3b946764ff9d4157ab04be95bd4dde2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoHide CodecContextSupplier
Robert Varga [Thu, 11 Jan 2024 12:05:53 +0000 (13:05 +0100)]
Hide CodecContextSupplier

Refactoring InstanceIdentifier.Item flushes out a problem with the class
hierarchy of ChoiceNodeContextPrototype.

Start off by refactoring CodecContextSupplier, introducing
LazyCodecContextSupplier base class.

JIRA: MDSAL-815
Change-Id: I79fe079d9fc4b0adf166c1a8b2561fb03a2f071f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoRefactor DOMYangTextSourceProvider
Robert Varga [Sat, 6 Jan 2024 03:48:25 +0000 (04:48 +0100)]
Refactor DOMYangTextSourceProvider

This should really be a proper extension with its own API. While we are
at it.

mdsal-binding-runtime-api is made synchronous, as there is just no need
to use futures.

Change-Id: I3711662242df8d912c2536a3d73d4f86beea2c33
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoBump yangtools to 13.0.0
Robert Varga [Mon, 11 Dec 2023 10:19:04 +0000 (11:19 +0100)]
Bump yangtools to 13.0.0

This adopts yangtools-13.0.0 and updates the various integration
surfaces.

Change-Id: Ie9e2ed6fec32bdb7cd98803552a4500a5b44f127
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoDo not use mockito-subclass
Robert Varga [Fri, 29 Dec 2023 11:12:31 +0000 (12:12 +0100)]
Do not use mockito-subclass

Upgraded Mockito seems to cope well with the tests now, remove the
workaround.

Change-Id: I4130a2fff5a62e73d56b69354287b13a8caba615
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoEliminate CodecDataObjectAnalysis
Robert Varga [Mon, 10 Jul 2023 14:29:15 +0000 (16:29 +0200)]
Eliminate CodecDataObjectAnalysis

We really do not want to have a ton of specializations -- at the end of
the day we just need to properly specialize generation and constructor
access.

While this introduces a bit of code duplication, it also attaches more
properly the individual types to their implementations and the contracts
therein.

JIRA: MDSAL-805
Change-Id: I88b9222835817d2f52469c219844b2f05485dbc2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoCapture collection type class
Robert Varga [Wed, 27 Dec 2023 00:13:01 +0000 (01:13 +0100)]
Capture collection type class

Improve CodeHelpers safety by not losing Class type.

Change-Id: I585afdbda3328b018764627631dff7c8df372c01
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoSkip SpotBugs for generated code
Robert Varga [Tue, 26 Dec 2023 20:50:19 +0000 (21:50 +0100)]
Skip SpotBugs for generated code

SpotBugs-4.8.3 allows us to explicitly exclude classes from analysis,
take advantage of this facility to suppress Spotbugs on all classes
generated from YANG models.

Change-Id: I81a09e7ba7a1bac9ad1884b36f0bd98a7a3ecde3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoBump upstreams
Robert Varga [Tue, 26 Dec 2023 20:17:38 +0000 (21:17 +0100)]
Bump upstreams

Adopt:
- odlparent-13.0.10
- yangtools-11.0.5

Also sprinkle @SuppressFBWarnings as needed.

Change-Id: I1649b1e2289f0a6ea2d8919f340dcc8e0b0579f7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoDo not pull in spotbugs-annotations into binding-parent
Robert Varga [Tue, 26 Dec 2023 20:21:55 +0000 (21:21 +0100)]
Do not pull in spotbugs-annotations into binding-parent

Binding constructs no longer emit @SuppressFBWarnings, hence there is no
point in pulling in this dependency.

Change-Id: If0cdc88df2b2d585fb3bf2defb07d928325466a5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoDo not leak SpotBugs from yang-binding
Robert Varga [Tue, 26 Dec 2023 23:52:34 +0000 (00:52 +0100)]
Do not leak SpotBugs from yang-binding

We do not want to pollute user-visible classes with @SuppressFBWarnings,
as that is a purely-internal thing.

Isolate the single method requiring suppression into its own
package-private class.

Change-Id: I200ef79c512063f531f1dd18ed0148439c850563
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoUse constructor injection for OSGi codec services
Robert Varga [Tue, 26 Dec 2023 23:12:58 +0000 (00:12 +0100)]
Use constructor injection for OSGi codec services

We can easily use constructor injection, which eliminates the need for
an explicit field.

Change-Id: I292169b1dd98dd0341a2b5067495bbc79a1c41e1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoMove binding.model.api documentation
Robert Varga [Tue, 19 Dec 2023 12:49:28 +0000 (13:49 +0100)]
Move binding.model.api documentation

Package documentation resides in the wrong file, move it.

Change-Id: I77d1c5f3b411df7ebb855ccaeb6c7c8d9d1184cc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoReuse found Set
Robert Varga [Tue, 19 Dec 2023 10:10:14 +0000 (11:10 +0100)]
Reuse found Set

We are just transferring entries here, so let's reuse the single object
and clear() after each pass.

JIRA: MDSAL-669
Change-Id: Ie41ba63087c8ad0fdc5a581a7d7c4c8dc77f8677
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoRemove duplicate documentation
Robert Varga [Tue, 19 Dec 2023 10:09:22 +0000 (11:09 +0100)]
Remove duplicate documentation

We have directUsers() described, rename the field and drop superfluous
documentation.

JIRA: MDSAL-669
Change-Id: I3824704f9aa6b15c88a1f0118cdac034b939bb80
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoRetain grouping/uses instantiation vectors
Samuel Schneider [Fri, 3 Mar 2023 07:42:50 +0000 (08:42 +0100)]
Retain grouping/uses instantiation vectors

We need the ability fo find all instantiations of a grouping for
closed-world analysis of BindingRuntimeTypes.

This analysis is need to determine, for example:
- possible types of 'type leafref's pointing outside a grouping,
  to determine which Binding/DOM codecs are applicable
- YANG/Binding overload mapping, i.e. whether a 'container'
  defined in a grouping is instantiated only once or multiple
  types, to use a strongly-bound CodecDataObject it the former case

This patch exposes a GroupingRuntimeType.instantiations(), which exposes
exactly this information.

DefaultGroupingRuntimeType stores this information in the form of
a set of vectors, each pointing either to another grouping or to a
concrete instantiation.

GeneratorReactor collects this information sufficiently early so that it
can be also used to perform partial closed-world analysis during
compile-time.

JIRA: MDSAL-669
Change-Id: I2e21a6b93ce30d9bd1022be5747d44663b6198fc
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoDo not fish for RpcInput/RpcOutput runtime types
Robert Varga [Sun, 17 Dec 2023 01:37:23 +0000 (02:37 +0100)]
Do not fish for RpcInput/RpcOutput runtime types

BindingRuntimeTypes provides all known types by their JavaTypeName. This
means we do not have to play games and just look the
{Input,Output}RuntimeType directly.

JIRA: MDSAL-781
Change-Id: If82275714a57f1dc173eae43d4407c0400cfc0e2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoUse bindingChild() to locate notifications
Robert Varga [Sun, 17 Dec 2023 01:46:40 +0000 (02:46 +0100)]
Use bindingChild() to locate notifications

BindingRuntimeTypes provides an interface to directly find
NotificationRuntimeType based on its name. Use it instead of dancing
around with reflection.

JIRA: MDSAL-781
Change-Id: I3ba1a06d8dc07700bd86a3288116989a1a445138
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoUse @Nullable in AbstractExplicitGenerator.runtimeType()
Robert Varga [Sat, 16 Dec 2023 20:41:36 +0000 (21:41 +0100)]
Use @Nullable in AbstractExplicitGenerator.runtimeType()

Rather than using Optional, split the two user groups to those who check
for null and who assume non-null.

The former continue to call runtimeType() and latter defer to
getRuntimeType().

Change-Id: I0818d806204007127a956f7598267735c90faca9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoImprove isOriginalDefinition()
Robert Varga [Sun, 17 Dec 2023 12:33:39 +0000 (13:33 +0100)]
Improve isOriginalDefinition()

We have an already-casted AddedByUsesAware, use that for the next
instanceof check.

Change-Id: I2e9a172c02fbc3e97d8c90e477cecaf8fa9504f5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoRemove BindingRuntimeTypes.findRpc{Input,Output}
Robert Varga [Sat, 16 Dec 2023 20:56:43 +0000 (21:56 +0100)]
Remove BindingRuntimeTypes.findRpc{Input,Output}

These methods are no longer used, remove them along with the indexing
support. This indes {Input,Output,Rpc}Generator.

Change-Id: I90820f5e925fd7e72dbe68572e5c671ef277da29
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoChange BindingRuntimeTypes.findIdentity()
Robert Varga [Sat, 16 Dec 2023 22:43:15 +0000 (23:43 +0100)]
Change BindingRuntimeTypes.findIdentity()

Rename the method to identityChild(), returning a @Nullable instead of
an Optional. Add the appropriate documentation.

Change-Id: I9c95c61d015595f876371cfc5e1e521a1b4b3cbe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoUse schemaTreeChild() to lookup input/output
Robert Varga [Sat, 16 Dec 2023 20:55:17 +0000 (21:55 +0100)]
Use schemaTreeChild() to lookup input/output

We have proper RpcRuntimeType, hence we can follow along the schema tree
axis to obtain the runtime types for RPC input/output.

Change-Id: Iea34601edc340b788fc3ee4e17c5da7e245734b7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoModernize ListGenerator
Robert Varga [Sat, 16 Dec 2023 20:28:26 +0000 (21:28 +0100)]
Modernize ListGenerator

Use local variable type inference. Also use local variables for keyGen
checking so as to eliminate false warnings.

Change-Id: Ic85f57228e42cfbc6cfe1f4a2dbd16b2798934b3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoDrop @Beta from mdsal.binding.generator.impl.rt
Robert Varga [Sat, 16 Dec 2023 15:58:00 +0000 (16:58 +0100)]
Drop @Beta from mdsal.binding.generator.impl.rt

This package is not exposed to outside world, there is no point in
having @Beta annotations here. Also make
Default{Input,Output}RuntimeType final.

Change-Id: I1506b99651bcc079c1d1d295e60d8a351f78a4a3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoClean up AbstractCompositeRuntimeType
Robert Varga [Sat, 16 Dec 2023 13:59:55 +0000 (14:59 +0100)]
Clean up AbstractCompositeRuntimeType

SpotBugs is no longer complaining about the Comparator, hence we can
completely remove the dependency of spotbugs-annotations.

While we are here, also clean up the Arrays.binarySearch() assumption we
make, so we tolerate if the key is reported as the first argument.

Change-Id: I97b9683b64e49617ca529826e37392face70739a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoFix wrong annotation use
Robert Varga [Sat, 16 Dec 2023 14:12:38 +0000 (15:12 +0100)]
Fix wrong annotation use

Use JDT annotation instead of SpotBugs, reducing our exposure.

Change-Id: I1fc1e13c5ae476a456a1ffd4db7182f118985945
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoUse instanceof pattern in AbstractCompositeRuntimeType
Robert Varga [Sat, 16 Dec 2023 13:45:01 +0000 (14:45 +0100)]
Use instanceof pattern in AbstractCompositeRuntimeType

Rather than a plain verify() and explicit cast, use an instanceof
pattern and an explicit throw.

Change-Id: I4583a650dd0ed875cbc2420ec60907c99a122876
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoUse instanceof pattern DefaultChoiceRuntimeType
Robert Varga [Sat, 16 Dec 2023 13:35:00 +0000 (14:35 +0100)]
Use instanceof pattern DefaultChoiceRuntimeType

Remove an explicit cast in favor of an instanceof pattern.

Change-Id: Iffe0425ba48a43396667354d4d7b22f882301445
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoUnify GeneratedType verification
Robert Varga [Sat, 16 Dec 2023 12:58:17 +0000 (13:58 +0100)]
Unify GeneratedType verification

We have number of places where we do verify a Type is a GeneratedType.

Introduce AbstractExplicitGenerator.verifyGeneratedType() to reduce
duplication and explicit casts.

Change-Id: Idcdc2344d59befa2c39d74893348de6627b6c39d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoModernize GeneratorReactor
Robert Varga [Sat, 16 Dec 2023 12:16:31 +0000 (13:16 +0100)]
Modernize GeneratorReactor

Use local variable type inference and instanceof patterns.

Change-Id: I2f9222d0e6535bfaf7655ef6afccbb2ef431ddd4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoUse Module.asEffectiveStatement()
Robert Varga [Sat, 16 Dec 2023 12:07:30 +0000 (13:07 +0100)]
Use Module.asEffectiveStatement()

Eliminate a verifyication by cleanly translating Module to
ModuleEffectiveStatement.

Change-Id: I65a08a388e54132457ac8d99d981cbd332d0c009
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoReduce ObjectRegistration use
Robert Varga [Sat, 9 Dec 2023 17:06:03 +0000 (18:06 +0100)]
Reduce ObjectRegistration use

We have a few more services which are exposing ObjectRegistration from
APIs for no particularly good reason.

Switch them to use Registration instead, which allows us to reduce
adaptation in some cases.

JIRA: MDSAL-843
Change-Id: I9c88288cd4d57b9fb2fc780d9017fbb3eb5dbd94
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoBump Xtend to 2.33.0
Robert Varga [Wed, 6 Dec 2023 18:28:21 +0000 (19:28 +0100)]
Bump Xtend to 2.33.0

https://eclipse.dev/Xtext/releasenotes.html#/releasenotes/2023/11/21/version-2-33-0

Change-Id: I926f2981d05af6f3cc7da5825377312dfe574c83
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoRemove Naming.NOTIFICATION_LISTENER_SUFFIX
Robert Varga [Wed, 6 Dec 2023 16:17:30 +0000 (17:17 +0100)]
Remove Naming.NOTIFICATION_LISTENER_SUFFIX

This constant was used only by aggregate NotificationListeners, remove
it.

JIRA: MDSAL-497
Change-Id: I2be5a92934e5bccb7816ee2d95acc8044e7066a8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoRemove Naming.RPC_SERVICE_SUFFIX
Robert Varga [Wed, 6 Dec 2023 16:15:36 +0000 (17:15 +0100)]
Remove Naming.RPC_SERVICE_SUFFIX

This constant was only used for ynag.binding.RpcService implementations,
remove it.

JIRA: MDSAL-772
Change-Id: I0b222743c8466e55cdfedd9974046dcfaaf37673
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoRemove SuppressFBWarnings from InstanceIdentifier
Robert Varga [Fri, 24 Nov 2023 15:00:17 +0000 (16:00 +0100)]
Remove SuppressFBWarnings from InstanceIdentifier

Define readObject()/writeObject() methods that enforce Serializable
Proxy pattern, which in turn silences SpotBugs.

Change-Id: Ic7c5f523adc5e0df7e9a2767f93fcadd3bc77c8a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days 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>
10 days 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>
10 days 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>
10 days 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>
10 days 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>
10 days 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>
10 days 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>
10 days 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>
10 days agoRelease mdsal
jenkins-releng [Sun, 17 Sep 2023 09:11:11 +0000 (09:11 +0000)]
Release mdsal

10 days 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>
10 days 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>
10 days agoRelease mdsal
jenkins-releng [Wed, 30 Aug 2023 14:41:47 +0000 (14:41 +0000)]
Release mdsal