Use ClusteredDTCL in OSGiEncryptionServiceConfigurator 29/105029/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 27 Mar 2023 07:41:21 +0000 (09:41 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 27 Mar 2023 07:42:14 +0000 (09:42 +0200)
Plain DataTreeChangeListener is not being notified on non-leader nodes,
leading to a failure to start up. Fix that by using
ClusteredDataTreeChangeListener.

JIRA: AAA-258
Change-Id: I479fb5b0ec5fb4186de0f747839ee75c18d01609
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
aaa-encrypt-service/impl/src/main/java/org/opendaylight/aaa/encrypt/impl/OSGiEncryptionServiceConfigurator.java

index 89d37d04a05b64c6568cd54fd9e5189e1cb06220..8110baa47a4144384b52643d393ecd58682bf022 100644 (file)
@@ -24,8 +24,8 @@ import org.checkerframework.checker.lock.qual.GuardedBy;
 import org.checkerframework.checker.lock.qual.Holding;
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
+import org.opendaylight.mdsal.binding.api.ClusteredDataTreeChangeListener;
 import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
 import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
 import org.opendaylight.mdsal.binding.api.DataTreeModification;
 import org.opendaylight.mdsal.common.api.CommitInfo;
@@ -56,7 +56,8 @@ import org.slf4j.LoggerFactory;
  * conditions and we try again.
  */
 @Component(service = { })
-public final class OSGiEncryptionServiceConfigurator implements DataTreeChangeListener<AaaEncryptServiceConfig> {
+public final class OSGiEncryptionServiceConfigurator
+        implements ClusteredDataTreeChangeListener<AaaEncryptServiceConfig> {
     private static final Logger LOG = LoggerFactory.getLogger(OSGiEncryptionServiceConfigurator.class);
     private static final SecureRandom RANDOM = new SecureRandom();
     private static final @NonNull AaaEncryptServiceConfig DEFAULT_CONFIG = new AaaEncryptServiceConfigBuilder()