Removed deprecated methods from BindingAwareProvider 06/13806/12
authorEd Warnicke <eaw@cisco.com>
Mon, 12 Jan 2015 01:02:35 +0000 (19:02 -0600)
committerEd Warnicke <eaw@cisco.com>
Tue, 13 Jan 2015 22:16:47 +0000 (22:16 +0000)
Also deprecated
BindingAwareBroker.registerConsumer(BindingAwareConsumer,BundleContext)
in favor of the newly added:
BindingAwareBroker.registerConsumer(BindingAwareConsumer)

and
BindingAwareBroker.registerProvider(BindingAwareProvider,BundleContext)
in favor of the newly added:
BindingAwareBroker.registerProvider(BindingAwareProvider)

Change-Id: Id256c81a7210640b9a493a3f0fc71a9e0379e317
Signed-off-by: Ed Warnicke <eaw@cisco.com>
13 files changed:
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/SalCompatibilityProvider.java
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/AbstractBindingAwareProvider.java
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/BindingAwareBroker.java
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/BindingAwareProvider.java
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/data/DataRefresher.java [deleted file]
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/data/RuntimeDataProvider.java [deleted file]
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RootBindingAwareBroker.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/connect/dom/BindingIndependentConnector.java
opendaylight/md-sal/sal-binding-it/src/test/java/org/opendaylight/controller/test/sal/binding/it/AbstractTestProvider.java
opendaylight/md-sal/sal-binding-it/src/test/java/org/opendaylight/controller/test/sal/binding/it/NotificationTest.java
opendaylight/md-sal/sal-binding-util/src/main/java/org/opendaylight/controller/md/sal/binding/util/BindingContextUtils.java
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/sal/NetconfDeviceSalProvider.java
opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/restconf/broker/SalRemoteServiceBroker.java

index f8f2b37..75e63f1 100644 (file)
@@ -7,11 +7,7 @@
  */
 package org.opendaylight.controller.sal.compatibility;
 
-import java.util.Collection;
-import java.util.Collections;
-
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
 import org.opendaylight.controller.sal.binding.api.NotificationService;
@@ -26,7 +22,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev13
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.FlowTopologyDiscoveryService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.OpendaylightPortStatisticsService;
-import org.opendaylight.yangtools.yang.binding.RpcService;
 
 import com.google.common.base.Preconditions;
 
@@ -37,21 +32,6 @@ class SalCompatibilityProvider implements BindingAwareProvider {
         this.activator = Preconditions.checkNotNull(cmpAct);
     }
 
-    @Override
-    public Collection<? extends ProviderFunctionality> getFunctionality() {
-        return Collections.emptyList();
-    }
-
-    @Override
-    public Collection<? extends RpcService> getImplementations() {
-        return Collections.emptyList();
-    }
-
-    @Override
-    public void onSessionInitialized(final ConsumerContext session) {
-        // No-op
-    }
-
     @Override
     public void onSessionInitiated(final ProviderContext session) {
         final NotificationService subscribe = session.getSALService(NotificationService.class);
index d32fa36..0b9c604 100644 (file)
@@ -7,12 +7,7 @@
  */
 package org.opendaylight.controller.sal.binding.api;
 
-import java.util.Collection;
-import java.util.Collections;
-
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.yangtools.yang.binding.RpcService;
 import org.osgi.framework.BundleContext;
 
 @Deprecated
@@ -21,52 +16,5 @@ public abstract class AbstractBindingAwareProvider extends AbstractBrokerAwareAc
     @Override
     protected final void onBrokerAvailable(BindingAwareBroker broker, BundleContext context) {
         ProviderContext ctx = broker.registerProvider(this, context);
-        registerRpcImplementations(ctx);
-        registerFunctionality(ctx);
-    }
-
-    private void registerFunctionality(ProviderContext ctx) {
-        Collection<? extends ProviderFunctionality> functionality = this.getFunctionality();
-        if (functionality == null || functionality.isEmpty()) {
-            return;
-        }
-        for (ProviderFunctionality providerFunctionality : functionality) {
-            ctx.registerFunctionality(providerFunctionality);
-        }
-
-    }
-
-    private void registerRpcImplementations(ProviderContext ctx) {
-        Collection<? extends RpcService> rpcs = this.getImplementations();
-        if (rpcs == null || rpcs.isEmpty()) {
-            return;
-        }
-        for (RpcService rpcService : rpcs) {
-            // ctx.addRpcImplementation(type, implementation);
-        }
-
-    }
-
-    @Override
-    public Collection<? extends ProviderFunctionality> getFunctionality() {
-        return Collections.emptySet();
-    }
-
-    @Override
-    public Collection<? extends RpcService> getImplementations() {
-        return Collections.emptySet();
-    }
-
-    /**
-     * Initialization of consumer context.
-     *
-     * {@link ProviderContext} is replacement of {@link ConsumerContext}
-     * so this method is not needed in case of Provider.
-     *
-     */
-    @Deprecated
-    @Override
-    public final void onSessionInitialized(ConsumerContext session) {
-        // NOOP
     }
 }
index 5e24560..ab62c80 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.controller.sal.binding.api;
 
 import org.opendaylight.controller.md.sal.common.api.routing.RoutedRegistration;
-import org.opendaylight.controller.sal.binding.api.BindingAwareProvider.ProviderFunctionality;
 import org.opendaylight.yangtools.concepts.ObjectRegistration;
 import org.opendaylight.yangtools.yang.binding.BaseIdentity;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -52,6 +51,12 @@ import org.osgi.framework.BundleContext;
  * and {@link ProviderContext}
  */
 public interface BindingAwareBroker {
+    /*
+     * @deprecated Use registerConsumer(BindingAwareConsumer cons) instead (BundleContext is no longer used)
+     */
+    @Deprecated
+    ConsumerContext registerConsumer(BindingAwareConsumer consumer, BundleContext ctx);
+
     /**
      * Registers the {@link BindingAwareConsumer}, which will use the SAL layer.
      *
@@ -73,7 +78,13 @@ public interface BindingAwareBroker {
      * @throws IllegalStateException
      *             If the consumer is already registered.
      */
-    ConsumerContext registerConsumer(BindingAwareConsumer consumer, BundleContext ctx);
+    ConsumerContext registerConsumer(BindingAwareConsumer consumer);
+
+    /*
+     * @deprecated Use registerProvider(BindingAwareProvider prov) instead (BundleContext is no longer used)
+     */
+    @Deprecated
+    ProviderContext registerProvider(BindingAwareProvider provider, BundleContext ctx);
 
     /**
      * Registers the {@link BindingAwareProvider}, which will use the SAL layer.
@@ -103,7 +114,7 @@ public interface BindingAwareBroker {
      * @throws IllegalStateException
      *             If the consumer is already registered.
      */
-    ProviderContext registerProvider(BindingAwareProvider provider, BundleContext ctx);
+    ProviderContext registerProvider(BindingAwareProvider provider);
 
     /**
      * {@link BindingAwareConsumer} specific access to the SAL functionality.
@@ -149,11 +160,6 @@ public interface BindingAwareBroker {
      */
     public interface ProviderContext extends ConsumerContext, RpcProviderRegistry {
 
-        @Deprecated
-        void registerFunctionality(ProviderFunctionality functionality);
-
-        @Deprecated
-        void unregisterFunctionality(ProviderFunctionality functionality);
     }
 
     /**
index cb26cad..35583c0 100644 (file)
@@ -7,11 +7,7 @@
  */
 package org.opendaylight.controller.sal.binding.api;
 
-import java.util.Collection;
-
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.yangtools.yang.binding.RpcService;
 
 /**
  *
@@ -107,55 +103,6 @@ import org.opendaylight.yangtools.yang.binding.RpcService;
  */
 public interface BindingAwareProvider {
 
-    /**
-     * @deprecated
-     *
-     * This interface was originally intended to solve problems of how to get Implementations
-     * of functionality from a provider, but that is no longer necessary because the Provider
-     * Registers RPCs in onSessionInitiated.
-     *
-     * Recommend:
-     * {code
-     * public Collection<? extends RpcService> getImplementations() {
-     *   return Collections.emptySet();
-     * }
-     * }
-     */
-    @Deprecated
-    Collection<? extends RpcService> getImplementations();
-
-    /**
-     * @deprecated
-     *
-     * This interface was originally intended to solve problems of how to get Functionality
-     *  a provider could provide, but that is no longer necessary because the Provider
-     * Registers RPCs in onSessionInitiated.
-     *
-     * Recommend:
-     * {code
-     * public Collection<? extends ProviderFunctionality> getFunctionality() {
-     *   return Collections.emptySet();
-     * }
-     * }
-     *
-     */
-    @Deprecated
-    Collection<? extends ProviderFunctionality> getFunctionality();
-
-    /**
-     * Functionality provided by the {@link BindingAwareProvider}
-     *
-     * <p>
-     * Marker interface used to mark the interfaces describing specific
-     * functionality which could be exposed by providers to other components.
-     *
-     *
-     *
-     */
-    @Deprecated
-    public interface ProviderFunctionality {
-
-    }
     /**
      * Callback signaling initialization of the consumer session to the SAL.
      *
@@ -168,22 +115,4 @@ public interface BindingAwareProvider {
      * @param session Unique session between consumer and SAL.
      */
     void onSessionInitiated(ProviderContext session);
-
-    /*
-     * @deprecated
-     *
-     * A provider was at one point considered an extension of a consumer, thus this
-     * call.  It is deprecated and the @see org.opendaylight.controller.sal.binding.api.BindingAwareConsumer#onSessionInitiated
-     * used, or you should simply use {@link #onSessionInitiated(ProviderContext)}
-     *
-     * Recommend:
-     * {code
-     * public final void onSessionInitialized(ConsumerContext session) {
-     *   // NOOP - as method is deprecated
-     * }
-     * }
-     */
-    @Deprecated
-    void onSessionInitialized(ConsumerContext session);
-
 }
diff --git a/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/data/DataRefresher.java b/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/data/DataRefresher.java
deleted file mode 100644 (file)
index c0c8f4f..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.binding.api.data;
-
-import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
-
-/**
- * Trigger for refreshing of the data exposed by the {@link Provider}
- *
- *
- * @deprecated Unused, not supported. Replaced by org.opendaylight.controller.sal.core.spi.data.DOMStore.
- */
-@Deprecated
-public interface DataRefresher extends BindingAwareProvider.ProviderFunctionality {
-
-    /**
-     * Fired when some component explicitly requested the data refresh.
-     *
-     * The provider which exposed the {@link DataRefresher} should republish its
-     * provided data by editing the data in all affected data stores.
-     */
-    void refreshData();
-}
\ No newline at end of file
diff --git a/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/data/RuntimeDataProvider.java b/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/data/RuntimeDataProvider.java
deleted file mode 100644 (file)
index 273f20f..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.binding.api.data;
-
-import org.opendaylight.controller.md.sal.common.api.data.DataReader;
-import org.opendaylight.controller.sal.binding.api.BindingAwareProvider.ProviderFunctionality;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-/**
- * Utility interface which does type capture for BindingAware DataReader.
- *
- *
- * @deprecated Removed, replaced by org.opendaylight.controller.sal.core.spi.data.DOMStore.
- *
- */
-@Deprecated
-public interface RuntimeDataProvider extends ProviderFunctionality,DataReader<InstanceIdentifier<? extends DataObject>, DataObject> {
-
-
-
-}
index d810149..ddfb1cd 100644 (file)
@@ -135,13 +135,25 @@ public class RootBindingAwareBroker implements //
     }
 
     @Override
-    public ConsumerContext registerConsumer(final BindingAwareConsumer consumer, final BundleContext ctx) {
+    public ConsumerContext registerConsumer(BindingAwareConsumer consumer,
+            BundleContext ctx) {
+        return registerConsumer(consumer);
+    }
+
+    @Override
+    public ProviderContext registerProvider(BindingAwareProvider provider,
+            BundleContext ctx) {
+        return registerProvider(provider);
+    }
+
+    @Override
+    public ConsumerContext registerConsumer(final BindingAwareConsumer consumer) {
         checkState(supportedConsumerServices != null, "Broker is not initialized.");
         return BindingContextUtils.createConsumerContextAndInitialize(consumer, supportedConsumerServices);
     }
 
     @Override
-    public ProviderContext registerProvider(final BindingAwareProvider provider, final BundleContext ctx) {
+    public ProviderContext registerProvider(final BindingAwareProvider provider) {
         checkState(supportedProviderServices != null, "Broker is not initialized.");
         return BindingContextUtils.createProviderContextAndInitialize(provider, supportedProviderServices);
     }
index d00d8b7..f63ce10 100644 (file)
@@ -12,15 +12,15 @@ import static com.google.common.base.Preconditions.checkState;
 
 import java.util.Collection;
 import java.util.Collections;
-
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
+
 import org.opendaylight.controller.md.sal.binding.impl.AbstractForwardedDataBroker;
+import org.opendaylight.controller.md.sal.common.api.data.DataReader;
 import org.opendaylight.controller.md.sal.common.api.routing.RouteChangePublisher;
 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
 import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
-import org.opendaylight.controller.sal.binding.api.data.RuntimeDataProvider;
 import org.opendaylight.controller.sal.binding.impl.DataBrokerImpl;
 import org.opendaylight.controller.sal.binding.impl.MountPointManagerImpl.BindingMountPointImpl;
 import org.opendaylight.controller.sal.binding.impl.RpcProviderRegistryImpl;
@@ -41,7 +41,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class BindingIndependentConnector implements //
-        RuntimeDataProvider, //
+        DataReader<InstanceIdentifier<? extends DataObject>, DataObject>, //
         Provider, //
         AutoCloseable {
 
index da47b17..6871a0a 100644 (file)
@@ -7,29 +7,9 @@
  */
 package org.opendaylight.controller.test.sal.binding.it;
 
-import java.util.Collection;
-import java.util.Collections;
-
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
-import org.opendaylight.yangtools.yang.binding.RpcService;
 
 public abstract class AbstractTestProvider implements BindingAwareProvider {
 
-    @Override
-    public Collection<? extends RpcService> getImplementations() {
-        return Collections.emptySet();
-    }
-
-    @Override
-    public Collection<? extends ProviderFunctionality> getFunctionality() {
-        return Collections.emptySet();
-    }
-
-    @Override
-    public void onSessionInitialized(ConsumerContext session) {
-        // Noop
-
-    }
 
 }
index 9ec5bcf..8f8e475 100644 (file)
@@ -12,7 +12,6 @@ import static org.junit.Assert.assertNotNull;
 
 import java.math.BigInteger;
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.List;
 
 import org.junit.Before;
@@ -35,7 +34,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.Swit
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.NotificationListener;
-import org.opendaylight.yangtools.yang.binding.RpcService;
 
 @Ignore
 public class NotificationTest extends AbstractTest {
@@ -115,25 +113,6 @@ public class NotificationTest extends AbstractTest {
                 listener2Reg = session.getSALService(NotificationProviderService.class).registerNotificationListener(
                         listener2);
             }
-
-            @Override
-            public void onSessionInitialized(ConsumerContext session) {
-                // TODO Auto-generated method stub
-
-            }
-
-            @Override
-            public Collection<? extends RpcService> getImplementations() {
-                // TODO Auto-generated method stub
-                return null;
-            }
-
-            @Override
-            public Collection<? extends ProviderFunctionality> getFunctionality() {
-                // TODO Auto-generated method stub
-                return null;
-            }
-
         };
 
         // registerConsumer method calls onSessionInitialized method above
index dc22891..26aa27e 100644 (file)
@@ -16,7 +16,6 @@ import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcR
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;
 import org.opendaylight.controller.sal.binding.api.BindingAwareConsumer;
 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
-import org.opendaylight.controller.sal.binding.api.BindingAwareProvider.ProviderFunctionality;
 import org.opendaylight.controller.sal.binding.api.BindingAwareService;
 import org.opendaylight.controller.sal.binding.api.RpcConsumerRegistry;
 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
@@ -132,17 +131,5 @@ public class BindingContextUtils {
                 throws IllegalStateException {
             return getSALService(RpcProviderRegistry.class).addRpcImplementation(type, implementation);
         }
-
-        @Deprecated
-        @Override
-        public void registerFunctionality(ProviderFunctionality functionality) {
-            // NOOP
-        }
-
-        @Deprecated
-        @Override
-        public void unregisterFunctionality(ProviderFunctionality functionality) {
-            // NOOP
-        }
     }
 }
index cf9174d..171f2f4 100644 (file)
@@ -23,7 +23,6 @@ import org.opendaylight.controller.sal.core.api.Provider;
 import org.opendaylight.controller.sal.core.api.RpcProvisionRegistry;
 import org.opendaylight.controller.sal.core.api.notify.NotificationPublishService;
 import org.opendaylight.yangtools.concepts.ObjectRegistration;
-import org.opendaylight.yangtools.yang.binding.RpcService;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.slf4j.Logger;
@@ -70,16 +69,6 @@ final class NetconfDeviceSalProvider implements AutoCloseable, Provider, Binding
         return Collections.emptySet();
     }
 
-    @Override
-    public Collection<? extends RpcService> getImplementations() {
-        return Collections.emptySet();
-    }
-
-    @Override
-    public Collection<? extends BindingAwareProvider.ProviderFunctionality> getFunctionality() {
-        return Collections.emptySet();
-    }
-
     @Override
     public void onSessionInitiated(final BindingAwareBroker.ProviderContext session) {
         logger.debug("{}: Session with sal established {}", id, session);
@@ -88,9 +77,6 @@ final class NetconfDeviceSalProvider implements AutoCloseable, Provider, Binding
         datastoreAdapter = new NetconfDeviceDatastoreAdapter(id, dataBroker);
     }
 
-    @Override
-    public void onSessionInitialized(final BindingAwareBroker.ConsumerContext session) {}
-
     public void close() throws Exception {
         mountInstance.close();
         datastoreAdapter.close();
index 74b2320..0553b2f 100644 (file)
@@ -51,7 +51,7 @@ public class SalRemoteServiceBroker implements BindingAwareBroker,AutoCloseable
                 .put(RpcConsumerRegistry.class,servicesFactory.getRpcConsumerRegistry() ).build();
     }
 
-    public ProviderContext registerProvider(BindingAwareProvider provider, BundleContext ctx) {
+    public ProviderContext registerProvider(BindingAwareProvider provider) {
         throw new UnsupportedOperationException();
     }
     @Override
@@ -59,9 +59,21 @@ public class SalRemoteServiceBroker implements BindingAwareBroker,AutoCloseable
         //TODO decide if serviceFactory should close clientContext or it has to be closed by consumer
     }
     @Override
-    public ConsumerContext registerConsumer(BindingAwareConsumer consumer, BundleContext ctx) {
+    public ConsumerContext registerConsumer(BindingAwareConsumer consumer) {
         checkState(supportedConsumerServices != null, "Broker is not initialized.");
         return BindingContextUtils.createConsumerContextAndInitialize(consumer, supportedConsumerServices);
     }
 
+    @Override
+    public ConsumerContext registerConsumer(BindingAwareConsumer consumer,
+            BundleContext ctx) {
+        return registerConsumer(consumer);
+    }
+
+    @Override
+    public ProviderContext registerProvider(BindingAwareProvider provider,
+            BundleContext ctx) {
+        return registerProvider(provider);
+    }
+
 }

©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.