Robert Varga [Wed, 23 Nov 2022 14:36:34 +0000 (15:36 +0100)]
Integrate getRpcMethodToSchema() into constructor
We are creating an intermediate map here, only to re-examine it in a
second pass. Integrate the method and create rpcNames in a single pass.
This gives us a more direct conduit to RpcInvocationStrategy.
JIRA: MDSAL-777
Change-Id: I63c6a6d108e9336fcca56343652b9695ae3d4992
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Nov 2022 14:26:58 +0000 (15:26 +0100)]
Move getRpcMethodToSchema()
This method is only used by RpcServiceAdapter and depends only on
BindingRuntimeContext. Move it to RpcServiceAdapter to improve
containment.
JIRA: MDSAL-777
Change-Id: Ib4222bb85214d27d82feec17fc8c91809ebe44de
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Nov 2022 13:18:33 +0000 (14:18 +0100)]
Update CurrentAdapterSerializer.getRpcMethodToSchema()
We are moving less reliance on BindingReflections and RpcDefinition.
Refactor getRpcMethodToSchema() to use RpcRuntimeTypes instead, from
whence we can acquire better information -- for example
RpcEffectiveStatement.
Also update LazySerializedContainerNodeTest to not rely on this method,
as it can get its inputs in a much smoother manner.
This is another step to eliminating BindingReflections from invocation
strategy creation, which we will need, as single RPCs just do not have
the type capture we need for the input class.
JIRA: MDSAL-777
Change-Id: I7382e2a01ee8ee0d0e611286f9dcef5d92e6acdf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Nov 2022 00:30:06 +0000 (01:30 +0100)]
Clean up RpcServiceAdapter
Deal with the proxy naming conflict, removing a CheckStyle suppression.
Also use local variable type inference to shorten things a bit.
JIRA: MDSAL-777
Change-Id: Ie0cebd4dac3c714060af5683671b1cafd164f00e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 23 Nov 2022 00:18:43 +0000 (01:18 +0100)]
Split out RpcInvocationStrategy
The invocation strategy will need to be shared with single-RPC proxies.
Split it out, seal it and make sure to clean it up. This ends up
eliminating one class, as the usual case is easily handled and then only
overridden for content-routed RPCs.
JIRA: MDSAL-777
Change-Id: If5f25617fa3120405d0872ded229cdd7db99065a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Nov 2022 13:38:08 +0000 (14:38 +0100)]
Move BindingReflections.isSubstitutionFor()
We have deprecated this method, now move it to its sole user.
Change-Id: Id596e9cea546264e848b302a73ba3bb4e82faee7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Nov 2022 13:34:40 +0000 (14:34 +0100)]
Deprecate BindingReflections.isSubstitutionFor()
This method is used only in mdsal-binding-dom-codec, deprecate it for
removal.
Change-Id: I188f0d14b10f72bce2561c6e80e087a230eb5b4b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Nov 2022 12:05:38 +0000 (13:05 +0100)]
Hide BindingReflections.isNotification()
This method is not used anywhere, remove it from public sight.
JIRA: MDSAL-781
Change-Id: I3d188db0d4622efdba0782656b0884d70540ae36
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Nov 2022 12:04:36 +0000 (13:04 +0100)]
Deprecate BindingReflections.isNotification()
This methods is only used internally and in tests, deprecate it for
removal.
Change-Id: I1c4b5b863c20caa5056a5db505921ff512cdeba8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Ruslan Kashapov [Wed, 23 Nov 2022 06:05:12 +0000 (08:05 +0200)]
Generate binding-dom-codec classes into separate packages
We are namespace-squatting on the codegen namespace, adding various
magic suffixes to ensure uniqueness. This is not perfect, because
compile-time codegen does not have a completely free reign over
its namespace. This is also problematic if these classes were delivered
through a separate jar -- it would cause split packages, which are
ugly.
Allocate three new namespaces and dump codec classes there, thus
ensuring no overlap, squatting or similar.
JIRA: MDSAL-784
Change-Id: I68b8db09ffc9286bb40118545619760b9060a082
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Nov 2022 10:23:21 +0000 (11:23 +0100)]
Move BindingReflections.getChildrenClass*
These methods are only used by mdsal-binding-dom-codec, move them to
their sole users.
JIRA: MDSAL-781
Change-Id: I074a8c91f1729194f47310424dd93a9e703ca629
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Nov 2022 11:38:23 +0000 (12:38 +0100)]
Deprecate BindingReflections.getChildrenClass*
These methods are only used by mdsal-binding-dom-codec, deprecate them.
Change-Id: I9ba5a82bfab437640c76625a316e60c4902099fc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 2 Nov 2022 14:47:59 +0000 (15:47 +0100)]
Deprecate BindingReflections.resolveRpc{In,Out}putClass()
These methods are not used anywhere, deprecate them.
Change-Id: I10cd81e4a52f52edcbcb1cb0be5621270633e9a9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Nov 2022 01:41:19 +0000 (02:41 +0100)]
Update {Leaf,Root}BindingClassLoader
Use a VarHandle so we can reduce volatile loads a bit. Also use
ImmutableSet.builder() fluently, eliminating an intermediate ArrayList.
Change-Id: I1ab2806db6ddd7482110826c96bf3d9b88d6d28c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 24 Nov 2022 00:50:45 +0000 (01:50 +0100)]
Split out mdsal-binding-loader
The class loader based on ByteBuddy is more generally useful, split it
out into a separate artifact for reuse.
Also rename CodecClassLoader to BindingClassLoader, as that is more
appropriate. Modernize the code a bit by using local variable type
inference. Furthermore drop dependency on Guava's Supplier, as we can
achieve the same with java.util.function.Supplier.
JIRA: MDSAL-793
Change-Id: I3630e452ed631c11cd0ea62b1d790bec360baf4a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 21 Nov 2022 18:47:31 +0000 (19:47 +0100)]
Refactor RpcRoutingStrategy
RpcRoutingStrategy is not really a nice construct -- it essentially
extracts context information, not much more. As such, dealing with two
subclasses is a drag.
Intruduce ContentRoutedRpcContext to capture the interesting information
in a record and adjust users to deal with the fact that normal RPCs do
not have this construct.
Change-Id: I2c8d24a61e6905063c9eb93fb0513dffe4831b66
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 21 Nov 2022 13:10:39 +0000 (14:10 +0100)]
Derive RpcRoutingStrategy from RpcEffectiveStatement
Use RpcEffectiveStatement instead of RpcDefinition to derive the
strategy. A knock-on effect is a clean up of entries and their tests,
as they can operate solely on QNames now.
Change-Id: Id2988458bb923d09b07a5a1819554b043b3840d8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 21 Nov 2022 13:01:04 +0000 (14:01 +0100)]
Seal RpcRoutingStrategy
We do not allow subclassing of this class, make sure to codify that by
sealing it.
Change-Id: I6edea76dec0511bc16e94a06b4aee2be894732b7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 20 Nov 2022 18:42:38 +0000 (19:42 +0100)]
Add RpcProviderService documentation
We have largely-undocumented methods. Add documentation.
Change-Id: I7b12ba2d412d6de276e4c62277ff3c852e72a996
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 18 Nov 2022 01:21:02 +0000 (02:21 +0100)]
Rename Enumeration to EnumTypeObject
Enumeration is a troublesome name, let's use a more regular
EnumTypeObject, which follows the TypeObject naming.
Change-Id: I2581d760db8597f7ccfe6f0d2c68e28423fbea5d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 17 Nov 2022 22:56:36 +0000 (23:56 +0100)]
Add UnionTypeObject
Introduce UnionTypeObject, which is a specialization of TypeObject to
unions. This allows us to seal TypeObject, making sure all it is always
properly specialized.
Also revert the change in SerialVersionUID introduced with
BitsTypeObject by properly ignoring it.
Change-Id: I72ef1d452e2a48c630e9c87bfb4ff0fac0fda32c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Ivan Martiniak [Tue, 12 Jul 2022 09:18:39 +0000 (11:18 +0200)]
Add BitsTypeObject
The new interface BitsTypeObject, besides grouping bits type objects,
helps clarify which bits are restricted.
Method validValues() returns constant containing valid bits.
The logic of the creation of this constant is contained in the
AbstractTypeObjectGenerator.java.
Method getValue() was included in this interface and its generation
was adjusted for restricted and standard bits types separately.
Related test classes were adjusted as well.
JIRA: MDSAL-743
Change-Id: I74820e7a041e137902c774655517ea8d1e4bccd9
Signed-off-by: Ivan Martiniak <ivan.martiniak@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 17 Nov 2022 22:33:46 +0000 (23:33 +0100)]
Bump byte-buddy to 1.12.19
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.12.14
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.12.15
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.12.16
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.12.17
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.12.18
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.12.19
Change-Id: Iff0bf7fac38abb69cb8d1547e8fa188a11428b94
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 10 Nov 2022 01:27:47 +0000 (02:27 +0100)]
Improve SerialVersionHelper a bit
sortedCollection() can use local variable type inference, which ends up
binding ArrayList.sort() directly -- providing a smidge better
performance by using INVOKEVIRTUAL instead of INVOKEINTERFACE.
Change-Id: I28470942dc37dd8171cc10eccf6c6a15d85ade9e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 10 Nov 2022 01:09:41 +0000 (02:09 +0100)]
Do not use appendValue to append bits
Using false/true values is overly verbose and incurs a boxing penalty.
Update mapping to only mention bits which are set. Add a dedicated
CodeHelpers.appendBit(), which uses boolean value to decide whether to
append the bit's name or not.
JIRA: MDSAL-744
Change-Id: Ifefa258dc6850ea220ffebcc7dbb788979657704
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 10 Nov 2022 00:36:32 +0000 (01:36 +0100)]
Use Boolean.hashCode() for bits components
Rather than boxing to Boolean and then going through
Objects.hashCode(Object), employ some smarts and go directly to
Boolean.hashCode(boolean).
JIRA: MDSAL-744
Change-Id: Ida374207c67b776e1eeafb40e3a4f725fe2edf1f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 9 Nov 2022 23:40:15 +0000 (00:40 +0100)]
Use primitive comparison for bit properties
Rather than boxing to go through Objects.equals(), use plain '==' on
booleans.
JIRA: MDSAL-744
Change-Id: I005ba52d8c68fb9eaf7d93e40adcf13ca159436f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 9 Nov 2022 22:59:09 +0000 (23:59 +0100)]
Remove BaseTemplate.hashCodeResult()
This method is not used anywhere, remove it.
Change-Id: I7c17303b08443c67eaf321ff5c316ebb991351ec
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 9 Nov 2022 22:53:46 +0000 (23:53 +0100)]
Improve class template equals()
Rather than generating a slew of if/return statements, use instanceof
pattern and generate a single-expression return statement.
Change-Id: Id8c0fc65736399fed3454fdbcc16a16849f86064
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 9 Nov 2022 22:19:32 +0000 (23:19 +0100)]
Import java.lang.Object in equals()
We have the machinery to have a proper reference, let's use it.
Change-Id: I92e08cac810c3c3f7a3a737746d6c85ba5f2c10e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
ivan.martiniak [Fri, 1 Jul 2022 11:31:41 +0000 (13:31 +0200)]
Map bits type to primitive boolean
The main change is in the AbstractTypeObjectGenerator.java,
returned type for bits was set to primitive boolean.
Generation of the getDefaultInstance() method in the ClassTemplate.xtend
had to be adjusted as well, as the null value obviously
does not make sense in the case of primitive type.
Related test classes had to be changed as well
JIRA: MDSAL-744
Change-Id: Ic6423f67679475fced73ea68ed4f447b241230f7
Signed-off-by: ivan.martiniak <ivan.martiniak@pantheon.tech>
Robert Varga [Mon, 7 Nov 2022 16:10:43 +0000 (17:10 +0100)]
Make SerializedDOMDataBroker final
This is a utility implementation and it should not be subclassed.
Change-Id: Ie69f01bd232ae1a407f332235c800b655a186499
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 9 Nov 2022 18:31:48 +0000 (19:31 +0100)]
Do not emit empty super() call
If we do not have any parent properties, we should not generate a
free-standing super() call -- javac will do that for us.
Change-Id: Ib45ec29e9914f0f3eeef7e2d86ebb94fbd33aab1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 9 Nov 2022 18:24:55 +0000 (19:24 +0100)]
Keep property initialization order constant
Eventhough one property is checked for null, we should not be placing it
before the others.
Change-Id: I2be23b4ed278d693828a1758af9c47b0a6e0caf9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 9 Nov 2022 18:05:46 +0000 (19:05 +0100)]
Require union field to be set
Do not allow an union type object to be costructed without supplying one
of its alternatives.
JIRA: MDSAL-792
Change-Id: I69a9dc3f0094cc9ff03d0846d5f9dcc746417628
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 9 Nov 2022 18:11:21 +0000 (19:11 +0100)]
Migrate mdsal-binding-test-model to JUnit 5
We have a few simple tests, let's migrate them.
Change-Id: Ifea435affc917070a20d3ca9368d6d3c7f499453
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 21 Feb 2021 12:15:35 +0000 (13:15 +0100)]
Do not allow multi-datastore transactions
Cross-datastore transactions are something that does not fit into
interaction model of neither MD-SAL nor NETCONF WG. As we are evolving
our APIs to make them impossible, make sure we report attempts to use
transactions across multiple datastore.
JIRA: MDSAL-775
Change-Id: If9a3bb619f4fd5703f786d14f42485d2073968ec
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 7 Nov 2022 01:56:16 +0000 (02:56 +0100)]
Use a VarHandle for closed flag
This eliminates type safety warnings and make it more explicit as to
what we mean.
Change-Id: Ib268de2c02c7ac04aec25a3a1f9df40d2b8c3238
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 7 Nov 2022 01:58:21 +0000 (02:58 +0100)]
Improve AbstractDOMForwardedTransactionFactory
AutoCloseable.close() is recommended to be idempotent, follow that
guidance, producing a warning with a stack trace if that is not the
case.
Change-Id: I0ba827bae521b07c94ecf58e8881f72b1ec8fdc6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 7 Nov 2022 01:11:11 +0000 (02:11 +0100)]
Specialize CommitCoordinationTask
Tracker is optional, so let's subclass the tracking into a wrapper
class.
Change-Id: I4271d2453181bbbf2310c4737ef90b87d154b046
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 6 Nov 2022 20:13:43 +0000 (21:13 +0100)]
Remove OSGiQueryFactory
We have constructor injection, so let's do that. Also activate lazily
and therefore lower debug levels.
Change-Id: I0b37a2bab8109d47d13276b135b7f510272ee024
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 6 Nov 2022 20:14:55 +0000 (21:14 +0100)]
Use a record for RecordId
This is pure data holder, use a record instead.
Change-Id: I1161e0431592f15360c6cdd87e37604bb0fbc2e0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 6 Nov 2022 20:22:47 +0000 (21:22 +0100)]
Fixup AbstractForwardedTransaction.doExecute()
This should be a static method, also modernize it a bit.
Change-Id: Iecea13d78146c235dea389f1e72543751ed255fb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 4 Nov 2022 16:40:54 +0000 (17:40 +0100)]
Rename ModuleInfoSnapshotResolver
We are masquerading as the binding-dom-codec, but that is not accurate.
Use our name instead.
Change-Id: I930976e96b22bbb070d1a02ccd28bfa86a59cf1e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 4 Nov 2022 17:18:56 +0000 (18:18 +0100)]
Modernize ModuleInfoSnapshotResolver a bit
Use local variable type inference and streams to transform things.
This reduces the verboseness a bit.
Change-Id: I9ec9bf70c7f90b4cd264e9f239b96ddff60bc0cc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 4 Nov 2022 16:36:45 +0000 (17:36 +0100)]
Simplify YangModuleInfoScanner
We will be tracking YangFeatureProviders, so
List<ObjectRegistration<YangModuleInfo>> is not quite accurate. Track
only a simple Registration and make sure we wrap the return from
ModuleInfoSnapshotResolver.
Also improve the tracking logic a bit: do not track bundles which do not
contain YangModuleInfos, but make a special exception for the system
bundle.
JIRA: MDSAL-791
Change-Id: I245f25c72152f7e49817c316f63ace557b4c56c0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 4 Nov 2022 16:16:33 +0000 (17:16 +0100)]
Remove unneeded suppression
We are catching only checked exceptions, no need for the suppression.
Change-Id: Ib19174db68934d058d3ec9352653e2d19762a164
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 4 Nov 2022 12:50:37 +0000 (13:50 +0100)]
Fix version mis-bump
We have failed to update model versions, fix that up.
Change-Id: Ie5894174fa2322cb663a14a10a98f50a2ff94897
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 2 Nov 2022 20:16:14 +0000 (21:16 +0100)]
Clean up LazySerializedContainerNodeTest
Use ImmutableNodes instead of relying on builder implementation.
Change-Id: I7e9ca92c8b1f71e06296427d19560fa6c62624e4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 2 Nov 2022 20:13:40 +0000 (21:13 +0100)]
Clean up NormalizedNodeSerializeDeserializeTest
Use static imports from Builders/ImmutableNodes to eliminate dependency
on builder implementations.
Change-Id: Ie34c8d92d721132d9b5881481997df358e1f53d8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 2 Nov 2022 19:58:06 +0000 (20:58 +0100)]
Clean up mdsal-dom-broker tests
Do not reference builder implementations directly.
Change-Id: I15111ea3b446e677d4c02a9cd0c7f46743e8f184
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 2 Nov 2022 19:54:36 +0000 (20:54 +0100)]
Clean up mdsal-dom-inmemory-datastore-benchmark
Clean up pom.xml, update JMH and use Builders instead of implementation
detail.
Change-Id: Ida822fa4e15f44d610ea080b3a68f217e8fecad4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 2 Nov 2022 19:49:04 +0000 (20:49 +0100)]
Migrate a SchemaContext reference
We should be operating on EffectiveModelContext.
Change-Id: I1a2978a3f912c4edb31923cc24e31c619df04a06
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 2 Nov 2022 19:41:01 +0000 (20:41 +0100)]
Clean up InMemoryDataStoreTest
Add proper assertions and use Builders instead of direct reference to
immutable container builder.
Change-Id: I07d725d9da13c75ad152e618a9bf1bc761167309
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Ivan Hrasko [Thu, 4 Nov 2021 14:10:26 +0000 (15:10 +0100)]
Add nonnullFoo() getters for non-semantic objects
Add non-null getters for containers without presence statement. They
return a lazy-initialized containers' empty instances in case the
container is null.
Non-null getters are implemented in Builder's inner implementation
of the container's parent.
Container's empty instance is located in container's builder class
and is hidden behind a static method.
In the binding codec part a nonnull method is generated using usual
lazy proxy backed by an empty ContainerNode.
JIRA: MDSAL-673
Change-Id: I3a5a346b32b89e7c28cad31536593824dee3c232
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 2 Nov 2022 15:48:16 +0000 (16:48 +0100)]
Clean up BindingNormalizedNodeCodec.deserialize() implementations
We should consistently throw NPE/IAE for inputs. Add some basic infra
and make sure every implementation behaves similarly. Most notably we do
not want to dump the entire argument, as that could lead to an OOM.
Change-Id: I6aad6c587028637e0089684ba2305d3e7c20675e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 2 Nov 2022 15:39:46 +0000 (16:39 +0100)]
Qualify FIXME
Attach issue reference to the pre-existing FIXME.
JIRA: MDSAL-785
Change-Id: Ic09ae54a8b8219703ccefc038df5d295e27b22c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 2 Nov 2022 14:34:39 +0000 (15:34 +0100)]
Remove BindingReflections.findHierarchicalParent()
These methods are not used anywhere, remove them.
JIRA: MDSAL-787
Change-Id: If141bf222523671fb524c27f2322e4591410d900
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 2 Nov 2022 14:33:33 +0000 (15:33 +0100)]
Deprecate BindingReflections.findHierarchicalParent()
These methods are not used, deprecate them for removal.
Change-Id: Idee358f004fb36fb01a3c5222430a808dd68bbfd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 2 Nov 2022 14:30:48 +0000 (15:30 +0100)]
Remove BindingReflections.isAugmentationChild()
This method is not used anywhere, remove it.
JIRA: MDSAL-786
Change-Id: I6ed40aab7432f59e2e2a8bcb51e161cac2fcb33e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 2 Nov 2022 14:28:24 +0000 (15:28 +0100)]
Deprecate BindingReflections.isAugmentationChild()
This method is used only in test, deprecate it for removal.
Change-Id: I894429041302163288036085a1af4718d5e28a83
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 2 Nov 2022 14:15:04 +0000 (15:15 +0100)]
Use Optional.orElseThrow()
This makes the intent clearer.
Change-Id: Ib7d733d7563e6a51b86dbf313da55abb18556d4d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 1 Nov 2022 18:23:54 +0000 (19:23 +0100)]
SimpleDOMQueryResult should be a record
This is a simple reference holder with some accessors, turn it into a
record.
Change-Id: I76f66684f805f1938b621229a35e2efe91ab502e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 1 Nov 2022 18:16:23 +0000 (19:16 +0100)]
Fix documentation typoes
We have simple grammar errors here, fix that up.
Change-Id: I597db08441200065924b233289a3e5864370a928
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 5 Oct 2022 11:16:17 +0000 (13:16 +0200)]
Bump upstreams
Adopt:
- odlparent-12.0.0
- yangtools-10.0.0
Change-Id: Ic101cb87855ee69680746d783e1a40b6f944e3f9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 22 Aug 2022 15:40:24 +0000 (17:40 +0200)]
Package iana-crypt-hash module
This is a useful registry, make sure we package it. Since this model
comes from RFC7317, which also defines ietf-system.yang, we break our
usual feature packaging for now. This will be revised once we have the
tools to correctly indicate ietf-system being implemented (or not).
JIRA: MDSAL-768
Change-Id: I5c0bb5f97290a91718c90b66ffea4872887443cf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 17 Oct 2022 21:02:00 +0000 (23:02 +0200)]
Clean up Datastore addressing
Rather than using Class files, use explicit well-known constants.
Change-Id: I999e3a7e32f7743320da5c3a0b42ec136653255e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 13 Oct 2022 13:40:34 +0000 (15:40 +0200)]
Add BindingReflections.getQName(Rpc)
Acquiring the QName of an RPC implementation is a well-known operation,
make sure we publish that capability.
JIRA: MDSAL-773
Change-Id: I2d3bd90d41b8da45f7b99a0ffebdfa4e18c0ffcc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 13 Oct 2022 13:28:36 +0000 (15:28 +0200)]
Improve BindingReflections.getQName()
BaseIdentity operates on instance methods now, hence we should not
be passing a Class here. This allows us to evolve the contract in
the future.
Change-Id: I837dbfd9dffedf190c6885202d39cf730cd08de2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 13 Oct 2022 13:27:06 +0000 (15:27 +0200)]
Update BindingReflections.getQName()
Use orElseThrow() instead of checkState() and explicit check/get.
Change-Id: I9b16d31ad4dba8a1d911a3566d590b2d8d2f47fc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 13 Oct 2022 11:21:58 +0000 (13:21 +0200)]
DOM RPC invocation takes ContainerNode
RPC input statements are equivalent to a ContainerNode, make sure to
update RPC services.
JIRA: MDSAL-541
Change-Id: Iaa26e7051cfb45e043acf4ca6f39125678684ea8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 13 Oct 2022 09:28:09 +0000 (11:28 +0200)]
Deprecate BindingMapping.NOTIFICATION_LISTENER_SUFFIX
This is part of the NotificationListener specification, it needs to be
deprecated just as the rest of it is.
Change-Id: I61996af51b9f8bc67b986cefdc8abf98bdc2ac7c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
8414434942b4548da0a3fd96013cd35391575493)
Robert Varga [Wed, 5 Oct 2022 12:43:57 +0000 (14:43 +0200)]
Generate Rpc services
Introduce an Rpc concept similar to Action, except without a path.
Generate its specializations, allowing RPCs to be implemented and/or
invoked without their ModuleService aggregate.
JIRA: MDSAL-773
Change-Id: I5fec1ac5c81b908714965e71c3471b954b58d1f9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 6 Oct 2022 11:58:58 +0000 (13:58 +0200)]
Integrate Action with BindingContract
Having an integrated BindingContract allows us readily identify
the the implementation contract of an action. This allows us to ditch
the explicit class instance.
JIRA: MDSAL-776
Change-Id: I6fc297f331d5f0c545b80e84ca54025c44c67eb6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 5 Oct 2022 12:16:23 +0000 (14:16 +0200)]
Update DOMRpcResult a bit
Use ContainerNode for result value and replace getErrors()/getResult()
with errors()/result().
This cleans up parlance a bit and makes the object model actually match
YANG RPCs.
JIRA: MDSAL-541
Change-Id: I0b1c0456385fd64eba06aa90580a7b56a5be0a86
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 6 Oct 2022 12:20:55 +0000 (14:20 +0200)]
Simplify ActionSpec.equals(Object)
We can use an instanceof pattern, squashing logic accordingly.
Change-Id: Ice925cc99d90b1c918ce17cfdc987275db932381
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 5 Oct 2022 12:42:26 +0000 (14:42 +0200)]
Improve ModuleAugmentGenerator safety
Require parent to be a module, which makes the intent more explicit.
Change-Id: Ic9d83c879838d10a475b46feb43a6aeab0c3f66c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 5 Oct 2022 12:50:53 +0000 (14:50 +0200)]
Use instanceof patterns
We have quite a bit of checking and casting going on, simplify a bit
but using JDK17 constructs.
Change-Id: Iffd0537e9832f8372b696fba7025c49c0fbf597c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 5 Oct 2022 11:53:54 +0000 (13:53 +0200)]
Remove use of SchemaPath
We are not referencing SchemaPath in any shape or form. Remove all
references.
Change-Id: I509ee338ed3e8d038200ca8d36686a5320b13884
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 5 Oct 2022 11:05:58 +0000 (13:05 +0200)]
Bump versions to 11.0.0-SNAPSHOT
This starts the next major development iteration.
Change-Id: Ia278be03f42f2e9c17c6b59fb5330aa41e3faa99
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 9 Aug 2021 21:40:27 +0000 (23:40 +0200)]
Do not tolerate empty action instances
The set of instances is specified to be non-empty, enforce this
requirement.
Change-Id: If3334c850eaf3ffb1be33626b332547268a2bd90
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 14 Sep 2022 12:30:02 +0000 (14:30 +0200)]
Bump versions to 10.0.3-SNAPSHOT
This starts the next development iteration.
Change-Id: I2434badf754ee6f6845ee7f090f78e597f0d5af0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Samuel Schneider [Wed, 17 Aug 2022 08:07:50 +0000 (10:07 +0200)]
Generate javadoc for TypeObjects
Fix warnings about missing javadoc in TypeObject classes.
Add setting of YangSourceDefinition when building GeneratedType
for TypeObject so JavaFileTemplate.appendSnippet() generate javadoc
for this class.
Generation of javadoc was added for all TypeObjects not only
ScalarTypes as described in corresponding task.
JIRA: MDSAL-762
Change-Id: Iec3ab9e36bcea0807892bd024b7f04c451ff9000
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 14 Sep 2022 10:43:51 +0000 (12:43 +0200)]
Clean up AbstractEnumerationBuilder
We can use Java 17, fluent StringBuilder and streams to make the code
denser.
Change-Id: Id0b8bc176076469120fddbb993e9a59215aa660a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 9 Sep 2022 13:52:44 +0000 (15:52 +0200)]
Propagate status in feature classes
When we have a deprecated or obsolete identity, the resulting interface
should be marked as deprecated, perhaps for removal.
JIRA: MDSAL-770
Change-Id: I2b1204b2afcd4b2786c0c76695c1d58304349f57
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 9 Sep 2022 13:51:15 +0000 (15:51 +0200)]
Propagate status in identity classes
When we have a deprecated or obsolete identity, the resulting interface
should be marked as deprecated, perhaps for removal.
JIRA: MDSAL-769
Change-Id: I5aefc70d5cde269217143e092ba208589b55d12f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 9 Sep 2022 05:39:05 +0000 (07:39 +0200)]
Bump xtend to 2.28.0
https://www.eclipse.org/xtend/releasenotes.html#/releasenotes/2022/05/30/version-2-27-0
https://www.eclipse.org/xtend/releasenotes.html#/releasenotes/2022/08/29/version-2-28-0
Change-Id: I9ce1d9fddabff9df48de9fc69637492d30c39635
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 22 Aug 2022 14:50:10 +0000 (16:50 +0200)]
Generate features with @NonNullByDefault
We get quite a few warnings around nulls, use @NonNullByDefault, as that
is what we need.
Change-Id: Ia6b7c572ece161cc4e9cac1e9530a91b621cd93e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 18 Aug 2022 08:11:18 +0000 (10:11 +0200)]
Bump versions to 10.0.2-SNAPSHOT
This starts the next development iteration.
Change-Id: I353e51fd685690023e24fdad452d53ced4d44eee
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 17 Aug 2022 15:48:39 +0000 (17:48 +0200)]
Bump odlparent/yangtools
Adopt:
- odlparent-11.0.1
- yangtools-9.0.1
Change-Id: I3b1ba2d5345bbf26d471296f850e3b9836ffb2a8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 16 Aug 2022 11:01:14 +0000 (13:01 +0200)]
Use @Serial tag
With Java 17 we can make serialization-related components explicitly
tagged so their shape is enforced. Sprinkle java.io.Serial around.
Change-Id: Ibf0ce6e19f8433b3274e05ad3f56d86616146e78
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 16 Aug 2022 10:06:57 +0000 (12:06 +0200)]
Use contructor injection in OSGiModelRuntime
Remove unneeded indirection through fields, so that the lifecycle is a
tad more crisp.
Change-Id: I55794015a41340e38f77c7cca7caf047116ae18c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 16 Aug 2022 11:47:39 +0000 (13:47 +0200)]
Use instanceof pattern in Identity's equals()
We can use an implicit cast here, let's just do that to make things a
tad simpler.
Change-Id: Ic2f48c2b8f3fc0e4b5aec0b699cad8edf4c434b0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 16 Aug 2022 09:45:50 +0000 (11:45 +0200)]
Fixup a nullness warning
Add an annotation to fix a potential problem.
Change-Id: I8676cb25ee5f7c8c132b894f47c4383825d9ff5d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 16 Aug 2022 09:38:16 +0000 (11:38 +0200)]
Fix raw type warnings in OSGiBindingRuntime
Component/ComponentFactory take a type specification, make sure we
take advantage of that.
Change-Id: I11cd64811b683fdfa8dfd62980cf9e1979ed1c0d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 10 Aug 2022 23:23:51 +0000 (01:23 +0200)]
Add YangFeatureProvider
YangFeatureProvider is a counterpart to YangModuleInfoProvider,
providing the runtime with the ability to introspect what features
should be supported in an EffectiveModelContext.
JIRA: MDSAL-767
Change-Id: I6d08772c96eead79b4c88ae9ac27c57901dc70a8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 10 Aug 2022 23:51:46 +0000 (01:51 +0200)]
Generate classes for 'feature' statements
We need to cross-reference 'feature' statements before we assemble an
EffectiveModelContext. In order to do that cleanly and in a type-safe
manner, we need to generate Binding representation of each feature.
JIRA: MDSAL-766
Change-Id: I67e2a1dd42bd1b364fbcbbf88a83d96c947621ef
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 15 Aug 2022 17:48:07 +0000 (19:48 +0200)]
Use instanceof pattern checks
We can clean up some code with instanceof patterns, use them.
Change-Id: I0c3022b44d824b4677b1286a9c3b99cf18a01193
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 15 Aug 2022 08:27:00 +0000 (10:27 +0200)]
Narrow @SuppressModernizer
We are only suppressing the use of Guava's Objects in != operator, narrow
covered places.
Change-Id: I6b3ec8f78996227bae27558f9c04b22ed866595b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 15 Aug 2022 07:35:54 +0000 (09:35 +0200)]
Use an instanceof pattern
We can remove a cast here, saving a few characters.
Change-Id: Ie2c03a062cffce58ba15a253e81957b6cc5d1b6b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>