mdsal.git
4 years agoUse cached AugmentationIdentifiers in BindingRuntimeContext 98/82898/2
Robert Varga [Fri, 31 May 2019 10:55:50 +0000 (12:55 +0200)]
Use cached AugmentationIdentifiers in BindingRuntimeContext

AugmentationIdentifiers allocated from BindingRuntimeContext
end up being used across the system. This ensures we squash
instances to system-wide cache.

Change-Id: I0d75dc8815f86cb1dda13ef118ceb9b6455a31e3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 380356b15c39311d29b3ebdf2f06ba6e0a3ebf0a)

4 years agoImprove getResolvedAugmentationSchema() 97/82897/2
Robert Varga [Fri, 31 May 2019 10:11:08 +0000 (12:11 +0200)]
Improve getResolvedAugmentationSchema()

This method is used for instantiating prototypes, from whence
it is used all over the place. Sharing a single instance allows
us to slightly improve lookups.

Change-Id: I93eb21ef83aef80ab0f26614950ebb042a7473ed
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit cd0ce4946f426fb56ce33cce9f894e43d4b0451e)

4 years agoTake advantage of AbstractAugmentable 99/82899/1
Robert Varga [Wed, 1 May 2019 14:34:35 +0000 (16:34 +0200)]
Take advantage of AbstractAugmentable

Rather than hand-rolling Augmentable implementations, take advantage
of AbstractAugmentable as the holder of augmentations -- reducing
the amount of generated code.

Since this leads to generated code not being exposed to augmentation(),
we can now rename the generic argument there to a full-compliant
name.

JIRA: MDSAL-445
Change-Id: I2459489074e9e50e82bd9d1c8eb051f9833b7a0b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 4fe6932b0f3911ee4a7684d3c9616efbbeb053a1)

4 years agoFix augmented action code generation 90/82890/1
Robert Varga [Tue, 2 Jul 2019 11:49:06 +0000 (13:49 +0200)]
Fix augmented action code generation

When an action is introduced as part of an augment statement, we
attempt to generate it in the augmented module, which refuses to
generate its input/output statements, leading to a NPE.

This patch updates codegen to ignore augmenting actions in the
augmented module and process them as part of augmentation.

JIRA: MDSAL-459
Change-Id: Ibd7d7abc5ec1eec6d32ee1885da00a0de69b2445
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit dee452d009946a175273ac2a21dca4174b2142af)

4 years agoBump versions to 3.0.10-SNAPSHOT 12/82812/1
Robert Varga [Mon, 1 Jul 2019 06:37:45 +0000 (08:37 +0200)]
Bump versions to 3.0.10-SNAPSHOT

This starts the next development iteration.

Change-Id: Iedb025a8e224ef2262687829c316843f7cfa07b3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump yangtools to 2.1.11 10/82810/1
Robert Varga [Mon, 1 Jul 2019 04:14:15 +0000 (06:14 +0200)]
Bump yangtools to 2.1.11

This picks up the latest improvements.

Change-Id: Ide1aecefbcd747770d78fd9ff49e1cef14ff64f4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump odlparent to 4.0.11 09/82809/1
Robert Varga [Mon, 1 Jul 2019 04:13:44 +0000 (06:13 +0200)]
Bump odlparent to 4.0.11

This picks up the latest updates.

Change-Id: Iad627fdf7c2261aa0c49a7b8a7502d3564b38cad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoResolve bits/union nested type naming 62/82762/1
Robert Varga [Tue, 25 Jun 2019 13:07:06 +0000 (15:07 +0200)]
Resolve bits/union nested type naming

The cases where we allocate an enumeration, bits or union type
for a leaf-like construct (leaf, leaf-list) need to handle an
edge case -- JLS does not allow nested classes to be named the
same as the enclosing class.

Enumeration case was already handled in
AbstractGeneratedTypeBuilder, this patch extends that support
to handle bits and union.

JIRA: MDSAL-458
Change-Id: Idc19b179274c7973ed205ffdae1d2242cbd2dbf6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 30952238d240260310d357c2e80be55021ccb1fc)

4 years agoRemove unused Matcher 45/82745/2
Robert Varga [Wed, 26 Jun 2019 11:20:33 +0000 (13:20 +0200)]
Remove unused Matcher

DOT_MATCHER is not used anywhere, remove it.

Change-Id: Ibc9cbdab0d9008cfd63522db951c93843ea20a66
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoReuse SUCCESS_FUTURE 47/82747/1
Robert Varga [Mon, 24 Jun 2019 15:36:40 +0000 (17:36 +0200)]
Reuse SUCCESS_FUTURE

Rather than allocating new temporary objects reuse a constant
we have handy.

Change-Id: I3b27eb1cc75c967e4f880e2c5f287c040276f674
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFlatten submodule hierarchy for YangModuleInfo 70/82670/1
Anna Bencurova [Mon, 10 Jun 2019 12:55:49 +0000 (14:55 +0200)]
Flatten submodule hierarchy for YangModuleInfo

YANG inherently contains modules and submodules, where submodules
do not really have further submodules. While YANG 1.0 allowed
inclusion of submodules in other submodules, and that is modeled
in yang-model-api, this practice has been deprecated with YANG 1.1.

If we are faced with multiple such includes, for example both
module and submodule including a second submodule, we could end up
generating superfluous classes, just to represent the second
submodule twice (once for module's purposes and once for submodule's
purposes) -- hence when all of them are collected recursively, we
would end up with two distinct instances for the same source.

Since submodules are not directly visible outside of the main class,
this hierarchy is not public API and is a purely internal thing.

This patch re-organizes generation so that we present all submodules
as dependencies of the main module, which automatically solves the
problem, while also making for nicer class layout, as we do not get
multiply-nested classes.

JIRA: MDSAL-457
Change-Id: Ic78edaf852f3497f3c4c96fdca3a77de30b7f8c1
Signed-off-by: Anna Bencurova <Anna.Bencurova@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 4a8ae0d2fbffc56edc956cde9a9ecde28f3e9a34)

4 years agoCheck registration being closed 56/82556/1
Robert Varga [Tue, 30 Apr 2019 03:35:41 +0000 (05:35 +0200)]
Check registration being closed

Check if the registration has been closed before firing events.
This way we stop delivering events a bit sooner, improving shutdown
speed and correctness.

JIRA: MDSAL-429
Change-Id: I533f2b07e8cd14597c29d2d3d9c11c44a1bb7ff5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit d90336420645d32d2c4684c7fd3839827e903774)

4 years agoAdd a simplified SimpleDOMActionResult constructor 38/82238/1
Robert Varga [Fri, 24 May 2019 14:59:11 +0000 (16:59 +0200)]
Add a simplified SimpleDOMActionResult constructor

If the user is not providing any errors, it should be a fair
game to provide just the value.

Change-Id: Iac7e5133fbe09f0e50d72597530b520778d341f5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 16c8f72ef40962af8212ab393e26a8ec217f58d2)

5 years agoGroupingDefinitionDependencySort needs to consider actions 26/82126/1
Robert Varga [Wed, 15 May 2019 12:01:19 +0000 (14:01 +0200)]
GroupingDefinitionDependencySort needs to consider actions

In order to be able to correctly process actions/notifications
which can refer to other groupings, we must properly sort them
within each module.

To do that, GroupingDefinitionDependencySort must consider
uses nodes within them to properly construct the dependency
graph.

JIRA: MDSAL-448
Change-Id: I627702e39b1ab235b1c77ceaa2717ee03b3b2e39
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 6fca42e6bde88795354a2a2386bc7a6d76aaec47)

5 years agoDo not issue immediate build when looking up grouping 90/82090/1
Robert Varga [Wed, 15 May 2019 11:52:34 +0000 (13:52 +0200)]
Do not issue immediate build when looking up grouping

If we fail to find a grouping, we will end up with a NPE which
does not provide any information. Move the .build() call so that
the proper ISE kicks in.

JIRA: MDSAL-448
Change-Id: I57d6a74074b49def9bbc814732cfc48cd5265072
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit e802061e56eea9779e13eede5f949aa96666ea28)

5 years agoAllow SnapshotBackedReadTransaction customization 52/81952/1
Robert Varga [Tue, 7 May 2019 13:03:57 +0000 (15:03 +0200)]
Allow SnapshotBackedReadTransaction customization

In some specific cases we need to customize abort-like handling,
which is already implemented for write-like transactions, but is
not present for read-only transaction.

This patch adds the capability to attach a close() handler and
makes sure AbstractSnapshotBackedTransactionChain takes advantage
of it.

JIRA: CONTROLLER-1879
Change-Id: Ic7027956556b5dd25120ee81613a6151e5dbc501
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit bd73bf5803137b27e25a647ff056da3f59e0a682)

5 years agoFix memory leak in BA mount service 03/81903/1
Robert Varga [Sun, 5 May 2019 18:15:19 +0000 (20:15 +0200)]
Fix memory leak in BA mount service

The cache used in BA mount service uses weakKeys() so the keys
(DOM mountpoint) could be GCed when no except cache, referenced
them).

However the values in the cache (BA mountpoint) also kept a reference
to the key, so the key was never weakly reachable and thus never GCed
resulting in a memory leak.

This is especially visible in case of frequent reconnects of netconf
mountpoints where after every reconnect a new DOM mountpoint is
created, requiring a new BA mountpoint creating new entry in the
cache of BA mount service.

This patch updates the entire suite of adapters, as it is shared
across all instances.

Change-Id: I9c109dd6d499d6185842d6a1ad5a59d75565af5c
Signed-off-by: Maros Marsalek <mmarsalek@frinx.io>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 8ae89c54f8019f53327001d1b916a53963097b34)

5 years agoSpeed up BindingReflections.getAugmentations() 81/81881/1
Robert Varga [Wed, 24 Apr 2019 09:05:38 +0000 (11:05 +0200)]
Speed up BindingReflections.getAugmentations()

One of the ways in which we can acquire augmentations is through
AugmentationHolder interface. While this is handled through
AugmentationFieldGetter.getGetter(), that is not really efficient
as it requires indirection through multiple implementations.

Since AugmentationFieldGetter is a package-internal implementation
detail, factor the check out into BindingReflections, where it can
execute directly. This not only improves locality, but also allows
us to remove one AugmentationFieldGetter implementation, resulting
in bimorphic invocation.

Change-Id: I15584dbe6151a70d13a766f27b927f598a5d21ba
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit efb454b9e1e6869240aebd6489e6219abefec227)

5 years agoIntroduce AbstractAugmentable 80/81880/1
Robert Varga [Wed, 1 May 2019 14:29:00 +0000 (16:29 +0200)]
Introduce AbstractAugmentable

Binding generated code hand-implements handling of augmentations,
which leads to some amount of duplicated code, but notably a lot
of distinct implementations of Augmentatable.augmentation().

We can improve the situation by providing a simple base class which
holds an immutable map of augmentations implementing
AugmentationHolder and Augmentable interfaces.

JIRA: MDSAL-445
Change-Id: I693cd4fbec3d236f039e01448dc4994722b5582d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 5e590b00d38ddbc28079d6f10928275136aa6b78)

5 years agoOptimize DataObjectCodecContext memory footprint 73/81873/1
Robert Varga [Thu, 2 May 2019 10:27:58 +0000 (12:27 +0200)]
Optimize DataObjectCodecContext memory footprint

Examining heap dumps while working on MDSAL-442/MDSAL-443 revealed
a slight inefficiency in DataObjectCodecContext: we are forcing
byStreamClass's entrySet to be instantiated for the purposes of
copying it into byBindingArgClassBuilder.

This patch corrects the mistake by using byStreamClassBuilder
as the source of copied entries -- which holds the same content,
but we will be throwing it away.

Furthermore byStreamClass and byBindingArgClass are only distinct
when we have a choice child, hence we also run comparison on the
two builders and reuse byStreamClass if they are equal.

Change-Id: Ie58367f7cc899d49da7f78cd0d4e70fbb064ae99
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 09870ca2f1234be7c175667341f783c0b95ef408)

5 years agoSpeed up DataContainerCodecPrototype.get() a bit 16/81716/1
Robert Varga [Tue, 23 Apr 2019 09:38:33 +0000 (11:38 +0200)]
Speed up DataContainerCodecPrototype.get() a bit

We can use less byte code to initialize both the local handle
and the cache field.

Change-Id: I362d0125836c6d962c4366c03ba76ae244fc54e5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit d4e362b68ea1cc5785bd6a01dff25dddb1213d81)

5 years agoAdd binding/dom codec class loader support 02/81702/2
Robert Varga [Thu, 18 Apr 2019 11:07:22 +0000 (13:07 +0200)]
Add binding/dom codec class loader support

Our current codec implementation relies on creating classes in
classloaders holding compile-time-generated code, effectively
polluting them, in two distinct ways.

The first, less intrusive, is the instantiation of dynamic
proxies, which support LazyDataObject and ForeignOpaqueObject
instances. Since this is done via JVM interfaces, the JVM
takes care of reusing these classes, but still they cannot
be removed when the binding-dom-codec is unloaded -- fortunately
their nature of being derived from yang-binding and compile-time
generated interfaces allows them to be reused.

The second, more intrusive, is the instantiation of dynamic
streamers to support emitting NormalizedNode structures from
DataObject instances. While there are some provisions to reuse
them, they are inherently tied to how BindingRuntimeContext
interprets generated classes -- if the underlying SchemaContext
ends up interpreting them incompatibly (for example, by leaf
changing to anyxml), we end up between a rock and a hard place --
the classes do not match NormalizedNode world and they cannot
be reloaded to rectify the problem.

This patch adds the infrastructure for separating out compile-time
and run-time worlds by introducing StaticClassPool and
CodecClassLoader. StaticClassPool is used to bind Javassist code
generator to the classloader into which binding-dom-codec is loaded.

CodecClassLoader allows effective bridging of StaticClassPool and
whatever classloader is loading compile-time-generated classes,
and provides a place where new classes can be defined without
polluting either classloader.

Change-Id: I963c7bc6eefd5dd77a80e06442896265116664c0
JIRA: MDSAL-442
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 57c0721d7660c83dadf2194923d75f7e4d664b7e)

5 years agoMake LazySerializedDOMNotification a DOMEvent 01/81701/2
Robert Varga [Thu, 11 Apr 2019 20:10:16 +0000 (22:10 +0200)]
Make LazySerializedDOMNotification a DOMEvent

DOMEvent carries the information about when the event occurred,
make sure we propagate it when available and backfill it on
submission.

It also retrofits some @NonNull annotations to make it clear we
are not propagating nulls.

JIRA: MDSAL-282
Change-Id: I2153b007af2accbad41f5aea00dbced21030a67d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 2188563bd18dccb50bbbfa13235ca4955c7eb7dc)

5 years agoOptimize source generation 99/81699/2
Robert Varga [Sun, 14 Apr 2019 14:22:50 +0000 (16:22 +0200)]
Optimize source generation

Since StringBuilder is fluent, we can optimize some of the source
generation utilities to have less bytecode. Also mark FIXMEs for
future improvement, as these would allow better devirtualization.

Furthermore we expose Class-based cast/assign operations, which
trim down code duplication a tiny bit.

Change-Id: I32d9d9321992effe0bec1423990208a92c1f780b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 3a1da8e23805b36351172eeb7f11bc134821ee36)

5 years agoExtend AugmentableExtension to handle AugmentationHolder 00/81700/1
Robert Varga [Wed, 17 Apr 2019 14:04:28 +0000 (16:04 +0200)]
Extend AugmentableExtension to handle AugmentationHolder

This class seems to be a duplicate of BindingReflections'
functionality, completely missing out on AugmentationHolder, which
can be used as an alternative to expose augmentations.

Change-Id: Iadcc4e2f4587ceeb27d6a47c42b0319705fc1e58
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDefine OpaqueData/OpaqueObject hashCode/equals 46/81646/2
Robert Varga [Fri, 12 Apr 2019 02:09:33 +0000 (04:09 +0200)]
Define OpaqueData/OpaqueObject hashCode/equals

This adds baseline hashCode/equals specification, so that we do not
rely on identity for comparisons.

JIRA: MDSAL-439
Change-Id: I41291935a0402f6fce13b6e49531d85e2fc905d5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 4c82af2a3ed7b1dc78b8e50b749dbd2b0c82268c)

5 years agoTag generated QNAME field with @NonNull 45/81645/1
Robert Varga [Sun, 14 Apr 2019 07:33:15 +0000 (09:33 +0200)]
Tag generated QNAME field with @NonNull

Improve code generation, so that users can be sure QNAME is never
nullable, improving interactions with APIs which take a QName.

Change-Id: I0454ba448fb9edb605d04e97901381ae0f8a79d0
JIRA: MDSAL-441
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 046cf58dc3b606edb90ebb8919f1121b8e4f2540)

5 years agoTag InstanceIdentifier methods with @Nullable/@NonNull 44/81644/1
Robert Varga [Sun, 14 Apr 2019 07:08:33 +0000 (09:08 +0200)]
Tag InstanceIdentifier methods with @Nullable/@NonNull

Most of these methods are guaranteed to return non-null, tag them
as such, improving user experience.

Change-Id: I6f581baf2a023b90274b9d89bf6475d9780449c8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit b515bd997a4afe8b0f1b9bbe0b585d3330503e4e)

5 years agoTag NotificationPublishService.REJECTED as non-null 02/81602/1
Robert Varga [Thu, 11 Apr 2019 20:08:37 +0000 (22:08 +0200)]
Tag NotificationPublishService.REJECTED as non-null

This can only ever be a non-null constant, tag is as such.

Change-Id: I2d011a66fa61b164dab184ab0808a77ee290c774
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 19e036ac942ae0c1257bb551ae1ed04b37e2b3e4)

5 years agoBump versions to 3.0.9-SNAPSHOT 76/81576/1
Robert Varga [Thu, 11 Apr 2019 16:42:42 +0000 (18:42 +0200)]
Bump versions to 3.0.9-SNAPSHOT

This starts the next development cycle.

Change-Id: I8f9550618fe1b3b2cda1e5e067b9c065f6d57328
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump yangtools to 2.1.10 65/81565/1
Robert Varga [Thu, 11 Apr 2019 11:09:50 +0000 (13:09 +0200)]
Bump yangtools to 2.1.10

Use yangtools version aligned with odlparent-4.0.10.

Change-Id: I95024bfcba252539926074b7ee10d2c4ad3b093a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump odlparent to 4.0.10 64/81564/1
Robert Varga [Thu, 11 Apr 2019 11:09:16 +0000 (13:09 +0200)]
Bump odlparent to 4.0.10

Adopt latest upgrades from odlparent.

Change-Id: I13ebcbe5c20aa208ca3d638494f32fc5d9140271
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump versions to 3.0.8-SNAPSHOT 63/81563/1
Robert Varga [Thu, 11 Apr 2019 11:08:40 +0000 (13:08 +0200)]
Bump versions to 3.0.8-SNAPSHOT

This starts the next development cycle.

Change-Id: I6c85e4f82eff7550545992f452626353bcf75075
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnable spotbugs in ietf-type-util 56/81556/1
Robert Varga [Fri, 22 Mar 2019 19:01:31 +0000 (20:01 +0100)]
Enable spotbugs in ietf-type-util

This is just a trivial flipping of the switch.

Change-Id: I916c22fee0dd9049359a044be1ee3cb6a4b673fe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit d716b93bac9c7fba5135ad861034afc10095d980)

5 years agoFix ietf-type-util checkstyle 55/81555/1
Robert Varga [Fri, 22 Mar 2019 18:46:53 +0000 (19:46 +0100)]
Fix ietf-type-util checkstyle

This fixes checkstyle violations, adding a few suppressions and
remove UnsupportedExceptionThrows and related reflection-based tests.

Change-Id: I0c1b8828a881299dde6df4fe666df000f0ec486b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit e146ccacb12facdae44954f2f5b9d29976bfbe7b)

5 years agoBindingAdapterFactory should be Immutable 54/81554/1
Robert Varga [Tue, 26 Mar 2019 13:04:05 +0000 (14:04 +0100)]
BindingAdapterFactory should be Immutable

This class is immutable, which implies thread-safety, removing
the need for @ThreadSafe.

Change-Id: Ic77c7932a2dd244b0a8211bd6e8c1dc9e95bb08c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit ed26768f43595f68767ee82769508d8b1a0924c2)

5 years agoRemove @(Not)ThreadSafe annotation 53/81553/1
Robert Varga [Tue, 26 Mar 2019 13:03:15 +0000 (14:03 +0100)]
Remove @(Not)ThreadSafe annotation

Use documentation rather than JSR305 to document non-thread-safety.
In package-private classes these annotations often do not make
sense.

Change-Id: Iea39cf23472917e9d5765e6d2a025ff7ab7f6114
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 0a31ba669d9ac4bc0451dcbc9017e1e3645b316c)

5 years agoDo not fail if invoking of listener fails 52/81552/1
Jakub Morvay [Sat, 6 Apr 2019 09:19:13 +0000 (11:19 +0200)]
Do not fail if invoking of listener fails

DOMMountPointServiceImpl should not fail and propagate uncaught
exceptions from mount point listeners. When invocation of a registered
listener onMounPpointCreated or onMounPointRemoved callback fails, just
log the error and continue execution.

Change-Id: I5d182b610c0b5749cfe01efc13bc1dddfffa5283
Signed-off-by: Jakub Morvay <jakub.morvay@gmail.com>
(cherry picked from commit 2ef4a8d7750fee095a21318236d401727b1c8ae0)

5 years agoFix small formatting issue 51/81551/1
Jakub Morvay [Sat, 6 Apr 2019 16:17:25 +0000 (18:17 +0200)]
Fix small formatting issue

Change-Id: I48128fee6f2ff9f8e27fb5714cec1fbbd44af2e9
Signed-off-by: Jakub Morvay <jakub.morvay@gmail.com>
(cherry picked from commit 6fe135d7aceb33c860fc3fbd01a289dc30804fcf)

5 years agoAdd AbstractDOMSchemaService and FixedDOMSchemaService 50/81550/1
Michael Vorburger [Mon, 28 Jan 2019 21:11:36 +0000 (22:11 +0100)]
Add AbstractDOMSchemaService and FixedDOMSchemaService

AbstractDOMSchemaService allows more code reuse between implementations
by holding the common bits needed to interface with SchemaContextProviders.

Also use these to implement a FixedDOMSchemaService for use in situations
when the SchemaContext and the set of associated sources are known to
never change.

This also slightly simplifies ScanningSchemaSourceProvider.

JIRA: MDSAL-418
Change-Id: I554837f8ae93e5bbb741b4cb801c31b8ebfcaa03
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
(cherry picked from commit 6f527c4f41f6d363cbd486e925e2447c4ab26995)

5 years agoReduce use of getDataChildByName() 49/81549/1
Robert Varga [Tue, 9 Apr 2019 06:47:51 +0000 (08:47 +0200)]
Reduce use of getDataChildByName()

Using findDataChildByName() is null-safe, allowing us to reduce
the number of assertions.

Change-Id: I182f52371aab5b18d94bebcd3a9aaf26b9d5fb55
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 0cfe4657be10a1a64de16f9bc29c8b1b9ee79555)

5 years agoClean up tryToUseCacheElse() 48/81548/1
Robert Varga [Wed, 10 Apr 2019 12:51:00 +0000 (14:51 +0200)]
Clean up tryToUseCacheElse()

Generated code is a bit ugly for the case of accessing cache,
with missing newline and misplaced whitespace. Clean that up.

Change-Id: I13c754c808b9da19e3f5e4cfc216073aafb462db
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit d9972690bb45cb28f43c63c21395b5042f4d4ce2)

5 years agoDocument BindingCodec/Serializer/Deserializer 47/81547/1
Robert Varga [Wed, 10 Apr 2019 11:10:57 +0000 (13:10 +0200)]
Document BindingCodec/Serializer/Deserializer

These interfaces are not documented at all, owing partly to the fact
they are are implementation of mdsal-binding-dom-codec, whose design
currently requires placing codecs into the same class loader as
generated code -- hence they leak to the common binding support
package.

Change-Id: Ib576b9aeddcc644d5b1f44a2047e775cc5266245
JIRA: MDSAL-401
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 3c45e3dec46d38b7c6fe121ca23d48ac602fe55f)

5 years agoBump yangtools to 2.1.9 45/81545/1
Robert Varga [Wed, 10 Apr 2019 23:40:52 +0000 (01:40 +0200)]
Bump yangtools to 2.1.9

This adopts the latest yangtools release.

Change-Id: Ia603a7c56c0e1ce77bff66b9e963653cee1b5a11
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd Opaque{Data,Object} interfaces 26/81326/3
Robert Varga [Wed, 27 Mar 2019 15:31:07 +0000 (16:31 +0100)]
Add Opaque{Data,Object} interfaces

This adds the baseline interfaces needed for generating
manifestations of anydata and anyxml node sin Binding world.

Since they are conceptually the same and cannot have the same
identifier, we can support them with a single BindingObject
sub-interface.

JIRA: MDSAL-428
Change-Id: I7d7e0ff6c7bcd7d2375d50c4e976bf68d4e47143
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 25952d26001a7ef4a04f713312f864b8af397f69)

5 years agoAdd yang-binding interfaces for annotations 25/81325/1
Robert Varga [Wed, 27 Mar 2019 13:53:01 +0000 (14:53 +0100)]
Add yang-binding interfaces for annotations

Binding users are interested in having a way to access RFC7952
metadata. While the actual codegen/runtime implementation requires
some work, we know what Binding Specification extension we will
need to support the generated classes.

This patch introduces Annotation and AnnotationAware, so a future
codegen version can bind to it.

JIRA: MDSAL-357
Change-Id: I2fed30ea34b21c36b626388bb37890cc73875176
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 4bd8c8ccb296b0982fe2b5b287976a55610511f8)

5 years agoAdd EventInstantAware interface 24/81324/1
Robert Varga [Wed, 27 Mar 2019 12:55:15 +0000 (13:55 +0100)]
Add EventInstantAware interface

This interface will be used to carry the equivalent of RFC5277
notification eventTime. It is modeled exactly the same way as
DOMEvent/DOMNotification, hence it will allow us to bridge the gap
in binding-dom-adapter, where we are losing this information.

JIRA: MDSAL-282
Change-Id: Ie93015c2609a2d1c59df6c63f76511aa68867832
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 992122145777924ad5b3a52da65188d8a91b8246)

5 years agoClarify DOMEvent and DOMNotification relationship 23/81323/1
Robert Varga [Wed, 27 Mar 2019 12:53:50 +0000 (13:53 +0100)]
Clarify DOMEvent and DOMNotification relationship

The relationship between these interfaces is realized in the
implementation, but it is not captured in the interface contract
documentation.

JIRA: MDSAL-282
Change-Id: I99d8787a16263c6628440dac8b3bd7a6bbec3f9c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit ae3fde5afcd6811321b8f9cbbf2f6da1661b5610)

5 years agoRemove use of deprecated createCursor() method 98/81198/2
Robert Varga [Tue, 26 Mar 2019 15:21:57 +0000 (16:21 +0100)]
Remove use of deprecated createCursor() method

This method has been superseded by openCursor(), use that.

Change-Id: Ie64c91106c1b1cfddbd0d68456e5081f6ef72341
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix logging arguments 99/81199/1
Robert Varga [Fri, 22 Mar 2019 18:27:10 +0000 (19:27 +0100)]
Fix logging arguments

This is caught by upgraded spotbugs, we are missing returnType
argument.

Change-Id: I5513c89cd22e0c4fd739ada5a2d5e5b61b185a09
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 545f4abe2c52f144acb97dc51c36e042038c3386)

5 years agoTolerate unresolvable leafrefs in groupings 73/81073/1
Vratko Polak [Fri, 1 Jul 2016 11:21:15 +0000 (13:21 +0200)]
Tolerate unresolvable leafrefs in groupings

In case a grouping contains a relative leafref pointing outside of
the grouping subtree we cannot safely determine the target type, which
lead to an IllegalArgumentException.

In this case we need to resolve the return type to an Object, which
loses type safety, but really is the best we can do as we just do not
know in what contexts that grouping is used.

Unfortunately this requires API changes to mdsal-binding-generator-api
as we need to communicate the fact we are resolving a type definition
in the context of a grouping to TypeProvider implementations.

JIRA: MDSAL-182
Change-Id: Iaf96d133c08eb47f4bb27b6c4f3db1463b78f05e
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 1e1d8a29875fe39cc41cc430d6d96ccebd5eb5f0)

5 years agoSpeed up ClassTemplate getDefaultInstance() generation 72/81072/1
Robert Varga [Tue, 19 Mar 2019 11:30:08 +0000 (12:30 +0100)]
Speed up ClassTemplate getDefaultInstance() generation

We can skip instantiating FQCN and just compare against constants,
which results in faster dispatch.

Change-Id: I681888872db411b4f70b3b09d205540d8b607568
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 103315ce162d60ca6896269a97ebaf34bf299e34)

5 years agoSpeed up Union stringValue() generation 71/81071/1
Robert Varga [Tue, 19 Mar 2019 11:31:14 +0000 (12:31 +0100)]
Speed up Union stringValue() generation

We can compare against well-known Types, which is faster than
going through FQCN.

Change-Id: I7f6a7bd143d94be48176d9d8e1fe56bd0e6eae8e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 3559737dc4dfd9ccb1d0d9b9d54ae648a24c226e)

5 years agoSimplify UnionTemplate stringValue() dispatch 70/81070/1
Robert Varga [Tue, 19 Mar 2019 11:19:41 +0000 (12:19 +0100)]
Simplify UnionTemplate stringValue() dispatch

We have a complicated if in two cases, simplify it and take
advantage of Types.BYTE_ARRAY.

Change-Id: Ib413d5f987b0dd15cf29fbc429bde68bc35c1379
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 7531d77c44d5b10be7d7728ff028792440d66a38)

5 years agoCleanup RuntimeException throws 69/81069/1
Robert Varga [Tue, 19 Mar 2019 17:04:49 +0000 (18:04 +0100)]
Cleanup RuntimeException throws

We are just wrapping exceptions in these cases, switch to wrapping
with IllegalStateException to keep sonar happy.

Change-Id: I571f444b9d97dd9d9129b6e18f7e91e72b30d842
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit fda572130077da8029e12bb770b0b8c8fb7890d0)

5 years agoUse E$$ to capture augmentation type 02/81002/2
Robert Varga [Mon, 18 Mar 2019 13:55:43 +0000 (14:55 +0100)]
Use E$$ to capture augmentation type

'E' is a valid generated identifier, which can lead to conflicts
when generating augmentable implementations.

Change-Id: I9d69d06e18301eff788c101e389a6d0b5365ad38
JIRA: MDSAL-425
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 8dbc1c0794dbd6be19ae0e724b4cc21714c6739f)

5 years agoFix check path contention when create tree producers 54/80954/2
han [Fri, 12 Oct 2018 03:16:19 +0000 (11:16 +0800)]
Fix check path contention when create tree producers

- It's not allowed to create producers with their subtrees conflicts.
  Add a map to store producers aim to do this check more simply than
  to travel 'DOMDataTreePrefixTable'.
  It's assumed there're less producers in th map that we could accept
  to do 'for' operation.

  JIRA: MDSAL-397
Change-Id: I105291402f21b530f54873307316f0f0c5640f6b
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit cb18b6de35bc819764b431a4e922d8cbce634014)

5 years agoUpdate .gitreview 15/80915/2
Robert Varga [Sat, 16 Mar 2019 00:07:17 +0000 (01:07 +0100)]
Update .gitreview

This updates .gitreview for 3.0.x branch

Change-Id: Id5ba4d5b29a34980d824954ce78b52ce9ae25509
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoImplement EthertypeBuilder 30/80930/3
Robert Varga [Sat, 16 Mar 2019 11:03:00 +0000 (12:03 +0100)]
Implement EthertypeBuilder

This implements EthertypeBuilder in an efficient way, using
pre-built known ethertypes.

It also defines {compare,equal,hash}Value, methods which perform
semantic operations, treating number-based and enumeration-based
Ethertypes equally.

Change-Id: I394f65a17fa84c06a63bc598c947d274d6dd6413
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd RFC8519 models 10/80910/4
Robert Varga [Wed, 13 Mar 2019 12:29:06 +0000 (13:29 +0100)]
Add RFC8519 models

This adds RFC8519 ietf-access-control-list and ietf-packet-fields
models, which are replacing previous instantiation of these models.

Change-Id: I984db5e2fc13c4a4e0b12b3afe4141cf73c1d6d5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove use of deprecated constructors 09/80909/2
Robert Varga [Fri, 15 Mar 2019 19:07:06 +0000 (20:07 +0100)]
Remove use of deprecated constructors

Java 11 deprecates most of these constructurs, so let's get rid
of them.

Change-Id: I67c03370c4e8440608e0cece182d87c7ea923258
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix logging placeholders 06/80906/3
Robert Varga [Fri, 15 Mar 2019 18:34:00 +0000 (19:34 +0100)]
Fix logging placeholders

Upgraded SpotBugs is finding these, fix them up.

Change-Id: I6209c661ccdf17d886d8c776d96fe6b6a32abc1b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix odl-mdsal-model-rfc8349 definition 24/80824/1
Robert Varga [Wed, 13 Mar 2019 12:40:22 +0000 (13:40 +0100)]
Fix odl-mdsal-model-rfc8349 definition

This feature should be polling in rfc8344, rfc8343 and rfc6991.
Due to transitive dependencies, it is enough to pull rfc8344.

Change-Id: I1098dba897dc4be27d062925799c5be3e4432117
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd RFC8530 Logical Network Elements 26/80726/5
Robert Varga [Thu, 7 Mar 2019 15:24:32 +0000 (16:24 +0100)]
Add RFC8530 Logical Network Elements

This adds packaging for RFC8530 model, so that it can be reused
by downstreams.

Change-Id: I863951b0caed784f5d7d6c3f5ce4d562d8755b72
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd RFC8529 Network Instances 25/80725/4
Robert Varga [Thu, 7 Mar 2019 15:10:16 +0000 (16:10 +0100)]
Add RFC8529 Network Instances

This adds packaging for RFC8529 model, so that it can be reused
by downstreams.

Change-Id: I0e6cbf9b1c45122d75b639b4be9a329cedb2a252
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd RFC8528 Schema Mount model 24/80724/3
Robert Varga [Thu, 7 Mar 2019 15:03:24 +0000 (16:03 +0100)]
Add RFC8528 Schema Mount model

This adds packaging for RFC8528 model, so that it can be reused
by downstreams.

JIRA: MDSAL-424
Change-Id: Ia6ec9ffd349cd6afa2629b9fa1eb9096d263aa39
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMake Enumeration extend TypeObject 33/79933/5
Jie Han [Sat, 26 Jan 2019 03:04:33 +0000 (11:04 +0800)]
Make Enumeration extend TypeObject

- By now we can use TypeObject for leaf type objects

JIRA: MDSAL-407
Change-Id: Ifc7889b154e5e8bcdcbc4885affa9d3fa88facc2
Signed-off-by: Jie Han <han.jie@zte.com.cn>
5 years agoMark typedef types as TypeObject 92/79892/6
Jie Han [Fri, 25 Jan 2019 07:29:04 +0000 (15:29 +0800)]
Mark typedef types as TypeObject

Make binding class of typedef implement TypeObject. In order to not
break compatibility, make sure we disregard marker interfaces when
computing serialVersionUID.

JIRA: MDSAL-406
Change-Id: I8e8bf31d3b3c43a2c843e7dd9914def12c52fee3
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoCleanup mdsal-trace-cli package 31/80331/1
Robert Varga [Thu, 14 Feb 2019 09:55:04 +0000 (10:55 +0100)]
Cleanup mdsal-trace-cli package

This is not part of the public contract and it encroaches on
controller's namespace. Fix that up.

Change-Id: Iae74934039ebc684ac29ef5420c4e4b2ea2d99a8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd a category for org.opendaylight.mdsal.model.ietf.util 30/80330/1
Robert Varga [Thu, 14 Feb 2019 09:52:45 +0000 (10:52 +0100)]
Add a category for org.opendaylight.mdsal.model.ietf.util

Provide a nice description in the javadocs for the package.

Change-Id: Ic699fe849d4fdd6d7e6181a7c480d481a24cd7b1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUse Collections.emptyList and Collections.emptySet 89/80289/1
Stephen Kitt [Tue, 12 Feb 2019 15:41:53 +0000 (16:41 +0100)]
Use Collections.emptyList and Collections.emptySet

... instead of the non-generic constants.

Change-Id: I8540db4c2d52185ed0de65eb8b45b75f75cc3f91
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoUse java.util.Objects.equals 88/80288/1
Stephen Kitt [Tue, 12 Feb 2019 15:39:24 +0000 (16:39 +0100)]
Use java.util.Objects.equals

... instead of com.google.common.base.Objects.equal.

Change-Id: Id4252306c443ce140e261c353dfecd601bcad84c
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoUse HashMap and HashSet constructors 87/80287/1
Stephen Kitt [Tue, 12 Feb 2019 15:37:56 +0000 (16:37 +0100)]
Use HashMap and HashSet constructors

... instead of Maps.newHashMap and Sets.newHashSet.

Change-Id: Ie6c04a4fc546401b41943c481335e2cc320f7edd
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoSwitch to java.util.Base64 86/80286/1
Stephen Kitt [Tue, 12 Feb 2019 14:23:30 +0000 (15:23 +0100)]
Switch to java.util.Base64

Change-Id: Ib944fdd09543d423478267d0ea8a386ae3efe02d
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoSwitch to Objects.requireNonNull 79/80279/1
Stephen Kitt [Tue, 12 Feb 2019 11:04:48 +0000 (12:04 +0100)]
Switch to Objects.requireNonNull

... instead of Guava’s Preconditions.checkNotNull.

Change-Id: If7979ac0071e8c1d1af2d7913c6df791942825ab
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoDo not generate CheckReturnValue annotations 17/80217/4
Robert Varga [Thu, 7 Feb 2019 18:52:41 +0000 (19:52 +0100)]
Do not generate CheckReturnValue annotations

Use of javax.annotation is really hurting our migration to Java 11,
just do not generate it all over the place.

JIRA: MDSAL-372
Change-Id: I81aa4d8b62b12ea0ea503b5d002e744a31855aea
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd mark interface 90/79890/5
Jie Han [Fri, 25 Jan 2019 03:52:34 +0000 (11:52 +0800)]
Add mark interface

- Add TypeObject for derived types only
- Add base BindingObject for all binding types

JIRA: MDSAL-406
Change-Id: I93ac1bea70f61a9ed05dc35951f024f08dcf6b83
Signed-off-by: Jie Han <han.jie@zte.com.cn>
5 years agoAccount for reported UNMODIFIED nodes 69/80269/1
Robert Varga [Mon, 11 Feb 2019 16:25:47 +0000 (17:25 +0100)]
Account for reported UNMODIFIED nodes

DataObjectModification has no way of expressing UNMODIFIED nodes,
but they can (and are) reported from DataTreeCandidateNode, hence
we end up reporting IllegalStateException when the user tries to
look at those nodes.

Make sure we take the node under consideration and do not report
unmodified children, hence preventing the ISE from happening.

JIRA: MDSAL-422
Change-Id: I34d36ae083c5ce3ad793eb584236f175f7a3a906
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump java-diff-utils 12/80212/2
Stephen Kitt [Thu, 7 Feb 2019 17:25:27 +0000 (18:25 +0100)]
Bump java-diff-utils

This upgrades java-diff-utils to version 4.0, with its new group id,
bringing better Java 9+ support and fixing a number of licensing
issues.

Change-Id: I4272f4d721dbd0af335115cc3bb2be196329ca11
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoFix AbstractBaseDataBrokerTest.assertCommit() 65/80165/2
Robert Varga [Tue, 5 Feb 2019 21:50:54 +0000 (22:50 +0100)]
Fix AbstractBaseDataBrokerTest.assertCommit()

This method should reflect whatever commit() is returning, but
unfortunately it was left out during conversion.

Change-Id: I7e7389d0a7f8fbd94af2ee07ce089f72f4855a74
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoGenerated javadoc does not separate multi-line description 15/80015/2
Jie Han [Wed, 30 Jan 2019 02:26:00 +0000 (10:26 +0800)]
Generated javadoc does not separate multi-line description

- replace any of "\n\t" with " " and then replace
  multiple " " to a single " ".

JIRA: MDSAL-416

Change-Id: I1f29f7da9f574e65a8ccf169e29883c9d1f47c26
Signed-off-by: Jie Han <han.jie@zte.com.cn>
5 years agoUpdate junit link 57/79957/3
Robert Varga [Mon, 28 Jan 2019 16:35:08 +0000 (17:35 +0100)]
Update junit link

javadoc.io breaks with JDK11, update the link.

JIRA: MDSAL-419
Change-Id: I9b0fdbe0d0dc888f4b5de8e25a298fb7424e5345
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agominor: fix wrong Logger in InMemoryDOMDataStoreFactory 34/79934/1
Michael Vorburger [Sat, 26 Jan 2019 06:01:55 +0000 (07:01 +0100)]
minor: fix wrong Logger in InMemoryDOMDataStoreFactory

Change-Id: I20257192bc2885a2500025bcbdf18e8fa0c8d0c6
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
5 years agoUpdate javadocs link 27/79827/1
Robert Varga [Tue, 22 Jan 2019 16:08:09 +0000 (17:08 +0100)]
Update javadocs link

We have moved javadocs to a different artifact, update the link.

Change-Id: I9f81681f6b2118712b1c4cebbe0a6de5fafed194
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump to 3.0.7-SNAPSHOT 23/79823/1
Robert Varga [Tue, 22 Jan 2019 15:12:58 +0000 (16:12 +0100)]
Bump to 3.0.7-SNAPSHOT

This starts the next release development.

Change-Id: I57a90dbf6d5961ea0c2d1c3bb5af5dda985132c0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix inability to promote 15/79815/1
Robert Varga [Tue, 22 Jan 2019 09:07:03 +0000 (10:07 +0100)]
Fix inability to promote

mdsal-docs not having the main artifact causes the repository
fail to promote. Work this around by packaging guides into a jar
rather than as a separate classifier.

Change-Id: I3c228e425da04b645f0a1a6dbd3e58cffe6e9f6f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRevert "Add BindingNormalizedNodeSerializer.coerceFromYangInstanceIdentifier" 03/79803/2
Robert Varga [Tue, 22 Jan 2019 01:58:17 +0000 (02:58 +0100)]
Revert "Add BindingNormalizedNodeSerializer.coerceFromYangInstanceIdentifier"

This reverts commit 137bd301e01ecec44fa47dfbc69df664ea014c5e.

Blueprint cannot handle default methods, hence we need to revert
this, unfortunately.

Change-Id: I67917f2e5cdb70ebe45f76cae347bde209841e17
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd mdsal-docs artifact 01/79801/3
Robert Varga [Mon, 21 Jan 2019 21:18:12 +0000 (22:18 +0100)]
Add mdsal-docs artifact

Rather than doing javadoc:aggregate, use the docs directory to
prepare documentation, which includes sources as well as javadocs.

This cuts down the build time in half while providing a better
javadoc result due to our ability to heavily customize.

Change-Id: If39191f179265240e7a5d3700fcea32e10897220
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump versions to 3.0.6-SNAPSHOT 76/79776/1
Robert Varga [Mon, 21 Jan 2019 01:24:22 +0000 (02:24 +0100)]
Bump versions to 3.0.6-SNAPSHOT

This starts the next development iteration.

Change-Id: I1012c62ad20cf9db03b8fa121db16377669e43d0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump yangtools to 2.1.8 40/79740/2
Robert Varga [Sat, 19 Jan 2019 20:16:54 +0000 (21:16 +0100)]
Bump yangtools to 2.1.8

This align with odlparent-4.0.9.

Change-Id: I0b8f5c3502a78ae7bf3b6c96631e84d9c1303183
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix aggregator pom name 20/79720/1
Robert Varga [Fri, 18 Jan 2019 21:58:48 +0000 (22:58 +0100)]
Fix aggregator pom name

This has a typo in it, fix it.

Change-Id: Idf979465e4ffe9814415147367db6e8a9b4a47fd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump to odlparent 4.0.9 60/79660/1
Stephen Kitt [Fri, 18 Jan 2019 15:26:59 +0000 (16:26 +0100)]
Bump to odlparent 4.0.9

Change-Id: Iefa6c11fe412f814a3e8e15ea709c6f6aa795ef4
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoAdd BindingNormalizedNodeSerializer.coerceFromYangInstanceIdentifier 23/79623/1
Robert Varga [Thu, 17 Jan 2019 16:18:21 +0000 (17:18 +0100)]
Add BindingNormalizedNodeSerializer.coerceFromYangInstanceIdentifier

In application-level adapter, which are bound to particular models,
the nullable annotation gets in the way, as it flags a potential
error, which needs to be expensively masked.

Introduce a coerceFromYangInstanceIdentifier() method, which includes
the masking, leaving application code unburdened with this detail.

Change-Id: I0b6e052b6b9be7c42538ab25924fd47b0421b274
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoCorrect EOS adapter error message 22/79622/2
Robert Varga [Thu, 17 Jan 2019 15:55:39 +0000 (16:55 +0100)]
Correct EOS adapter error message

The catch block covers multiple error causes and provides a misleading
message when the listener (i.e. user code) fails.

Refactor the method to cleanly separate failure causes.

Change-Id: I21b9c846425b35684951c6f8d3c011a50d3308d8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agofix NPE in odl-mdsal-trace 23/79523/1
Michael Vorburger [Fri, 14 Dec 2018 15:37:16 +0000 (16:37 +0100)]
fix NPE in odl-mdsal-trace

It (probably) broke back in
Commit a6286576cf76bce93009c58b88ba1e949ef717af
Change-Id: Id82a79e8e430665f6fb5433ed7bab858044eacbe.

This NPE only occurs if mdsaltrace has non-empty write-watches
(as it does in the initial default mdsaltrace_config.xml).

The following commit adds a non-regression test for this.

Caused by: java.lang.NullPointerException
  at org.opendaylight.mdsal.binding.dom.codec.impl.BindingCodecContext.getCodecContextNode(BindingCodecContext.java:152)
  at org.opendaylight.mdsal.binding.dom.codec.impl.InstanceIdentifierCodec.deserialize(InstanceIdentifierCodec.java:36)
  at org.opendaylight.mdsal.binding.dom.codec.impl.BindingNormalizedNodeCodecRegistry.fromYangInstanceIdentifier(BindingNormalizedNodeCodecRegistry.java:101)
  at org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec.fromYangInstanceIdentifier(BindingToNormalizedNodeCodec.java:215)
  at Proxyabf4ea17_f2e5_4773_bd89_e4f8393036df.fromYangInstanceIdentifier(Unknown Source)
  at Proxy1038cd39_b88e_4023_8cb1_af39f6d6feb2.fromYangInstanceIdentifier(Unknown Source)
  at org.opendaylight.controller.md.sal.trace.dom.impl.TracingBroker.toPathString(TracingBroker.java:270)
  at org.opendaylight.controller.md.sal.trace.dom.impl.TracingBroker.toPathString(TracingBroker.java:264)
  at org.opendaylight.controller.md.sal.trace.dom.impl.TracingBroker$Watch.eventIsOfInterest(TracingBroker.java:167)
  at org.opendaylight.controller.md.sal.trace.dom.impl.TracingBroker.isWriteWatched(TracingBroker.java:248)
  at org.opendaylight.controller.md.sal.trace.dom.impl.AbstractTracingWriteTransaction.recordOp(AbstractTracingWriteTransaction.java:37)
  at org.opendaylight.controller.md.sal.trace.dom.impl.AbstractTracingWriteTransaction.<init>(AbstractTracingWriteTransaction.java:32)
  at org.opendaylight.controller.md.sal.trace.dom.impl.TracingWriteTransaction.<init>(TracingWriteTransaction.java:24)

JIRA: CONTROLLER-1877
Change-Id: Ia9fbf69bc1c3553e929a045146a3610bce72cd96
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd javadoc badge 10/79510/1
Robert Varga [Mon, 14 Jan 2019 11:02:53 +0000 (12:02 +0100)]
Add javadoc badge

Now that our aggregate javadocs are in central, add a javadoc.io
badge pointing to them.

Change-Id: I2df704706baff60079edb69a9c188c923e9ee307
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd feature descriptions 95/79495/1
Robert Varga [Sat, 12 Jan 2019 08:46:19 +0000 (09:46 +0100)]
Add feature descriptions

odlparent-lite is giving use a rather verbose and non-descript
feature description. Add proper short descriptions, so that users
can see something useful.

Change-Id: I2c9c29dbc6dde579bd4f50f0da0b1b2b814933b2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoStart mdsal-3.0.5 development 20/79420/1
Robert Varga [Thu, 10 Jan 2019 15:21:34 +0000 (16:21 +0100)]
Start mdsal-3.0.5 development

This bumps versions to .5-SNAPSHOT, opening the next development
iteration.

Change-Id: I082400c698c78eaa525f8addaac2ecbdc90c4874
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump yangtools to 2.1.7 04/79404/1
Robert Varga [Thu, 10 Jan 2019 10:18:44 +0000 (11:18 +0100)]
Bump yangtools to 2.1.7

This realigns odlparent/yangtools versions and brings in some
minor improvements.

Change-Id: If46369a9be7976f905dd4c3ebf26e984328c489f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRevert "Simplify ClassLoadingStrategy implementations" 01/79401/2
Robert Varga [Thu, 10 Jan 2019 10:06:25 +0000 (11:06 +0100)]
Revert "Simplify ClassLoadingStrategy implementations"

This reverts commit 75181ffcf7c147a22330a8817af89aecdaf8149c,
which breaks blueprint, as it does not mix with default methods.

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