mdsal.git
4 months agoUse bindingChild() to locate notifications 63/109363/6
Robert Varga [Sun, 17 Dec 2023 01:46:40 +0000 (02:46 +0100)]
Use bindingChild() to locate notifications

BindingRuntimeTypes provides an interface to directly find
NotificationRuntimeType based on its name. Use it instead of dancing
around with reflection.

JIRA: MDSAL-781
Change-Id: I3ba1a06d8dc07700bd86a3288116989a1a445138
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoUse @Nullable in AbstractExplicitGenerator.runtimeType() 58/109358/7
Robert Varga [Sat, 16 Dec 2023 20:41:36 +0000 (21:41 +0100)]
Use @Nullable in AbstractExplicitGenerator.runtimeType()

Rather than using Optional, split the two user groups to those who check
for null and who assume non-null.

The former continue to call runtimeType() and latter defer to
getRuntimeType().

Change-Id: I0818d806204007127a956f7598267735c90faca9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoImprove isOriginalDefinition() 64/109364/2
Robert Varga [Sun, 17 Dec 2023 12:33:39 +0000 (13:33 +0100)]
Improve isOriginalDefinition()

We have an already-casted AddedByUsesAware, use that for the next
instanceof check.

Change-Id: I2e9a172c02fbc3e97d8c90e477cecaf8fa9504f5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRemove BindingRuntimeTypes.findRpc{Input,Output} 60/109360/10
Robert Varga [Sat, 16 Dec 2023 20:56:43 +0000 (21:56 +0100)]
Remove BindingRuntimeTypes.findRpc{Input,Output}

These methods are no longer used, remove them along with the indexing
support. This indes {Input,Output,Rpc}Generator.

Change-Id: I90820f5e925fd7e72dbe68572e5c671ef277da29
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoChange BindingRuntimeTypes.findIdentity() 61/109361/4
Robert Varga [Sat, 16 Dec 2023 22:43:15 +0000 (23:43 +0100)]
Change BindingRuntimeTypes.findIdentity()

Rename the method to identityChild(), returning a @Nullable instead of
an Optional. Add the appropriate documentation.

Change-Id: I9c95c61d015595f876371cfc5e1e521a1b4b3cbe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoUse schemaTreeChild() to lookup input/output 59/109359/3
Robert Varga [Sat, 16 Dec 2023 20:55:17 +0000 (21:55 +0100)]
Use schemaTreeChild() to lookup input/output

We have proper RpcRuntimeType, hence we can follow along the schema tree
axis to obtain the runtime types for RPC input/output.

Change-Id: Iea34601edc340b788fc3ee4e17c5da7e245734b7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoModernize ListGenerator 57/109357/1
Robert Varga [Sat, 16 Dec 2023 20:28:26 +0000 (21:28 +0100)]
Modernize ListGenerator

Use local variable type inference. Also use local variables for keyGen
checking so as to eliminate false warnings.

Change-Id: Ic85f57228e42cfbc6cfe1f4a2dbd16b2798934b3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoDrop @Beta from mdsal.binding.generator.impl.rt 56/109356/1
Robert Varga [Sat, 16 Dec 2023 15:58:00 +0000 (16:58 +0100)]
Drop @Beta from mdsal.binding.generator.impl.rt

This package is not exposed to outside world, there is no point in
having @Beta annotations here. Also make
Default{Input,Output}RuntimeType final.

Change-Id: I1506b99651bcc079c1d1d295e60d8a351f78a4a3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoClean up AbstractCompositeRuntimeType 55/109355/3
Robert Varga [Sat, 16 Dec 2023 13:59:55 +0000 (14:59 +0100)]
Clean up AbstractCompositeRuntimeType

SpotBugs is no longer complaining about the Comparator, hence we can
completely remove the dependency of spotbugs-annotations.

While we are here, also clean up the Arrays.binarySearch() assumption we
make, so we tolerate if the key is reported as the first argument.

Change-Id: I97b9683b64e49617ca529826e37392face70739a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoFix wrong annotation use 54/109354/2
Robert Varga [Sat, 16 Dec 2023 14:12:38 +0000 (15:12 +0100)]
Fix wrong annotation use

Use JDT annotation instead of SpotBugs, reducing our exposure.

Change-Id: I1fc1e13c5ae476a456a1ffd4db7182f118985945
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoUse instanceof pattern in AbstractCompositeRuntimeType 53/109353/2
Robert Varga [Sat, 16 Dec 2023 13:45:01 +0000 (14:45 +0100)]
Use instanceof pattern in AbstractCompositeRuntimeType

Rather than a plain verify() and explicit cast, use an instanceof
pattern and an explicit throw.

Change-Id: I4583a650dd0ed875cbc2420ec60907c99a122876
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoUse instanceof pattern DefaultChoiceRuntimeType 52/109352/2
Robert Varga [Sat, 16 Dec 2023 13:35:00 +0000 (14:35 +0100)]
Use instanceof pattern DefaultChoiceRuntimeType

Remove an explicit cast in favor of an instanceof pattern.

Change-Id: Iffe0425ba48a43396667354d4d7b22f882301445
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoUnify GeneratedType verification 51/109351/1
Robert Varga [Sat, 16 Dec 2023 12:58:17 +0000 (13:58 +0100)]
Unify GeneratedType verification

We have number of places where we do verify a Type is a GeneratedType.

Introduce AbstractExplicitGenerator.verifyGeneratedType() to reduce
duplication and explicit casts.

Change-Id: Idcdc2344d59befa2c39d74893348de6627b6c39d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoModernize GeneratorReactor 50/109350/2
Robert Varga [Sat, 16 Dec 2023 12:16:31 +0000 (13:16 +0100)]
Modernize GeneratorReactor

Use local variable type inference and instanceof patterns.

Change-Id: I2f9222d0e6535bfaf7655ef6afccbb2ef431ddd4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoUse Module.asEffectiveStatement() 49/109349/2
Robert Varga [Sat, 16 Dec 2023 12:07:30 +0000 (13:07 +0100)]
Use Module.asEffectiveStatement()

Eliminate a verifyication by cleanly translating Module to
ModuleEffectiveStatement.

Change-Id: I65a08a388e54132457ac8d99d981cbd332d0c009
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoReduce ObjectRegistration use 61/109261/2
Robert Varga [Sat, 9 Dec 2023 17:06:03 +0000 (18:06 +0100)]
Reduce ObjectRegistration use

We have a few more services which are exposing ObjectRegistration from
APIs for no particularly good reason.

Switch them to use Registration instead, which allows us to reduce
adaptation in some cases.

JIRA: MDSAL-843
Change-Id: I9c88288cd4d57b9fb2fc780d9017fbb3eb5dbd94
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoClean up (DOM)DataTreeIdentifier methods 59/109259/5
Robert Varga [Sat, 9 Dec 2023 14:45:47 +0000 (15:45 +0100)]
Clean up (DOM)DataTreeIdentifier methods

These two classes represent the same thing with different addressing
modes. Unfortunately their instantiation is wildly different.

Introduce common.api.LogicalDatastorePath to force them to have the same
shape. While we are at it, make sure the new methods record-friendly.

JIRA: MDSAL-846
Change-Id: I359f77233a37e8cf4c7f7aa340cf2131111835c3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoSwitch (DOM)DataTreeIdentifier to serialization proxy 58/109258/3
Robert Varga [Sat, 9 Dec 2023 13:32:41 +0000 (14:32 +0100)]
Switch (DOM)DataTreeIdentifier to serialization proxy

Switch to using proxies on writeout, so the JVM representation is
disconnected from the serial form.

JIRA: MDSAL-844
Change-Id: I090786c58557df9fb2de36bb237c4a8aabd5c37e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoAdd (DOM)DataTreeIdentifier serialization proxies 57/109257/3
Robert Varga [Sat, 9 Dec 2023 13:18:03 +0000 (14:18 +0100)]
Add (DOM)DataTreeIdentifier serialization proxies

Further evolution of these two classes will require allowing for two
distinct specializations.

In order to be able to do that, we need to disconnect them from their
serial form.

This patch instroduces serialization proxies, which know how to write
out and read in these objects without referencing their class name.

JIRA: MDSAL-845
Change-Id: I2b50d3aa5f752d6181dab991a5a8282b079b16df
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoUse constructor activation for adapted services 60/109260/3
Robert Varga [Sat, 9 Dec 2023 16:42:34 +0000 (17:42 +0100)]
Use constructor activation for adapted services

We have a modern OSGi SCR, hence we can use constructor injection and
make the forwarding implementations completely immutable. Also remove
@Beta annotations.

Change-Id: I1132e10a52b7f3f1b32348db537eb22cae8bf5d5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRemove references to java.util.EventListener 55/109255/3
Robert Varga [Sat, 9 Dec 2023 12:32:36 +0000 (13:32 +0100)]
Remove references to java.util.EventListener

java.util.EventListener does not bring much to the table, remove any and
all references to it.

Change-Id: I933c16954ef8674e36e3dd0bd0ce796cbda85084
JIRA: MDSAL-843
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoDo not use ListenerRegistration in mdsal-binding-api 54/109254/3
Robert Varga [Sat, 9 Dec 2023 12:24:47 +0000 (13:24 +0100)]
Do not use ListenerRegistration in mdsal-binding-api

We have a few direct uses of ListenerRegistration. Convert them to use a
plain Registration instead.

JIRA: MDSAL-843
Change-Id: I1946d4ad17854894617931aa4979c74098d61e6c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoClean up DataTreeIdentifier a bit 56/109256/3
Robert Varga [Sat, 9 Dec 2023 12:37:24 +0000 (13:37 +0100)]
Clean up DataTreeIdentifier a bit

Use a simple hashCode() implementation and instanceof pattern to
simplify equals().

Change-Id: I1312468eb97fad1991366f04970b3c2db27b6ff0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoFix a deprecation-related warning 53/109253/2
Robert Varga [Sat, 9 Dec 2023 12:23:38 +0000 (13:23 +0100)]
Fix a deprecation-related warning

Implementations of deprecated methods should be deprecated themselves.
Fix that.

Change-Id: I8b1b2738160d0da17b25a0f10fa0fb2c26e1aba6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoServiceGroupIdentifier should be a record 51/109251/4
Robert Varga [Sat, 9 Dec 2023 11:17:32 +0000 (12:17 +0100)]
ServiceGroupIdentifier should be a record

Using a record here allows us to perform proper validation, improve
serialization format and ditch the dependency on yangtools.util.

While we are here, also strengthen the check to reject blank strings.

JIRA: MDSAL-843
Change-Id: Ic1342f1cc8090fbb9892d608d03bea0b64e2e5c7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoUse compareAndExchange() to set closeFuture 50/109250/1
Robert Varga [Sat, 9 Dec 2023 10:51:14 +0000 (11:51 +0100)]
Use compareAndExchange() to set closeFuture

Java 9+ gives us a convenient way to ensure null-safety in this CAS
operation -- compareAndExchange() returns the witness value, i.e.
we get the value instead of a plain boolean false.

Change-Id: I636b0f084170d42bbd99490577917afefe5145e2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoFurther cleanups 49/109249/2
Robert Varga [Sat, 9 Dec 2023 09:37:18 +0000 (10:37 +0100)]
Further cleanups

Pick up a few stray fixups which were not part of previous patches.

JIRA: MDSAL-843
Change-Id: I1d8ae43567f004e7c00e3d4176f17cdf3eb0723e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoClean up singleton-service implementation internals 47/109247/2
Robert Varga [Sat, 9 Dec 2023 08:13:28 +0000 (09:13 +0100)]
Clean up singleton-service implementation internals

We have {Active,Placeholder}ServiceGroup, to keep the naming short and
sweet. Also seal ServiceGroup.

JIRA: MDSAL-843
Change-Id: I685ae82e34cf18e603db6e1f51054516caa3d40e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoUse simple Registration in ClusterSingletonServiceProvider 46/109246/1
Robert Varga [Sat, 9 Dec 2023 07:57:28 +0000 (08:57 +0100)]
Use simple Registration in ClusterSingletonServiceProvider

Move ClusterSingletonServiceRegistration into the implementation, so
that end users operate on a plain Registration.

Within implementation, combine it with its sole base implementation to
form a better-named ServiceRegistration.

JIRA: MDSAL-843
Change-Id: I2506a6f86cd66794612b77791d3f5a5ab058f4b5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoClean up mdsal-singleton-dom-impl 45/109245/1
Robert Varga [Sat, 9 Dec 2023 06:38:46 +0000 (07:38 +0100)]
Clean up mdsal-singleton-dom-impl

Fold the multitude of implementation classes into a single
EOSClusterSingletonServiceProvider.

Furthermore do not expose close() from the implemented interface, so
that users do not end up shutting the implementation down.

Eliminate ServiceLoader integration, as we are a stateful component
and therefore want to explicit lifecycle.

The shutdown process is made synchronous, so that close() waits for
everything to settle down.

JIRA: MDSAL-843
Change-Id: I0d137d03d184de07e21e5a9a4329855a021dd433
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRemove GenericEntityOwnershipService 43/109243/3
Robert Varga [Sat, 9 Dec 2023 05:49:20 +0000 (06:49 +0100)]
Remove GenericEntityOwnershipService

GenericEntityOwnershipService acts as a straight jacket for
EntityOwnershipService and DOMEntityOwnershipService, which end up
overriding its methods.

Opt to duplicate the API contracts rather than having this generic
weirdness.

JIRA: MDSAL-843
Change-Id: I867162f8da643b0163fb20bd4de3f8e790e0d4f9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRemove generics from mdsal-singleton-dom-impl 44/109244/4
Robert Varga [Sat, 9 Dec 2023 02:19:57 +0000 (03:19 +0100)]
Remove generics from mdsal-singleton-dom-impl

Cluster Singleton Service is using horrible amounts of generics just
because of its legacy origin, where there was another implementation
working on EntityOwnershipService.

We have had only a single, DOMEntityOwnershipService-based,
implementation for a long time and it works well.

Remove generics by pushing down DOM-based types.

JIRA: MDSAL-843
Change-Id: I975ab1dbb6cc820039fe72277080b7b2d6247fcb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoEliminate EntityOwnershipChange 42/109242/1
Robert Varga [Sat, 9 Dec 2023 03:55:51 +0000 (04:55 +0100)]
Eliminate EntityOwnershipChange

EntityOwnershipChange is only used in ownership listeners as a single
method argument. Since it is generic on GenericEntity type, users
actually need to use @SuppressFBWarnings to safely get at the entity.

Remove the DTO and inline its contents into
GenericEntityOwnershipListener.ownershipChanged() arguments.

JIRA: MDSAL-843
Change-Id: I49f8714c030ede45b073b0d5f3db5b4c4eb5d013
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRename EntityOwnershipChangeState 41/109241/1
Robert Varga [Sat, 9 Dec 2023 03:46:48 +0000 (04:46 +0100)]
Rename EntityOwnershipChangeState

This is a bit of a misnomer, coming from the fact we communicate this
delta from EntityOwnershipChange.

A better name EntityOwnershipStateChange, as it pertains to a change in
EntityOwnershipState.

JIRA: MDSAL-843
Change-Id: Ief4660088696f966a1d12a1f87c7948b5400e500
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoShare common EntityOwnershipChange 40/109240/1
Robert Varga [Sat, 9 Dec 2023 03:40:27 +0000 (04:40 +0100)]
Share common EntityOwnershipChange

Both Binding and DOM versions differ only in the type of passed entity.
Rename GenericEntityOwnershipChange to EntityOwnershipChange and make it
generic and final.

This allows us to drop some generic arguments, making it easier to
eliminate the listener registration.

Change-Id: Ieab0f9f80ba6832dd14aa1dd86f403cae0f8dc0d
JIRA: MDSAL-843
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRemove GenericEntityOwnershipListenerRegistration 39/109239/2
Robert Varga [Fri, 8 Dec 2023 22:56:25 +0000 (23:56 +0100)]
Remove GenericEntityOwnershipListenerRegistration

This registration brings absolutely nothing to the table aside from
capturing the entity type -- which is only used in one implementation
as a detail.

Use a simple Registration instead, which ends up simplifying things
quite significantly, to the point of eliminating mdsal-eos-common-spi.

JIRA: MDSAL-843
Change-Id: I5decd9b39ec7da7d11f904842d4849f09c7a7d46
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRemove GenericEntityOwnershipCandidateRegistration 38/109238/1
Robert Varga [Fri, 8 Dec 2023 21:52:37 +0000 (22:52 +0100)]
Remove GenericEntityOwnershipCandidateRegistration

This interface brings nothing to the table. Use a plain Registration
instead, which ends up removing its specializations in both DOM and
Binding worlds and bringing them closer together.

While we are at it, use constructor injection in
mdsal-eos-binding-adapter, so that just have a plain
DefaultEntityOwnershipService.

JIRA: MDSAL-843
Change-Id: Ic5c27830ce18a1d5be4348fa61cd3994486e4325
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoClean up mdsal-eos-common-api 37/109237/1
Robert Varga [Fri, 8 Dec 2023 21:45:00 +0000 (22:45 +0100)]
Clean up mdsal-eos-common-api

Modernize tests and classes contained here before eliminating
registration specializations.

JIRA: MDSAL-843
Change-Id: Idf452e7b847b66c47de2019c883570964e28a85f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRemove DOMDataTreeCommitCohortRegistration 36/109236/1
Robert Varga [Fri, 8 Dec 2023 21:24:16 +0000 (22:24 +0100)]
Remove DOMDataTreeCommitCohortRegistration

This interface does not bring anything to the table, remove it.

JIRA: MDSAL-843
Change-Id: Ia39a79fe08e06c6f6ec98f9324fcec1fee8d73e6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoDo not use ListenerRegistration in DOMStoreTreeChangePublisher 34/109234/4
Robert Varga [Fri, 8 Dec 2023 20:24:53 +0000 (21:24 +0100)]
Do not use ListenerRegistration in DOMStoreTreeChangePublisher

Use a simple Registration, as that is all that is now required.

Furthermore improve DOMStoreTreeChangePublisher interface by hiding
the implementation-internal registration and exposing only the bits
needed via a dedicated sealed interface.

JIRA: MDSAL-843
Change-Id: Ife076937a0e44f5ad140179935b3a8a1a03abb99
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRemove use of NoOpListenerRegistration 35/109235/1
Robert Varga [Fri, 8 Dec 2023 21:08:17 +0000 (22:08 +0100)]
Remove use of NoOpListenerRegistration

Use a simple lambda, as we just need a simple Registration.

JIRA: MDSAL-843
Change-Id: I85a6be83a4ea8fded2aafab4f1ba13a40200c628
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoClean up AbstractRegistrationTree 33/109233/3
Robert Varga [Fri, 8 Dec 2023 19:22:56 +0000 (20:22 +0100)]
Clean up AbstractRegistrationTree

Inline RegistrationTree{Node,Snapshot} and perform general cleanups:
- hide snapshot() method so it can only be invoked from subclasses
- add @VisibleForTesting annotations
- use Map.computeIfAbsent()
- use local variable type inference
- check result of Collection.remove() on cleanup

JIRA: MDSAL-843
Change-Id: I4776be432da92bfe2f81d0551dd0d81184380987
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoClean up DOMRpcRouter registrations 08/109208/4
Robert Varga [Thu, 7 Dec 2023 16:02:45 +0000 (17:02 +0100)]
Clean up DOMRpcRouter registrations

Use a plain AbstractObjectRegistration specialized to
(DOMRpc)AvailabilityListener instead of over-verbose
ListenerRegistrations.

JIRA: MDSAL-843
Change-Id: I1640eed53c2daae8674d42e7b00bbba85b583d36
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRemove DOMRpcImplementationRegistration 07/109207/4
Robert Varga [Thu, 7 Dec 2023 15:53:54 +0000 (16:53 +0100)]
Remove DOMRpcImplementationRegistration

DOMRpcImplementationRegistration is a completely unnecessary
specialization of Registration. Remove it and update
DOMRpcProviderService to simplify implementations.

This change renders AbstractDOMRpcProviderService and
AbstractDOMRpcImplementationRegistration superfluous and hence we remove
them.

JIRA: MDSAL-843
Change-Id: I51871aa0a4a9831acfb6c096cb9b72dbf5aa27d0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoDo not use ListenerRegistration in mdsal-dom-api 06/109206/4
Robert Varga [Thu, 7 Dec 2023 14:52:47 +0000 (15:52 +0100)]
Do not use ListenerRegistration in mdsal-dom-api

Using ListenerRegistration implies unneeded generics and details the
clients already know (the instance they registered).

Reduce clutter and verbosity by using a simple Registration return in
all mdsal-dom-api methods.

This cascades to mdsal-dom-broker, and other components, allowing them
to be further simplified.

JIRA: MDSAL-843
Change-Id: I067ae11bff4ce2adac297f7d8caae2d2b695bbfd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoClean up DOMMountPointServiceImpl 22/109222/1
Robert Varga [Fri, 8 Dec 2023 11:14:14 +0000 (12:14 +0100)]
Clean up DOMMountPointServiceImpl

Reduce logs and allow the service be found by Dagger and also for it to
be deactivated when needed.

Change-Id: Ibd677c42a178adf286bcce7e06cd0c590dbb6837
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRefactor DOMNotificationSubscriptionListener(Registry) 02/109202/2
Robert Varga [Thu, 7 Dec 2023 14:09:48 +0000 (15:09 +0100)]
Refactor DOMNotificationSubscriptionListener(Registry)

This interface wants to really be a DOMNotificationPublish.Extension.
Rename it and move it to mdsal.dom.api.

JIRA: MDSAL-481
Change-Id: I2b376726b49e64925e259dd4aed584fd3aa47e0c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoClean up TracingBroker 00/109200/4
Robert Varga [Thu, 7 Dec 2023 12:40:10 +0000 (13:40 +0100)]
Clean up TracingBroker

Hide LOG and forward requests to it from the two call sites we have.
Also optimize value checking a bit.

Change-Id: I014081ea23c4c1f00ce3345bdb1b8640bfea5014
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRename DOMActionProviderServiceExtension 01/109201/3
Robert Varga [Thu, 7 Dec 2023 12:46:07 +0000 (13:46 +0100)]
Rename DOMActionProviderServiceExtension

Move the extension marker to its base service, with a cute name of
DOMActionProviderService.Extension.

JIRA: MDSAL-841
Change-Id: I7c2ff3b45c2a31fbb0894304e738d511063728fc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRename DOMActionServiceExtension to DOMActionService.Extension 99/109199/4
Robert Varga [Thu, 7 Dec 2023 12:18:08 +0000 (13:18 +0100)]
Rename DOMActionServiceExtension to DOMActionService.Extension

Move the extension marker to its base service.

JIRA: MDSAL-841
Change-Id: Iee0212136034a6556caec332296bc6e72b0ab5b3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRename DOMDataBrokerExtension to DOMDataBroker.Extension 98/109198/3
Robert Varga [Thu, 7 Dec 2023 11:55:48 +0000 (12:55 +0100)]
Rename DOMDataBrokerExtension to DOMDataBroker.Extension

Move the extension marker to its base service.

JIRA: MDSAL-841
Change-Id: I39efe057322b2bed8a2704c0666ce16d1c457d38
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRename DOMSchemaServiceExtension to DOMSchemaService.Extension 95/109195/4
Robert Varga [Thu, 7 Dec 2023 11:47:55 +0000 (12:47 +0100)]
Rename DOMSchemaServiceExtension to DOMSchemaService.Extension

Move the extension marker to its base service.

JIRA: MDSAL-841
Change-Id: I59c204d6663714daffa3059da3ebb9b9e498c49f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoMerge DOMExtensibleService into DOMService 62/109062/8
Robert Varga [Fri, 24 Nov 2023 19:56:45 +0000 (20:56 +0100)]
Merge DOMExtensibleService into DOMService

yangtools.concepts.ExtensibleObject provides a generalized view on what
we are trying to achieve here.

This patch adopts it into DOMService, forcing all DOMServices to define
their type-safe Extension point.

This has a side-effect that multiple DOMServices cannot be implemented
by the same object, forcing DOMNotificationRouter to split out its
component services.

JIRA: MDSAL-841
Change-Id: I355fbe82cf913af7682432611b5f25773832a9ab
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRemove DOMRpcRouterServices 91/109191/3
Robert Varga [Thu, 7 Dec 2023 09:10:38 +0000 (10:10 +0100)]
Remove DOMRpcRouterServices

Expose DOMRpcRouter as the endpoint without an intermediate interface.
This allows us to neatly increase the scope of OSGiDOM*Service classes
so they work with other dependency injection mechanisms.

JIRA: MDSAL-842
Change-Id: I88d86b23c78defb37f476389002d850a995e9a90
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoMake sure listeners are immutable 84/109184/2
Robert Varga [Thu, 7 Dec 2023 02:38:45 +0000 (03:38 +0100)]
Make sure listeners are immutable

We guarantee DOMNotificationRouter.listeners to be immutable. Make sure
the field has the correct type to prevent confusion.

Change-Id: Ia4b86c00bdd0517182d4ec0ad63b7f903d3c4ee7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoBump Xtend to 2.33.0 80/109180/1
Robert Varga [Wed, 6 Dec 2023 18:28:21 +0000 (19:28 +0100)]
Bump Xtend to 2.33.0

https://eclipse.dev/Xtext/releasenotes.html#/releasenotes/2023/11/21/version-2-33-0

Change-Id: I926f2981d05af6f3cc7da5825377312dfe574c83
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoClean up DOMNotificationRouterEvent 77/109177/2
Robert Varga [Wed, 6 Dec 2023 16:43:25 +0000 (17:43 +0100)]
Clean up DOMNotificationRouterEvent

Use Empty instead of Void to reduce proliferation of nulls.

Change-Id: I39753a0deccf588578a2875b8bac40d02bd34129
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoClean up DOMNotificationRouter.NO_LISTENERS 76/109176/2
Robert Varga [Wed, 6 Dec 2023 16:39:24 +0000 (17:39 +0100)]
Clean up DOMNotificationRouter.NO_LISTENERS

Use Futures.immediateFuture() with Empty.value() to reduce reliance on
FluentFuture and null values.

Change-Id: I8233a4227e38753531994c13feb9e580c03f66d2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoClean up DOMNotificationPublishService.REJECTED 75/109175/2
Robert Varga [Wed, 6 Dec 2023 16:38:23 +0000 (17:38 +0100)]
Clean up DOMNotificationPublishService.REJECTED

Reduce qualifier from <Object> to <?>, so that the value remains
completely opaque. Also add a @NonNull annotation.

Change-Id: I99d0e04327bcf9b67ec6b1f760e2dec24fc70ffa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoClean up DOMNotificationRouter 74/109174/2
Robert Varga [Wed, 6 Dec 2023 16:30:55 +0000 (17:30 +0100)]
Clean up DOMNotificationRouter

Remove create() method, as it has been deprecated long time ago.

Also use local variable type inference to reduce verbosity and adjust
tests to use try-with-resources.

Change-Id: Ibccaeeabb19d7f2e3440246dac62c2175817c030
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRemove Naming.NOTIFICATION_LISTENER_SUFFIX 73/109173/1
Robert Varga [Wed, 6 Dec 2023 16:17:30 +0000 (17:17 +0100)]
Remove Naming.NOTIFICATION_LISTENER_SUFFIX

This constant was used only by aggregate NotificationListeners, remove
it.

JIRA: MDSAL-497
Change-Id: I2be5a92934e5bccb7816ee2d95acc8044e7066a8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRemove Naming.RPC_SERVICE_SUFFIX 72/109172/1
Robert Varga [Wed, 6 Dec 2023 16:15:36 +0000 (17:15 +0100)]
Remove Naming.RPC_SERVICE_SUFFIX

This constant was only used for ynag.binding.RpcService implementations,
remove it.

JIRA: MDSAL-772
Change-Id: I0b222743c8466e55cdfedd9974046dcfaaf37673
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoClean up BindingDOMNotificationPublishServiceAdapter 71/109171/1
Robert Varga [Wed, 6 Dec 2023 16:13:55 +0000 (17:13 +0100)]
Clean up BindingDOMNotificationPublishServiceAdapter

Remove deprecated method and address the two FIXMEs which are long
overdue.

Change-Id: I27354cd2d530268473236ba823afec162bfd2cc3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRemove deprecate DOMRpcResult methods 70/109170/1
Robert Varga [Wed, 6 Dec 2023 16:11:28 +0000 (17:11 +0100)]
Remove deprecate DOMRpcResult methods

getErrors() and getResult() were deprecated in previous major release,
remove them now.

Change-Id: I234c649dcd45e9b4ac38c7d5415de64249e95db9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRemove deprecated constructor 69/109169/1
Robert Varga [Wed, 6 Dec 2023 13:50:55 +0000 (14:50 +0100)]
Remove deprecated constructor

We require only a simple Executor, simplify things accordingly.

Change-Id: I94b89d2b7bf4d7cee65a30cf4635a01923b6db61
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoRemove SuppressFBWarnings from InstanceIdentifier 55/109055/1
Robert Varga [Fri, 24 Nov 2023 15:00:17 +0000 (16:00 +0100)]
Remove SuppressFBWarnings from InstanceIdentifier

Define readObject()/writeObject() methods that enforce Serializable
Proxy pattern, which in turn silences SpotBugs.

Change-Id: Ic7c5f523adc5e0df7e9a2767f93fcadd3bc77c8a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoRemove two spotbugs suppressions 78/108978/2
Robert Varga [Wed, 15 Nov 2023 14:19:18 +0000 (15:19 +0100)]
Remove two spotbugs suppressions

Let's not use @NonNullByDefault and instread sprinkle @NonNull --
allowing us to ditch two suppression.

Change-Id: I779fe4925da8ef3c9eccbdc8e61381162e576ba8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoMove PingPongTransctionChain.LOG 77/108977/1
Robert Varga [Wed, 15 Nov 2023 14:16:02 +0000 (15:16 +0100)]
Move PingPongTransctionChain.LOG

Remove @SuppressFBWarnings by moving the logger (and changing its
identity).

Change-Id: I2865e2dc59e59081c0fb07b1b24d8148740ee94f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoMove StatementNamespace to yang.binding.contract 52/108952/3
Robert Varga [Tue, 14 Nov 2023 14:17:12 +0000 (15:17 +0100)]
Move StatementNamespace to yang.binding.contract

This enumeration forms a part of the binding naming contract, move it to
yang-binding.

Change-Id: I8fe170d5791ff36c5c1728b0ea7112b178e3d808
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoRemove support for composite NotificationListener 50/108950/5
Robert Varga [Tue, 14 Nov 2023 11:53:58 +0000 (12:53 +0100)]
Remove support for composite NotificationListener

We have a much more flexible mechanism for dealing with notifications
via the Notification interface, which is a proper FunctionalInterface.

Remove support for aggregated moduled-level FooListener interfaces.

JIRA: MDSAL-497
Change-Id: I7dd82c477de6ca836cce84354c016d5ebd21022d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoRename RpcConsumerRegistry to RpcService 48/108948/3
Robert Varga [Tue, 14 Nov 2023 10:59:35 +0000 (11:59 +0100)]
Rename RpcConsumerRegistry to RpcService

Now that we have removed yang.binding.RpcService, we can reuse that name
in mdsal-binding-api.

JIRA: MDSAL-779
Change-Id: I59e23a7e31825407b6b7fc9431f0e960e2b87864
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoRemove yang.binding.RpcService 96/108696/10
Robert Varga [Thu, 26 Oct 2023 22:35:19 +0000 (00:35 +0200)]
Remove yang.binding.RpcService

RpcService is a base marker for generated interfaces representing
the collection of 'rpc' statements in a module.

This interface and its uses have been deprecated, as their design
assumptions are based on Java 7, that is do not consider lambdas.

Since we have yang.binding.Rpc and related interfaces to cleanly
represent RPCs in lambda-cognizant world, remove RpcService and all its
related codegen/runtime support.

JIRA: MDSAL-772
Change-Id: I41b3c6513869a43b6373ad588336ebed2dc873d4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoSeal LeafReference 85/108585/3
Robert Varga [Sat, 21 Oct 2023 04:59:08 +0000 (06:59 +0200)]
Seal LeafReference

We only want to access this interface through specializations, express
that through sealing it.

Change-Id: I2586005b482e4b25427c93ae9bca11bf772ae613
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoBump versions to 13.0.0-SNAPSHOT 21/108921/1
Robert Varga [Mon, 13 Nov 2023 15:47:23 +0000 (16:47 +0100)]
Bump versions to 13.0.0-SNAPSHOT

This starts the next major development version.

Change-Id: I4f549a7b19adea7ab284fea0278db79468ef20c0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoBump versions to 12.0.4-SNAPSHOT 59/108759/1
Robert Varga [Mon, 30 Oct 2023 21:21:28 +0000 (22:21 +0100)]
Bump versions to 12.0.4-SNAPSHOT

This starts the next development iteration.

Change-Id: I22fefd3c8ae76998cd879391b322adeb61a0c9b8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoBump upstreams 52/108752/1
Robert Varga [Mon, 30 Oct 2023 16:12:11 +0000 (17:12 +0100)]
Bump upstreams

Adopt:
- odlparent-13.0.7
- yangtools-11.0.4

Change-Id: Iaa314dfdca3513a67d9a1b8cb895554172071441
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoMake LambdaTarget a record 81/108581/3
Robert Varga [Sat, 21 Oct 2023 03:43:30 +0000 (05:43 +0200)]
Make LambdaTarget a record

We have a FIXME for efficiency improvement, address it.

Change-Id: If09bdb15b83b5e83114435456f4e4d1df4344e0a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoMigrate rfc6991-ietf-yang-types to JUnit5 02/108502/1
Robert Varga [Wed, 18 Oct 2023 16:08:52 +0000 (18:08 +0200)]
Migrate rfc6991-ietf-yang-types to JUnit5

We have a single test here, which is trivial to migrate.

Change-Id: I871dc1813c59159300c9561a539cce299d7e8700
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoMigrate rfc6991-ietf-inet-types to JUnit5 01/108501/1
Robert Varga [Wed, 18 Oct 2023 16:04:42 +0000 (18:04 +0200)]
Migrate rfc6991-ietf-inet-types to JUnit5

This is a trivial migration, except we also migrate hamcrest assertions
to assertInstanceOf().

Change-Id: I812ec1c4a885c9912afea41135ed767ce6436c0c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoMigrate ietf-type-util to JUnit5 00/108500/1
Robert Varga [Wed, 18 Oct 2023 15:57:41 +0000 (17:57 +0200)]
Migrate ietf-type-util to JUnit5

This is a straightforward automated conversion.

Change-Id: I307c021985090c59e8d41fc833427c0da9e7842f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoFix links in README 38/106938/4
matus.matok [Thu, 20 Jul 2023 07:26:31 +0000 (09:26 +0200)]
Fix links in README

Fixed the links in README.md to use the correct markdown syntax.

JIRA: MDSAL-832
Change-Id: Iba195c6ee9191480b8cfb4c888fb82904ba3f37a
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
6 months agoBump byte-buddy to 1.14.9 75/108475/1
Robert Varga [Tue, 17 Oct 2023 12:18:08 +0000 (14:18 +0200)]
Bump byte-buddy to 1.14.9

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

Change-Id: I254907a6467e8d3d76d165bd4f3c22a379545eb7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoAdd docs for model registration with OSGi 86/104986/13
Šimon Ukuš [Wed, 22 Mar 2023 14:43:40 +0000 (15:43 +0100)]
Add docs for model registration with OSGi

JIRA: MDSAL-9
Change-Id: Id0c6c2071c14977caad31743253bbae8b6436755
Signed-off-by: Šimon Ukuš <simon.ukus@pantheon.tech>
6 months agoBump upstreams 08/108108/2
Robert Varga [Sun, 1 Oct 2023 23:29:00 +0000 (01:29 +0200)]
Bump upstreams

Adopt:
- odlparent-13.0.5
- yangtools-11.0.3

Change-Id: Ic5ae3e0bfa2359087ad4c8818794746489ab2e20
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoFix NotificationListenerInvokerTest on Java 19+ 64/108064/1
Robert Varga [Fri, 29 Sep 2023 16:03:18 +0000 (18:03 +0200)]
Fix NotificationListenerInvokerTest on Java 19+

We cannot mock MethodHandle, as it is a sealed class on Java 19+. Adjust
the test to use String.toString() as the source of the MH.

Change-Id: Ieab28fdec5c703c2fcad8b14cd95ea3f49bd2a21
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoBump versions to 12.0.3-SNAPSHOT 98/107898/1
Robert Varga [Sun, 17 Sep 2023 11:53:18 +0000 (13:53 +0200)]
Bump versions to 12.0.3-SNAPSHOT

This starts the next development iteration.

Change-Id: Id25ee91d56adadb4dda0b0dbb57555a5f0a31b7a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoRelease mdsal v12.0.2
jenkins-releng [Sun, 17 Sep 2023 09:11:11 +0000 (09:11 +0000)]
Release mdsal

7 months agoBump byte-buddy to 1.14.8 91/107891/1
Robert Varga [Sat, 16 Sep 2023 11:11:17 +0000 (13:11 +0200)]
Bump byte-buddy to 1.14.8

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

Change-Id: Ica0c4632f81b6d11303409303ebe30245b63cc22
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoBump yangtools to 11.0.2 90/107890/1
Robert Varga [Sat, 16 Sep 2023 11:10:35 +0000 (13:10 +0200)]
Bump yangtools to 11.0.2

Pick up fixes and improvements from upstream.

Change-Id: I25d4724ac546438db4470925bb73e30c7f9cccea
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoMake AbstractPingPongTransactionChain.close() idempotent 76/107676/2
Robert Varga [Sun, 3 Sep 2023 19:59:41 +0000 (21:59 +0200)]
Make AbstractPingPongTransactionChain.close() idempotent

Expend one byte of state to track close() method, making sure it is
idempotent.

JIRA: MDSAL-838
Change-Id: Ie7bccb2c12ad9eadd948fc15244cc2b2b150a256
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoMigrate callers of deprecated DataTreeCandidateNode methods 77/107677/1
Robert Varga [Sun, 3 Sep 2023 20:13:23 +0000 (22:13 +0200)]
Migrate callers of deprecated DataTreeCandidateNode methods

DataTreeCandidateNode has deprecated a number of methods, migrate its
callers.

Change-Id: Ie190e4bfa6c4e37c3f242d9b6220a5dcc9e3d20d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoMigrate mdsal-dom-api to JUnit5 01/107601/4
Robert Varga [Wed, 30 Aug 2023 17:52:31 +0000 (19:52 +0200)]
Migrate mdsal-dom-api to JUnit5

Migrate and clean up tests.

Change-Id: Id437ae4ca4e93ca2b8ec38ed46a760fe2db4d157
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoMigrate mdsal-common-api to JUnit5 02/107602/3
Robert Varga [Wed, 30 Aug 2023 19:19:39 +0000 (21:19 +0200)]
Migrate mdsal-common-api to JUnit5

This is mostly a trivial conversion, but we also expand the test suite
to increase coverage and assertions.

Change-Id: I6ad81c99cc153e2fee3cd937dba42371a98ea047
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoMigrate mdsal-binding-api to JUnit5 00/107600/2
Robert Varga [Wed, 30 Aug 2023 17:35:26 +0000 (19:35 +0200)]
Migrate mdsal-binding-api to JUnit5

Remove DataObjectModificationTest and migrate other tests to use JUnit5.

Change-Id: Ie341ae97344066a0627225e7ee56162bc27927ac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoBump versions to 12.0.2-SNAPSHOT 99/107599/1
Robert Varga [Wed, 30 Aug 2023 19:26:19 +0000 (21:26 +0200)]
Bump versions to 12.0.2-SNAPSHOT

This starts the next developement iteration.

Change-Id: I1cab2e06404eb6de3fb589fb07ba34f1695f98b4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoRelease mdsal v12.0.1
jenkins-releng [Wed, 30 Aug 2023 14:41:47 +0000 (14:41 +0000)]
Release mdsal

7 months agoBump upstreams 84/107584/2
Robert Varga [Wed, 30 Aug 2023 12:07:25 +0000 (14:07 +0200)]
Bump upstreams

Adopt:
- odlparent-13.0.4
- yangtools-11.0.1

Change-Id: I292e6adbf213017d4dc9316e32ba60111ad7e60b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoFix mdsal-binding-dom-adapter checkstyle 83/107583/1
Robert Varga [Wed, 30 Aug 2023 13:06:45 +0000 (15:06 +0200)]
Fix mdsal-binding-dom-adapter checkstyle

Upgraded checkstyle is finding a few issues, fix them up.

Change-Id: Ifdafb339f112749b891ef288420e28af124b306e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoFix mergeParentStructure{Merge,Put} with augmentations 66/107566/4
Robert Varga [Wed, 30 Aug 2023 08:35:26 +0000 (10:35 +0200)]
Fix mergeParentStructure{Merge,Put} with augmentations

We need to pay attention to the result of normalization, as
AugmentationResult points to the parent YangInstanceIdentifier --
and hence we should just use it instead of peeling its last component.

JIRA: MDSAL-837
Change-Id: I7f108a6dff96a010f029b38b2cbba5548551b56e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoClean up dependencies 72/107572/1
Robert Varga [Wed, 30 Aug 2023 09:47:20 +0000 (11:47 +0200)]
Clean up dependencies

We have quite a few warnings about used undeclared dependencies, clean
them up.

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