Bug 9057: Revert "Take advantage of default" ... 54/62954/2
authorVratko Polak <vrpolak@cisco.com>
Thu, 7 Sep 2017 17:53:31 +0000 (19:53 +0200)
committerRobert Varga <nite@hq.sk>
Tue, 12 Sep 2017 11:13:02 +0000 (11:13 +0000)
... " methods in DOMRpcProviderService"
This reverts commit adf49155eced15c9f654d7bed7ee45cd95686e4f.

This is perhaps only a workaround,
depending on why test app expects class in the first place.

Change-Id: I68840f79aec25b128ddb78edc1a1e5514de16631
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/md/sal/dom/api/DOMRpcProviderService.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMRpcRouter.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/BrokerImpl.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/md/sal/dom/spi/AbstractDOMRpcProviderService.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/md/sal/dom/spi/ForwardingDOMRpcProviderService.java

index 21f0da2..82de4b0 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.controller.md.sal.dom.api;
 
-import com.google.common.collect.ImmutableSet;
 import java.util.Set;
 import javax.annotation.Nonnull;
 
@@ -41,10 +40,8 @@ public interface DOMRpcProviderService extends DOMService {
      * @throws NullPointerException if implementation or types is null
      * @throws IllegalArgumentException if types is empty or contains a null element.
      */
-    default @Nonnull <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(
-            @Nonnull final T implementation, @Nonnull final DOMRpcIdentifier... rpcs) {
-        return registerRpcImplementation(implementation, ImmutableSet.copyOf(rpcs));
-    }
+    @Nonnull <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(
+            @Nonnull T implementation, @Nonnull DOMRpcIdentifier... rpcs);
 
     /**
      * Register an {@link DOMRpcImplementation} object with this service.
index 2851735..02d2710 100644 (file)
@@ -12,6 +12,7 @@ import com.google.common.base.Verify;
 import com.google.common.collect.Collections2;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableList.Builder;
+import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.MapDifference;
 import com.google.common.collect.MapDifference.ValueDifference;
 import com.google.common.collect.Maps;
@@ -63,6 +64,12 @@ public final class DOMRpcRouter implements AutoCloseable, DOMRpcService, DOMRpcP
         return rpcRouter;
     }
 
+    @Override
+    public <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(
+            final T implementation, final DOMRpcIdentifier... rpcs) {
+        return registerRpcImplementation(implementation, ImmutableSet.copyOf(rpcs));
+    }
+
     private synchronized void removeRpcImplementation(final DOMRpcImplementation implementation,
             final Set<DOMRpcIdentifier> rpcs) {
         final DOMRpcRoutingTable oldTable = routingTable;
index 40a4efd..33fc244 100644 (file)
@@ -161,6 +161,13 @@ public class BrokerImpl implements Broker, DOMRpcProviderService, DOMRpcService,
         return session;
     }
 
+
+    @Nonnull
+    @Override
+    public <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(@Nonnull final T implementation, @Nonnull final DOMRpcIdentifier... rpcs) {
+        return rpcProvider.registerRpcImplementation(implementation, rpcs);
+    }
+
     @Nonnull
     @Override
     public <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(@Nonnull final T implementation, @Nonnull final Set<DOMRpcIdentifier> rpcs) {
index 29598ac..c137426 100644 (file)
@@ -7,14 +7,18 @@
  */
 package org.opendaylight.controller.md.sal.dom.spi;
 
+import com.google.common.collect.ImmutableSet;
+import org.opendaylight.controller.md.sal.dom.api.DOMRpcIdentifier;
+import org.opendaylight.controller.md.sal.dom.api.DOMRpcImplementation;
+import org.opendaylight.controller.md.sal.dom.api.DOMRpcImplementationRegistration;
 import org.opendaylight.controller.md.sal.dom.api.DOMRpcProviderService;
 
 /**
  * Convenience abstract base class for {@link DOMRpcProviderService} implementations.
- *
- * @deprecated Useless class. Implement {@link DOMRpcProviderService} directly.
  */
-@Deprecated
 public abstract class AbstractDOMRpcProviderService implements DOMRpcProviderService {
-
+    @Override
+    public final <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(final T implementation, final DOMRpcIdentifier... types) {
+        return registerRpcImplementation(implementation, ImmutableSet.copyOf(types));
+    }
 }
index 6267455..99c4cad 100644 (file)
@@ -24,8 +24,12 @@ public abstract class ForwardingDOMRpcProviderService extends ForwardingObject i
     protected abstract @Nonnull DOMRpcProviderService delegate();
 
     @Override
-    public <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(
-            final T implementation, final Set<DOMRpcIdentifier> types) {
+    public <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(final T implementation, final DOMRpcIdentifier... types) {
+        return delegate().registerRpcImplementation(implementation, types);
+    }
+
+    @Override
+    public <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(final T implementation, final Set<DOMRpcIdentifier> types) {
         return delegate().registerRpcImplementation(implementation, types);
     }
 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.