Robert Varga [Thu, 19 Aug 2021 23:07:16 +0000 (01:07 +0200)]
Bump upstreams
Adops odlparent-9.0.3 and yangtools-7.0.5.
Change-Id: I22c5ae9be1e8b817b8bf47f82ac28eb10ba6e840
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 17 Aug 2021 21:04:09 +0000 (23:04 +0200)]
Shorten JavaFileGeneratorFactory's name
The package name here is quite wasteful, hence use something shorter,
which should help with hitting file path limits.
Change-Id: Iade9a8e8a71a5cbfb0b7aef1de253e623c731920
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 17 Aug 2021 19:59:51 +0000 (21:59 +0200)]
Do not guard utility class constructors
There is no point in having exception throwing here, just use a simple
comment.
Change-Id: If4e2c22bde3a2456e1aec77ef2a1e846c2732a7f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 16 Aug 2021 18:20:29 +0000 (20:20 +0200)]
Remove ByteBuddyUtils.{ifEq,markLabel}
Ever since we have moved DataObject.equals() implementations to
generated interfaces this code is no longer used. Remove it to reduce
overall footprint.
Since these are the only methods which require frame informantion, also
ditch the code to mark COMPUTE_FRAMES, providing even more
simplification.
Change-Id: I32f1868e3d82193702835938f54663fb2052ae71
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 16 Aug 2021 16:55:18 +0000 (18:55 +0200)]
Improve AdaptingTracker type safety
Component{Factory,Instance} are generic with OSGi R7, let's take
advantage of that to improve type safety.
Change-Id: Ibe5c7937ad37117bab3492c9a2dfd5b67b972e4e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 16 Aug 2021 16:52:20 +0000 (18:52 +0200)]
Improve DynamicBindingAdapter safety
OSGi R7 uses generic ComponentFactory, let's use proper types to
improve safety.
Change-Id: I6a6a06186af825a54199e1576798ed34ba7be7a5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 16 Aug 2021 16:43:46 +0000 (18:43 +0200)]
Add a basic test for Dict
Just test common functionality to increase coverage.
Change-Id: Icb41990aa1c884ed86679d4b1bf44f81e1ea73a7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 16 Aug 2021 16:28:59 +0000 (18:28 +0200)]
Improve BindingDOMTransactionChainAdapterTest coverage
We are not testing merging transaction chains, let's do that through
a few parameters.
Change-Id: I77fb2a9e6fd335afebccc254df741670023f3750
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 9 Aug 2021 20:36:05 +0000 (22:36 +0200)]
Support DOMAction-level routing
We have a distinct use case where we want to route actions across
a system. In this scenario, a next hop provider registers itself as the
local provider with the appropriate cost.
This capability is also exposed as the simplest way of registering
binding-level implementations -- where we want to register to all
actions on the operational datastore.
Add explicit documentation around how how the arguments are interpreted
and teach DOMRpcRouter about wildcards -- similar to how it deals with
RPCs.
JIRA: MDSAL-681
Change-Id: I6daf70b28347fab88c8dc467fce267d8ba71e57d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 12 Aug 2021 12:24:13 +0000 (14:24 +0200)]
Remember netty sink's registration
I928f1f5486b6edc8a62ed006431b7c5f06ddf986 has made a mistake in startup
path of replication source -- it fails to initialize the registration,
leading to a failure during shutdown.
JIRA: MDSAL-682
Change-Id: I4202e9773597169997b4ca88ed4d30819ebae678
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 11 Aug 2021 13:27:13 +0000 (15:27 +0200)]
Use utility DOMActionInstance constructor
We have a simplified method, which creates the intermediate
DOMDataTreeIdentifier. Use it.
Change-Id: I98348c37574e09e7c17e0882bbc9cff6c256525f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 11 Aug 2021 12:24:37 +0000 (14:24 +0200)]
Improve DOMRpcRouterTest
We have a ton of untested functionality, add a few tests to increase
coverage.
Change-Id: I0885a9a2c1b8f5ca5a3b56b6c03ff0c7acd00563
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
PeterSuna [Mon, 26 Jul 2021 11:19:32 +0000 (13:19 +0200)]
Fix ActionProviderService(Adapter)
ActionProviderServiceAdapter is always passing an empty set of
instances to DOMActionProviderService, which is a direct violation of
API contract. Unfortunately the implementation interprets empty set as
a no-op, resulting in the violation being ignored silently and routing
not working.
JIRA: MDSAL-679
Change-Id: I53a8977365166228ed30130519a2024372d89365
Signed-off-by: PeterSuna <Peter.Suna@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 11 Aug 2021 12:01:40 +0000 (14:01 +0200)]
Use a global comparator
Rather than instantiating a new comparator every time, just reuse a
single instance.
Change-Id: Ida1e9c1f41c5ab67a2847173bdcad6a1cd780c0e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 10 Aug 2021 22:08:35 +0000 (00:08 +0200)]
Fix a NPE on missing path
If we have an action registration for a different path, we will end up
with a NPE. Handle this case and throw DOMActionNotAvailableException
instead of a NPE.
Change-Id: Icc01eb2f7b291285fc26392561553520ad784bf3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 10 Aug 2021 11:18:07 +0000 (13:18 +0200)]
Add a FIXME to merge OSGiDOMRpcRouter
We have constructor injection available, hence we can merge the OSGi
proxy router with DOMRpcRouter. Add a FIXME to that effect.
Change-Id: I4d58bf3036b7f6d89e7d305dfe3e5e670ce67931
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 10 Aug 2021 11:10:32 +0000 (13:10 +0200)]
Fix formatting a bit
We are splitting a Map<> declaration, make sure we keep it on the same
line.
Change-Id: Ia5c7601469801522e9eb97a07faedd9ba1672f0c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Iaroslav [Mon, 25 Jan 2021 09:16:57 +0000 (11:16 +0200)]
Added documentation which describe Binding Query language API for end user.
User Guide document for Binding Query Feature (Query language
based API for work with YANG based models):
- Feature Overview
- Query structure
- Query Usage
- Examples
JIRA: MDSAL-658
Change-Id: I1cfd3f2526a7deaab96f74c907d4c03563ca744d
Signed-off-by: Iaroslav Kholiavko <iaroslav.kholiavko@pantheon.tech>
Robert Varga [Mon, 9 Aug 2021 21:46:53 +0000 (23:46 +0200)]
Use builder fluently
DOMRpcRouter should use ImmutableList.Builder()'s methods as fluent
to maximize expressiveness.
Change-Id: I0e1663041a323cb65595675a029767a68cf2ba64
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 9 Aug 2021 20:25:35 +0000 (22:25 +0200)]
Add a single-instance registerActionImplementation()
Single instances are rather prevalent, make sure we add a faster
specialization.
Change-Id: I58c0048c14868ffd129096f5536f16d2947ee660
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 9 Aug 2021 18:10:11 +0000 (20:10 +0200)]
Cleanup whitespace in test.yang
We have some ugliness here, clean it up.
Change-Id: I9107551e82de226e327c8ba50f4dcb11b05b3c5b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 24 Jul 2021 21:02:12 +0000 (23:02 +0200)]
Bump versions to 8.0.2-SNAPSHOT
This starts the next development iteration.
Change-Id: I43dca6e2f7926a176c94d4cc5b08515e632b92cc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 24 Jul 2021 18:06:05 +0000 (20:06 +0200)]
Bump yangtools to 7.0.4
Pick up latest fixes from upstream.
Change-Id: If5a2b590bb57cde510f3adaba29fc235f7a607a3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 24 Jul 2021 18:05:40 +0000 (20:05 +0200)]
Fix raw type warnings
ComponentFactory now takes a proper generic argument, update to use it.
Change-Id: I67e2c7d1107240604e80e4b14edd5841953ac17b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 21 Jul 2021 17:09:57 +0000 (19:09 +0200)]
Require yang-common transitively
We have a number of utilities using yang-common, require it explicitly.
Change-Id: Ief3e652f053ddd1da7f94949f0bf52f20f273ecc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 21 Jul 2021 13:30:11 +0000 (15:30 +0200)]
Fix network-topology leafrefs
We are using leafref paths in a typedef. YANG XPath evaluation rules
mean that our use of unqualified names will pick up default namespace
from whereever we are referenced -- and thus we end up point not into
ietf-network namespace anymore.
JIRA: MDSAL-677
Change-Id: I4f55f766cdc304c70ee8d3675c2e5365654f613a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 21 Jul 2021 09:50:58 +0000 (11:50 +0200)]
Improve ietf-type-util assertions
A number of areas are improved:
- use assertThrows instead of @Test(expected=)
- do not declare Exception as thrown
- use assertThat(foo, instanceOf)) instead of assertTrue()
- use assertEquals() instead of assertTrue()
Change-Id: I0633f116d8afb2ebc46282e72f25bc4fd9c3b97a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 20 Jul 2021 18:43:01 +0000 (20:43 +0200)]
Add generalized IetfInetUtil.ipPrefixFor()
Conversion of IpAddress (or IpAddressNoZone) to a IpPrefix is rather
something which is useful to reduce RSI where we already provide
base address->prefix utilities.
Change-Id: I2242e8945065763f6941dff0db1c6f4f14776286
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 15 Jul 2021 12:34:29 +0000 (14:34 +0200)]
Add GeneratorTest
We have a few tests targeting low-level utility methods in Generator,
add a dedicated GeneratorTest to hold them.
Change-Id: I18ee7f1e66ed1b0519de0b1d61b4e63135f2c947
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 15 Jul 2021 12:44:24 +0000 (14:44 +0200)]
Split out Bug1862Test
We have a disabled test here. Split it out and reactivate it.
Change-Id: I38b72751eb38bc492208fdd47af0534c8b6b6c4d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 15 Jul 2021 12:23:00 +0000 (14:23 +0200)]
Further cleanup of test classes
We have no users of TestLeafSchemaNode and TypeProviderModel is only
used by TypeProviderTest.
Change-Id: I92e8467d60c1e2a784607181674f8ae32b47974b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 15 Jul 2021 12:16:55 +0000 (14:16 +0200)]
Migrate Bug4621Test
Move the test into the appropriate package and migrate it to work on top
of DefaultBindingGenerator.
Change-Id: Idc86823388898341d5fe54adc224ad3d5e4fbb27
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 15 Jul 2021 12:07:40 +0000 (14:07 +0200)]
Remove unused testing TypeDefinitions
We are not using these two classes anymore, remove them.
Change-Id: I12b779a4d52c080a3850499a38efd41c32520595
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 15 Jul 2021 11:34:07 +0000 (13:34 +0200)]
Remove TypeProvider interface
We have only a single implementation of this interface, remove it
by collapsing it into AbstractTypeProvider.
Change-Id: I3e8999327a0ddbd7e632099fe1e282f6432bc960
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 15 Jul 2021 11:19:33 +0000 (13:19 +0200)]
Remove BaseYangTypesProvider
This provider is rather unused, collapse it into its sole caller and
eliminate its test.
Change-Id: I41b239babd696fe1e8be6872764bcab93c6b9dd1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 15 Jul 2021 10:48:21 +0000 (12:48 +0200)]
Remove useless TypeProvider tests
These tests are just testing null arguments, remove them.
Change-Id: I97a1b87c655fe5159a17ab0d0c07c63d234e380a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 15 Jul 2021 10:35:52 +0000 (12:35 +0200)]
Cleanup BindingGeneratorUtilTest
We have a number of tests which should be in binding-spec-util,
move them around.
Change-Id: I76900f1f0c87401cf6d4e0b84b8340edbd116f22
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 25 Jun 2021 14:50:59 +0000 (16:50 +0200)]
Bump versions to 8.0.1-SNAPSHOT
This starts the next development iteration.
Change-Id: I42188134fea033a8af370b12784035554a975c6d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 25 Jun 2021 14:46:22 +0000 (16:46 +0200)]
Lock down mdsal-binding-generator
Expose only the bare minimum API surface from generator, requiring
downstreams to use proper injection.
Change-Id: I7552c90c4d9524b783a627fe883ed31b69ba9274
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 25 Jun 2021 13:22:36 +0000 (15:22 +0200)]
Test self-referencing leafrefs
Our refactor has lost the ability to detect self-referencing leafrefs.
Add that capability back and activate the relevant unit test.
Change-Id: Idcc09c1a41560588cb8db3974caa8cc4047aa7ff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 25 Jun 2021 09:53:52 +0000 (11:53 +0200)]
Refactor mdsal-binding-generator artifacts
Generator artifacts have a layout which belies their actual purpose,
as exposed after mdsal-binding-generator-impl refactor.
mdsal-binding-generator-impl is renamed to mdsal-binding-generator,
absorbing BindingGenerator from the API artifact.
mdsal-binding-generator-{api,util} are renamed to
mdsal-binding-model-{api,ri}, with generator-specific utilities being
moved to mdsal-binding-generator.
This change makes it easier to integrate
mdsal-binding-java-api-generator, as we can directly depend on
mdsal-binding-generator.
Change-Id: Idb8591771837175128e05febb4614d624dca03fd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 25 Jun 2021 08:55:27 +0000 (10:55 +0200)]
Hide binding.model.api.DefaultType
Expose DefaultType only from Type.of() static factory methods and adjust
its implementation to remove open-coded toString() methods.
Change-Id: Iaa3c0a7c117f12235a18e75512d9974403ab7f24
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Jun 2021 14:49:10 +0000 (16:49 +0200)]
Eliminate org.opendaylight.mdsal.binding.generator.spi
This package is not really used anywhere, remove it to lower confusion.
Change-Id: Iecc4917325749ad12553aa646c5ec894994f54b6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Jun 2021 12:52:43 +0000 (14:52 +0200)]
Move BaseYangTypesProvider
BaseYangTypesProvider is not really used anywhere, centralize it in
mdsal-binding-generator-impl prior to its removal.
Change-Id: I7c92885446f2ce25869f364f8ec922c3d2f43c88
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Jun 2021 12:35:13 +0000 (14:35 +0200)]
Cleanup BindingReflections.getModuleInfo()
Simplify callers by throwing only IllegalStateExceptions, i.e.
properly catching our internal errors.
Change-Id: I900f3f1ed1236e54a66ed17c093df6a1c855be50
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Jun 2021 11:58:11 +0000 (13:58 +0200)]
DOMDataTreeChangeListener.onInitialData() is mandatory
Hiding this method is ugly, make sure users are aware of it.
JIRA: MDSAL-674
Change-Id: I9e733b46dea6251b43b3aa97d06e056fd7e8af16
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Jun 2021 12:12:03 +0000 (14:12 +0200)]
Hide mdsal.binding.yang.types
Code in these classes is legacy and should be cleaned up. Stop
exporting it as a first step.
Change-Id: I431b8d9ce4b6782a15b3efd85a1b31be73d161c4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Jun 2021 12:02:18 +0000 (14:02 +0200)]
Hide NodeWrappedType
This class is an internal implementation detail, hide it.
Change-Id: Ib76f76332c0a3d0cb8abb4a63e7ab824a8bfad82
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Jun 2021 11:57:34 +0000 (13:57 +0200)]
Depend on rfc8346 in docs
Force bundle to be created before docs, so that features are tested
last.
Change-Id: If1e992dff1b12c473825b9ed07970cfd74448a55
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 2 Jun 2021 08:20:14 +0000 (10:20 +0200)]
Bump byte-buddy to 1.11.5
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.11.1
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.11.2
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.11.3
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.11.4
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.11.5
Also remove ByteBuddyUtils.loadThis(), as it is no longer needed.
Change-Id: I1e32f6d552ce5f1bca1ad71158cb03e1fbfda261
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Jun 2021 09:20:30 +0000 (11:20 +0200)]
Do not hash augmentation keys
We do not want to take into account augmentation identity for
hashCode(), as that prevents equivalent augmentation lookups.
This is not a complete solution, as equality still indicates non-equal,
but that's better than what we have.
JIRA: MDSAL-667
Change-Id: I1f4d7122534c175aff6e0d7da27c877d7493f92f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Jun 2021 10:12:15 +0000 (12:12 +0200)]
Remove superfluous plugin dance
FileGenerator-driven directories are maintained by yang-maven-plugin
itself, there is no need to twiddle with directories here.
Change-Id: I819c622c1816e9f4d4663a68ab20f7187c0ee346
JIRA: MDSAL-232
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Jun 2021 19:47:35 +0000 (21:47 +0200)]
Remove useless no-op constructRequire()
We want to have as few implementations as possible, the default
implementation already is a no-op, so reflect that.
JIRA: MDSAL-602
Change-Id: I452f8f5dddc48ef14605768722f83f7c0743ddfd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Jun 2021 19:18:12 +0000 (21:18 +0200)]
Cleanup mdsal-binding-dom-codec-osgi dependency
We are relying on mdsal-binding-dom-codec-spi only, hence we can lower
the dependency.
JIRA: MDSAL-672
Change-Id: If6950aabd833703062c77ea624b621a64aa64c82
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Jun 2021 19:13:04 +0000 (21:13 +0200)]
Cleanup mdsal-binding-dom-adapter dependencies
yang-model-util's inference faculties are only used by
mdsal-binding-dom-codec, hence we should not be explicitly including
them.
JIRA: MDSAL-672
Change-Id: Ibe16a93639349645c7bb6c65889c2b803f606383
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Jun 2021 19:09:46 +0000 (21:09 +0200)]
Cleanup mdsal-binding-dom-codec dependencies
We do not need to bring in mdsal-binding-generator-util, as that is only
used by mdsal-binding-generator-impl.
JIRA: MDSAL-672
Change-Id: I5ef15bb2b4d0c6a12606b6b2995ad30f2820c942
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Jun 2021 19:05:37 +0000 (21:05 +0200)]
Cleanup mdsal-dom-schema-osgi dependencies
We do not need to pull in anything from yangtools, as we are completely
serviced by mdsal-binding-runtime-spi.
JIRA: MDSAL-672
Change-Id: Ia006161a63fb1f7b42eb356e4191237c336aee4e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Jun 2021 18:30:49 +0000 (20:30 +0200)]
Fix mdsal-binding-api dependencies
We should not be pulling in yang-data-api, as that exposes users to a
ton of DOM-specific interfaces, causing confusion.
JIRA: MDSAL-672
Change-Id: Id55f2cdd446b6d77202f79d0b05c7005166561a6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Jun 2021 18:56:38 +0000 (20:56 +0200)]
Remove mdsal-common-util
This artifact is completely empty, remove it to prevent confusion.
JIRA: MDSAL-672
Change-Id: Iadc8a7a87f7abe120c5651058cf49d2e70e94021
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Konstantin.Nosach [Wed, 25 Nov 2020 12:07:32 +0000 (14:07 +0200)]
Add non-null getters for leaf objects
DTO getters inherently return nullable objects. We have a nonnullFoo()
concept, which is very powerful with Lists/Maps, where we return an
empty collection. This turns out to be very useful for end users, who
can worry about other logic problems instead.
This patch introduces a similar construct for non-complex getters, so
that
container foo {
leaf bar {
type string;
}
}
ends up generating a default method:
interface Foo {
default @NonNull String requireBar() {
// ..
}
}
which nicely throws an exception distinct from NPE and retaining call
site.
JIRA: MDSAL-602
Change-Id: Ia66ee61f51fb9b6eb11aea3736e5246aadad6a3e
Signed-off-by: Kostiantyn Nosach <kostiantyn.nosach@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Jun 2021 12:25:42 +0000 (14:25 +0200)]
Move unified documentation generator
maven-sal-api-gen-plugin is not really useful anymore, move its
sole remaining generator into dom's unified-html-generator. It
also is deprecated, since it's never been actually used.
JIRA: MDSAL-232
Change-Id: Id6ed104ca6171d9c3d3b1d9be260211bc6e089a0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Jun 2021 12:45:44 +0000 (14:45 +0200)]
Promote replicate to a full feature
There are a few issues in packaging, fix them up and drop
the -exp- infix from feature names.
JIRA: MDSAL-671
Change-Id: I4f3fc6fbba71da77a8c1b8c0ee149955cb43080f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Jun 2021 12:15:09 +0000 (14:15 +0200)]
Remove WADL generator
WADL generator has been downstreamed to NETCONF project as
restconf-wadl-generator. Remove it from MD-SAL.
JIRA: MDSAL-232
Change-Id: I7179fd305b0a5135e2251519c994a25bd479b02a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Jun 2021 11:34:22 +0000 (13:34 +0200)]
Convert DocumentationGenerator to FileGenerator
Migrate to using FileGenerator, which is a more modern replacement
for BasicCodeGenerator.
JIRA: MDSAL-232
Change-Id: I591b1dbb21bda24be76305abad2999dd9fce1d99
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Jun 2021 10:27:44 +0000 (12:27 +0200)]
Convert WADL generator to FileGenerator API
FileGeneratorFactory acts as a proper bootstrap for generators,
and it really pushes us towards a proper generator/template split,
slightly reducing the use of Xtend for non-templating purposes.
JIRA: MDSAL-232
Change-Id: I5414bd154b02a87eb0cfccf776de54f38ca5fab9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Jun 2021 09:51:44 +0000 (11:51 +0200)]
Rename additionalConfiguration
Since we are using FileGeneratorFactory, the configuration map is our
only source of configuration, rename arguments to match that.
JIRA: MDSAL-232
Change-Id: I5da112835906e070ae9016fd62f72459b9e6f4de
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Jun 2021 09:40:05 +0000 (11:40 +0200)]
Inline WADL generator methods
We have quite a few methods used only once, make sure we make them
more templatey.
JIRA: MDSAL-232
Change-Id: I6ba1cce80f09c9d7e102922d461fc976f5fd8271
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Jun 2021 09:32:19 +0000 (11:32 +0200)]
Remove 'maven' packages
We have four packages here, hosting 6 classes, make sure we squash
them to two packages, each holding 3 classes.
JIRA: MDSAL-232
Change-Id: I9665ca6f7d5ef229ffe3be4f0ff9193ceca605d0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 11 Nov 2018 20:19:16 +0000 (21:19 +0100)]
Use FileGenerator for java-api-generator
Do not use deprecated BasicCodeGenerator interface to interact with
yang-maven-plugin. Using FileGenerator allows us to decouple lifecycle
and eliminate a bit of duplication.
JIRA: MDSAL-232
Change-Id: I04931ff6f70f548de5a49042201283c7e503f92e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Iaroslav [Wed, 23 Dec 2020 10:23:54 +0000 (12:23 +0200)]
Make JavaFileTemplate.importedName() identify all name collisions.
Refactor xtend files to use importedName instead of fillyQualifiedName
to prevent full package path in generated files.
JIRA: MDSAL-649
Change-Id: I569f46bb095512274b28c0decd5d2d2eefe7f7dd
Signed-off-by: Iaroslav Kholiavko <iaroslav.kholiavko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 21 Jun 2021 10:15:11 +0000 (12:15 +0200)]
Fix UnionTypeCodec.loader() expectations
A union type can be derived via a typedef, in which case we will
not see a top-level RuntimeGeneratedUnion. Update the loader to walk
the inheritence hierarchy to locate union types.
Change-Id: I664c21c0400140c1f02a7c48f455608751ddd072
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 19 Jun 2021 09:27:32 +0000 (11:27 +0200)]
Bump to yangtools-7.0.3
Pick up fixes from upstream.
Change-Id: Iad48c8176c3c91e79552266e2943c80e09e0a3bd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 18 Jun 2021 12:51:44 +0000 (14:51 +0200)]
Add Member.equalRoot()
When we are considering two distinct augmentations to, say, RPC input,
we need to consider more than just the local name, as otherwise we end
up shifting more than needed.
Change-Id: If717d54dfc3f6e5caa8d7e0955c752439ffac141
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 16 Jun 2021 15:53:06 +0000 (17:53 +0200)]
Restore augmentation sorting semantics
Augmentation sort we are performing to order augmentations has another,
undocumented, impact. It provides stability of generated code towards
reformats of the YANG source, so that changing the order of augment
statements (by itself) does not change the naming of generated fields.
The simple comparator failed to take this effect, leading to an
incompatible change of assignments which is extremely hard to untangle.
Fix this by restoring previous sorting behaviour.
Change-Id: I7164e6e06d47fcded3261752a8a0f587afc70274
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 16 Jun 2021 09:11:59 +0000 (11:11 +0200)]
Treat wildcards as objects
The effort to properly specialize leafref values has created
opportunities for WildcardType to be reported as the return. Handle
these as Objects for now, but also issue FIXMEs for a follow-up proper
fix.
JIRA: MDSAL-668
JIRA: MDSAL-670
Change-Id: I4e8a6ff3aa23a3e94c1ec4a52726e9caf9e9c4ff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 16 Jun 2021 09:18:31 +0000 (11:18 +0200)]
Update CodecDataObjectGenerator FIXME
We have an issue tracking the activation of Fixed generator, make sure
the FIXME is referencing it.
JIRA: MDSAL-443
Change-Id: Id5af6daa7ee777592b214085dbe61fecc4ac8305
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 9 Jun 2021 23:33:47 +0000 (01:33 +0200)]
Assert schema tree class claim
'action' statement is displacing 'grouping' as per its claim on
schema tree namespace. 'rpc' historically does something radically
different, but we really want to go the 'action' route.
This change in behavior is already happening as part of CollisionDomain
mode of operation, here we add an explicit test for that scenario.
JIRA: MDSAL-666
Change-Id: Ie46b1234f5b01c66a8e3657ce984ec59d3a2475e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 9 Jun 2021 20:34:46 +0000 (22:34 +0200)]
Fix union losing patterns
Union typedefs need to generate type enforcement patterns for their
constituent types. Make sure that happens.
Change-Id: Id4512f17e1ca6b2f9a5157d3b44dd3d03d5dfcec
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 9 Jun 2021 19:53:59 +0000 (21:53 +0200)]
Improve ModuleGenerator.addQNameConstant() type safety
Take an AbstractQName instead of a String, making further type safety
guarantees and reducing bytecode a bit.
Change-Id: I58dc0d3b9b2d28ebd55df4654da3efb6dae02da9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 9 Jun 2021 19:49:05 +0000 (21:49 +0200)]
Fix augmentation numbering
We should be considering only the localName part of the AbstractQName,
otherwse differing QNames will not compare as equal -- wrecking the
algorithm.
Change-Id: I9dcd457121b619bb8ace3f15fd01e67295436c9b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 9 Jun 2021 18:06:00 +0000 (20:06 +0200)]
Add generator references fo CollisionDomain
Having a generator reference is handy for diagnosing conflicts.
Change-Id: If5ff5b7c5862594cb07b7a1cdcece64f2ad2da6b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 9 Jun 2021 08:54:38 +0000 (10:54 +0200)]
Add yang-ext:mount extension
We are gratiously refering to yang-ext:mount all over the place, without
the construct being actually defined. Add a proper definition so that
our data/schema processing can be correctly hooked into it.
JIRA: MDSAL-665
Change-Id: Ib6076060d693955be236d548e07fca1c88016b5f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 8 Jun 2021 07:13:20 +0000 (09:13 +0200)]
Bump yangtools to 7.0.2
Adopt released version instead of temporary snapshot.
Change-Id: I00fbc1099046cc3ecd229342169cc08e2a3ca50f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 21 May 2021 11:13:11 +0000 (13:13 +0200)]
Do not use a static String reference in length enforcer
LengthGenerator is making the mistake of having a static reference
to java.lang.String without FQCN. This breaks down if String is
overridden by definition context.
Fix this by using importedName(Type) to emit a properly-scoped
reference.
JIRA: MDSAL-664
Change-Id: I16b12865448bde807f0afd0d35e3145f8b6359c3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 24 May 2021 19:58:34 +0000 (21:58 +0200)]
Reenable mdsal533 test
For some reason we lost @Test here, make sure we reinstate it.
Change-Id: I879179761ff33e85dbb4579ed4643db6726b3efe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 24 May 2021 16:53:38 +0000 (18:53 +0200)]
Bump upstreams
Adop odlparent-9.0.2 and yangtools-7.0.2-SNAPSHOT to pick up their
bugfixes.
Change-Id: I2394c3bfcd300caeb16530db0783e544476d516c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Ivan Hrasko [Thu, 20 May 2021 10:25:37 +0000 (12:25 +0200)]
Fix submodule resource resolution
Initial integration with yangtools-6.0.0 has changed the resource
resolution logic. Unfortunately the lambda instroduced in
Ifa9780fbdfb411b4613df0ee18407d85e81bd517 incorrectly passed 'module'
and not the requested entity to the resolver -- leading to all
submodules to open their module's resource instead.
Fix the lambda and also add proper asserts to check resources are being
open correctly.
JIRA: MDSAL-663
Change-Id: I293f20c15426490a97bb70b4303f0c7b23114c82
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 10 May 2021 19:21:37 +0000 (21:21 +0200)]
Fix CollisionDomain chaining
A simple augmentation of RPC input fails becase we end up having a
secondary (augment) being attached to another secondary (input), which
triggers a verify error.
Generalize the concept of having secondaries, so that we can have a
secondary -> secondary transition.
Change-Id: I2c1ca5b5473d3db56516385f4957ff11dcf512a0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 9 May 2021 05:12:38 +0000 (07:12 +0200)]
Update yangtools to 7.0.1
We have an upstream release, use it instead of snapshots.
Change-Id: I78f5726fb0754dcedc18cdebc680b12d948e82d8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 8 May 2021 19:48:01 +0000 (21:48 +0200)]
Bump odlparent to 9.0.1
Adopt bugfixes from upstream.
Change-Id: I781263f3803a00ade5b8d49e17c0ffa0155ad86e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 8 May 2021 16:58:24 +0000 (18:58 +0200)]
Restore getter reference discriptions
Previous update has lost propagation type method, make sure we restore
this functionality.
Change-Id: Iedb48d502525024adb9cc5b163384507255cbe47
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 22 Dec 2020 21:01:36 +0000 (22:01 +0100)]
Bump to odlparent-9.0.0/yangtools-7.0.1-SNAPSHOT
Aside from the usual mechanical updates, we need to also rewrite
mdsal-binding-generator-impl, as its mechanics relied completely on
TypeDefinition.getPath(), which is no longer available.
The rewritten component is a wee bit more navigable, making a number of
deficiencies clearly visible. These are marked as FIXMEs for future
improvements.
One such problem arises when we attempt to create a derived type from an
enumeration: here we ended up generating an empty DTO rather than
properly specializing the type. Attempting to retain compatibility would
be fruitless, as it would violate a number of method signatures.
Furthermore leafref resolution is made stricter, requiring that
references actually point to a leaf, not to a random location -- which
was true in abstract-topology@2013-02-08.yang test model.
Another change revolves around nested union types. These previously
ended up being flattened in the class hierarchy, i.e. siblings of the
generated type and enclosed in the top-level type. Refactored code
structure is showing this is inconsistent, as bits/enums end up not as
siblings, but rather normal enclosed types.
This patch leaves a bit of dead code, deactivated test cases as well as
a few uncaught codegen regressions. These will be rectified by follow-up
patches.
JIRA: MDSAL-503
Change-Id: I40c445aa1d3f79fd55f6e8007db1259d9a09c8d8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 8 May 2021 10:57:52 +0000 (12:57 +0200)]
Improve RpcRoutingStrategyTest
Rather than relying on mocking and reflection and overall ugliness,
refactor the test to work with proper parser, really making it an
integration thing.
Change-Id: I8efbbd56d1648e3bc663aaf4de96400ee21bfe58
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 7 May 2021 13:41:58 +0000 (15:41 +0200)]
Centralize union/leafref naming
We have open-coded dependency between dom-codec and generator-impl where
union member naming is concerned. The entire glue here is rather funky
and flaky, make sure the construction is captured in BindingMapping and
use the magic from there.
Change-Id: I3e19f41b7bab8b8431beae37e4e712e09153e883
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 6 May 2021 08:47:30 +0000 (10:47 +0200)]
Make sure we re-export yangtools.util
ExceptionMapper is declared as a public element, we should be using
'requires transitive' to keep downstreams safe.
Change-Id: I8f2ffd4c2b7365675f3c62f19542bdf41060b1ec
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 4 May 2021 10:32:18 +0000 (12:32 +0200)]
Simplify YangSourceDefinition
We can use asEffectiveStatement() instead of guessing, make the code
flow more obvious.
Change-Id: Ie249bcc05820f7670fab86e9b0e4cfd1dbfa43ac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 30 Apr 2021 15:44:33 +0000 (17:44 +0200)]
Improve binding-dom-codec assertions
We are using a plain checkState(boolean), improve it with a message,
to get some diagnostic when things go wrong.
Change-Id: Ided7ba1f546ea8b861cbb2ec99fae5a8305e97eb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 30 Apr 2021 09:18:48 +0000 (11:18 +0200)]
Improve mdsal-binding-java-api-generator asserts
Use proper assertNotNull() and also be more defensive about type
ordering.
Change-Id: If1ea743a85d8a4bc24db857efa9a8e2ddb2c8791
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 28 Apr 2021 18:24:38 +0000 (20:24 +0200)]
Improve CompilationTest assertions
Annotation assertions could use a bit of love, fix that.
Change-Id: I10b5ea21d50a74c198f1565025e6fb4af6877b6c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 28 Apr 2021 17:33:08 +0000 (19:33 +0200)]
Fix context-reference test
The test relies on overly-broad definition of context reference, but we
should only be binding to yang-ext. Fix that.
Change-Id: I43d6beecf2af50f275408fb103b60fbe4633dbee
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>