bug 3126 - shift to new notification service 42/19642/1
authorMartin Bobak <mbobak@cisco.com>
Mon, 4 May 2015 15:43:04 +0000 (17:43 +0200)
committerMartin Bobak <mbobak@cisco.com>
Tue, 5 May 2015 16:31:19 +0000 (18:31 +0200)
Change-Id: Id25983e139b521075a21d579fe12afd9db2b9363
Signed-off-by: Martin Bobak <mbobak@cisco.com>
19 files changed:
drop-test-karaf/src/main/java/org/opendaylight/openflowplugin/droptestkaraf/DropTestProviderImpl.java
drop-test-karaf/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/config/openflow/test/droptest/rev150327/DropTestProviderModule.java
drop-test-karaf/src/main/resources/initial/69-drop-test.xml
drop-test-karaf/src/main/yang/drop-test.yang
drop-test/src/main/java/org/opendaylight/openflowplugin/droptest/DropTestActivator.java
features-li/src/main/resources/features.xml
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/OpenFlowPluginProvider.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/device/DeviceContext.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/device/DeviceManager.java
openflowplugin-controller-config/src/main/resources/initial/42-openflowplugin-new.xml
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/DeviceContextImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/DeviceManagerImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/config/openflow/plugin/impl/rev150327/OpenFlowProviderModule.java
openflowplugin-impl/src/main/yang/openflow-plugin-impl.yang
test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/DropTestCommiter.java
test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/DropTestDsProvider.java
test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/DropTestRpcProvider.java
test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/DropTestRpcSender.java

index 4507e7cb93e47291ff21c5fdcf8e055c4e65f474..fd15c14d795cda18f7839923f7e4c3ef7672dca0 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.openflowplugin.droptestkaraf;
 
 import com.google.common.base.Preconditions;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.opendaylight.openflowplugin.testcommon.DropTestDsProvider;
 import org.opendaylight.openflowplugin.testcommon.DropTestRpcProvider;
@@ -29,18 +30,18 @@ public class DropTestProviderImpl implements AutoCloseable {
     private static DropTestRpcProvider dropRpcProvider = new DropTestRpcProvider();
 
     public DropTestProviderImpl(final DataBroker dataBroker,
-                                final NotificationProviderService notificationProviderService,
+                                final NotificationService notificationService,
                                 final SalFlowService salFlowService) {
         Preconditions.checkNotNull(dataBroker, "Data broker can't be empty");
-        Preconditions.checkNotNull(notificationProviderService, "NotificationProviderService can't be empty");
+        Preconditions.checkNotNull(notificationService, "NotificationProviderService can't be empty");
         Preconditions.checkNotNull(salFlowService, "SalFlowService can't be empty");
 
         LOG.debug("Activator DropAllPack INIT");
 
         dropDsProvider.setDataService(dataBroker);
-        dropDsProvider.setNotificationService(notificationProviderService);
+        dropDsProvider.setNotificationService(notificationService);
 
-        dropRpcProvider.setNotificationService(notificationProviderService);
+        dropRpcProvider.setNotificationService(notificationService);
         dropRpcProvider.setFlowService(salFlowService);
 
         LOG.debug("Activator DropAllPack END");
index fd55a525057986e59f8f51e830ed7ccc6aa3768d..62bfbcc19570528cdcf50ee03c4d00071d00e84f 100644 (file)
@@ -1,6 +1,7 @@
 package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.config.openflow.test.droptest.rev150327;
 
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.opendaylight.openflowplugin.droptestkaraf.DropTestProviderImpl;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
@@ -26,9 +27,9 @@ public class DropTestProviderModule extends org.opendaylight.yang.gen.v1.urn.ope
     public java.lang.AutoCloseable createInstance() {
         LOG.debug("Starting drop-test provider module.");
         DataBroker dataBroker = getDataBrokerDependency();
-        NotificationProviderService notificationProviderService = getNotificationServiceDependency();
+        NotificationService notificationAdapterDependency = getNotificationAdapterDependency();
         SalFlowService salFlowService = getRpcRegistryDependency().getRpcService(SalFlowService.class);
-        DropTestProviderImpl dropTestProvider = new DropTestProviderImpl(dataBroker, notificationProviderService, salFlowService);
+        DropTestProviderImpl dropTestProvider = new DropTestProviderImpl(dataBroker, notificationAdapterDependency, salFlowService);
         LOG.info("Drop-test provider module initialized.");
         return dropTestProvider;
     }
index 515a41ea7a7c3f4ca3dcb97f4bc38343f841a8c4..5ee576358106c03ef8f9f5e9bd04ef72026924ed 100644 (file)
                         <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-rpc-registry</type>
                         <name>binding-rpc-broker</name>
                     </rpc-registry>
-                    <notification-service>
+                    <notification-adapter>
+                        <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">binding:binding-new-notification-service</type>
+                        <name>binding-notification-adapter</name>
+                    </notification-adapter>
+                    <!--notification-service>
                         <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-notification-service</type>
                         <name>binding-notification-broker</name>
-                    </notification-service>
+                    </notification-service-->
                 </module>
             </modules>
         </data>
index e251dd86a1f8222c9f3c67ace36b63b199e98f85..7572210178b80603d3eb723023510ee4c737b5d2 100644 (file)
@@ -6,6 +6,7 @@ module drop-test-provider {
     import config {prefix config; revision-date 2013-04-05;}
     import rpc-context { prefix rpcx; revision-date 2013-06-17; }
     import opendaylight-md-sal-binding { prefix md-sal-binding; revision-date 2013-10-28;}
+    import opendaylight-sal-binding-broker-impl { prefix sal-broker; revision-date 2013-10-28;}
 
     description
         "drop-test-provider";
@@ -40,6 +41,15 @@ module drop-test-provider {
                     }
                 }
             }
+            container notification-adapter {
+                uses config:service-ref {
+                    refine type {
+                        mandatory true;
+                        config:required-identity sal-broker:binding-new-notification-service;
+                    }
+                }
+            }
+            /*
             container notification-service {
                 uses config:service-ref {
                     refine type {
@@ -48,6 +58,7 @@ module drop-test-provider {
                     }
                 }
             }
+            */
         }
     }
 }
index 10488899fa2a1261923f226d8d0f583ee1699cdc..3c8f06d75f04adf5f5ddd79329f05c3098954bc4 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.openflowplugin.droptest;
 
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
 import org.opendaylight.controller.sal.binding.api.AbstractBindingAwareProvider;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
@@ -34,9 +35,9 @@ public class DropTestActivator extends AbstractBindingAwareProvider {
         LOG.debug("Activator DropAllPack INIT");
         provider.setDataService(session.<DataBroker>getSALService(DataBroker.class));
 
-        provider.setNotificationService(session.<NotificationProviderService>getSALService(NotificationProviderService.class));
+        provider.setNotificationService(session.<NotificationService>getSALService(NotificationService.class));
 
-        rpcProvider.setNotificationService(session.<NotificationProviderService>getSALService(NotificationProviderService.class));
+        rpcProvider.setNotificationService(session.<NotificationService>getSALService(NotificationService.class));
 
         rpcProvider.setFlowService(session.<SalFlowService>getRpcService(SalFlowService.class));
         outCmdProvider.onSessionInitiated(session);
index 14d50e6965a2a4e14a024b186fb141629a056e1d..da104cb69151e8017d9507c6d9c68ebd1bb75665 100644 (file)
@@ -44,6 +44,7 @@
         <feature version="${project.version}">odl-openflowplugin-app-config-pusher-li</feature>
         <feature version="${project.version}">odl-openflowplugin-app-lldp-speaker-li</feature>
         <feature version="${project.version}">odl-openflowplugin-nsf-services-li</feature>
+
     </feature>
 
     <feature name='odl-openflowplugin-nsf-services-li' version='${project.version}'
index 71e3248387b4286f4c0cf8a7e4e75c024fb49970..6e97fcc274a1e1fd53e086513c3f287b1e9ce28d 100644 (file)
@@ -11,6 +11,8 @@ package org.opendaylight.openflowplugin.api.openflow;
 import java.util.Collection;
 import org.opendaylight.controller.md.sal.binding.api.BindingService;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
 import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;
@@ -35,7 +37,8 @@ public interface OpenFlowPluginProvider extends AutoCloseable, BindingService {
 
     void setRpcProviderRegistry(RpcProviderRegistry rpcProviderRegistry);
 
-    void setNotificationProviderService(NotificationProviderService notificationProviderService);
+    void setNotificationProviderService(NotificationService notificationProviderService);
+    void setNotificationPublishService(NotificationPublishService notificationPublishService);
 
     /**
      * Method sets role of this application in clustered environment.
index f6788e1ac951801ad460330268ebf27cb595251c..2d9b377bd2ceed728ac10ee51224a99493b201ab 100644 (file)
@@ -10,6 +10,8 @@ package org.opendaylight.openflowplugin.api.openflow.device;
 
 import io.netty.util.Timeout;
 import java.math.BigInteger;
+import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
 import org.opendaylight.controller.md.sal.binding.api.ReadTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
@@ -195,7 +197,9 @@ public interface DeviceContext extends AutoCloseable,
      *
      * @param notificationService
      */
-    void setNotificationService(NotificationProviderService notificationService);
+    void setNotificationService(NotificationService notificationService);
+
+    void setNotificationPublishService(NotificationPublishService  notificationPublishService);
 
     MessageSpy getMessageSpy();
 
index 1848bac77b541616326efbf402a28781d330f28c..0283bcef393b9331060d07dce192ed85a69a2839 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.openflowplugin.api.openflow.device;
 
+import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 
 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceConnectedHandler;
@@ -29,10 +31,16 @@ public interface DeviceManager extends DeviceConnectedHandler,
         DeviceInitializationPhaseHandler, DeviceContextClosedHandler {
 
     /**
-     * Sets notification service
+     * Sets notification receiving service
      * @param notificationService
      */
-    void setNotificationService(NotificationProviderService notificationService);
+    void setNotificationService(NotificationService notificationService);
+
+    /**
+     * Sets notification publish service
+     * @param notificationPublishService
+     */
+    void setNotificationPublishService(NotificationPublishService  notificationPublishService);
 
 }
 
index 268db91bef048a9c9cdce320a2a3aeb9f2e8f072..fa825b6f4d23ec896bc2e7477ba617d56b82c84a 100644 (file)
@@ -74,10 +74,18 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
                         <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-rpc-registry</type>
                         <name>binding-rpc-broker</name>
                     </rpc-registry>
-                    <notification-service>
+                    <!--notification-service>
                         <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-notification-service</type>
                         <name>binding-notification-broker</name>
-                    </notification-service>
+                    </notification-service-->
+                    <notification-adapter>
+                        <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">binding:binding-new-notification-service</type>
+                        <name>binding-notification-adapter</name>
+                    </notification-adapter>
+                    <notification-publish-adapter>
+                        <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">binding:binding-new-notification-publish-service</type>
+                        <name>binding-notification-publish-adapter</name>
+                    </notification-publish-adapter>
                     <rpc-requests-quota>20000</rpc-requests-quota>
                 </module>
             </modules>
index d0428bda07b6d71aedb9f32a45eda677cab05b47..e272dfb9dc781e17c25af33f90e6f0cd67475094 100644 (file)
@@ -17,7 +17,8 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
 import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;
 import org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProvider;
@@ -51,7 +52,8 @@ public class OpenFlowPluginProviderImpl implements OpenFlowPluginProvider, OpenF
     private RpcProviderRegistry rpcProviderRegistry;
     private StatisticsManager statisticsManager;
     private ConnectionManager connectionManager;
-    private NotificationProviderService notificationProviderService;
+    private NotificationService notificationProviderService;
+    private NotificationPublishService notificationPublishService;
 
     private ExtensionConverterManager extensionConverterManager;
 
@@ -129,6 +131,7 @@ public class OpenFlowPluginProviderImpl implements OpenFlowPluginProvider, OpenF
         connectionManager.setDeviceConnectedHandler(deviceManager);
         deviceManager.setDeviceInitializationPhaseHandler(statisticsManager);
         deviceManager.setNotificationService(this.notificationProviderService);
+        deviceManager.setNotificationPublishService(this.notificationPublishService);
         statisticsManager.setDeviceInitializationPhaseHandler(rpcManager);
         rpcManager.setDeviceInitializationPhaseHandler(deviceManager);
 
@@ -137,10 +140,15 @@ public class OpenFlowPluginProviderImpl implements OpenFlowPluginProvider, OpenF
     }
 
     @Override
-    public void setNotificationProviderService(final NotificationProviderService notificationProviderService) {
+    public void setNotificationProviderService(final NotificationService notificationProviderService) {
         this.notificationProviderService = notificationProviderService;
     }
 
+    @Override
+    public void setNotificationPublishService(final NotificationPublishService notificationPublishProviderService) {
+        this.notificationPublishService = notificationPublishProviderService;
+    }
+
     @Override
     public ExtensionConverterRegistrator getExtensionConverterRegistrator() {
         return extensionConverterManager;
index 49ed53b7a2b7a30fff296e9b96c4a6bc5b1617c8..7229a28eb5f5d4ae2f6759d9c45049c05b820b44 100644 (file)
@@ -22,9 +22,10 @@ import java.util.TreeMap;
 import java.util.concurrent.atomic.AtomicLong;
 import javax.annotation.Nonnull;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
 import org.opendaylight.controller.md.sal.binding.api.ReadTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceState;
@@ -99,10 +100,11 @@ public class DeviceContextImpl implements DeviceContext {
     private final DeviceGroupRegistry deviceGroupRegistry;
     private final DeviceMeterRegistry deviceMeterRegistry;
     private Timeout barrierTaskTimeout;
-    private NotificationProviderService notificationService;
+    private NotificationService notificationService;
     private final MessageSpy<Class> messageSpy;
     private DeviceDisconnectedHandler deviceDisconnectedHandler;
     private List<DeviceContextClosedHandler> closeHandlers = new ArrayList<>();
+    private NotificationPublishService notificationPublishService;
 
 
     @VisibleForTesting
@@ -362,7 +364,10 @@ public class DeviceContextImpl implements DeviceContext {
         final TranslatorKey translatorKey = new TranslatorKey(packetInMessage.getVersion(), PacketIn.class.getName());
         final MessageTranslator<PacketInMessage, PacketReceived> messageTranslator = translatorLibrary.lookupTranslator(translatorKey);
         final PacketReceived packetReceived = messageTranslator.translate(packetInMessage, this, null);
-        notificationService.publish(packetReceived);
+        if (!notificationPublishService.offerNotification(packetReceived)){
+            LOG.debug("Notification offer refused by notification service.");
+        }
+
     }
 
     @Override
@@ -459,10 +464,15 @@ public class DeviceContextImpl implements DeviceContext {
     }
 
     @Override
-    public void setNotificationService(final NotificationProviderService notificationServiceParam) {
+    public void setNotificationService(final NotificationService notificationServiceParam) {
         notificationService = notificationServiceParam;
     }
 
+    @Override
+    public void setNotificationPublishService(final NotificationPublishService notificationPublishService) {
+        this.notificationPublishService = notificationPublishService;
+    }
+
     @Override
     public MessageSpy getMessageSpy() {
         return messageSpy;
index 217a96351d6abefad7cb040ba127b0b1339c1824..e88f13788f63ea089a76e7d70cbf4bc1a55f4359 100644 (file)
@@ -26,6 +26,8 @@ import java.util.concurrent.TimeUnit;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
@@ -108,7 +110,9 @@ public class DeviceManagerImpl implements DeviceManager, AutoCloseable {
     private RequestContextStack emptyRequestContextStack;
     private TranslatorLibrary translatorLibrary;
     private DeviceInitializationPhaseHandler deviceInitPhaseHandler;
-    private NotificationProviderService notificationService;
+    private NotificationService notificationService;
+    private NotificationPublishService notificationPublishService;
+
     private final List<DeviceContext> synchronizedDeviceContextsList = new ArrayList<DeviceContext>();
     private final MessageIntelligenceAgency messageIntelligenceAgency = new MessageIntelligenceAgencyImpl();
 
@@ -162,6 +166,7 @@ public class DeviceManagerImpl implements DeviceManager, AutoCloseable {
         final DeviceContext deviceContext = new DeviceContextImpl(connectionContext, deviceState, dataBroker, hashedWheelTimer, messageIntelligenceAgency);
 
         deviceContext.setNotificationService(notificationService);
+        deviceContext.setNotificationPublishService(notificationPublishService);
         deviceContext.writeToTransaction(LogicalDatastoreType.OPERATIONAL, deviceState.getNodeInstanceIdentifier(), new NodeBuilder().setId(deviceState.getNodeId()).build());
 
         connectionContext.setDeviceDisconnectedHandler(deviceContext);
@@ -427,10 +432,15 @@ public class DeviceManagerImpl implements DeviceManager, AutoCloseable {
     }
 
     @Override
-    public void setNotificationService(final NotificationProviderService notificationServiceParam) {
+    public void setNotificationService(final NotificationService notificationServiceParam) {
         notificationService = notificationServiceParam;
     }
 
+    @Override
+    public void setNotificationPublishService (final NotificationPublishService notificationService) {
+        this.notificationPublishService = notificationService;
+    }
+
     @Override
     public void close() throws Exception {
         for (DeviceContext deviceContext : synchronizedDeviceContextsList) {
index a441031cd3ff87d4cc88e3da13056235213f72b2..9f0456f037b5dbeb650e53a7b28f93ea28323448 100644 (file)
@@ -33,7 +33,9 @@ public class OpenFlowProviderModule extends org.opendaylight.yang.gen.v1.urn.ope
         openflowPluginProvider.setRole(getRole());
         openflowPluginProvider.setDataBroker(getDataBrokerDependency());
         openflowPluginProvider.setRpcProviderRegistry(getRpcRegistryDependency());
-        openflowPluginProvider.setNotificationProviderService(getNotificationServiceDependency());
+        openflowPluginProvider.setNotificationProviderService(getNotificationAdapterDependency());
+        openflowPluginProvider.setNotificationPublishService(getNotificationPublishAdapterDependency());
+
 
         openflowPluginProvider.initialize();
 
index 393ee3b29ce116f731af2855e532281da2614656..fe2c97c06ac5a132aee931132c08067a682aa233 100644 (file)
@@ -8,6 +8,7 @@ module openflow-plugin-provider-impl {
     import openflow-provider {prefix openflow-provider; revision-date 2015-03-31;}
     import openflow-switch-connection-provider {prefix openflow-switch-connection-provider;revision-date 2014-03-28;}
     import opendaylight-md-sal-binding { prefix md-sal-binding; revision-date 2013-10-28;}
+    import opendaylight-sal-binding-broker-impl { prefix sal-broker; revision-date 2013-10-28;}
     import openflow-plugin-types { prefix ofp-types; revision-date 2015-03-27;}
     import openflowplugin-extension-registry {prefix ofp-ext-reg; revision-date 2015-04-25;}
 
@@ -46,6 +47,23 @@ module openflow-plugin-provider-impl {
                     }
                 }
             }
+            container notification-adapter {
+                uses config:service-ref {
+                    refine type {
+                        mandatory true;
+                        config:required-identity sal-broker:binding-new-notification-service;
+                    }
+                }
+            }
+            container notification-publish-adapter {
+                uses config:service-ref {
+                    refine type {
+                        mandatory true;
+                        config:required-identity sal-broker:binding-new-notification-publish-service;
+                    }
+                }
+            }
+            /*
             container notification-service {
                 uses config:service-ref {
                     refine type {
@@ -54,6 +72,7 @@ module openflow-plugin-provider-impl {
                     }
                 }
             }
+            */
             list openflow-switch-connection-provider {
                 uses config:service-ref {
                     refine type {
index 9bf6673e3c55e8c39c8828243f6460d8355080c8..4aa347be4b4ed5458a52b78e022b9899795e918c 100644 (file)
@@ -11,9 +11,9 @@ import java.math.BigInteger;
 import java.util.concurrent.Callable;
 import java.util.concurrent.atomic.AtomicLong;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
 import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.opendaylight.openflowplugin.common.wait.SimpleTaskRetryLooper;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
@@ -31,7 +31,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.N
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.NotificationListener;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -65,9 +64,9 @@ public class DropTestCommiter extends AbstractDropTest {
         }
     };
 
-    private NotificationProviderService notificationService;
+    private NotificationService notificationService;
 
-    private ListenerRegistration<NotificationListener> notificationRegistration;
+    private ListenerRegistration<DropTestCommiter> notificationRegistration;
 
     /**
      * start listening on packetIn
@@ -76,9 +75,9 @@ public class DropTestCommiter extends AbstractDropTest {
         SimpleTaskRetryLooper looper = new SimpleTaskRetryLooper(STARTUP_LOOP_TICK,
                 STARTUP_LOOP_MAX_RETRIES);
         try {
-            notificationRegistration = looper.loopUntilNoException(new Callable<ListenerRegistration<NotificationListener>>() {
+            notificationRegistration = looper.loopUntilNoException(new Callable<ListenerRegistration<DropTestCommiter>>() {
                 @Override
-                public ListenerRegistration<NotificationListener> call() throws Exception {
+                public ListenerRegistration<DropTestCommiter> call() throws Exception {
                     return notificationService.registerNotificationListener(DropTestCommiter.this);
                 }
             });
@@ -146,7 +145,7 @@ public class DropTestCommiter extends AbstractDropTest {
     /**
      * @param notificationService
      */
-    public void setNotificationService(NotificationProviderService notificationService) {
+    public void setNotificationService(NotificationService notificationService) {
         this.notificationService = notificationService;
     }
 }
index adf2cee69c661510c1cb2b9034f6277ca583906d..14e05d8bfdc140b61a4284dfbb546cf7d68446bf 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.openflowplugin.testcommon;
 
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -19,7 +20,7 @@ public class DropTestDsProvider implements AutoCloseable {
     private static final Logger LOG = LoggerFactory.getLogger(DropTestDsProvider.class);
 
     private DataBroker dataService;
-    private NotificationProviderService notificationService;
+    private NotificationService notificationService;
     private final DropTestCommiter commiter = new DropTestCommiter();
     private boolean active = false;
 
@@ -48,7 +49,7 @@ public class DropTestDsProvider implements AutoCloseable {
     /**
      * @param notificationService value for setter
      */
-    public void setNotificationService(final NotificationProviderService notificationService) {
+    public void setNotificationService(final NotificationService notificationService) {
         this.notificationService = notificationService;
     }
 
index 352f61410edebdf6026c8aa2c9f8e4aed6c2b9f0..edf66e246e03516fcf70ef343f83f2a683792e42 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.openflowplugin.testcommon;
 
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
 import org.slf4j.Logger;
@@ -19,7 +20,7 @@ public class DropTestRpcProvider implements AutoCloseable {
     private static final Logger LOG = LoggerFactory.getLogger(DropTestDsProvider.class);
 
     private SalFlowService flowService;
-    private NotificationProviderService notificationService;
+    private NotificationService notificationService;
     private DropTestRpcSender commiter = new DropTestRpcSender();
     private boolean active = false;
 
@@ -33,7 +34,7 @@ public class DropTestRpcProvider implements AutoCloseable {
     /**
      * @param notificationService value for setter
      */
-    public void setNotificationService(final NotificationProviderService notificationService) {
+    public void setNotificationService(final NotificationService notificationService) {
         this.notificationService = notificationService;
     }
 
index 80d4b9ba784433d9b2ac46d2cb747b94ea033d48..a81cb20262ddfcceaa425af269e2fb29f87dc602 100644 (file)
@@ -9,7 +9,7 @@ package org.opendaylight.openflowplugin.testcommon;
 
 import java.math.BigInteger;
 import java.util.concurrent.Callable;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
 import org.opendaylight.openflowplugin.common.wait.SimpleTaskRetryLooper;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInputBuilder;
@@ -64,9 +64,9 @@ public class DropTestRpcSender extends AbstractDropTest {
         }
     };
 
-    private NotificationProviderService notificationService;
+    private NotificationService notificationService;
 
-    private ListenerRegistration<NotificationListener> notificationRegistration;
+    private ListenerRegistration<DropTestRpcSender> notificationRegistration;
 
     /**
      * start listening on packetIn
@@ -75,9 +75,9 @@ public class DropTestRpcSender extends AbstractDropTest {
         SimpleTaskRetryLooper looper = new SimpleTaskRetryLooper(STARTUP_LOOP_TICK,
                 STARTUP_LOOP_MAX_RETRIES);
         try {
-            notificationRegistration = looper.loopUntilNoException(new Callable<ListenerRegistration<NotificationListener>>() {
+            notificationRegistration = looper.loopUntilNoException(new Callable<ListenerRegistration<DropTestRpcSender>>() {
                 @Override
-                public ListenerRegistration<NotificationListener> call() throws Exception {
+                public ListenerRegistration<DropTestRpcSender> call() throws Exception {
                     return notificationService.registerNotificationListener(DropTestRpcSender.this);
                 }
             });
@@ -116,7 +116,7 @@ public class DropTestRpcSender extends AbstractDropTest {
     /**
      * @param notificationService
      */
-    public void setNotificationService(NotificationProviderService notificationService) {
+    public void setNotificationService(NotificationService notificationService) {
         this.notificationService = notificationService;
     }