mdsal.git
3 years agoDataBrokerTestModule getBindingToNormalizedNodeCodec() & Co. 68/90068/2
Michael Vorburger [Thu, 18 Jan 2018 02:15:23 +0000 (03:15 +0100)]
DataBrokerTestModule getBindingToNormalizedNodeCodec() & Co.

need these exposed for a new standalone component style test  I'm on

JIRA: MDSAL-556
Change-Id: I5efd3a6e507d46d035067a561aaca7c2f80f51e6
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBug 8163: getDataTreeChangeListenerExecutor() & DataBrokerTestModule 66/90066/1
Michael Vorburger [Thu, 13 Jul 2017 21:17:24 +0000 (02:47 +0530)]
Bug 8163: getDataTreeChangeListenerExecutor() & DataBrokerTestModule

Adjust AbstractDataBrokerTestCustomizer with a
getDataTreeChangeListenerExecutor() instead of a
setDataTreeChangeListenerExecutor(), just for more consistency with the
existing getCommitCoordinatorExecutor() method.  Also less confusing (to
me) than seeing the private Executor set by default which may get
changed by the setter later.

Adjust ConcurrentDataBrokerTestCustomizer with the
useMTDataTreeChangeListenerExecutor as a constructor argument, instead
of an useMTDataTreeChangeListenerExecutor() method, just for consistency
for how you already have it in AbstractConcurrentDataBrokerTest.

Extend ConstantSchemaAbstractDataBrokerTest and DataBrokerTestModule to
allow passing through this new opt-in tweak flag, so that tests in
downstream projects such as genius and netvirt can staring exploring
enabling this.

JIRA: MDSAL-556
Change-Id: I4ad85ac48163d2f4bac865f46a3b047d5b7d333a
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAbstractConcurrentDataBrokerTest @deprecate-s the AbstractDataBrokerTest 65/90065/1
Michael Vorburger [Mon, 6 Feb 2017 23:23:31 +0000 (00:23 +0100)]
AbstractConcurrentDataBrokerTest @deprecate-s the AbstractDataBrokerTest

This is take #2 on a similar earlier attempt which made the same change
directly in AbstractDataBrokerTest, which broke some downstrean tests,
which were BADLY WRITTEN (!) because the assumed single threaded direct
execution (which DataBroker does not guarantee).

https://bugs.opendaylight.org/show_bug.cgi?id=7538 has full background

JIRA: MDSAL-556
Change-Id: I05ac3525bdcf1ab9c99dfa15b98e090848d0fddc
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAbstractDataBrokerTestTest which actually does something 62/90062/6
Michael Vorburger [Wed, 5 Oct 2016 16:22:25 +0000 (18:22 +0200)]
AbstractDataBrokerTestTest which actually does something

Incl. verification that each @Test cleans up after itself.  We had a
suspicion that this didn't work; it turns out that it actually does and
we had another problem somewhere else.  Contributing this test still
seems useful for future non-regression.

JIRA: MDSAL-556
Change-Id: I295ebde45a0c030ab74852788b45203cdf6639e0
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoDataBrokerTestModule: use AbstractDataBrokerTest without inheritance 61/90061/5
Michael Vorburger [Wed, 10 Aug 2016 15:22:30 +0000 (17:22 +0200)]
DataBrokerTestModule: use AbstractDataBrokerTest without inheritance

While starting to write JUnit tests (for functional components) with the
AbstractDataBrokerTest, I found myself not liking its design which
forces one to use a class SomeTest extends AbstractDataBrokerTest...

Modern JUnit tests should be written by composition, not enforced
inheritance.  Thus this new DataBrokerTestModule allows one to obtain a
DataBroker suitable for Tests from anywhere.

The *(Test)Module naming convention is obviously inspired by a DI point
of view (think Spring Framework's @Configuration classes, or Google
Guice or Dagger (yay!) *Module classes - which is exactly what this
really is - a particular way to obtain an instance of an
implementationof some service (here a DataBroker) in a certain
environment (here for tests).

The internal implementation of DataBrokerTestModule could be changed
later; I guess ideally what's in AbstractDataBrokerTest could go into
DataBrokerTestModule and AbstractDataBrokerTest could use it, but for
now I'm too lazy to change that, as this does the trick nicely.  Later
implementation changes would be transparent to users of
DataBrokerTestModule.

JIRA: MDSAL-556
Change-Id: I9641f527bbc0cb92732f2e513cdd64cc6a837200
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix SnapshotBackedWriteTransaction error message 54/89954/1
Robert Varga [Tue, 26 May 2020 11:15:42 +0000 (13:15 +0200)]
Fix SnapshotBackedWriteTransaction error message

The message is misleading, as we are not performing a write, but
a merge operation.

Change-Id: I8b61ac7b0bf5f3ae746a2b6c1883a02e6fe61e47
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoDo not use raw superclass for CodecDataObject instances 98/81998/9
Robert Varga [Sat, 11 May 2019 09:47:38 +0000 (11:47 +0200)]
Do not use raw superclass for CodecDataObject instances

We can improve generated class accuracy by specifying generic type
argument of CodecDataObject, thus making generated classes look
not like raw subclasses.

JIRA: MDSAL-550
Change-Id: If0581ea7186793539c9bc149c5e62c6db906616b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd test-sources for mdsal-binding-dom-adapter 64/89664/1
Robert Varga [Mon, 11 May 2020 15:58:41 +0000 (17:58 +0200)]
Add test-sources for mdsal-binding-dom-adapter

We are (unwisely) constructing a test-jar here, hence we should
also be publishing the corresponding sources.

Change-Id: I08ffb23b1e5eb8036e16237b8bc6fb0c6480f848
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd lazily-instantiated maps 88/89588/26
Robert Varga [Mon, 4 May 2020 12:34:27 +0000 (14:34 +0200)]
Add lazily-instantiated maps

Instantiating an ImmutableMap on each access is quite wasteful,
as there are a number of cases where we do not need the entire
mapping to be instantiated.

Typical uses touch the Map only once -- either to lookup a value
based on the key, or to iterate through the values. Others are
possible, but those two cover most of the patterns.

We add the prerequisite indirection and two implementations to
support each of the cases. The iterator part is optimized to
perform lazy object instantiation -- similar to LazyBindingList.

The lookup part works in a rather similar way, except it keeps
a lookup ConcurrentHashMap as the primary storage and values
are seen as expendable secondary storage. This makes iteration
order unstable, which might be seen as a violation of immutable
contract -- but our contract is a Map and mappings remain stable.

JIRA: MDSAL-539
Change-Id: I7c095065915f3c0d7b180d4aa1494e15d6374a11
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd lazily-instantiated lists 08/89608/14
Robert Varga [Tue, 5 May 2020 20:03:26 +0000 (22:03 +0200)]
Add lazily-instantiated lists

Lists are usually searched linearly. For large lists we can end
up instantiating a large number of items upfront, some of which is
wasteful.

The cutoff point can be configured via a JVM property, which is
interpreted as a dynamic constant.

JIRA: MDSAL-551
Change-Id: I9e7c987929481143b931e763f4ef0313745a5c89
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoGuarantee non-null in CodecDataObject.codecKey() 89/89589/2
Robert Varga [Mon, 4 May 2020 13:49:50 +0000 (15:49 +0200)]
Guarantee non-null in CodecDataObject.codecKey()

The key loaded is guaranteed to be non-null, propagate that
annotation outwards.

Change-Id: If6bf3f4a7d5cabd760da603abb9038bb1e665b37
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoEliminate KeyedListNodeCodecContext.Unordered.getKey() 87/89587/2
Robert Varga [Mon, 4 May 2020 12:40:40 +0000 (14:40 +0200)]
Eliminate KeyedListNodeCodecContext.Unordered.getKey()

This method and the methodhandle invoker are completely superfluous,
as we can directly access key() from the created object. While capturing
a MethodHandle lowers what method can be invoked, it does not really
buy us much, as the observed class will we always the same.

That property is visible enough (wired through an invokeExact() on the
constructor), hence JIT should be able to optimize without this help.

Change-Id: Id24eac8e74782f750576c90d60485b2dcbdcff9e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoTake advantage of MapNode.size() 85/89585/2
Robert Varga [Mon, 4 May 2020 11:17:34 +0000 (13:17 +0200)]
Take advantage of MapNode.size()

Checking the size allows us to skip instantiating values, plus we
can pass it down to map construction, where a correct strategy
can be taken based on the size.

JIRA: MDSAL-539
Change-Id: Ib42e290571cf162150b6e94b24df4aca5a9762ff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove semicolons in comments 26/89526/2
Robert Varga [Thu, 30 Apr 2020 07:31:29 +0000 (09:31 +0200)]
Remove semicolons in comments

sonarcloud insists this is commented-out code, which it is for
documentation purposes. Eliminating the trailing semicolon fools
it just enough to not notice.

Change-Id: I0546beb3b7584e426c2470c95bd4e8c177617bde
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd InstanceIdentifier.verifyTarget() 73/89573/3
Robert Varga [Sun, 3 May 2020 08:04:18 +0000 (10:04 +0200)]
Add InstanceIdentifier.verifyTarget()

There are a number of places where users are casting InstanceIdentifiers,
just to restore type-safety after a type-unsafe operation, such as
going through serialization. Add InstanceIdentifier.verifyTarget(),
which restores type safety.

Change-Id: I2bfa69eb938b4a6b86b88e4054369b3abadf7c7d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd odl-mdsal-trace artifact declaration 94/89494/3
Robert Varga [Tue, 28 Apr 2020 16:23:01 +0000 (18:23 +0200)]
Add odl-mdsal-trace artifact declaration

Since controller was encroaching on this space and its version
did cover our functionality this was never packaged. Now that
controller does not package it, we need to do that ourselves.

JIRA: MDSAL-547
Change-Id: I38faf8cb9da554357b134c8a37fa9b6affe4f9b7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd datastore benchmark 57/89457/2
Robert Varga [Mon, 27 Apr 2020 19:14:57 +0000 (21:14 +0200)]
Add datastore benchmark

Change-Id: I2e5b1589805ddf9feae4d54667e60483a6c16530
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoImprove notification delivery defensiveness 42/89442/4
Robert Varga [Mon, 27 Apr 2020 11:45:28 +0000 (13:45 +0200)]
Improve notification delivery defensiveness

If a listener throws an exception, make sure to log it and proceed
as if nothing happened.

JIRA: MDSAL-544
Change-Id: I0ca54bb5c517115b840ad03ea24d442c7762ff05
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix unsubscribe checks in DOMNotificationRouterEvent 41/89441/3
Robert Varga [Mon, 27 Apr 2020 11:42:12 +0000 (13:42 +0200)]
Fix unsubscribe checks in DOMNotificationRouterEvent

The checks here are based on old assumption that the listener
would be set to null, which does not hold true for quite some
time. Update the check to close a simple race.

JIRA: MDSAL-545
Change-Id: I950ffcbcf732d4c24dcad675b81c2889465d9045
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump versions to 6.0.1-SNAPSHOT 72/89272/11
Robert Varga [Wed, 22 Apr 2020 18:34:49 +0000 (20:34 +0200)]
Bump versions to 6.0.1-SNAPSHOT

This starts the next development iteration.

Change-Id: I047dbba41739424eaeca008143fbe8ed7e466daf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAllow DOMMountPoint to not have a model context 97/89397/2
Robert Varga [Sun, 26 Apr 2020 13:50:17 +0000 (15:50 +0200)]
Allow DOMMountPoint to not have a model context

We need to allow mount points without a context, as that is what
NETCONF requires for now.

JIRA: MDSAL-435
Change-Id: Ia74bc3416162663e67003486cf67f3cfac46e340
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRevert "Remove deprecated uint migration elements" 96/89396/1
Robert Varga [Sun, 26 Apr 2020 13:06:09 +0000 (15:06 +0200)]
Revert "Remove deprecated uint migration elements"

This reverts commit 1382c1d88b753e152ff26eae1091cd42e5aba76b,
reinstating generation of compatibility elements.

JIRA: MDSAL-490
Change-Id: Ia59eb16f3f0e534ce7339c46c24fc4d0b22d6f05
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump to yangtools-5.0.1 25/89325/2
Robert Varga [Thu, 23 Apr 2020 15:39:25 +0000 (17:39 +0200)]
Bump to yangtools-5.0.1

We need further changes to tie together netconf and us.

Change-Id: Ia3668c7a79221f060159696c5554ef1c21e38782
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRevert "Update RPC invocation to take ContainerNode" 24/89324/1
Robert Varga [Thu, 23 Apr 2020 18:24:27 +0000 (20:24 +0200)]
Revert "Update RPC invocation to take ContainerNode"

This reverts commit f77a6182a4af3150fac68911cc98d0259342136d, as
we cannot tolerate ContainerNode in arguments either, due to how
netconf is implemented.

JIRA: MDSAL-303
Change-Id: Ib176d71aebcb85da36a65f3048cfef32e474bcd4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRevert "Turn DOMRpcResult's result back to NormalizedNode" 23/89323/1
Robert Varga [Thu, 23 Apr 2020 18:23:56 +0000 (20:23 +0200)]
Revert "Turn DOMRpcResult's result back to NormalizedNode"

This reverts commit db7aba121dd8f6b4ee793325a31d91e28e0185d3, as
we are backing things out.

JIRA: MDSAL-303
Change-Id: Iaa0842f1c6ce16e401595f21ad14bc547705f6eb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoTurn DOMRpcResult's result back to NormalizedNode 18/89318/1
Robert Varga [Thu, 23 Apr 2020 14:17:13 +0000 (16:17 +0200)]
Turn DOMRpcResult's result back to NormalizedNode

Eventhough we really want to have ContainerNode here, NETCONF
is utterly misusing normalization to tunnel AnyXmlNode here.

Revert the change donewwwe have done, so that it continues to
work.

JIRA: MDSAL-303
Change-Id: Ie675609fe4dc5e77e1f4e8ee2ea471a9f1d3d87b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCatch nulls in RpcServiceAdapter 02/89302/5
Robert Varga [Thu, 23 Apr 2020 06:39:32 +0000 (08:39 +0200)]
Catch nulls in RpcServiceAdapter

Binding/DOM invocation should not tolerate null input, make sure
we stop such attempts early.

JIRA: MDSAL-303
Change-Id: I2ca04b820154768b50b2353b1f99e48c31484035
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCleanup BindingRuntimeHelpers 10/89310/4
Robert Varga [Thu, 23 Apr 2020 11:38:04 +0000 (13:38 +0200)]
Cleanup BindingRuntimeHelpers

We need to differentiate between testing (static context) and dynamic
contexts. This makes it possible to use these helpers in OSGi if we
inject the right set of services.

Change-Id: Ibc22b1597320956408217b98d44c9ea3fdd98c32
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoGenerate legacy List adaptation 09/89309/3
Robert Varga [Thu, 23 Apr 2020 10:50:53 +0000 (12:50 +0200)]
Generate legacy List adaptation

In order to lower the pain of migration, generate legacy setFoo()
methods with List argument. These internally perform translation
to an ImmutableMap with unique index.

JIRA: MDSAL-434
Change-Id: If364c50a1f48d94b72520c674cbd033fe53646a8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFurther deprecate addAugmentation() 08/89308/2
Robert Varga [Thu, 23 Apr 2020 10:31:54 +0000 (12:31 +0200)]
Further deprecate addAugmentation()

We want to remove this method in next major release. Make sure
its deprecated for removal.

JIRA: MDSAL-183
Change-Id: I8d76a1eeab07e9fd40f6d970be391dbf3b26f542
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove AbstractBindingRuntimeContext.toString() 06/89306/2
Robert Varga [Thu, 23 Apr 2020 09:08:31 +0000 (11:08 +0200)]
Remove AbstractBindingRuntimeContext.toString()

BindingRuntimeTypes can have a huge string representation, which
hurts when combined with a subclass of it being present in OSGi SR
and bundle-diag printing out services.

Change-Id: I38a95c6283454930674f5d6311829d7450559f0c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUpdate RPC invocation to take ContainerNode 96/89296/2
Robert Varga [Thu, 23 Apr 2020 00:07:59 +0000 (02:07 +0200)]
Update RPC invocation to take ContainerNode

Our acceptance of NormalizedNode here is misleading, we should be
taking a ContainerNode, just as actions do.

Change-Id: I1c24a24a8f42decd4a000b01805b51913fe05bf2
JIRA: MDSAL-303
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoOSGiDOMSchemaService should provide YANG sources 97/89297/2
Robert Varga [Thu, 23 Apr 2020 00:19:17 +0000 (02:19 +0200)]
OSGiDOMSchemaService should provide YANG sources

This was caught in downstream integration: the refactor here
forgo to add routing towards YANG source.

JIRA: MDSAL-392
Change-Id: I27b792eb932c68c89aeab21c69f7338ecb68d73b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUpdate BindingRuntime{Context,Generator,Types} 94/89294/5
Robert Varga [Wed, 22 Apr 2020 22:13:54 +0000 (00:13 +0200)]
Update BindingRuntime{Context,Generator,Types}

These interfaces should be operating on EffectiveModelContext to
provide smooth transition to downstreams. Fix that, along with
implementation and tests.

JIRA: MDSAL-435
Change-Id: Idfb155984d1261203d225c8293189941d5d345e9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdjust DOMMountPoint to be EffectiveModelContextProvider 93/89293/2
Robert Varga [Wed, 22 Apr 2020 19:44:14 +0000 (21:44 +0200)]
Adjust DOMMountPoint to be EffectiveModelContextProvider

SchemaContext does not cut it here. We really should not have this
at all and should rely on DOMSchemaService being present, but that
refactor has to wait for another breaking release.

JIRA: MDSAL-435
Change-Id: I3182b0cda7809cf7b90fe0a05413a9b88541bfb6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoReduce use of BaseTemplate.getterMethodName() 65/89265/1
Robert Varga [Wed, 22 Apr 2020 12:24:55 +0000 (14:24 +0200)]
Reduce use of BaseTemplate.getterMethodName()

We are using BuilderGeneratedProperty in Builder(Impl)Template,
and this class has access to the getter method. We therefore do
not need to construct the getter name, but rather can access it
directly.

Change-Id: I1b61c347d2919acf763d1f7d11ca9471b8a25f0f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDeprecate misnamed FooBuilder.addAugmentation() 90/89190/4
Robert Varga [Tue, 21 Apr 2020 09:26:47 +0000 (11:26 +0200)]
Deprecate misnamed FooBuilder.addAugmentation()

Add explicit documentation to generated methods and deprecate
the two-argument addAugmetation() variant. Steer users towards
the one-argument variant or removeAugmentation().

JIRA: MDSAL-183
Change-Id: I496cfa542cb1f35cec975cd8288ef79e2b38fba6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoClean up GeneratedProperty use 62/89262/2
Robert Varga [Wed, 22 Apr 2020 10:25:20 +0000 (12:25 +0200)]
Clean up GeneratedProperty use

Previous patch made a bit of a mess in GeneratedProperty. Clean this
up by creating a dedicated BuilderGeneratedProperty to hold the
properties created in java-api-generator.

Also add a few dedicated tests to ensure generated builders what
they are supposed to do.

JIRA: MDSAL-451
Change-Id: I594475019a997277560f77d4ef51144f2b281ffe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoExpand ValueMechanics with NONNULL 54/89254/1
Robert Varga [Tue, 21 Apr 2020 20:09:30 +0000 (22:09 +0200)]
Expand ValueMechanics with NONNULL

Since we have introduced a backchannel to add semantics, this can
be (mis)used to communicate nullness guarantees. Add another
ValueMechanics which can be recognized as needed.

JIRA: MDSAL-492
Change-Id: Ic50bb827c2e410ab4afb9dd6dd20941be689bd2d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSquash empty lists/maps 36/89236/2
Robert Varga [Tue, 21 Apr 2020 13:11:41 +0000 (15:11 +0200)]
Squash empty lists/maps

Dealing with lists requires us to interfere with what the user
is giving us in builders, effectively creating new mechanics.

This patch adds the model metadata to carry these around, exposing
just how badly broken some binding.model.api construcs are misused.
We do not fix the misuse, but make it slightly worse, but also mark
the mess for future cleanup.

JIRA: MDSAL-451
Change-Id: I43b3ddccff69bec9a4e98b3c8e73aac4679c1d1f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCentralize non-key property copies 35/89235/1
Robert Varga [Tue, 21 Apr 2020 12:44:25 +0000 (14:44 +0200)]
Centralize non-key property copies

AbstractBuilderTemplate can discern between a copied key property
and other properties. Make sure we split the second part into a
separte method, allowing it to be customized.

The immediate benefit here is that we do not end up copying properties
if there are no keys.

JIRA: MDSAL-451
Change-Id: Ic1ba59d12cd65e7e8991345d50dc80db3fc029bf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFixup DataObjectCodecContext.createBindingProxy() nullness 92/89192/1
Robert Varga [Tue, 21 Apr 2020 09:50:35 +0000 (11:50 +0200)]
Fixup DataObjectCodecContext.createBindingProxy() nullness

This method cannot return a null, nor can anything which ultimately
uses it as its sole return.

Change-Id: Ia7bc32fa050777130a635d3929fbce6da705bb22
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSquash empty MapNode/UnkeyedListNode objects to null 91/89191/1
Robert Varga [Tue, 21 Apr 2020 09:43:55 +0000 (11:43 +0200)]
Squash empty MapNode/UnkeyedListNode objects to null

When we encounter an empty keyed/unkeyed list, we need to treat
it as it were not present. This adjusts the appropriate codecs
to ensure that is the case.

JIRA: MDSAL-452
Change-Id: Iba70207642e014d59a94cc09a69da988ee71c63f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSimplify builder's addAugmentation() method 42/45742/7
Robert Varga [Mon, 20 Apr 2020 23:15:06 +0000 (01:15 +0200)]
Simplify builder's addAugmentation() method

All augmentation already extend DataObject, which really is to say
that Augmentation should be doing the same. This has the benefit
of giving us access to DataContainer.implementedInterface(), which
we can use to add a simplified addAugmentation() method.

JIRA: MDSAL-183
Change-Id: I053a2d23e6bf95e07fa58e4078a37661e6e726a3
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove explicit UOE throws 83/89183/1
Robert Varga [Tue, 21 Apr 2020 05:50:55 +0000 (07:50 +0200)]
Remove explicit UOE throws

Private constructors do not really have to be that defensive.
Remove exception throws and related tests.

Change-Id: I245264a78607d136d92a4c18d68f5d5df17a4832
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd CodeHelper.emptyToNull() 77/89177/3
Robert Varga [Mon, 20 Apr 2020 22:30:16 +0000 (00:30 +0200)]
Add CodeHelper.emptyToNull()

We will need to be squashing empty collections to nulls, add
utility methods to do that.

JIRA: MDSAL-451
Change-Id: I28510efc2e10cef6181a9241d52f88c9cfd884e0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove CodeHelpers.nonNullValue() 76/89176/3
Robert Varga [Mon, 20 Apr 2020 22:27:29 +0000 (00:27 +0200)]
Remove CodeHelpers.nonNullValue()

This method is used only with augmentations. Remove it and update
callers to use Objects.requireNonNull() instead.

This removes a source of IAEs in favor of more consistent NPE
as well as trims down a few bytes from builder classes.

Change-Id: I57ee77c19230f57b34bf85eb5e31863f17372437
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd CodeHelper documentation 75/89175/1
Robert Varga [Mon, 20 Apr 2020 22:19:33 +0000 (00:19 +0200)]
Add CodeHelper documentation

We are missing documentation for generic method types, add a few
words.

Change-Id: I3c3faa2836f4a6b55283028d04f5528728149bff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoImprove often-used class imports 73/89173/3
Robert Varga [Mon, 20 Apr 2020 18:28:29 +0000 (20:28 +0200)]
Improve often-used class imports

importedName(Class) is slightly slower than importName(JavaTypeName),
hence improve performance by creating a few more often-used constants.

Change-Id: I2af9ad97bc2122a83c26cd247faf15e136bdb768
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoReorder encapsulation checks 52/89152/1
Robert Varga [Mon, 20 Apr 2020 18:03:04 +0000 (20:03 +0200)]
Reorder encapsulation checks

Reordering checks provides a small speed up due to fewer checks
being made on average, as we take care of most popular types first.

Change-Id: I0acc2e77007054c7c35ad159d98bb3be1cdabfee
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSpeed up BaseYangTypesProvider's restricted types 50/89150/2
Robert Varga [Mon, 20 Apr 2020 13:20:54 +0000 (15:20 +0200)]
Speed up BaseYangTypesProvider's restricted types

We are currently bouncing through explicit classes and a switch
expression which pretty-much duplicates BaseYangTypes. Clean this
up by exposing an alternative method to create restricted types,
so that we can first lookup mapping and then create a restricted
type.

Change-Id: I98601b6bf4ddb43c76c62d4f988d174456be4229
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoImprove BaseYangTypes.javaTypeForYangType() 49/89149/2
Robert Varga [Mon, 20 Apr 2020 13:00:30 +0000 (15:00 +0200)]
Improve BaseYangTypes.javaTypeForYangType()

This method should not tolerate nulls and it can be implemented
in terms of a simple switch() statement instead of a lookup map.

Change-Id: Icbef37aec6aef2d1a445ce26dcc3b7479b0ec81f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoClean up test naming confusion 48/89148/2
Robert Varga [Mon, 20 Apr 2020 13:02:49 +0000 (15:02 +0200)]
Clean up test naming confusion

BaseTypeProvider is really a BaseTypesTest, and that test is really
BaseYangTypesProviderTest. Clean them up, relocating them as to their
home packages.

Change-Id: I37f9a78fe48b1954882bfa344f1d866c9591e14b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSpeed up BaseYangTypesProvider 47/89147/1
Robert Varga [Mon, 20 Apr 2020 12:40:45 +0000 (14:40 +0200)]
Speed up BaseYangTypesProvider

Most of the time we do not need to go through the switch expression
and restricted types. Short-circuit lookup when we know we do not
have restrictions.

Change-Id: I84568a180c6ed208e077dbe3c0cb749e84acf3cf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCorrect ClassTemplate's check for types 46/89146/6
Robert Varga [Mon, 20 Apr 2020 11:51:53 +0000 (13:51 +0200)]
Correct ClassTemplate's check for types

ClassTemplate's checks run against Java Types, which is fine, except
that we should be referencing them through BaseYangTypes, so that we
have the incidental alignment well covered.

Furthermore the checks rely on FQCN, which is potentially slow to
compute, while the new checks rely on plain type equality -- hence
potentially speeding up things and lowering the number of branches.

We also drop a FIXMEs to clarify situation around InstanceIdentifier.

Change-Id: I3328199a8ec56e28d58582c076f1344fb4459103
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCorrect UnionTemplate's check for types 45/89145/4
Robert Varga [Mon, 20 Apr 2020 11:35:50 +0000 (13:35 +0200)]
Correct UnionTemplate's check for types

UnionTemplate's checks run against Java Types, which is fine, except
that we should be referencing them through BaseYangTypes, so that we
have the incidental alignment well covered.

Change-Id: I5be3708d80ee5c376178df14dbc76333a01e06ff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMove BaseYangtypes to binding.model.util 44/89144/4
Robert Varga [Mon, 20 Apr 2020 11:31:37 +0000 (13:31 +0200)]
Move BaseYangtypes to binding.model.util

These constants sit between Types and BindingTypes, hence they should
not be in a completely different package.

Change-Id: If9894102e27b8dd3568493ef615c40328d213ca9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSplit out BaseYangTypesProvider 43/89143/4
Robert Varga [Mon, 20 Apr 2020 11:18:09 +0000 (13:18 +0200)]
Split out BaseYangTypesProvider

BaseYangTypes is related to binding.model.api, while the type provider
is related to binding.generator.api. Split out
BaseYangTypes.BASE_YANG_TYPES_PROVIDER as a BaseYangTypesProvider.INSTANCE,
separating these two concerns.

Change-Id: I61dc6ed7f39ba233017bb9938eaab151a7c41e3e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCleanup java-api-generator Constants 42/89142/3
Robert Varga [Mon, 20 Apr 2020 11:05:11 +0000 (13:05 +0200)]
Cleanup java-api-generator Constants

We have a number of useless constants here, remove them along with
the not-so-useful test.

Change-Id: I71ac7da20a035a7274d8e25017e2e937c1fefcf1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoEnforce non-null input on RPCs 39/89139/4
Robert Varga [Mon, 20 Apr 2020 08:41:40 +0000 (10:41 +0200)]
Enforce non-null input on RPCs

RPC invocations should never have a null input, rather an empty
container.

JIRA: MDSAL-303
Change-Id: I3cb019bdbd05ccc6a1d3f7e83d2220d9882ddaff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoTag TypeObjects which wrap a value with ScalarTypeObject 51/88651/13
Robert Varga [Tue, 24 Mar 2020 15:58:29 +0000 (16:58 +0100)]
Tag TypeObjects which wrap a value with ScalarTypeObject

Capturing this type of objects has a nice side-effect of being
able to specialize code generation. It is furthermore useful
for providing a common definition of getValue() method.

This is an unfortunate side-effect of changing the API
mapping for boolean typedefs: the accessor changes from isValue()
to getValue().

JIRA: MDSAL-530
Change-Id: Ie40e50bbe566a747d0a5d3e9ff84e428c2960a94
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove executable bits 32/89132/1
Robert Varga [Sun, 19 Apr 2020 13:34:44 +0000 (15:34 +0200)]
Remove executable bits

Plain files should not be executable, correct that mistake.

Change-Id: Ic3ea7299e9402c5a4c4ac1e4a9b25f93e0aa0593
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump yangtools to 5.0.0 24/89124/1
Robert Varga [Sat, 18 Apr 2020 12:14:22 +0000 (14:14 +0200)]
Bump yangtools to 5.0.0

Adopt released yangtools-5.0.0, ending snapshot integration.

Change-Id: I08af2bba59aed2ab61838795f496e3d0a7cdb3e1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoImprove grouping sort allocation 10/89110/4
Robert Varga [Fri, 17 Apr 2020 19:37:28 +0000 (21:37 +0200)]
Improve grouping sort allocation

Pre-allocating the result list saves us the common case when
the input is actually empty.

Change-Id: I237a75db38e8e0c160b204875bc5824433e9c3dc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoImprove grouping error reporting 11/89111/3
Robert Varga [Fri, 17 Apr 2020 19:54:00 +0000 (21:54 +0200)]
Improve grouping error reporting

Reporting FQCN here is useful, as it is giving us crucial information
as to what class is being generated -- including the namespace.

Change-Id: I1ad5f6a0a568a71656e338ae0d5d9e3f863103a4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove odl-mdsal-model-draft-ietf-netmod-acl-model-07 98/89098/2
Robert Varga [Fri, 17 Apr 2020 12:57:01 +0000 (14:57 +0200)]
Remove odl-mdsal-model-draft-ietf-netmod-acl-model-07

These models come from a draft which has been published as RFC8519.
As we are shipping the standardized model, remove the old draft
reducing associated baggage.

The only downstream user is netvirt's aclservice, which will have
these models integrated.

JIRA: MDSAL-537
Change-Id: Iacb09209a831fc9539496247ee3432c0f7ac21c4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove odl-mdsal-model-draft-ietf-netmod-iana-afn-safi-00 95/89095/2
Robert Varga [Fri, 17 Apr 2020 12:26:57 +0000 (14:26 +0200)]
Remove odl-mdsal-model-draft-ietf-netmod-iana-afn-safi-00

This is a long-expired draft which is used only by lispflowmapping.
Remove it from MD-SAL as part of migration to its sole user.

JIRA: MDSAL-536
Change-Id: I8ed143d65203d0bbc64afb72102d19b7e56302ec
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove ietf-lisp-address-types 86/89086/3
Robert Varga [Fri, 17 Apr 2020 06:17:00 +0000 (08:17 +0200)]
Remove ietf-lisp-address-types

This model is ancient and is used only in one of our downstreams,
lispflowmapping. Remove it along with its packaging feature.
This patch has a mirror in lispflowmapping, which reintroduces
the two files removed in that project.

JIRA: MDSAL-535
Change-Id: I400e6dea0ebd549ab73afb2bcb3a7046092341bf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBUG-3128: make context reference mandatory 03/51003/25
Robert Varga [Wed, 25 Jan 2017 12:07:42 +0000 (13:07 +0100)]
BUG-3128: make context reference mandatory

It does not make quite sense to have an optional context
reference: the RPC is either routed (action, with a reference)
or not. If the leaf is not mandatory, there is is a mismatch
between providers and consumers with regard to what is it
that invoking an action as an RPC really means.

Change-Id: I4f86acdc205192e3771fe9c480a71f38e1fe3e6f
Signed-off-by: Robert Varga <rovarga@cisco.com>
4 years agoSwitch DOMNotificationRouter to OSGi DS 75/89075/4
Robert Varga [Thu, 16 Apr 2020 14:08:59 +0000 (16:08 +0200)]
Switch DOMNotificationRouter to OSGi DS

DOMNotificationRouter is easily converted to declarative services,
this performs the migration.

JIRA: MDSAL-521
Change-Id: I54990b7ccbe45a717c46742216487b90dc4855fd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDeprecated getSessionContext() for removal 77/89077/3
Robert Varga [Thu, 16 Apr 2020 16:25:36 +0000 (18:25 +0200)]
Deprecated getSessionContext() for removal

We really want to be removing this method, mark it for removal.

Change-Id: I7e0779d58bdb6b1c2478544166e7bf14e3cdaeb5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd Binding/DOM Query language adapter 93/88193/27
Robert Varga [Sun, 1 Mar 2020 12:14:00 +0000 (13:14 +0100)]
Add Binding/DOM Query language adapter

Provide implementation of binding language translation on top
of its DOM counterpart.

On the DOM layer the expression can be transmitted, hence it gives
the possibility to move the execution to storage backend, thus
reducing app/backend data interchange volume.

Change-Id: I51c8ec7e34c2485f62aeb5bdbe35fe1507cabaa9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSplit DOMRpcRouter from blueprint 74/89074/3
Robert Varga [Thu, 16 Apr 2020 13:29:06 +0000 (15:29 +0200)]
Split DOMRpcRouter from blueprint

Add OSGi DS wiring instead of blueprint, so that we can ditch
some references to ODL extensions. This also neccessitates adding
a few missing forwarding implementations.

JIRA: MDSAL-521
Change-Id: I15d2c9373f06c31bcee43c520733bb2f4a2255ff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFixup odl-mdsal-trace's name 73/89073/1
Robert Varga [Thu, 16 Apr 2020 12:35:05 +0000 (14:35 +0200)]
Fixup odl-mdsal-trace's name

Fix naming here to be consistent with other features by adding
"MD-SAL" infix.

Change-Id: Iad4418faf3712f88ba74b7c4e4ea39d016a3807d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRefactor binding-dom-adapter 40/89040/10
Robert Varga [Sun, 12 Apr 2020 11:35:02 +0000 (13:35 +0200)]
Refactor binding-dom-adapter

BindingNormalizedNodeCodecRegistry is a serializer which allows
dynamic updates to its backing codec. Rather than referencing this
implementation, reference either BindingNormalizedNodeSerializer
(interface) or BindingCodecContext, which is the simple implentation.

This makes it obvious we are not using BindingNormalizedNodeCodecRegistry
in the context of mdsal-binding-dom-codec at all, making it a good
candidate to move to mdsal-binding-dom-adapter. Except we do not want
to just move it, but refactor so that it is properly controlled.

Change-Id: I2be67ed78ac89da5c5b5ec7322d03e769d2826c6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd mdsal-binding-dom-codec-osgi dependency 69/89069/1
Robert Varga [Thu, 16 Apr 2020 10:56:44 +0000 (12:56 +0200)]
Add mdsal-binding-dom-codec-osgi dependency

docs should depend on this artifact to have proper build order
and complete javadocs.

Change-Id: I61a62bf063ce379393c81b5924d0fd3f8b35ea14
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoHide BindingMountPointAdapter 44/89044/3
Robert Varga [Sun, 12 Apr 2020 13:11:29 +0000 (15:11 +0200)]
Hide BindingMountPointAdapter

This class is an internal implementation detail, hide it. Also
use Codec directly rather than taking a registry reference.

Change-Id: Ie3ac61f2456d2b6c5f3ba84d2588839fa5a4415f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix a BindingToNormalizedNodeCodec warning 45/89045/2
Robert Varga [Sun, 12 Apr 2020 14:43:11 +0000 (16:43 +0200)]
Fix a BindingToNormalizedNodeCodec warning

We are not using proper generic arguments, which the interface
specification requires. Fix that.

Change-Id: I6c22eaba5b6b739f0d23de2e6ededa4bc89ad888
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove BindingToNormalizedNodeCodec.getCodecFactory() 35/89035/1
Robert Varga [Sat, 11 Apr 2020 15:04:36 +0000 (17:04 +0200)]
Remove BindingToNormalizedNodeCodec.getCodecFactory()

This is a duplicate of getCodecRegistry(), remove it.

Change-Id: I32b04de56a22659fec2db54847ebf16424f0e31f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoImprove verification message 30/89030/1
Robert Varga [Sat, 11 Apr 2020 02:46:48 +0000 (04:46 +0200)]
Improve verification message

Since we have the class identity available, let's use it to diagnoze
failures to supply a proper resource name.

Change-Id: I9b159e9ca8c16565b8e63b82637696ea90a42bc6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove BindingToNormalizedNodeCodec.instanceIdentifierToNode() 29/89029/1
Robert Varga [Sat, 11 Apr 2020 01:58:56 +0000 (03:58 +0200)]
Remove BindingToNormalizedNodeCodec.instanceIdentifierToNode()

This method has a single in-package user, move it to centralize
logic and reduce codec clutter.

Change-Id: If234858384de767c71971c1a310cf45cb59f428c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove BindingToNormalizedNodeCodec.toNormalized(Entry) 28/89028/1
Robert Varga [Sat, 11 Apr 2020 01:52:37 +0000 (03:52 +0200)]
Remove BindingToNormalizedNodeCodec.toNormalized(Entry)

This method is a simple delegator to a interface-specified method
with a single caller -- refactor the caller and remove it.

Change-Id: If1a811484581848900e05f45dd9f76d0cd8ed567
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove BindingToNormalizedNodeCodec.toNormalized(InstanceIdentifier) 27/89027/1
Robert Varga [Sat, 11 Apr 2020 01:45:48 +0000 (03:45 +0200)]
Remove BindingToNormalizedNodeCodec.toNormalized(InstanceIdentifier)

This method is a duplicate of
BindingNormalizedNodeSerializer.toYangInstanceIdentifier(), remove it
and adjust callers to reduce confusion.

Change-Id: I5bbbdd87b2c0b6f85b2208ed23d25446fab9e0f3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix mdsal-binding-dom-codec exports 26/89026/1
Robert Varga [Sat, 11 Apr 2020 01:40:47 +0000 (03:40 +0200)]
Fix mdsal-binding-dom-codec exports

We only need the .impl package exported, as we do not want to
embed our -api artifact, as that just wrecks source code lookups.

Change-Id: I9c85c7ba0e121c0497cd17e0fcfdc2b7133ddfc8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove BindingToNormalizedNodeCodec.toBinding() 25/89025/1
Robert Varga [Sat, 11 Apr 2020 01:22:17 +0000 (03:22 +0200)]
Remove BindingToNormalizedNodeCodec.toBinding()

This method is not used anywhere, remove it to keep our codebase
free of distractions.

Change-Id: I4ddd88572f336c0046cd807563718b6875f8bbcf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove AbstractForwardedDataBroker 24/89024/1
Robert Varga [Sat, 11 Apr 2020 01:20:00 +0000 (03:20 +0200)]
Remove AbstractForwardedDataBroker

This class hosts a chunk of functionality which is not used anymore,
dating back to when we had DataChangeListeners. Remove it.

Change-Id: Ia2c7dbbf0621eb5ba69983b84393acbb8d3ffd99
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove BindingToNormalizedNodeCodec.getNotificationClasses() 23/89023/1
Robert Varga [Sat, 11 Apr 2020 01:11:54 +0000 (03:11 +0200)]
Remove BindingToNormalizedNodeCodec.getNotificationClasses()

This method is not used anywhere, remove it to reduce the amount
of untested legacy code.

Change-Id: I76a8c1beca37d296b73e5aad9ac885a16d805c97
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd more error context to ResourceYangModuleInfo 99/88999/2
Robert Varga [Thu, 9 Apr 2020 17:55:32 +0000 (19:55 +0200)]
Add more error context to ResourceYangModuleInfo

In case we end up failing to load a resource, log the subclass
and potentially the ClassLoader where the problem occured.

Change-Id: Id5cbe9875734d0c8f185d7cbbd8cc2cd3f09ee3f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCache YangModuleInfo type name 69/86469/9
Robert Varga [Wed, 18 Dec 2019 09:05:15 +0000 (10:05 +0100)]
Cache YangModuleInfo type name

Analysis of a heap dump shows we are creating a number of instances
pointing to the same type for the purposes of having the QNAME constant.

As we have the context in which we are creating YangModuleInfo,
instantiate a primitive cache to de-duplicate these definitions.

JIRA: MDSAL-515
Change-Id: I9bb52d04627e91eac3adff672b06f6340cac157f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUnable to resolve grouping test 99/88399/4
miroslav.kovac [Wed, 11 Mar 2020 11:55:56 +0000 (12:55 +0100)]
Unable to resolve grouping test

JIRA MDSAL-531
Change-Id: Icdba0c0babf93ca14f7d81b42cc432eb4455d6e0
Signed-off-by: miroslav.kovac <miroslav.kovac@pantheon.tech>
4 years agoMake DOMSchemaService operate of EffectiveModelContext 97/84797/5
Robert Varga [Mon, 30 Sep 2019 05:08:26 +0000 (07:08 +0200)]
Make DOMSchemaService operate of EffectiveModelContext

We are stepping towards working on Declared/EffectiveStatements
instead of SchemaNodes, this exposes EffectiveModelContext from
the DOMSchemaService.

JIRA: MDSAL-435
Change-Id: I6b24f423e104683e008a97595647a7b9ce4d3a11
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump odlparent to 7.0.1 91/88991/1
Robert Varga [Thu, 9 Apr 2020 07:58:53 +0000 (09:58 +0200)]
Bump odlparent to 7.0.1

This picks up latest updates.

Change-Id: I2782df0f7638233ebfb0a9715a3c49aa4078baa8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove WriteOperations.put()/merge() with ensure parents 77/88977/3
Robert Varga [Wed, 8 Apr 2020 13:16:45 +0000 (15:16 +0200)]
Remove WriteOperations.put()/merge() with ensure parents

These methods have been deprecated in favor of their explicit
counterparts, mergeParentStructurePut() and mergeParentStructureMerge().

While all users have not been migrated, force that migration to
happen now.

Change-Id: Ia5ae9f0f82c3b64e11e7a828ff614045029ed5ba
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix logic ensuring parent presence 75/88975/1
Robert Varga [Wed, 8 Apr 2020 13:01:59 +0000 (15:01 +0200)]
Fix logic ensuring parent presence

When we are asked to create intermediate nodes for a path, whose
parent is the conceptual root (i.e. its parent is empty), we should
not attempt to merge it, as it just does not make sense.

JIRA: MDSAL-534
Change-Id: Ia5f6ef2857903d8e88030f4c1f3867b8ed8f5a0e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove superfluous @NonNull annotations 74/88974/1
Robert Varga [Wed, 8 Apr 2020 12:31:02 +0000 (14:31 +0200)]
Remove superfluous @NonNull annotations

These annotations are inherited from interface contract, there is
no point in specifying them again.

Change-Id: I7e2cb6d353b358f5c2eefc03181803377e047750
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMigrate test to use mergeParentStructure{Merge,Put} 71/88971/2
Robert Varga [Wed, 8 Apr 2020 12:22:51 +0000 (14:22 +0200)]
Migrate test to use mergeParentStructure{Merge,Put}

We have deprecated these methods, make sure we migrate the test
so that it does not add false warnings.

Change-Id: I3a6bd6b936f34478fe7afdcc26547ffa7edb8992
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRealign junit links 69/88969/1
Robert Varga [Wed, 8 Apr 2020 11:45:06 +0000 (13:45 +0200)]
Realign junit links

Align JUnit links with odlparent-7, so that we generate nice
javadocs.

Change-Id: I28cb6669dfcb24d5b3de9d4d519555d6e48645e6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump byte-buddy to 1.10.9 29/88929/2
Robert Varga [Tue, 7 Apr 2020 09:52:49 +0000 (11:52 +0200)]
Bump byte-buddy to 1.10.9

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.10.8
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.10.9

Change-Id: I6dd7ef731fefd5de334b268f23c9a24bf5ae0a41
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFixup netty's parent reference 63/88863/1
Robert Varga [Thu, 2 Apr 2020 19:37:17 +0000 (21:37 +0200)]
Fixup netty's parent reference

We want to pull in 7.0.0, not 6.0.3.

Change-Id: I64b4b13ce6ba75887150a72b2e44d0969950209f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd a simple Binding query language 52/88552/11
Robert Varga [Fri, 20 Mar 2020 16:22:09 +0000 (17:22 +0100)]
Add a simple Binding query language

Offloading some amount of data matching towards the storage engine
can give use two-fold improvement:

1) skip instantiation of Binding DTOs, as the query can be realized
   in terms of DOM matches
2) potentially skip transfer of large amount of data

For Binding layer we want to have something type-safe, where we are
in control of the flow the language.

This provides a first cut at the structure, which may end up being
further evolved.

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