Robert Varga [Tue, 11 Apr 2023 16:05:19 +0000 (18:05 +0200)]
Bump upstreams
Adopt:
- odlparent-12.0.4
- yangtools-10.0.5
Change-Id: If70cc51bda56c6129d359f6b548554ea41e6f696
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 11 Apr 2023 16:16:07 +0000 (18:16 +0200)]
Tag serialVersionUID with @Serial
Java 14+ allows tagging serialization-related constructs. While we do
not do anything fancy, make sure we tak serialVersionUID.
JIRA: MDSAL-821
Change-Id: I1b660df8fb5e7599d9d8b6658d8955251cc49870
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 11 Apr 2023 11:37:46 +0000 (13:37 +0200)]
Migrate Optional.get() callers
Use Optional.orElseThrow() instanced.
Change-Id: I6ffee0b3e92ddca92a659d0f67d0fda128c02258
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 4 Apr 2023 09:34:23 +0000 (11:34 +0200)]
Remove explicit DataTreeChangeService
DataBroker always implements DataTreeChangeService, hence we do not need
to spell that out.
Change-Id: If8f3889358cd7d92c59d719b37de040abcb40831
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 4 Apr 2023 07:14:16 +0000 (09:14 +0200)]
Use ArgumentMatchers.anyCollection()
Remove type safety warnings by using a dedicated method for matching any
collection.
Change-Id: I4607cb370115ec375757cb15277c43890bf06b70
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 24 Mar 2023 10:02:30 +0000 (11:02 +0100)]
Rename InstanceIdentifierBuilder
Turn the intermediate interface into a sealed abstract class, which
lowers verbosity significantly. We now have three builder classes, only
two of which are exposed.
JIRA: MDSAL-798
Change-Id: I45e23643e196d9d06112053d60b2e2fbf1544311
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
matus.matok [Thu, 23 Feb 2023 12:34:42 +0000 (13:34 +0100)]
Introduce InstanceIdentifier.KeyedBuilder
When we are dealing with the last idem being an identifiable, we should
expose that by producing KeyedInstanceIdentifier.
Introduced KeyedBuilder and switch to this interface whenever the last
item is an IdentifiableItem -- guaranteeing KeyedInstanceIdentifier
return from build() method.
JIRA: MDSAL-798
Change-Id: I404df6aa1f3c79f259ea705adedd58a9d466cb78
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 22 Mar 2023 13:32:47 +0000 (14:32 +0100)]
Clean up InstanceIdentifierTest
Add missing spaces and remove unneeded trailing comments.
Change-Id: I44c0db8aa27b145148fc86c3fb43b0d78769ce51
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 22 Mar 2023 10:31:57 +0000 (11:31 +0100)]
Improve InstanceIdentifierBuilderImpl.equals()
Use an instanceof pattern and perform direct comparison on hashcodes.
Change-Id: I345e68b9c29fe32ee68d12808f02446c4636388e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 22 Mar 2023 09:41:05 +0000 (10:41 +0100)]
Improve InstanceIdentifierBuilderImpl safety
Add a constructor which explicitly takes (Identifiable)Item, removing the
need to use type arguments and hiding the intermediate empty constructor
as well as the methods to add items.
Change-Id: Ib45485b0ab3b10ab0666b4ad6797dc710cd00130
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 22 Mar 2023 09:31:38 +0000 (10:31 +0100)]
Simplify AbstractPathArgument.equals()
Use instanceof pattern to simplify the equals method.
Change-Id: I31eb8b095a701a43ece60008bc1b797a9ef6ebac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 22 Mar 2023 09:22:12 +0000 (10:22 +0100)]
Remove internal callers of isWildcarded()
We have two internal callers who can just refer to the field, fix them
up.
Change-Id: Ia634c2f65b809dd719746bd85061feee14f44ec9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 21 Mar 2023 15:24:31 +0000 (16:24 +0100)]
Correct InstanceIdentifier.trustedCreate()
The check for wildcard is not correct: we should just consider the last
item when deciding to create a KeyedInstanceIdentifier. Add an explicit
test and fix the checks.
JIRA: MDSAL-818
Change-Id: Ic6fedca7e182eaf0d983e3e39b49dd75d01f8ae8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Šimon Ukuš [Wed, 22 Feb 2023 12:06:39 +0000 (13:06 +0100)]
Rehost BindingMapping in yang.binding.contract.Naming
Preparation stage for further changes requested by MDSAL-804,
where all the constants and utility methods are moved to
yang.binding.contract.Naming.
Includes moving from BindingMappingTest to NamingTest.
JIRA: MDSAL-804
Change-Id: I8c34f4c4eef40f9c040a0eaeadd49fdfed6dca13
Signed-off-by: Šimon Ukuš <simon.ukus@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 13 Mar 2023 12:39:14 +0000 (13:39 +0100)]
Bump byte-buddy to 1.14.2
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.14.1
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.14.2
Change-Id: I1763b4314eead1f822d9cfee948d703aea9f9d51
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 1 Mar 2023 23:10:30 +0000 (00:10 +0100)]
Bump xtend to 2.30.0
https://www.eclipse.org/xtend/releasenotes.html#/releasenotes/2023/02/27/version-2-30-0
Change-Id: If861cb4f3148a2d7d40ec8bc47ea3f8f8cc21feb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 1 Mar 2023 14:35:52 +0000 (15:35 +0100)]
Improve DOMMountPointServiceImpl error message
The checkState() we perform is rather ugly, as it does not provide
enough diagnostic information. We already have a nicer checkState()
in the register() path. Extract it to a common method and reuse it from
both places.
Also improve safety by checking for null path before anything and also
take the lock to ensure serialization with others.
JIRA: NETCONF-621
Change-Id: I55845f9bbd7b3f4dbfa06a91724abcb601dc4f7f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 28 Feb 2023 10:22:33 +0000 (11:22 +0100)]
Bump versions to 12.0.0-SNAPSHOT
This starts the next major development iteration.
Change-Id: Iae454a79260f3633994976e086f45458a6240185
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 23 Feb 2023 15:10:24 +0000 (16:10 +0100)]
Use mockito-subclass
Reduce the workaround here to use mockito-subclass instead of forcing an
old mockito version.
Change-Id: Ibcf45b9101133f2c7852e404081b58c25cd3b888
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 23 Feb 2023 12:58:44 +0000 (13:58 +0100)]
Add IdentityKeyTest
Add an explicit test for there/back conversion of identitiable items
with identity-bearing keys.
Change-Id: Iee6ef612aac91058dff658025fc6670c8b8b4f56
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 23 Feb 2023 09:48:12 +0000 (10:48 +0100)]
Bump versions to 11.0.8-SNAPSHOT
This starts the next development iteration.
Change-Id: I80ca407339914e3c26aa72b30936c141625e1544
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 22 Feb 2023 20:48:34 +0000 (21:48 +0100)]
Migrate user of TypeDescription.OBJECT
Use TypeDescription.ForLoadedType.of() instead. Also shorten references
to TypeDescription.ForLoadedType, as we already have it imported.
Change-Id: I2e5531b8e0199d341ee943792369bafb7ab64dc3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 17 Feb 2023 14:28:20 +0000 (15:28 +0100)]
Bump upstreams
Adopt:
- odlparent-12.0.3
- yangtools-10.0.4
Change-Id: I98d91e0dac8b396e6164c8b3820c57ba4c5304ae
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 22 Feb 2023 20:12:01 +0000 (21:12 +0100)]
Remove unneeded declaration
junit-jupiter-params is pulled in by default, remove the declaration.
Change-Id: I8bed9db5e4b50d114357ed308cb9479ed29f1078
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 22 Feb 2023 19:09:28 +0000 (20:09 +0100)]
Use text blocks in BuilderGeneratorTest
Java 17 has text blocks, which we can use to make the test a lot more
readable.
Change-Id: Ifa4236e09f6e576b339be7fba0dd2c91469ce9a7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 22 Feb 2023 19:03:31 +0000 (20:03 +0100)]
Reduce bindingEquals() verbosity
We are generating a cascade of checks, all of which must pass for us to
return 'true'. Rather that generating a number of 'if/return' blocks,
use a single expression to achieve the same result.
Change-Id: I13c7abe4ef81d2a2822b6b4d0456f277dd5ce288
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 22 Feb 2023 18:41:56 +0000 (19:41 +0100)]
Use {@code null} instead of plain null
We want to highlight null, make sure we do that.
Change-Id: I489c42a5e8f28bec5799ba22c78b960fc4e753cb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 22 Feb 2023 19:02:37 +0000 (20:02 +0100)]
Clean up dependencies
We rely on rfc8040-model-api in generator, add that to dependencies to
supporess a warning.
Change-Id: I28f2a16b8eff90cc757a4ccebebe3940033a4739
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 22 Feb 2023 19:12:46 +0000 (20:12 +0100)]
Bump byte-buddy to 1.14.0
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.12.20
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.12.21
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.12.22
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.12.23
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.13.0
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.14.0
Change-Id: I5fded158100395f841b15fba08245399d7973b85
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 5 Feb 2023 11:09:03 +0000 (12:09 +0100)]
Bump versions to 11.0.7-SNAPSHOT
This starts the next development iteration.
Change-Id: I5220b28e9fd077c1b88acb89a25485fa16742f5d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 2 Feb 2023 22:49:35 +0000 (23:49 +0100)]
Expand StatementNamespace
We are dealing with weird generated models in some cases. Expand
StatementNamespace to cover all the possible inter-statement conflicts
by dedicating suffixes.
JIRA: MDSAL-810
Change-Id: If5e99f89a03f1fa6287dc3516f193bed3de097e8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 2 Feb 2023 22:00:01 +0000 (23:00 +0100)]
Move appendPrefix()
The decision to append a prefix is a policy decision, hence it should
live in NamingStrategy. StatementNamespace only provides the knobs.
Change-Id: I3439930b2f9978a157f03f7ca685250c010242f1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Sangwook Ha [Sat, 4 Feb 2023 19:18:38 +0000 (11:18 -0800)]
Update listeners in registerNotificationListeners
'registerNotificationListeners' does not include a step to replace the
the listener map with a new one. Make sure that the listener map is
actually updated. Also, add test cases for the registration methods.
JIRA: MDSAL-811
Change-Id: I469000b6f92e8d45186cafa1a3a2c737f642de01
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
Robert Varga [Wed, 1 Feb 2023 12:58:07 +0000 (13:58 +0100)]
Bump versions to 11.0.6-SNAPSHOT
This starts the next development iteration.
Change-Id: Idf89c631cd7dcd33f4469c3a05c30f0da33d319e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 1 Feb 2023 10:38:11 +0000 (11:38 +0100)]
Add BindingRuntimeContext.getYangDataClass()
For runtime support we need the ability to load YangData classes, this
patch adds that ability.
JIRA: MDSAL-675
Change-Id: Ia318c2cd7b47e6477144938d9f67f69972e4d7c6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 1 Feb 2023 10:28:44 +0000 (11:28 +0100)]
Add BindingRuntimeTypes.findYangData()
BindingRuntimeTypes (as well as ModuleRuntimeType) need to expose the
ability to locate YangDataRuntimeTypes. This patch adds that capability.
JIRA: MDSAL-675
Change-Id: Ibb5da804ffa04750f6b450ace3a240b910fc7eac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 1 Feb 2023 10:11:09 +0000 (11:11 +0100)]
Use instanceof pattern
Remove an explicit cast, making things a bit cleaner.
Change-Id: I5a06c7fcfa74dcca61e7c767cd9107fb926e7894
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Ruslan Kashapov [Tue, 13 Dec 2022 10:34:08 +0000 (12:34 +0200)]
RFC8040 'rc:yang-data' support for mdsal binding generator
New naming strategy is introduced to generate artifact names out of
yang-data argument: if name is yang identifier compliant the camel-case
transformation used, otherwise non-compliant characters are encoded.
JIRA: MDSAL-675
JIRA: MDSAL-808
Change-Id: I6644f550a378cd176e5f53a201ee6e70b32c6410
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 31 Jan 2023 22:13:23 +0000 (23:13 +0100)]
Separate out YangIdentifierClassNamingStrategy
Our current ClassNamingStrategies rely on the fact that each YANG
statement's argument provides an AbstractQName from which we can extract
a YANG identifier (i.e. AbstractQName.getLocalName()).
ietf-restconf:yang-data's argument is any non-empty String, so we just
cannot keep this contract.
Separate current handing into a separate class, which inherits the
notion of having a nodeIdentifier(), except that fact is purely internal
field. This also neatly re-joins Module and CamelCase to use the same
simpleClassName() method.
JIRA: MDSAL-675
Change-Id: Iaa1a43ba865ff78aa98ac69459e16373634eff40
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 31 Jan 2023 21:46:27 +0000 (22:46 +0100)]
Revert "Make CamelCaseWithNamespaceNamingStrategy reusable"
This reverts commit
74423fd58d3af3c3fcafd179be4b174aeace2230. As it
turns out we do not need fallback for yang-data after all.
JIRA: MDSAL-675
Change-Id: I3ecba0c7d93bc3e0d33479221b95adea40b4befe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 30 Jan 2023 20:04:06 +0000 (21:04 +0100)]
Move ClassNamingStrategy.simpleClassName()
Class name generation must not depend on YANG identifier, as there very
well may be other implementations. This results in a bit of duplicate
code, but that's fine.
JIRA: MDSAL-675
Change-Id: Iccbcf77ea68a7f6cf1c5cff18a218a27c04c40a8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 30 Jan 2023 18:44:57 +0000 (19:44 +0100)]
Make CamelCaseWithNamespaceNamingStrategy reusable
Appending a suffix is usable for other strategies as well, rename this
class to AppendNamespaceNamingStrategy and extract the fact that a
strategy has a namespace to AppendNamespaceNamingStrategy, which
automatic fallback.
JIRA: MDSAL-675
Change-Id: Ib1614b84591b4c0349f81785846f7216e0e87ec4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 17 Jan 2023 20:52:18 +0000 (21:52 +0100)]
Add YangData base interface
RFC8040 defines a yang-data extension, which defines a piece of data,
which is yang-modeled, but does not tie to any of the RFC7950
constructs.
Add a baseline binding interface which captures its basic contract and
codegen generates interfaces on top of it.
JIRA: MDSAL-675
Change-Id: I6f93733ce15ad47294c7c04bc7de2d7aa22ac9cd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 30 Jan 2023 17:36:29 +0000 (18:36 +0100)]
Bump upstreams
Adopt:
- odlparent-12.0.2
- yangtools-10.0.3
Change-Id: I557f7fab6650da3980109cde573bf509a27dd5f7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 23 Jan 2023 09:45:36 +0000 (10:45 +0100)]
Bump versions to 11.0.5-SNAPSHOT
This starts the next development iteration.
Change-Id: If57c4c2a776554c1892bf23e30b032966eabc059
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 16 Jan 2023 13:42:30 +0000 (14:42 +0100)]
Fix typedef/bits code generation
bits/typedef seemed to be generating code which does not compile.
Add a test to check if the generated code contains desired method and
fix the check for bits type.
JIRA: MDSAL-807
Change-Id: I4618269fff1fc284b65e9efb1d49501248d233c3
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 16 Jan 2023 00:27:40 +0000 (01:27 +0100)]
Add Augmentable.augmentationOrElseThrow()
A number of places assume, or check-or-throw on, presence of a
particular Augmentation. Add convenience methods to short-circuit
the equivalent of Optional.orElseThrow(), so users get more comfort
expressing this.
JIRA: MDSAL-806
Change-Id: I457a93ac1689087a7ceace57489e528b488ed207
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 17 Jan 2023 22:07:13 +0000 (23:07 +0100)]
Use instanceof patterns for argument checking
Eliminate the need for explicit casts by inlining verify(instanceof)
calls.
Change-Id: Ice2508ea44693bac4198b55779f82a9d51cbe514
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 17 Jan 2023 20:38:10 +0000 (21:38 +0100)]
Add FIXMEs to Rpc{Input,Output}
DataObject has implications which cover the possibility of being an
interior node of a structured data. RpcInput and RpcOutput are
explicitly excluded from that contract, similarly as BaseNotification
is.
Add FIXMEs to reconcile this modeling problem.
Change-Id: I84b6f5ca90cbfb685209559863f29634c5744772
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 6 Jan 2023 22:28:26 +0000 (23:28 +0100)]
More use of instanceof patterns
Reduce the number of explicit casts by integrating them into instanceof
patterns, which leads to reduction of nested if statements in some
cases.
Change-Id: I1255b4c9998faa1ec0de037fc54dc0d79544ed4f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 18 Dec 2022 11:08:25 +0000 (12:08 +0100)]
Bump versions to 11.0.4-SNAPSHOT
This starts the next development iteration.
Change-Id: I3e4125653c6fe0cff8fe61d052fa0b3f9facdf0d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 13 Dec 2022 16:50:38 +0000 (17:50 +0100)]
Deprecate DataObjectReadingUtil
This class is not used anywhere and is a rather heavy user of
reflection. Deprecate it for removal.
JIRA: MDSAL-802
Change-Id: If3f94622b9ae11b8f63f4d93e3ee211d456725f8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 13 Dec 2022 16:22:17 +0000 (17:22 +0100)]
Deprecate BindingReflections.getModelRootPackageName()
This implementation is a pure mapping thing, hence it has nothing
to do with reflection. Introduce the same method in BindingMapping
and deprecate old methods for removal.
JIRA: MDSAL-800
Change-Id: I598807e481db629e6c12380271ca160430b5fa66
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 8 Dec 2022 22:09:13 +0000 (23:09 +0100)]
Deprecate WriteTransaction.mergeParentStructure*()
These methods hark to our dark past. Most of their uses should be
superfluous with current semantics and they paper over important
lifecycle management questions. Furthermore there are corner cases for
which they cannot be made to work simply because of the semantics
involved.
Deprecate these method so their users are pointed out and can be
gradually migrated.
Change-Id: Ib85d42a9514b33fcdb1efb1ddb273b4c6ee0e554
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 5 Dec 2022 17:50:10 +0000 (18:50 +0100)]
Fix union/bits string mapping
BitsTypeObject changed the name of the value getter -- it is now
values(), not getValue(). Adjust UnionTemplate reference and update
tests to covert this case.
JIRA: MDSAL-797
Change-Id: I8b8789b87ae5ea43eaa942b932690dc3e35a161e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 4 Dec 2022 17:59:36 +0000 (18:59 +0100)]
Set Xtend generation target to Java 17
Xtend can now support Java 17, let's use it.
Change-Id: I3135f893b89e453af2a13abd67e1fde59fd0ac5c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 4 Dec 2022 17:59:09 +0000 (18:59 +0100)]
Bump Xtend to 2.29.0
Pick up latest upgrade.
Change-Id: Ie5d3c7e508b6e2886c55985ea5e4e5c46c61f722
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 4 Dec 2022 14:37:14 +0000 (15:37 +0100)]
Bump versions to 11.0.3-SNAPSHOT
This starts the next development iteration.
Change-Id: I4a8f80b45a971542dd1ca5d0a696b26b60118b71
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 4 Dec 2022 14:31:49 +0000 (15:31 +0100)]
Bump yangtools to 10.0.2
Pick up the fix for XML parser regression.
Change-Id: Idd5789f19ae3925e12950a8cf51a5901370bcb96
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 28 Nov 2022 17:08:45 +0000 (18:08 +0100)]
Bump versions to 11.0.2-SNAPSHOT
This starts the next development iteration.
Change-Id: I7a2367609de91fe1d2231ee3c8f48fe6851387ba
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 28 Nov 2022 13:15:17 +0000 (14:15 +0100)]
Fix AbstractDOMRoutingTable.{add,remove}All()
Our naive implementation breaks down if we are registering multiple
items, as we end up adding unmodified entries each and every time.
Fix this up by decomposing identifiers in the caller, keeping them in a
table and then have addAll()/removeAll() work on the table, with careful
checks.
JIRA: MDSAL-796
Change-Id: I0a52763e047026c1a641d9a25d82ee1d193fd573
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 28 Nov 2022 10:42:41 +0000 (11:42 +0100)]
Make invertImplementationsMap() static
This method is not touching staste, make it static to make that clear.
Change-Id: I1c6366c3f36bae4a8b77c84edeea9e8770eae968
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 26 Nov 2022 15:32:05 +0000 (16:32 +0100)]
Refactor createDomRpcIdentifiers()
We are creating a temporary HashMap, there is just no need to do that,
and we can further de-duplicate callers by introducing register()
which registered a transformed map.
Change-Id: I6ac52eb9b383ebfefc790596cdbb92ce418871a8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 26 Nov 2022 09:22:30 +0000 (10:22 +0100)]
Simplify transactionAborted()
We have introduced instanceof patterns, which simplify the structure
enough so Sonar points out we should merge if statements. Do that and
inline 'success' as well.
Change-Id: I23bc76a3abe26b25d534e6a22f8b672310f987c1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 26 Nov 2022 09:36:55 +0000 (10:36 +0100)]
Modernize AbstractIetfInetUtil
Centralize thrown exceptions, inline the checks and use switch
expressions. This should make Sonar happier.
Change-Id: Ibc71439eb8ebe4f8b7f60d018b70d2e255bdcfb0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 26 Nov 2022 09:01:17 +0000 (10:01 +0100)]
Enable HTML linting
We require JDK17, hence we can properly lint HTML.
Change-Id: Ie845b23530f96f5ab3ee3eacae42734b0f754281
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 26 Nov 2022 09:19:04 +0000 (10:19 +0100)]
Use explicit exceptions in benchmark
Sonar does not like Exception, fix the issues reported.
Change-Id: I483b4bb04839f577261f4a141ddfc0dd8b90b08a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 26 Nov 2022 09:06:59 +0000 (10:06 +0100)]
Log timeouts
Sonar is complaining about TimeoutException, log them.
Change-Id: Ia3f33fb5f66b7bba71763e281172184c56b46394
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 26 Nov 2022 07:54:00 +0000 (08:54 +0100)]
Use RpcEffectiveStatement.input()
This saves a bit of code.
Change-Id: I77c482b6566fb4cb5102eae8ab84999f4d9ad083
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 25 Nov 2022 16:44:54 +0000 (17:44 +0100)]
Bump versions to 11.0.1-SNAPSHOT
This starts the next development iteration.
Change-Id: Ia40325bfd0a3da4de33c05f8484f1e24c80204e5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 25 Nov 2022 15:46:44 +0000 (16:46 +0100)]
Bump upstream versions
Adopt:
- odlparent-12.0.1
- yangtools-10.0.1
Change-Id: I376c482c8c050a14a3de94c4768cad2c01320e1e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 25 Nov 2022 02:43:32 +0000 (03:43 +0100)]
Fix a module warning
We are exposing javax.inject-annotated class, user should therefore
know about javax.inject (although there should not be any).
Change-Id: I076f82b9921b00d9483703f684277512e565d33e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 25 Nov 2022 02:36:09 +0000 (03:36 +0100)]
Improve SchemaUnawareCodec
Propagate type safety a bit and reduce casts a bit.
JIRA: MDSAL-743
Change-Id: I05a727f9eb21f55f41c84b3dd5bb264aefd71a73
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 25 Nov 2022 02:08:11 +0000 (03:08 +0100)]
Clean up AbstractCompositeGenerator
Sonar is pointing out foldable ifs, compress them thoroughly with
instanceof patterns.
Change-Id: I8c7ce9bed79dbc3338a526f4fe0337df712ead50
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 25 Nov 2022 02:02:55 +0000 (03:02 +0100)]
Clean up SchemaRootCodecContext
We have a few warnings from Sonar, perform general modernization.
Change-Id: Id817e176a8968afacbc4bdd7c56f25b7240af370
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 25 Nov 2022 01:53:00 +0000 (02:53 +0100)]
Clean up IdentifiableItemCodec
Sonar reports a few issues, clean the class up.
Change-Id: Ibc6f8794444369d976dce216c835a517f99f4d1f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 25 Nov 2022 01:34:54 +0000 (02:34 +0100)]
Clean up EncapsulatedValueCodec
Sonar is pointing out a number of issues, clean them up, although
most are false positives.
Change-Id: Ie04d42a902c6d6ee6037ba6e105205cf308c36dd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Nov 2022 23:40:13 +0000 (00:40 +0100)]
Centralize AbstractDOMRpcImplementationAdapter.serialize()
The invocation paths between the two specializations are exactly the
same, hence we can peel arguments and just pass down the input. Also
fixup duplicate access to serializer.
JIRA: MDSAL-86
Change-Id: I2df5061b47c63cd2886efdacfe5178acc08239de
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Nov 2022 21:28:12 +0000 (22:28 +0100)]
Tighten AbstractDOMRpcImplementationAdapter.serialize()
Require non-null arguments and make sure to return RpcInput, as that
what we need. Allows us to tighten up the legacy method handle as well.
JIRA: MDSAL-86
Change-Id: I76b6bc5707babcd2d71c1349672daf750999c998
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Nov 2022 21:18:24 +0000 (22:18 +0100)]
Eliminate RpcMethodInvoker
RpcMethodInvoker is a useless indirection around a MethodHandle with
a known signature. Eliminate this indirection and cache all
MethodHandles for a particular Rpc, passing each of them the its
individual LegacyDOMRpcImplementationAdapter.
This allows LegacyDOMRpcImplementationAdapter to fuse the delegate
object into its internal MethodHandle -- hence we do not need to track
the delegate separately.
JIRA: MDSAL-86
Change-Id: I9b89d353fc61e313c82e997ffeddbbb473bbd07f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Nov 2022 20:39:07 +0000 (21:39 +0100)]
Register multiple LegacyDOMRpcImplementationAdapters
We have created all the building blocks for being able to remove
binding dispatch during method invocation -- we already have a 1:1
BindingDOMRpcImplementationAdapter to bridge to a Rpc.invoke().
There we can perform the same binding here -- and register multiple
legacy adapters, each servicing one method.
JIRA: MDSAL-86
Change-Id: Ifacaf5f61b73a0a7f0870477dac295b2d5a04287
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Nov 2022 20:10:46 +0000 (21:10 +0100)]
Eliminate RpcServiceInvokers
RpcServiceInvokers are a useless indirection, really, as we can get
by with a simple map. This is not yet perfect, as we really want to
eliminate the lookup map completely.
JIRA: MDSAL-86
Change-Id: I6e95bfd979c4862799ea51915c6ca46f69cbe379
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Nov 2022 19:28:36 +0000 (20:28 +0100)]
Unify RPC input serialization
We know the expected RPC QName, hence we can share code between the
two implementations.
Change-Id: I9e071d329b441509a6747495ab6d9d3573796ff5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Nov 2022 18:40:06 +0000 (19:40 +0100)]
Rehost getRpcMethodToQName()
This methods is only used by BindingDOMRpcProviderServiceAdapter,
move it there.
Change-Id: I676b7254386f15a447b753af01d5f71f1e15fa3b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Nov 2022 18:13:55 +0000 (19:13 +0100)]
LegacyDOMRpcImplementationAdapter is generic
We are bridging to a well-defined RpcService subclass, hence this
should be captured in the field type -- making the class generic.
Change-Id: I46019e6e821a798474f639737c6fefe199bae8ee
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 2 Nov 2022 14:50:44 +0000 (15:50 +0100)]
Remove BindingReflections.resolveRpc{In,Out}putClass()
These methods are not used anywhere, remove them.
JIRA: MDSAL-788
Change-Id: I3ab399500e28c4cc446ab24b55080c2d4aa8af60
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Nov 2022 17:59:38 +0000 (18:59 +0100)]
Centralize "invoke" string definition
We have "invoke" in three places and it needs to be tied to the actual
definition. Introduce two constants in BindingMapping to perform that
job and link RPC/Action adapters to those constants.
Change-Id: If6c8f43e266d2a4395eb5237578803c23125d21d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 13 Oct 2022 09:17:50 +0000 (11:17 +0200)]
Deprecate RpcService
We have single-RPC generated interfaces, which are easier to use than
the RpcService-based roll-up. This patch deprecates all RPC interfaces
pending their removal.
JIRA: MDSAL-778
Change-Id: Iac537de518725173f21369ab0e04fb44fb0506b7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 6 Oct 2022 11:47:52 +0000 (13:47 +0200)]
Add support for registering single-RPC services
We are currently providing an aggregated RpcService generated class,
which is binding the invocation model to that class -- without the
ability to provide an implementation of a single RPC. It also
complicates the invocation path from DOM, since we need to perform
two lookups: one in DOM, where we route the invocation towards the
RpcServiceAdapter and then a method-based lookup to dispatch it in
the proxy.
Furthermore this prevents the possibility of adapting the invocation
contract, as the codegen is always involved.
We are now generating interfaces representing individual RPCs, just like
we do for actions. This provides a more granular access and notably
allows mdsal-binding-api to provide invocation contract adapters -- thus
disconnecting it from codegen.
JIRA: MDSAL-777
Change-Id: I114bd3795ba353da57e7f96d5db9680986ecb5f6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Nov 2022 16:14:54 +0000 (17:14 +0100)]
Change action input/output naming strategy
Users may want to implement multiple actions in a single source file, to
which extent the placement and bare names of Input and Output are rather
bad -- they cannot be imported more than once, leading to clutter.
RPC input/output do not suffer from this, as they combine their names
with the name of the RPC -- leading to to classes which can easily be
imported.
JIRA: MDSAL-794
Change-Id: I59e9926d7c5504519e9c9ba43c6915f6e5808ad6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Nov 2022 16:57:43 +0000 (17:57 +0100)]
Clean up BindingDOMAdapterLoaderTest
We have @Test(expected=) here as well as nulls which are not allowed.
Clean up the entire test.
Change-Id: Ie1774401adceed35d519de8f6d844096a6ee8798
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Nov 2022 15:42:50 +0000 (16:42 +0100)]
Clean up ContextReferenceExtractor a bit
Both implementations are operating on MethodHandles, which brings
Throwable into the picture. Move the common try/catch block into
the abstract class, reducing code duplication a bit.
Change-Id: I549ab704b6c1d1f3c0d9e4a1ac66b5dd9ecedaf7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Nov 2022 16:36:36 +0000 (17:36 +0100)]
Tighten up RpcInvocationStrategy
The invoke path is always taking RpcInput, make sure we cast it that
way, preventing potential confusion.
Change-Id: I8ec00eb4b4074b60b36abfe57948806a11634aad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Nov 2022 15:58:02 +0000 (16:58 +0100)]
Connect ContextReferenceExtractor with BindingMapping
The "getValue" magic string is well documented, make sure to reference
it in its BindingMapping form.
Change-Id: If152de3145f6821a6b83715a3232da8092ff6d73
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Nov 2022 15:35:11 +0000 (16:35 +0100)]
Seal ContextReferenceExtractor
Now that we have the pesky anonymous null implementation out of the way,
we can seal ContextReferenceExtractor, codifying there are only two
possible implementations -- since they are utterly simple, also move
them into ContextReferenceExtractor.java.
Change-Id: I7eb592316cc91baba3fe803eef3ff52682b2ac26
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Nov 2022 15:23:34 +0000 (16:23 +0100)]
Rework ContextReferenceExtractor caching
Rather than instantiating a weak global cache, cache
ContextReferenceExtractors in CurrentAdapterSerializer based on
JavaTypeName. This allows us to remove BindingReflections from the
instantiation path.
Since we are mucking around with this, also eliminate the null
extractor, which means we end up falling back to stock-normal invocation
strategy -- removing an unneeded indirection.
JIRA: MDSAL-777
Change-Id: Ic5e1f5a9da399a2ae2e93d549c6056a0067a6bcd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Nov 2022 14:50:00 +0000 (15:50 +0100)]
Break open RpcInvocationStrategy
Creation of the strategy is inter-twined with ContextReferenceExtractor,
which we want to cache in CurrentAdapterSerializer. Inline creation of
the strategy where we have controlled access to
CurrentAdapterSerializer, with RpcServiceAdapter doing the mediation, so
that we do not pass things around and create a method call tangle.
JIRA: MDSAL-777
Change-Id: I3f092f8ce47d154c84ca821512d1fbfbb65d8673
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Nov 2022 14:36:34 +0000 (15:36 +0100)]
Integrate getRpcMethodToSchema() into constructor
We are creating an intermediate map here, only to re-examine it in a
second pass. Integrate the method and create rpcNames in a single pass.
This gives us a more direct conduit to RpcInvocationStrategy.
JIRA: MDSAL-777
Change-Id: I63c6a6d108e9336fcca56343652b9695ae3d4992
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Nov 2022 14:26:58 +0000 (15:26 +0100)]
Move getRpcMethodToSchema()
This method is only used by RpcServiceAdapter and depends only on
BindingRuntimeContext. Move it to RpcServiceAdapter to improve
containment.
JIRA: MDSAL-777
Change-Id: Ib4222bb85214d27d82feec17fc8c91809ebe44de
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Nov 2022 13:18:33 +0000 (14:18 +0100)]
Update CurrentAdapterSerializer.getRpcMethodToSchema()
We are moving less reliance on BindingReflections and RpcDefinition.
Refactor getRpcMethodToSchema() to use RpcRuntimeTypes instead, from
whence we can acquire better information -- for example
RpcEffectiveStatement.
Also update LazySerializedContainerNodeTest to not rely on this method,
as it can get its inputs in a much smoother manner.
This is another step to eliminating BindingReflections from invocation
strategy creation, which we will need, as single RPCs just do not have
the type capture we need for the input class.
JIRA: MDSAL-777
Change-Id: I7382e2a01ee8ee0d0e611286f9dcef5d92e6acdf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>