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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Robert Varga [Wed, 25 Mar 2020 14:34:22 +0000 (15:34 +0100)]
Simplify empty checking
Use a simple negation instead of an equality check -- not that it
makes much difference in generated code.
Change-Id: If7c73a3884544c5acb5590b8154df712d4af2c55
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 24 Mar 2020 15:15:19 +0000 (16:15 +0100)]
Refactor "value" property access
There are a number of callers open-coding the way to acquire 'value'
property. Centralize them.
JIRA: MDSAL-530
Change-Id: I6fdf17b204c7f491eb667747a68d6d80daf55b78
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 24 Mar 2020 13:55:09 +0000 (14:55 +0100)]
Add ScalarTypeObject
TypeObjects are used for encapsulated values, which expose a getValue()
method, which is guaranteed to be non-null and can have additional
validation implied.
JIRA: MDSAL-530
Change-Id: I3ec4a5b4d7e04ff0c220144c9d1796fb44b2a80b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 25 Mar 2020 11:35:13 +0000 (12:35 +0100)]
Fix import order
xtend plugin does not automatically order imports, fix a misorder.
Change-Id: I099bbe07debe6a37b1f94fd6f39ec42d6d87f917
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 24 Mar 2020 15:38:31 +0000 (16:38 +0100)]
Use StringBuilder streaming in AbstractTypeProvider.union()
StringBuilder's methods return a value we can use to form a nice
pipeline.
Change-Id: I70831ac9f7347d23b6c5b5e3cd34c99df6d29ce0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 24 Mar 2020 14:15:11 +0000 (15:15 +0100)]
JavaFileTemplate.findProperty() should be static
This method does not touch any local state -- hence it is truly
a static utility that can be moved to a properly-bound state.
Change-Id: Iad3b70d129e758a24aaa0558a1549728f529f236
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 25 Mar 2020 08:28:47 +0000 (09:28 +0100)]
Bump odlparent to 7.0.0
Do not rely on snapshots, use the released version.
Change-Id: I2fc5ebecbd18ce392a75979fb0e7185ffd206190
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 20 Mar 2020 20:31:58 +0000 (21:31 +0100)]
Remove unneeded dependency on osgi-core
mdsal-binding-api does not need osgi-core, remove the dependency.
Change-Id: I962211addacff49d6d0edbdd1c0d12cde464d431
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 16 Mar 2020 12:26:18 +0000 (13:26 +0100)]
Migrate mdsal-trace-impl's use of BindingNormalizedNodeSerializer
We do not really need a full serializer here, it is eanough to get
an InstanceIdentifierCodec -- which is readily available from
BindingCodecTree.
JIRA: MDSAL-522
Change-Id: Ia82128b3579b562bb8ca7277072aee07a66a5e1e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 2 Mar 2020 07:18:31 +0000 (08:18 +0100)]
Refactor OSGi ModuleInfoSnapshot/BindingRuntimeContext
All components acting on EffectiveModel should end up reacting
to new generation by publishing components based on it before
tearing down the previous instance.
Refactor lifecycle by introducing this into both mdsal-dom-schema-osgi
and mdsal-binding-runtime-osgi -- providing the infrastructure for
mdsal-binding-dom-codec doing the same.
This leads to mdsal-binding-dom-codec-osgi to provide atomic updates
of BindingDOMCodecServices (and its constituent services), hence we
no longer want binding-dom-adapter to publish
BindingNormalizedNodeSerializer from its internal service.
JIRA: MDSAL-525
Change-Id: Ia6757b3db8068d585638bd8e2d3d17aaadb08955
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 11 Mar 2020 09:30:05 +0000 (10:30 +0100)]
Fix test locations
Some of our tests are still located in legacy packages from
controller. Fix this by moving them to appropriate packages in
mdsal structure.
Change-Id: I4beac6dc0c98a1b1d7e022dddae57bedbf54aca9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 10 Mar 2020 09:49:24 +0000 (10:49 +0100)]
Remove dependency on general-entity
mdsal-binding-api should not depend on general-entity, as that
part of API is served by EOS APIs.
Change-Id: I0d8860b9c07bd1b7305c08cce9fa8c74e3703f36
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 6 Mar 2020 18:21:28 +0000 (19:21 +0100)]
Remove replaceAllIllegalChars(CharSequence)
We do not have any callers here, remove the deprecated method.
Change-Id: I19a0919560729efb11a5658f1e4403543d30a134
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 2 Mar 2020 12:58:50 +0000 (13:58 +0100)]
Fix YANG snippet escaping
This is the non-javadoc path for module generation, where we are
failing to escape potential unicode references. Add the proper
callout and also optimize it to be a faster no-op when not
applicable, properly documenting what is going on.
JIRA: MDSAL-529
Change-Id: Ib21ed4f15555d49aaa7eb3dac61043c4b2e90451
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Samuel Kontris [Fri, 28 Feb 2020 13:33:02 +0000 (14:33 +0100)]
Propagate grouping inference flag
The test case ends up looking through the magic code flagged
for refactoring -- which is losing knowledge that the parent
node is actually a grouping. Fix this up by propagating the
flag correctly.
JIRA: MDSAL-519
Change-Id: I8fe04e688adfcc068ff29e90a039530bcd56b3c3
Signed-off-by: Samuel Kontris <samuel.kontris@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 1 Mar 2020 18:46:28 +0000 (19:46 +0100)]
Centralize BindingCodecContext services
BindingCodecContext provides an immutable class providing a number
of services. It really should provide all services, so that
downstreams can make a proper decision around lifecycle.
We do not want to expose BindingCodecContext itself, as it provides
other, implementation-internal, services -- hence create
BindingDOMCodecServices to hold the interface specification.
Missing methods come from BindingNormalizedNodeSerializer, which
can perhaps be re-formulated externally, but including it here
makes this more obvious for BindingNormalizedNodeCodecRegistry.
JIRA: MDSAL-825
Change-Id: I2a37f9c36b25bf4ef43c76bf81a170edfe75b60c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 4 Mar 2020 12:14:43 +0000 (13:14 +0100)]
Bump odlparent to 7.0.0-SNAPSHOT
This picks up upgraded odlparent, notably for pre-installed SCR.
Change-Id: Icaab7aaab204e0959dc6606d319f947779040688
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 4 Mar 2020 12:35:45 +0000 (13:35 +0100)]
Do not pull immutables.org processor to docs
We only need annotations here, pull only those.
Change-Id: I22ef37856bf4aa4bf1d586357a6d4a286f2e7944
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 1 Mar 2020 13:34:45 +0000 (14:34 +0100)]
BindingCodecContext implements BindingNormalizedNodeWriterFactory
There is slight confusion between BindingCodecContext and
BindingNormalizedNodeCodecRegistry -- the registry implements this
interface and uses internal methods with exact signatures for most
of them. There's a few methods missing, leading to confusion as to
what is what.
Move the two methods and make BindingCodecContext be the Immutable
reference implementation. This also shows that we have a lifecycle
issue, where we can end up reading codecContext twice.
Fix that race by properly encapsulating state before referring to
the (now static) common method. This has the nice side-effect of
removing state capture of 'this', leading to the indirection lambda
being stateless.
JIRA: MDSAL-825
Change-Id: I81e26ad6865c48035b64d1973bae1bb396d584f0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 1 Mar 2020 13:17:58 +0000 (14:17 +0100)]
Remove BindingToNormalizedNodeCodec.deserializeFunction()
This method has been deprecated and has no users, remove it and
reduce clutter.
Change-Id: I195913e7117f98b839696f02bfaa46aa62017385
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 1 Mar 2020 12:22:00 +0000 (13:22 +0100)]
Move AbstractLazyActionContainerNode to SPI
While this is an implementation detail, it can be shared between
implementations quite reasonably. Pull it out of
binding-dom-codec-impl.
JIRA: MDSAL-825
Change-Id: I21b79bee5b73583a406d17665dfd9aff1376c3c3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 1 Mar 2020 12:05:40 +0000 (13:05 +0100)]
Update BindingInstanceIdentifierCodec documentation
Document IllegalArgumentException being thrown and add FIXMEs.
Change-Id: I44e8a8c86b2dd180dc09f23a8a930b23f01b3c75
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 29 Feb 2020 15:36:35 +0000 (16:36 +0100)]
Reduce BindingNormalizedNodeCodecRegistry proliferation
Most functional blocks require only a
BindingNormalizedNodeSerializer implementation, not the concrete
implementation. This allows us to disconnect component lifecycle
from BindingCodecContext updates without relying on magic class.
BindingNormalizedNodeCodecRegistry provides a globally updated
holder for these implementations, so that they end up refreshing
their codec based on latest global state.
A follow-up patch will introduce an explicit component, which can
be used in these contexts.
JIRA: MDSAL-525
Change-Id: I6938e23e30656b9dbc960bd6b2ca17c068b67b35
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 29 Feb 2020 15:16:49 +0000 (16:16 +0100)]
Add type parameter documentation
'C' here is undocumented, add at least a single line.
Change-Id: I06f4471983c0ea1fcbff49f45f6e263661030db4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 29 Feb 2020 14:38:05 +0000 (15:38 +0100)]
Expose BindingInstanceIdentifierCodec from BindingCodecTree
This codec is in similar class as IdentityCodec -- make sure it is
available to users.
JIRA: MDSAL-522
JIRA: MDSAL-525
Change-Id: I08371dfbbb264991d6d5840838c0736b35921b8f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 29 Feb 2020 10:57:05 +0000 (11:57 +0100)]
Use ListenerRegistry.clear()
We do not need to access the registrations, just instruct the registry
to clear them.
Change-Id: I710989a5fe473135d5051ab127e23dc33e4227c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 29 Feb 2020 10:16:40 +0000 (11:16 +0100)]
Modernize ListenerRegistry users
ListenerRegistry has been modernized for Java 8 way back
in https://git.opendaylight.org/gerrit/c/yangtools/+/73957 and our
users have not been updated.
Use new API surface introduced in that patch, which actually makes
our code cleaner.
Change-Id: Id7e554ed229638cdc871d5b4152cc6795a662514
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 29 Feb 2020 10:38:39 +0000 (11:38 +0100)]
Remove ScanningSchemaServiceProvider.removeListener()
This method is not used anywhere, remove it.
Change-Id: I5e6d9c25618344b12085d121101ca56b4e09a647
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 29 Feb 2020 10:36:10 +0000 (11:36 +0100)]
Do not use by-listener unregistration
This test is the only one needing access to unregister(L). Remove
it via proper registration interaction.
Change-Id: I5eff48b7123820bb090fdb834054fa78fd767e8a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 29 Feb 2020 11:58:15 +0000 (12:58 +0100)]
Remove TracingBroker.name
This can only ever be 'default', remove it as a property.
Change-Id: I66ca5bb6fdf1072cc3f9550866ff375f59a6c544
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 29 Feb 2020 10:28:54 +0000 (11:28 +0100)]
Remove unneeded cast
Pointed out by Eclipse, very true.
Change-Id: If9ad77f87889e423e7918badc1b4bff2480079ca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 29 Feb 2020 09:43:46 +0000 (10:43 +0100)]
Convert DOMSchemaServiceImpl into a component
This is a trivial service which has no dependencies, promote it
to a component and remove it from blueprint.
JIRA: MDSAL-521
Change-Id: Ia6f0feb0ad1324e4a57cac476167dfbe4e07eade
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 28 Feb 2020 17:39:51 +0000 (18:39 +0100)]
Expand test suite to cover uses-augment of actions
Augment can also target a relative path from uses context, this
expands the testing model to cover that case, too.
The test case flushes out the problem of not handling
action/notification nodes when targeted in this manner, leading
to an obvious hiccup.
JIRA: MDSAL-517
Change-Id: If389440622c31f544917b04e3825fe6e08e08244
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 28 Feb 2020 17:36:28 +0000 (18:36 +0100)]
Update Mdsal517Test a bit
This just cleans up naming to prevent confusion.
JIRA: MDSAL-617
Change-Id: I75d2e95d2396f63d05cd533f16057f556850763c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 28 Feb 2020 17:29:10 +0000 (18:29 +0100)]
Hide BindingCodecContext methods
BindingCodecContext is package-private, so should be its methods.
Change-Id: Ic371d8f63597d0e00f0287903be81cf3e5e49e45
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 28 Feb 2020 16:14:13 +0000 (17:14 +0100)]
Fixup docs references
We do not use blueprint annotations anymore and reference Karaf's
FeaturesService. Adjust docs to reflect that.
Change-Id: I1c5691a81e13ce2cc5aef81d8285c2b59162521d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 28 Feb 2020 15:02:58 +0000 (16:02 +0100)]
Make OSGiModuleInfoSnapshot generation unsigned
The intent is to have this an unsigned counter, expose it as such.
JIRA: MDSAL-392
Change-Id: I7d240933ae35288be0ba6a5f8a047587ab179803
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 28 Feb 2020 14:25:18 +0000 (15:25 +0100)]
Do not expose DataObjectSerializerRegistry outside of codec
BindingNormalizedNodeCodecRegistry should not implement this
interface directly, as it is only used internally.
Change-Id: I02956b6ae399eabb27634a2048c837f05f6ab3ea
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 28 Feb 2020 14:59:15 +0000 (15:59 +0100)]
Fix minor typos from previous patches
Copyrhing header is wrong and we have an extra empty line, clean
that up.
JIRA: MDSAL-392
Change-Id: Id9dcbf88c12a86d6358fc400705b729f394db398
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 28 Feb 2020 13:22:21 +0000 (14:22 +0100)]
Add KarafFeaturesSupportTest
Improve test coverage a bit exercising KarafFeaturesSupport.
JIRA: MDSAL-235
Change-Id: I475e69566bce11c44ec8022b0d6bb1d451f45ff5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 28 Feb 2020 11:58:16 +0000 (12:58 +0100)]
Make mdsal-dom-schema-osgi Karaf-aware
Karaf's FeaturesService exposes lifecycle hooks which allow us
to understand in that an installation is in progress, so that
we can suppress updates while we bundles are not fully resolved.
JIRA: MDSAL-235
Change-Id: Ie5c5b862a5d2975cd4cb08ca4bb1976f263578d2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 24 Feb 2020 11:40:56 +0000 (12:40 +0100)]
Rework binding component instantiation
This reshuffles how DOM and Binding interoperate where schema is
concerned. Since Binding requires Classloader information available
at scanning time, we refactor mdsal-dom-schema-service-osgi to
actually perform Binding-aware scanning, so that this information
is available in ModuleInfoSnapshot.
These are published as OSGiModuleInfoSnapshot along with generation
number for easier reference by a new component, OSGiModelRuntime.
DOMSchemaService is realized on top of ServiceRegistry, where it
listens for OSGiModelRuntime and for SchemaContextListeners, driving
an OSGi whiteboard pattern.
This renders mdsal-binding-dom-codec-osgi completely superfluous,
as there is not enough magic going on to justify it.
mdsal-binding-runtime-osgi is also hooked onto OSGiModuleInfoSnapshot,
providing BindingRuntimeContexts as needed and retaining generation
inforation.
JIRA: MDSAL-392
Change-Id: I083caf3abbc3d7e2212d1df14e45d2745096b5f9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
miroslav.kovac [Thu, 27 Feb 2020 16:51:37 +0000 (17:51 +0100)]
Fix augmentation pointing to a grouping action's input
When augmentation targets an action input which itself is defined
in a grouping, we need to actually lookup the original definition.
Add a type aliasing information, which should be consulted when
making a simple reference to a type -- and use it in
augmentationToGenTypes().
JIRA: MDSAL-517
Change-Id: I1ef383e8777a7c09a979cbdd84f71be3a0f9b021
Signed-off-by: miroslav.kovac <miroslav.kovac@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 28 Feb 2020 05:55:29 +0000 (06:55 +0100)]
Switch from NPE to ISE
When we fail to locate a type it constitutes an IllegalState, not
a plain NPE.
Change-Id: I46eaa470342a5e72ad6a92aefed97e458a2ca398
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 27 Feb 2020 09:38:33 +0000 (10:38 +0100)]
Fix action/grouping lookup mechanics
When we are following references towards the original definitions
we need to mind the fact that 'uses' statement may point to a grouping
in a different module and hence we need to adjust namespace accordingly.
The same thing applies when we want to find generated types for such
actions' input/output -- here we need to acquire the correct
ModuleContext.
JIRA: MDSAL-516
Change-Id: I1931279beb8e663e6d8558d50c5d7d274e248cf3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 27 Feb 2020 15:38:47 +0000 (16:38 +0100)]
BindingReflections.getModuleInfo() returns @NonNull
A null return here would be an API violation, make sure we catch
these in BindingReflections and do not bother users with potential
nulls.
Change-Id: I1670a46d1de4aeac0730538822157ec6ae216011
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 26 Feb 2020 10:38:07 +0000 (11:38 +0100)]
Use osgi-core constants
Just to keep things consistent, use OSGi's Constants class to get
the bundle id for framework (i.e. SYSTEM_BUNDLE_ID).
Change-Id: I18dae474c944f29ebb32203a12db1c96c2e1483f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 25 Feb 2020 13:53:01 +0000 (14:53 +0100)]
Remove commented-out dependency
We do not need a dependency on javax.annotation, remove it.
Change-Id: I5f71224827f2e4c106820e9859988df5d5d12893
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 25 Feb 2020 13:49:17 +0000 (14:49 +0100)]
Use BindingCodecTreeFactory in yanglib
Since BindingCodecTreeFactory is a proper component now, we can
use in our yanglib implementations, severing explicit dependency
on binding-dom-codec implementation.
JIRA: MDSAL-392
Change-Id: I76b3ce49a2b25ef7e2f9ff357f98c843659ad181
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 25 Feb 2020 11:42:50 +0000 (12:42 +0100)]
Remove BindingToNormalizedNodeCodec.getDefaultNodeFor()
This method is used only in controller compat layer, which is going
away anyway. Remove it from our proper.
Change-Id: I61b73754e08c3b36ce6043e19b1cf25d554888d2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 25 Feb 2020 11:15:01 +0000 (12:15 +0100)]
Untangle BindingCodecContext/BindingNormalizedNodeCodecRegistry
The relationship here should be clear -- a BindingCodecContext is
self-contained and should not be subject to dynamism. The registry
maintains a 'current' codec.
Achieving this is very simple -- just do not perform upcalls to
Registry when we are looking for a streamer, it would just loop
back to BindingCodecContext and we want to be consistent, i.e. do
not try to upcall to a different BindingCodecContext.
JIRA: MDSAL-392
Change-Id: I720738f122ba89974e32c91ed8c7f3a059c21690
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 25 Feb 2020 11:07:34 +0000 (12:07 +0100)]
Split off DefaultBindingCodecTreeFactory
BindingCodecTreeFactory is a simple interface which should be backed
by a simple implementation, rather than munging it with the codec
itself. Split it out of BindingNormalizedNodeCodecRegistry and back
it by the corresponding context.
JIRA: MDSAL-392
Change-Id: I1c35d39ab1b7d3b40a6cc3eacd69d3677306c081
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 24 Feb 2020 12:23:16 +0000 (13:23 +0100)]
Use only BundleContext in BindingClassLoadingStrategy
OSGi DS allows us to inject BundleContext directly, do not bother
with ComponentContext.
JIRA: MDSAL-392
Change-Id: I679d981d36a2e9e8d7df09bc79f87b4e803b1e8d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 24 Feb 2020 13:28:09 +0000 (14:28 +0100)]
Migrate assertThat() imports
Assert.assertThat() has been deprecated, with MatcherAssert.assertThat()
being its replacement.
Change-Id: Ifd0f0243756e78f0788f39867514958109d1ab24
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 19 Feb 2020 17:18:52 +0000 (18:18 +0100)]
Use OSGi DS instead of Activator/blueprint
This saves us some hassle, making the intent more obvious.
JIRA: MDSAL-392
Change-Id: I76a42e206857b1c59d0080c788b157ecf40ba829
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 23 Jan 2020 07:01:07 +0000 (08:01 +0100)]
Bump yangtools to 5.0.0-SNAPSHOT
This adopts yangtools-5.0.0 at snapshots, so we can shake out
integation issues and base our development on yt-5.0.0 changes.
This forces us to refactor mdsal-binding-dom-codec-osgi, which
is done in this patch. We adopt OSGi DS for tracking services.
JIRA: MDSAL-392
Change-Id: Ib5f7cb9817869ca5fc9053af4620d9536a27dcbf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 23 Feb 2020 21:26:25 +0000 (22:26 +0100)]
Remove BindingRuntimeContext{Listener,Service}
These are not used anywhere and we'll be publishing the context
to the SR anyway. Remove the code while preparing to have it
refactored with DS.
Change-Id: I7639a7ae64edbbc52789eaa0ce388ce7698ff2d7
JIRA: MDSAL-392
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 20 Feb 2020 10:24:15 +0000 (11:24 +0100)]
Split up BindingRuntimeContext
We need to disconnect API and implementation here, so that we can
publish BindingRuntimeTypes as a service. The split is done within
runtime-api, though the code is still subject to movement.
JIRA: MDSAL-392
Change-Id: Ied64b89018312daef61d9eb9da3e77a0314eca9d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 21 Feb 2020 19:15:14 +0000 (20:15 +0100)]
Remove blueprint component
A thorough review of MD-SAL lifecycle has shown we bend over
backwards to maintain immutable service view for blueprint
containers.
The basic mindset behind blueprint goes directly against MD-SAL's
view of immutable objects. Specifically, hides all dynamic services
behind proxies, isolating us from the Service Registry. Hence we
cannot use the registry to exchange state -- which defeats the point
of having the service registry.
OSGi Declarative Services use static binding (by default) and allow
us to expose component lifecycle, so that it can be correctly
responded to.
We therefore remove any pretense we are endorsing blueprint -- because
we are not. Everybody should decompose their application properly
and use DS for OSGi.
JIRA: MDSAL-413
Change-Id: I6a53e2f9da80a52d4d53371669158e9db7452c1e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>