mdsal.git
4 years agoBump versions by x.y.(z+1) 19/82619/1 stable/fluorine
jenkins-releng [Thu, 20 Jun 2019 21:11:15 +0000 (21:11 +0000)]
Bump versions by x.y.(z+1)

Change-Id: I455db8e92befdb3c0a208408b83be36c10ad1d71
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
4 years agoBump yangtools to 2.0.20 92/82092/4
Robert Varga [Wed, 15 May 2019 13:13:24 +0000 (15:13 +0200)]
Bump yangtools to 2.0.20

This brings in latest fixes.

Change-Id: If56bc4ae811fdab81a9dfeea6f17b485019b5b06
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump odlparent to 3.1.7 91/82091/4
Robert Varga [Wed, 15 May 2019 13:12:40 +0000 (15:12 +0200)]
Bump odlparent to 3.1.7

This brings in latest upstream upgrades.

Change-Id: Ib99ec7c8167d39c1f8037fe4f9503835df580612
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoGroupingDefinitionDependencySort needs to consider actions 27/82127/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)

4 years agoDo not issue immediate build when looking up grouping 89/82089/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)

4 years agoAllow SnapshotBackedReadTransaction customization 53/81953/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)

4 years agoIntroduce AbstractAugmentable 83/81883/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)

4 years agoSpeed up BindingReflections.getAugmentations() 82/81882/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)

4 years agoOptimize DataObjectCodecContext memory footprint 74/81874/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)

4 years agoSpeed up DataContainerCodecPrototype.get() a bit 17/81717/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 agoTolerate unresolvable leafrefs in groupings 78/81078/2
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 Union stringValue() generation 77/81077/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 76/81076/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 75/81075/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 12/81012/1
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 agoAccount for reported UNMODIFIED nodes 22/80322/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>
(cherry picked from commit bd453654173fdb8109cb86413daa245d9d109081)

5 years agoGenerated javadoc does not separate multi-line description 75/80175/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>
(cherry picked from commit b530d7cabc7098caee13e5026f561efcf0665cef)

5 years agoBump versions by x.y.(z+1) 96/80196/1
jenkins-releng [Thu, 7 Feb 2019 09:45:04 +0000 (09:45 +0000)]
Bump versions by x.y.(z+1)

Change-Id: I2d0438ae4efa369a91062d81fb6b254d5deee41d
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
5 years agominor: fix wrong Logger in InMemoryDOMDataStoreFactory 35/79935/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>
(cherry picked from commit b240db6bf23b47acfb203407bc04396853608101)

5 years agoBump to yangtools-2.0.16 30/79730/1
Robert Varga [Sat, 19 Jan 2019 11:41:17 +0000 (12:41 +0100)]
Bump to yangtools-2.0.16

This aligns with odlparent-3.1.6.

Change-Id: I0ebbb2fd41b5a6644c7094883dba541439de14b4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump to odlparent 3.1.6 42/79642/2
Stephen Kitt [Fri, 18 Jan 2019 09:19:21 +0000 (10:19 +0100)]
Bump to odlparent 3.1.6

Change-Id: I4517bdd9cc1abc4089fa3153ea39e4c31e083038
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoFix aggregator pom name 21/79721/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>
(cherry picked from commit 0b318674e2b6f8bc9927960ee0577824976cacee)

5 years agoBump yangtools to 2.0.15 41/78641/3
Robert Varga [Tue, 11 Dec 2018 09:35:42 +0000 (10:35 +0100)]
Bump yangtools to 2.0.15

This brings in latest fixes.

Change-Id: I3e45a3f88516423f6311690998ee53fa9126fb7f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDowngrade mdsal-binding-generator-impl dependencies 75/78975/2
Robert Varga [Fri, 21 Dec 2018 21:12:52 +0000 (22:12 +0100)]
Downgrade mdsal-binding-generator-impl dependencies

mdsal-binding-generator-impl does not need yang-data-impl,
only yang-data-api. Downgrade the dependency.

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

5 years agoBump to odlparent 3.1.5 40/78940/2
Stephen Kitt [Fri, 21 Dec 2018 10:48:13 +0000 (11:48 +0100)]
Bump to odlparent 3.1.5

Upgrading xtend-maven-plugin to 2.16.0 and removing dependency
override.

Change-Id: Ia00a0698e40d14b75c5d4eb2eac3794d5928af5f
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoSeparate out single-key Identifiable handling 72/78372/1
Robert Varga [Sun, 25 Nov 2018 15:01:34 +0000 (16:01 +0100)]
Separate out single-key Identifiable handling

We can further optimize IdentifiableItemCodec by separating
out the common case of a single-key from multiple-keys.

This allows us to specialize ImmutableMapTemplates we use for
the two cases, more efficiently binding to
NodeIdentifierWithPredicates constructor.

Furthermore we can specialize key constructor invocation such
that we directly invoke the constructor for single-key identifiers,
without the need to iterate and allocate arrays.

JIRA: MDSAL-387
Change-Id: I2fc26dc7285bfb3fe829b8b0efd9937daf6fbc8d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 581410c9bc93c396631b8a09be0df7bc3faf03d3)

5 years agoOptimize IdentifiableItemCodec 33/78133/4
Robert Varga [Fri, 23 Nov 2018 00:30:08 +0000 (01:30 +0100)]
Optimize IdentifiableItemCodec

ImmutableMapTemplate allows us to instantiate space-efficient
ImmutableOffsetMaps very quickly, because we know exactly what
keySet() we are going to use, including our preferred ordering.

Use this class to instantiate keyValueContexts and also create
NodeIdentifierWithPredicates.

JIRA: YANGTOOLS-917
Change-Id: I087083fe4e1914bb5d8e58b9e378ebda9e070793
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit f6557f4f6831805301ea4690596310fcc03247c3)

5 years agoFix mdsal-binding-spi's relativePath 68/78168/2
Robert Varga [Mon, 26 Nov 2018 18:59:48 +0000 (19:59 +0100)]
Fix mdsal-binding-spi's relativePath

It should be empty, as we are inheriting from odlparent.

Change-Id: Ia7491e287ca7fe09cb3ece63a4c3943b7652a979
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump yangtools to 2.0.13 30/78130/2
Robert Varga [Mon, 26 Nov 2018 08:48:56 +0000 (09:48 +0100)]
Bump yangtools to 2.0.13

This brings in the latest patch release.

Change-Id: I4a35bd7cafa38f7c60a3d9c330494f58a71c4b35
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUse internal classes for codecs 32/78132/2
Robert Varga [Sun, 25 Nov 2018 18:39:00 +0000 (19:39 +0100)]
Use internal classes for codecs

As we are exposing codecs through package-private interfaces, there
is no point in hiding the implementation class. This helps JIT to
devirtualize the calls.

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

5 years agoBind invoker method handle to constructor 31/78131/2
Robert Varga [Sun, 25 Nov 2018 15:15:23 +0000 (16:15 +0100)]
Bind invoker method handle to constructor

We only ever pass the constructor method handle to the invoker,
hence we can make this a constant by binding the invoker handle
to the constructor -- saving us a field.

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

5 years agoUse ImmutableMaps for lazy augmentations initialization 44/78044/4
Robert Varga [Wed, 14 Nov 2018 15:40:29 +0000 (16:40 +0100)]
Use ImmutableMaps for lazy augmentations initialization

Rather than tracking lookups in two separate ConcurrentMaps, we
perform locked atomic updates in copy-on-write immutable structure.

The two lookup maps are kept in ImmutableMaps, which offer tighter
packing and do not incur any further volatile reads beyond getting
a reference to them.

This results in lower memory overhead, as the maps are more tightly
packed and also biases performance towards the dominant use case,
which is pure lookups.

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

5 years agoIndex getter methods by String 42/78042/5
Robert Varga [Fri, 16 Nov 2018 09:20:45 +0000 (10:20 +0100)]
Index getter methods by String

Looking up by String offers slight advantage over Method lookup,
because we'll end up with a constant hashCode() over objects which
are guaranteed to be interned.

This rework implies we no longer get to have a map whose keySet
reflects property methods -- which is fine, as the keyset would
take up more memory than a plain array, so we retain the methods
in an array -- hence this ends up being a net win in both cases.

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

5 years agoDo not box result twice 21/77921/2
Robert Varga [Sun, 18 Nov 2018 20:58:17 +0000 (21:58 +0100)]
Do not box result twice

result is an int while both cache and return type are Integer,
instantiate a local variable to hold the boxed value so we not
box twice.

Change-Id: I659b60b40d0d1dfa1eee25d214af4a096bf3e60e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoCache mismatched augmentations 25/77725/2
Robert Varga [Tue, 13 Nov 2018 14:13:41 +0000 (15:13 +0100)]
Cache mismatched augmentations

Address a FIXME around caching of mismatched augmentations, as it
seems openflowplugin is doing this on purpose.

The cache is expected to be needed infrequently in terms of associated
objects as well as modified infrequently, hence we use a space-efficient
ImmutableMap.

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

5 years agoIndex cached data by method name 84/77884/3
Robert Varga [Fri, 16 Nov 2018 07:15:42 +0000 (08:15 +0100)]
Index cached data by method name

Method.hashCode() is not a constant, whereas String.hashCode() is
pre-computed (for interned Strings). As Method.getName() is guaranteed
to be interned and getters have zero arguments, a method's name
is enough to uniquely identify the corresponding piece of data.

Therefore use Method.getName() to index cachedData.

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

5 years agoSwitch on method names 83/77883/3
Robert Varga [Fri, 16 Nov 2018 06:51:27 +0000 (07:51 +0100)]
Switch on method names

Method names are guarateed to be interned by the JVM, hence their
hashCode is O(1) -- making them a prime target for a switch statement,
which side-steps the need to run String.equals() slow path most of
the time.

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

5 years agoSwitch on parameterCount 82/77882/2
Robert Varga [Fri, 16 Nov 2018 06:47:39 +0000 (07:47 +0100)]
Switch on parameterCount

The else case here assumes parameterCount being 1, make that explicit,
resulting in cleaner code.

JIRA: MDSAL-398
Change-Id: Ie3fa47de6b1630e98a426da69bb6c6d2b6b4b026
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 312facb6827886b2a129b754e416809a2115b878)

5 years agoUse Method.getParameterCount() 81/77881/2
Robert Varga [Fri, 16 Nov 2018 06:38:51 +0000 (07:38 +0100)]
Use Method.getParameterCount()

Java 8 introduced this method, which bypasses array cloning done
by getParameterTypes(), making it more efficient. Take advantage
of it.

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

5 years agoDefine getImplementedInterface name in BindingMapping 80/77880/2
Robert Varga [Fri, 16 Nov 2018 06:34:37 +0000 (07:34 +0100)]
Define getImplementedInterface name in BindingMapping

This moves the definition from LazyDataObject to a common place,
so we have one place which defines it. Also remove unused Throwable
declaration.

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

5 years agoPrevent NPE from being propagated from LazyDataObject 45/77645/3
Robert Varga [Thu, 8 Nov 2018 14:09:49 +0000 (15:09 +0100)]
Prevent NPE from being propagated from LazyDataObject

Rather than incurring a NPE when we fail to find proper
NodeContextSupplier, add an explicit verifyNotNull() check to
throw a more explanatory VerifyException.

Change-Id: Ieed6d050bccfe482f69152b33a9a84bbe20037c2
JIRA: MDSAL-18
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 93e1775598fde7a18b2cf21b9009c50474411ea4)

5 years agoRefactor DataObjectCodecContext.getBindingChildValue() 44/77644/3
Robert Varga [Thu, 8 Nov 2018 14:01:07 +0000 (15:01 +0100)]
Refactor DataObjectCodecContext.getBindingChildValue()

Using instanceof checks is an OOP anti-pattern, which we do not
want here anyways. Generalize NodeCodecContext.defaultObject()
to return null by default and refactor decoding to rely on it,
with LeafNodeCodecContext returning whatever it has as a default
value.

Change-Id: I2b58bc7f1a16496cf6bc93fd7a33aec38f864597
JIRA: MDSAL-18
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 5376803e1c41d25f4c8e6e2ca38dc5e4d9fc18fb)

5 years agoSpeed up DataObjectCodecContext instantiation 43/77643/2
Robert Varga [Mon, 15 Oct 2018 10:22:09 +0000 (12:22 +0200)]
Speed up DataObjectCodecContext instantiation

Do not bounce multiple times to bindingClass(), but rather store
it in a local variable. Since we are here, also update other callers
of bindingClass().

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

5 years agoFix AbstractTypeMember toString() 72/77572/2
Stephen Kitt [Tue, 6 Nov 2018 16:08:35 +0000 (17:08 +0100)]
Fix AbstractTypeMember toString()

It shouldn't reference MethodSignatureImpl.

Change-Id: I20c44fe66b76daa5fb8ccd51485e57c1da0e932c
Signed-off-by: Stephen Kitt <skitt@redhat.com>
(cherry picked from commit 2786e60fbb57e29857adebfe2c4e2a03da80b01b)

5 years agoBump versions by x.y.(z+1) 02/78002/1
jenkins-releng [Tue, 20 Nov 2018 23:48:14 +0000 (23:48 +0000)]
Bump versions by x.y.(z+1)

Change-Id: I67eb31aaba226b77b83e04fda7fae5f9383766f9
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
5 years agoTry harder to acquire class mapping 04/77304/2
Robert Varga [Mon, 15 Oct 2018 12:44:48 +0000 (14:44 +0200)]
Try harder to acquire class mapping

We can perform a third try when we failed to load an augmentation
using TCCL by installing the candidate class classloader as the TCCL.

This can help in situations where we are invoked from a context where
the TCCL is not set up to actually see binding classes properly.

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

5 years agoBump to odlparent 3.1.4 and yangtools 2.0.12 57/76857/7
Stephen Kitt [Thu, 11 Oct 2018 09:49:12 +0000 (11:49 +0200)]
Bump to odlparent 3.1.4 and yangtools 2.0.12

Change-Id: Ia84f914d4d14503fb0f9522ba85f41c74d2ab9ed
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoRelax LazyDataObject.augmentations() implementation 92/76992/1
Robert Varga [Sat, 13 Oct 2018 09:35:56 +0000 (11:35 +0200)]
Relax LazyDataObject.augmentations() implementation

We use double-checked locking to guard against concurrent
initialization of cachedAugmentations. While this ensures we do
not do the same work twice, it is a bit costly for the typical
case when the augmentations field is accessed once.

During the first call, we perform:
- a volatile read
- a lock acquire
- a volatile read
- compute the value (exclusive)
- a volatile write
- a lock release

Rather than doing that, allow the value to be computed concurrently
and use compare-and-swap to initialize it. Hence for the first call
we perform:
- a volatile read
- compute the value (concurrent)
- a compare-and-set

In case of concurrent initialization, all threads will compute
the value, but all except the first one will issue another volatile
read and throw their work away.

JIRA: MDSAL-377
Change-Id: I1dbf9c4e60cf9800720eea31bd9de936b1dae5aa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 6379e438ee4c8496c7d71865b1a29409dcd06d7b)

5 years agoBuilder should acquire augmentations only once 65/76965/2
Robert Varga [Sat, 13 Oct 2018 08:28:34 +0000 (10:28 +0200)]
Builder should acquire augmentations only once

While generated DataObjects have this method simple, LazyDataObject
constructs the map lazily and caches it -- hence additional access
is forcing an additional volatile read.

Therefore instead of invoking augmentations() twice, store its
result in a local variable and reuse that.

Change-Id: Ifbe2002bb7edbd253d65b5bdc1e53c4d687bed32
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoOptimize AbstractBuilderTemplate key property sort 62/76962/1
Robert Varga [Sat, 13 Oct 2018 08:54:39 +0000 (10:54 +0200)]
Optimize AbstractBuilderTemplate key property sort

Rather than using a lambda for each comparison, create a constant
Comparator and reuse it.

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

5 years agoUse ArrayList.sort() instead of Collections.sort() 61/76961/1
Robert Varga [Sat, 13 Oct 2018 08:38:32 +0000 (10:38 +0200)]
Use ArrayList.sort() instead of Collections.sort()

We do not need Collections, as we have Java 8 and hence can
directly use List.sort(). This has the side-effect of
short-circuiting to ArrayList's implementation.

Change-Id: If978265242275014c586fcf92d96d5ba09bb7bca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFixup javassist class use #2 40/76940/2
Robert Varga [Fri, 12 Oct 2018 14:14:31 +0000 (16:14 +0200)]
Fixup javassist class use #2

Somehow Ib19477ece9e76b735285df3b553ca9504579f8c9 got munged
in Fluorine release train. This patch fixes it up.

Change-Id: I3f14edd27539fea03006a4c98d2f49c10099ed20
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix infinite recursion in ForwardingWriteTransaction 35/76935/1
Stephen Kitt [Thu, 11 Oct 2018 13:44:52 +0000 (15:44 +0200)]
Fix infinite recursion in ForwardingWriteTransaction

put() calls itself instead of delegating. This patch fixes that.

Change-Id: I4d42bbae0952e12f17ddfd46ad08cf06e746cf70
Signed-off-by: Stephen Kitt <skitt@redhat.com>
(cherry picked from commit ab8addc791ca009a381e54c6d6344695052afe37)

5 years agoSeparate out builder/impl copy generators 66/76866/1
Robert Varga [Wed, 10 Oct 2018 17:43:41 +0000 (19:43 +0200)]
Separate out builder/impl copy generators

Builders are taking an immutable implementation of target type,
hence for list entries they can rely on the key to be present and
do not have to check it. Implementations need to account
for the builder key being set to null, hence they need to
instantiate the key themselves.

This patch separates the two code paths, so both cases are properly
expressed in the object hierarchy. This allows us to simplify
the abstract template, removing weird boolean-based decisions.

We also promote implementation constructor to package-visible, which
allows javac to skip generation of synthetic accessor.

We further optimize the template output by capturing importedNames
when they are reused -- leading to xtend generating cleaner Java code.

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

5 years agoMake sure we compare key members via their property name 53/76653/1
Robert Varga [Thu, 4 Oct 2018 15:17:42 +0000 (17:17 +0200)]
Make sure we compare key members via their property name

As it turns out, simple comparison ignoring cases does not correctly
work if the schema is using CamelCase. We need to do the hard work of
deriving Binding property name and sort on that to be consistent with
what the codegen does.

JIRA: MDSAL-355
Change-Id: I34cdb032fbdeb093e2973b91c5011e302e6280bc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate conceptual-data-tree to RST 53/75453/2
Thanh Ha [Fri, 17 Aug 2018 17:39:36 +0000 (13:39 -0400)]
Migrate conceptual-data-tree to RST

Change-Id: Ic3c417a1f985055b0a80e3162940480c674d4712
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
(cherry picked from commit e954c42ed4def1ff1326986d088f1a533311cb95)

5 years agoSet Fluorine branch version to Fluorine for RTD 87/75287/2
Thanh Ha [Sat, 18 Aug 2018 02:47:54 +0000 (22:47 -0400)]
Set Fluorine branch version to Fluorine for RTD

Change-Id: I701e987b19a2e909f1d597fe251cf5ec1146d5d6
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoRemove AsciiDoc documentation 54/75454/2
Thanh Ha [Fri, 17 Aug 2018 18:15:45 +0000 (14:15 -0400)]
Remove AsciiDoc documentation

Completed migrating these files to RST so remove the
AsciiDoc copy.

Change-Id: I92862e9bb3cd7e0d1263627da47a753319fb68dd
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
(cherry picked from commit c9e3d948110213fb7777345e50ebf3d3c9c0dd6c)

5 years agoFix KeyedListAction serialization 81/76081/8
Jakub Tóth [Fri, 14 Sep 2018 08:44:14 +0000 (10:44 +0200)]
Fix KeyedListAction serialization

SchemaRootCodecContext needs to understand both Action and
KeyedListAction, as their parameterizations differ.

JIRA: MDSAL-371
Change-Id: I405a73b1a8ca8801ae1786be704cefe674c5fb72
Signed-off-by: Jakub Tóth <jakub.toth@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump yangtools to 2.0.11 36/76136/2
Robert Varga [Mon, 17 Sep 2018 08:58:25 +0000 (10:58 +0200)]
Bump yangtools to 2.0.11

This brings in latest fixes.

Change-Id: If33433d57695e584f4aa114213251ed0cbbd7bfa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMDSAL-370: expose LogicalDatastoreType-aware constructor 02/76202/2
Robert Varga [Tue, 18 Sep 2018 08:30:13 +0000 (10:30 +0200)]
MDSAL-370: expose LogicalDatastoreType-aware constructor

This exposes the constructors needed to customize the underlying
data tree instances -- both through direct configuration and via
LogicalDatastoreType.

Change-Id: I056d74f4059cca792aa49e5463570b35e1d0005a
JIRA: MDSAL-370
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFixup javassist class use 92/75092/2
Robert Varga [Fri, 10 Aug 2018 08:51:45 +0000 (10:51 +0200)]
Fixup javassist class use

We need to cast the returned class, as the Javassist API no longer
does so.

Change-Id: Ib19477ece9e76b735285df3b553ca9504579f8c9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoActivate BUG-6135 test 89/75089/2
Robert Varga [Wed, 8 Aug 2018 09:10:46 +0000 (11:10 +0200)]
Activate BUG-6135 test

The underlying bug was fixed long time ago, but the corresponding
test was not activated. Fix that.

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

5 years agoFix set schema context to action routing table 15/75315/2
Jie Han [Fri, 17 Aug 2018 08:46:44 +0000 (16:46 +0800)]
Fix set schema context to action routing table

Change-Id: I33b400f05a0fafa01f64f64c599e457257f3ae02
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit 05c28017d6c7613375abbed637a4063c88751f1e)

5 years agoBump versions by x.y.(z+1) 83/75583/1
jenkins-releng [Thu, 30 Aug 2018 16:51:20 +0000 (16:51 +0000)]
Bump versions by x.y.(z+1)

Change-Id: I9d6e2da7ef180ea46476e708c93855cd026f18b1
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
5 years agoRework ClusterSingletonServiceGroupImpl locking 69/75169/17
Robert Varga [Wed, 25 Jul 2018 12:16:29 +0000 (14:16 +0200)]
Rework ClusterSingletonServiceGroupImpl locking

The problem we are are seeing is a classic AB/BA deadlock, hence
we need to change how serviceGroup is handled. This patch reworks
ClusterSingletonServiceGroupImpl to separate state tracking from
service startup/shutdown mechanics.

State locking is separated out into three domains:
- entity state, guarded by ClusterSingletonServiceGroupImpl object
- service membership, tracked in a ConcurrentMap
- service instantiation, guarded by a simple CAS-based lock

Furthermore anytime state changes, we mark this fact in a volatile
variable. Whenever we observe dirty state, we attempt to reconcile
it -- if we can also acquire the service instantiation lock.

Each registered service is tracked separately, so we do not have
to have wholesale aggregator futures for stopping services and can
also start newcomer services without causing weird state tracking
disruptions.

Splitting state tracking and service instantiation leads to faster
group shutdown, because when a group is being closed we know we can
unregister the service entity irrespective of the state of user
services. Unit tests, especially asynchronous, are updated to account
for this accelerated shutdown procedure.

This has the benefit of improving inter-node failover latency,
because the process of user service shutdown and service entity
unregistration runs concurrently. That leads to lower likelihood
of the new service entity owner having to block on becoming
the cleanup entity owner, as services which shut down quickly
will have released the cleanup entity by the time the new owner
is selected.

JIRA: MDSAL-362
Change-Id: I7cd82f81da9135591e4242a196cc0f06a78973a1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix enumeration leafref lookup 24/75024/1
Robert Varga [Mon, 30 Jul 2018 07:40:05 +0000 (09:40 +0200)]
Fix enumeration leafref lookup

Leafref lookup for straight uses of enumeration typedefs seems
to be failing. The code in question seems to rely on weird assumptions,
hence this patch places a FIXME and turns an alternative branch
into a fallback if the weird code fails to find a definition.

This also activates ietf-hardware models.

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

5 years agoUpdate .gitreview to stable/fluorine 76/74976/1
Anil Belur [Thu, 9 Aug 2018 12:12:25 +0000 (17:42 +0530)]
Update .gitreview to stable/fluorine

Change-Id: I6afe87ca4a96cff5e47cac0a2da007ff47fcfd94
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
5 years agoAdd ietf-hardware model 13/74613/13
Robert Varga [Sat, 28 Jul 2018 17:48:51 +0000 (19:48 +0200)]
Add ietf-hardware model

This adds ietf-hardware model, updating previously-defined features.
Unfortunately, this does not wuite work yet, as MDSAL-352 needs to
be fixed.

Change-Id: I6ce999e20cca870e043e42da42f264d9242dc872
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate Architecture doc to RTD 10/74710/3
Thanh Ha [Wed, 1 Aug 2018 01:34:53 +0000 (21:34 -0400)]
Migrate Architecture doc to RTD

Change-Id: Ibed073a93ed1fc660a3b6ea36a608e76d9cc8b1e
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoMigrate overview page to RTD 09/74709/2
Thanh Ha [Wed, 1 Aug 2018 01:18:19 +0000 (21:18 -0400)]
Migrate overview page to RTD

Change-Id: I04278ca050c73785929e38451cafb01609fe1601
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoMDSAL-320 Mapping type collisions between yang built-in uint* and int* 33/70633/5
Jie Han [Mon, 9 Apr 2018 01:06:25 +0000 (09:06 +0800)]
MDSAL-320 Mapping type collisions between yang built-in uint* and int*

- Use yang.commom.Uint* instead of java primitive types
  and fix up the correlative UT.

- Add Uint*RangeGenerators, temporarily hard code
  min and max values which would better be provided
  by yang.common.Uint*.

Change-Id: Ieaa04c36f4f8a148cdf9740cdf544283fbecc4a8
Signed-off-by: Jie Han <han.jie@zte.com.cn>
5 years agoBump yangtools to 2.0.10 85/74885/4
Robert Varga [Mon, 6 Aug 2018 15:49:05 +0000 (17:49 +0200)]
Bump yangtools to 2.0.10

This fixes an issue with actions, hence we need it in Fluorine.

Change-Id: I557bc824fdbe3d957a36caada17428e10fd2ab24
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAvoid depending on immutables.value at runtime 88/74888/1
Robert Varga [Mon, 6 Aug 2018 16:46:57 +0000 (18:46 +0200)]
Avoid depending on immutables.value at runtime

Change-Id: Ia257d8d30cf51333a30b1244f1cd56886a7569de
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd DOMAction(Provider)Service facades 10/74210/19
Robert Varga [Wed, 18 Jul 2018 16:36:33 +0000 (18:36 +0200)]
Add DOMAction(Provider)Service facades

DOMRpcRouter needs to be able to route actions, i.e. implement
DOMActionService and DOMActionProviderService. Add facades
and implement them.

Change-Id: I9f66f3aee5ab5b63c2d0dcb3571831a7913a4650
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix raw type warnings and null safety errors 39/74839/1
Robert Varga [Mon, 6 Aug 2018 08:44:48 +0000 (10:44 +0200)]
Fix raw type warnings and null safety errors

This fixes up warnings.

Change-Id: Ib46adb83ea76cb0c2e62d9976e87d0d81b7275be
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove MappingCheckedFuture 25/74825/2
Robert Varga [Sat, 4 Aug 2018 00:56:15 +0000 (02:56 +0200)]
Remove MappingCheckedFuture

This class has been moved to controller.

Change-Id: Ib98d2d7c05d16ce66431ef7cb311a571f75e09e0
JIRA: MDSAL-229
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDeprecate MappingCheckedFuture 24/74824/2
Robert Varga [Sat, 4 Aug 2018 00:55:20 +0000 (02:55 +0200)]
Deprecate MappingCheckedFuture

CheckedFutures are not used anywhere in MD-SAL, this class is moved
to Controller.

JIRA: MDSAL-229
Change-Id: I5ce538edca4c902cc38b8aad0457927563f2f8b8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRevert 4cc8455a7232d6833ba88911ad5c45a77ddda3dc 23/74823/1
Robert Varga [Sat, 4 Aug 2018 00:48:39 +0000 (02:48 +0200)]
Revert 4cc8455a7232d6833ba88911ad5c45a77ddda3dc

String utilities are not useful, as the functionality is provided
by generated code -- stringValue() does it for all unions.

Change-Id: I5f93d17d89601ceaa91e176a5f119d5c08e75d5f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoGet rid of CheckedFutures 22/74822/2
Robert Varga [Sat, 4 Aug 2018 00:07:58 +0000 (02:07 +0200)]
Get rid of CheckedFutures

We do not really need them, so let's replace them where we can.

Change-Id: I06dd05d60018a814fb0610096aa8fe5709669980
JIRA: MDSAL-229
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd DOMActionRoutingTable and DOMActionRoutingTableEntry 74/74374/13
Jie Han [Tue, 24 Jul 2018 08:43:55 +0000 (16:43 +0800)]
Add DOMActionRoutingTable and DOMActionRoutingTableEntry

- Split out AbstractDOMRoutingTable and AbstractDOMRoutingTableEntry
- Provide Action routing table and entry

Change-Id: I6606b2b280344e52d58fb7b6fbec0e76231c2786
Signed-off-by: Jie Han <han.jie@zte.com.cn>
5 years agoinc. BindingRuntimeContext details in "Schema .. is not available" 20/73320/6
Michael Vorburger [Thu, 21 Jun 2018 15:56:40 +0000 (17:56 +0200)]
inc. BindingRuntimeContext details in "Schema .. is not available"

but in a debug log, not the IllegalStateException, because it's huge.

JIRA: MDSAL-354
Change-Id: I65c236fc3b675e7cf231cc1d8cdc56fc36131281
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
5 years agoRemove AbstractDOMRpcRoutingTableEntry.invokeRpc 24/74624/2
Jie Han [Mon, 30 Jul 2018 06:20:07 +0000 (14:20 +0800)]
Remove AbstractDOMRpcRoutingTableEntry.invokeRpc

Make routing entry not directly tied to invocation model and
add an inner static class RpcInvocation in DOMRpcRouter
to be used to invoke rpc with routing entries.

Change-Id: I55fa669bff8a18eb182a579b9dd636294d54e460
Signed-off-by: Jie Han <han.jie@zte.com.cn>
5 years agoExpose Action(Provider)ServiceAdapter 28/74628/1
Robert Varga [Mon, 30 Jul 2018 08:44:33 +0000 (10:44 +0200)]
Expose Action(Provider)ServiceAdapter

Allow controller reuse of these adapters, as it is defining only
a shim on top of the baselines.

Change-Id: I49c9b5bda5e2d49c6fbbe839181b8a7e4d3f8d20
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd iana-hardware and odl-mdsal-model-rfc8348 12/74612/3
Robert Varga [Sat, 28 Jul 2018 17:37:45 +0000 (19:37 +0200)]
Add iana-hardware and odl-mdsal-model-rfc8348

This starts the addition of {iana,ietf}-hardware models.

Change-Id: I586be5c181c2504ddb30c52888b38028850e79e6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoClean up BaseTemplate 99/74599/3
Robert Varga [Fri, 27 Jul 2018 22:08:51 +0000 (00:08 +0200)]
Clean up BaseTemplate

Move logic dispatch methods into JavaFileTemplate, where we can
write the same thing in Java. Also makes a few methods static.

Change-Id: I3ac8c16b5378d0420dcb37c31265f06a5f7770a2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRework inlined union generation 82/71682/8
Robert Varga [Fri, 27 Jul 2018 19:32:04 +0000 (21:32 +0200)]
Rework inlined union generation

Unions internal to a leaf union end up being incompletely generated,
as they lack stringValue(), hashCode(), equals() and do not correctly
bind to its enclosing builder -- leading to a generated code not being
compilable.

There are multiple issues here, all of which are addressed in this patch:
- hashCode/equals properties are created in the wrong place
- property return type is set to the builder, not its product
- union builder type is not set as a union
- builders for nested types are not correctly emitted
- Class/InterfaceTemplate use different logic to emit the inner classes

JIRA: MDSAL-320
Change-Id: I626fb4ac42ae6528bc98b809bc33756e8daa08b9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoWire Action(Provider)Service into mountpoints 00/74600/2
Robert Varga [Fri, 27 Jul 2018 22:57:06 +0000 (00:57 +0200)]
Wire Action(Provider)Service into mountpoints

We need to wire the two adapters so they can be exposed to binding
world from DOM mountpoints.

Change-Id: I63e68b0c7ebfeae2a3fbba64b171196ee9c8e8ff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd ActionProviderService adapter 65/74065/13
Robert Varga [Mon, 16 Jul 2018 12:41:01 +0000 (14:41 +0200)]
Add ActionProviderService adapter

A mostly straightforward implementation of ActionProviderService on top
of a DOMOperationProviderService.

Change-Id: I50b7f2d7b03059088be9ba277999c11bc085b385
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoSimplify DOMOperationService API 96/74596/6
Robert Varga [Fri, 27 Jul 2018 20:53:31 +0000 (22:53 +0200)]
Simplify DOMOperationService API

With DOMRpcService API being cleaned up to use FluentFuture, there
is no need for us to duplicate the API. Introduce a simplistic
DOMActionService API and port all users.

JIRA: MDSAL-283
Change-Id: Id59cd3a8c910dbd79aac87cc6777e8f9d108a749
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd forwarding transactions to binding v1 89/74289/7
Stephen Kitt [Mon, 23 Jul 2018 10:57:25 +0000 (12:57 +0200)]
Add forwarding transactions to binding v1

This ports the forwarding transactions from controller.

Change-Id: I1c1ce1a340424e8fb3f86d7b92fa53d1d623de00
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoPull in correct version of yangtools 98/74598/1
Robert Varga [Fri, 27 Jul 2018 21:21:06 +0000 (23:21 +0200)]
Pull in correct version of yangtools

These are new artifacts, they need bumped versions.

Change-Id: I170a9e99dfdaf63a4959dc3ce9f1c2caa8662da6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd forwarding transactions to binding v2 92/74292/7
Stephen Kitt [Fri, 20 Jul 2018 14:08:17 +0000 (16:08 +0200)]
Add forwarding transactions to binding v2

This ports the forwarding transactions from controller.
WriteTransaction::delete is removed to allow WriteTransaction to be
implemented outside its package (it conflicts with
AsyncWriteTransaction::delete).

Change-Id: I7b8c0454b788ef1c5857c7f546005dcd0b4c12a6
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoSimplify code using Java 8 features 88/74588/2
Stephen Kitt [Fri, 27 Jul 2018 15:26:11 +0000 (17:26 +0200)]
Simplify code using Java 8 features

* lambda expressions
* method references
* ThreadLocal::withInitial
* Comparator::comparing
* List::sort
* Map::computeIfAbsent

Change-Id: Ia1eee88a49fe3cb7f07bd90cdaa481ecd5c10003
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoBump yangtools to 2.0.9 75/74575/1
Robert Varga [Fri, 27 Jul 2018 12:10:13 +0000 (14:10 +0200)]
Bump yangtools to 2.0.9

This patch bumps yangtools to latest release.

Change-Id: I61e0f6549cf21b56bfc5b9c96860b5492c719311
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd RFC8349 models 52/74552/15
Robert Varga [Thu, 26 Jul 2018 22:16:39 +0000 (00:16 +0200)]
Add RFC8349 models

This adds  ietf-routing, ietf-ipv4-unicast-routing and
ietf-ipv6-unicast-routing.

JIRA: MDSAL-332
Change-Id: I3bda7f14c617ed1af1b505d1f8511c0bfe31f8a0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDetect and repair identity/grouping/typedef conflicts 54/74554/10
Robert Varga [Thu, 26 Jul 2018 23:17:26 +0000 (01:17 +0200)]
Detect and repair identity/grouping/typedef conflicts

We are mapping four distinct YANG namespaces onto a single Java
namespace, which is bound to cause conflicts.

Define a hierarchy of priorities (data, typedef, grouping, identity)
and rename types when a conflict is detected.

JIRA: MDSAL-332
Change-Id: I8f6e5987b2057fba5b7d1534c7688725547a146c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove TypeProviderImpl 60/74560/1
Robert Varga [Fri, 27 Jul 2018 09:25:14 +0000 (11:25 +0200)]
Remove TypeProviderImpl

This compatibility class is no longer used, remove it.

Change-Id: I408828da2ce1783203a55f98f43bbf4a24c0633a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix actions in keyed lists 55/74555/6
Robert Varga [Fri, 27 Jul 2018 01:10:33 +0000 (03:10 +0200)]
Fix actions in keyed lists

When we encounter a keyed list we end up generating an action for
the key, not for the list, which leads to a compilation error.

Change-Id: Iad9a5b449778704a3209d43011060f4a7942b9a6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoCorrect test name 53/74553/2
Robert Varga [Thu, 26 Jul 2018 23:20:52 +0000 (01:20 +0200)]
Correct test name

mdsal269 -> mdsal161

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