Merge branch 'master' into topic/ietf_yang 88/28288/1
authorLorand Jakab <lojakab@cisco.com>
Mon, 12 Oct 2015 14:10:24 +0000 (17:10 +0300)
committerLorand Jakab <lojakab@cisco.com>
Mon, 12 Oct 2015 14:15:53 +0000 (17:15 +0300)
Change-Id: I489ceff034e498cff459393c7284370710dc12c6
Signed-off-by: Lorand Jakab <lojakab@cisco.com>
34 files changed:
features/pom.xml
features/src/main/features/features.xml
mappingservice/api/src/main/yang/mappingservice-dao.yang [moved from mappingservice/api/src/main/yang/lfm-ms-dao.yang with 62% similarity]
mappingservice/implementation/src/main/config/default-config.xml
mappingservice/implementation/src/main/java/org/opendaylight/controller/config/yang/config/lfm/mappingservice/impl/LispMappingServiceModule.java
mappingservice/implementation/src/main/java/org/opendaylight/controller/config/yang/config/lfm/mappingservice/impl/MappingServiceModule.java
mappingservice/implementation/src/main/java/org/opendaylight/controller/config/yang/config/lfm/mappingservice_shell/impl/MappingServiceShellModule.java [new file with mode: 0644]
mappingservice/implementation/src/main/java/org/opendaylight/controller/config/yang/config/lfm/mappingservice_shell/impl/MappingServiceShellModuleFactory.java [new file with mode: 0644]
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/LispMappingService.java
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/MappingService.java
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/lisp/MapServer.java
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/mdsal/MappingDataListener.java
mappingservice/implementation/src/main/yang/mappingservice-impl.yang
mappingservice/implementation/src/main/yang/mappingservice-shell-impl.yang
mappingservice/inmemorydb/src/main/config/default-config.xml
mappingservice/inmemorydb/src/main/java/org/opendaylight/controller/config/yang/config/lfm/mappingservice_dao/inmemorydb/InMemoryDbModule.java [moved from mappingservice/inmemorydb/src/main/java/org/opendaylight/controller/config/yang/config/lfm/ms/dao/inmemorydb/InMemoryDbModule.java with 75% similarity]
mappingservice/inmemorydb/src/main/java/org/opendaylight/controller/config/yang/config/lfm/mappingservice_dao/inmemorydb/InMemoryDbModuleFactory.java [new file with mode: 0644]
mappingservice/inmemorydb/src/main/java/org/opendaylight/controller/config/yang/config/lfm/ms/dao/inmemorydb/InMemoryDbModuleFactory.java [deleted file]
mappingservice/inmemorydb/src/main/yang/lfm-ms-inmemorydb.yang [deleted file]
mappingservice/inmemorydb/src/main/yang/mappingservice-dao-inmemorydb.yang [new file with mode: 0644]
mappingservice/integrationtest/pom.xml
mappingservice/integrationtest/src/test/java/org/opendaylight/lispflowmapping/integrationtest/MappingServiceIntegrationTest.java
mappingservice/lisp-proto/pom.xml
mappingservice/lisp-proto/src/main/java/org/opendaylight/lispflowmapping/lisp/util/LispAFIConvertor.java
mappingservice/neutron/pom.xml
mappingservice/pom.xml
mappingservice/shell/pom.xml
mappingservice/southbound/src/main/config/default-config.xml
mappingservice/southbound/src/main/java/org/opendaylight/controller/config/yang/config/lfm_mappingservice_sb/impl/LfmMappingServiceSbModule.java
mappingservice/southbound/src/main/java/org/opendaylight/lispflowmapping/southbound/LispSouthboundPlugin.java
mappingservice/southbound/src/main/java/org/opendaylight/lispflowmapping/southbound/lisp/LispSouthboundService.java
mappingservice/southbound/src/main/java/org/opendaylight/lispflowmapping/southbound/lisp/LispXtrSouthboundService.java
mappingservice/southbound/src/main/yang/lfm-mappingservice-sb-impl.yang
mappingservice/southbound/src/test/java/org/opendaylight/lispflowmapping/southbound/lisp/LispSouthboundServiceTest.java

index 289ae5f8a9cdca0327d1ab4fa8ab3e8fd431b5a0..dfaa8230dd6ad32de2c4d9e5a35c2a1ce0b78169 100644 (file)
@@ -68,13 +68,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <classifier>features</classifier>
       <type>xml</type>
     </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>features-base</artifactId>
-      <version>${commons.opendaylight.version}</version>
-      <classifier>features</classifier>
-      <type>xml</type>
-    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>features-mdsal</artifactId>
index 14c622482d81591110983d52d3336dfe6999ada5..40c1169877e4e7e173f7b2c704572b445f1fafaf 100644 (file)
@@ -18,8 +18,6 @@
     <repository>mvn:org.opendaylight.netconf/features-restconf/${restconf.version}/xml/features</repository>
     <!-- Needed for odl-config-api -->
     <repository>mvn:org.opendaylight.controller/features-config/${config.version}/xml/features</repository>
-    <!-- TODO features-base should be removed when we get rid of Activators, hopefully soon -->
-    <repository>mvn:org.opendaylight.controller/features-base/${commons.opendaylight.version}/xml/features</repository>
     <repository>mvn:org.opendaylight.neutron/features-neutron/${neutron.version}/xml/features</repository>
     <repository>mvn:org.opendaylight.dlux/features-dlux/${dlux.core.version}/xml/features</repository>
 
@@ -61,8 +59,6 @@
     </feature>
 
     <feature name="odl-lispflowmapping-neutron" description="OpenDaylight :: LISP Flow Mapping :: Neutron Integration" version='${project.version}'>
-         TODO felix-dm should be removed when we get rid of Activators, hopefully soon
-        <feature>odl-base-felix-dm</feature>
         <feature version="${neutron.version}">odl-neutron-service</feature>
         <feature version="${project.version}">odl-lispflowmapping-mappingservice</feature>
         <bundle>mvn:org.opendaylight.lispflowmapping/mappingservice.neutron/${project.version}</bundle>
similarity index 62%
rename from mappingservice/api/src/main/yang/lfm-ms-dao.yang
rename to mappingservice/api/src/main/yang/mappingservice-dao.yang
index 3507e4a7791df076e5dfb4bc944dae2f2a9c045a..ac94b1e8404adb17d8147abeaed45a76328169a9 100644 (file)
@@ -1,6 +1,6 @@
-module lfm-ms-dao {
+module mappingservice-dao {
     yang-version 1;
-    namespace "urn:opendaylight:params:xml:ns:yang:controller:config:lfm:ms:dao";
+    namespace "urn:opendaylight:lfm:mappingservice-dao";
     prefix "ms-dao";
 
     import config { prefix config; revision-date 2013-04-05; }
@@ -8,13 +8,13 @@ module lfm-ms-dao {
     description
         "Service definition for Mapping Service DAO.";
 
-    revision "2015-07-13" {
+    revision "2015-10-07" {
         description
-            "Initial revision";
+            "Module renamed from lfm-ms-dao.";
     }
 
-    identity ms-dao {
+    identity mappingservice-dao {
         base "config:service-type";
         config:java-class "org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO";
     }
-}
\ No newline at end of file
+}
index 31eadc2501b941e76f310c081c6a201ade5350be..e2317de2a3645a1441bf2a56d6f7902ade098900 100644 (file)
@@ -1,16 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <snapshot>
     <required-capabilities>
-        <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&amp;revision=2013-10-28</capability>
-        <capability>urn:opendaylight:params:xml:ns:yang:controller:config:lfm:ms:dao?module=lfm-ms-dao&amp;revision=2015-07-13</capability>
         <capability>urn:opendaylight:params:xml:ns:yang:controller:config:lfm:mappingservice:impl?module=mappingservice-impl&amp;revision=2015-09-06</capability>
-        <capability>urn:opendaylight:params:xml:ns:yang:controller:config:lfm:mappingservice:shell:impl?module=mappingservice-shell-impl&amp;revision=2015-09-25</capability>
+        <capability>urn:opendaylight:params:xml:ns:yang:controller:config:lfm:mappingservice-shell:impl?module=mappingservice-shell-impl&amp;revision=2015-09-25</capability>
+        <capability>urn:opendaylight:params:xml:ns:yang:controller:config:lfm:mappingservice-dao:inmemorydb?module=mappingservice-dao-inmemorydb&amp;revision=2015-10-07</capability>
     </required-capabilities>
     <configuration>
         <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
             <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
                 <module>
-                    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:lfm:mappingservice:impl">prefix:mappingservice-impl</type>
+                    <type xmlns:msi="urn:opendaylight:params:xml:ns:yang:controller:config:lfm:mappingservice:impl">msi:mappingservice-impl</type>
                     <name>mappingservice-default</name>
                     <rpc-registry>
                         <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-rpc-registry</type>
                       <name>binding-osgi-broker</name>
                     </broker>
                     <dao>
-                      <type xmlns:dao="urn:opendaylight:params:xml:ns:yang:controller:config:lfm:ms:dao">dao:ms-dao</type>
-                      <name>lfm-ms-inmemorydb</name>
+                      <type xmlns:dao="urn:opendaylight:lfm:mappingservice-dao">dao:mappingservice-dao</type>
+                      <name>mappingservice-dao-inmemorydb</name>
                     </dao>
-                    <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-publish-service>
+                      <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-service>
                 </module>
                 <module>
-                    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:lfm:mappingservice:shell:impl">prefix:mappingservice-shell-impl</type>
+                    <type xmlns:shell="urn:opendaylight:params:xml:ns:yang:controller:config:lfm:mappingservice-shell:impl">shell:mappingservice-shell-impl</type>
                     <name>mappingservice-shell-default</name>
-                    <broker>
+                    <osgi-broker>
                       <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-broker-osgi-registry</type>
                       <name>binding-osgi-broker</name>
-                    </broker>
+                    </osgi-broker>
                     <mappingservice>
-                      <type xmlns:prefix="urn:opendaylight:lfm:mappingservice">prefix:mappingservice</type>
+                      <type xmlns:ms="urn:opendaylight:lfm:mappingservice">ms:mappingservice</type>
                       <name>mappingservice</name>
                     </mappingservice>
                 </module>
                 <module>
-                    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:lfm:mappingservice:impl">prefix:lisp-mappingservice-impl</type>
+                    <type xmlns:ms="urn:opendaylight:params:xml:ns:yang:controller:config:lfm:mappingservice:impl">ms:lisp-mappingservice-impl</type>
                     <name>lisp-mappingservice-default</name>
                     <osgi-broker>
                       <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-broker-osgi-registry</type>
                       <name>binding-osgi-broker</name>
                     </osgi-broker>
+                    <notification-service>
+                      <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-service>
                     <mappingservice>
-                      <type xmlns:prefix="urn:opendaylight:lfm:mappingservice">prefix:mappingservice</type>
+                      <type xmlns:ms="urn:opendaylight:lfm:mappingservice">ms:mappingservice</type>
                       <name>mappingservice</name>
                     </mappingservice>
                 </module>
@@ -86,4 +89,4 @@
             </services>
         </data>
     </configuration>
-</snapshot>
\ No newline at end of file
+</snapshot>
index 59ee2727972d72bad93ae9b05db1047497d329af..86e43e3600b97fc50ae9089b6640836bf36e779c 100644 (file)
@@ -28,6 +28,7 @@ public class LispMappingServiceModule extends org.opendaylight.controller.config
 
         lmsService = new LispMappingService();
         lmsService.setBindingAwareBroker(getOsgiBrokerDependency());
+        lmsService.setNotificationService(getNotificationServiceDependency());
         lmsService.setMappingService(getMappingserviceDependency());
         lmsService.initialize();
 
index 48d4a237e218a12edacea93a4b08aee90a0cda4e..af7543383091b9c26df7b267d6ca9cdd15df9cb1 100644 (file)
@@ -28,7 +28,7 @@ public class MappingServiceModule extends org.opendaylight.controller.config.yan
         mappingService.setBindingAwareBroker(getBrokerDependency());
         mappingService.setDataBroker(getDataBrokerDependency());
         mappingService.setRpcProviderRegistry(getRpcRegistryDependency());
-        mappingService.setNotificationService(getNotificationServiceDependency());
+        mappingService.setNotificationPublishService(getNotificationPublishServiceDependency());
         mappingService.setDaoService(getDaoDependency());
         mappingService.initialize();
 
diff --git a/mappingservice/implementation/src/main/java/org/opendaylight/controller/config/yang/config/lfm/mappingservice_shell/impl/MappingServiceShellModule.java b/mappingservice/implementation/src/main/java/org/opendaylight/controller/config/yang/config/lfm/mappingservice_shell/impl/MappingServiceShellModule.java
new file mode 100644 (file)
index 0000000..156bf7f
--- /dev/null
@@ -0,0 +1,29 @@
+package org.opendaylight.controller.config.yang.config.lfm.mappingservice_shell.impl;
+
+import org.opendaylight.lispflowmapping.implementation.MappingServiceShell;
+
+public class MappingServiceShellModule extends org.opendaylight.controller.config.yang.config.lfm.mappingservice_shell.impl.AbstractMappingServiceShellModule {
+    private MappingServiceShell mappingServiceShell;
+
+    public MappingServiceShellModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+        super(identifier, dependencyResolver);
+    }
+
+    public MappingServiceShellModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.config.lfm.mappingservice_shell.impl.MappingServiceShellModule oldModule, java.lang.AutoCloseable oldInstance) {
+        super(identifier, dependencyResolver, oldModule, oldInstance);
+    }
+
+    @Override
+    public void customValidation() {
+        // add custom validation form module attributes here.
+    }
+
+    @Override
+    public java.lang.AutoCloseable createInstance() {
+        mappingServiceShell = new MappingServiceShell();
+        mappingServiceShell.setBindingAwareBroker(getOsgiBrokerDependency());
+        mappingServiceShell.setMappingService(getMappingserviceDependency());
+        return mappingServiceShell;
+    }
+
+}
diff --git a/mappingservice/implementation/src/main/java/org/opendaylight/controller/config/yang/config/lfm/mappingservice_shell/impl/MappingServiceShellModuleFactory.java b/mappingservice/implementation/src/main/java/org/opendaylight/controller/config/yang/config/lfm/mappingservice_shell/impl/MappingServiceShellModuleFactory.java
new file mode 100644 (file)
index 0000000..9fad099
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+* Generated file
+*
+* Generated from: yang module name: mappingservice-shell-impl yang module local name: mappingservice-shell-impl
+* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
+* Generated at: Wed Oct 07 15:26:43 EEST 2015
+*
+* Do not modify this file unless it is present under src/main directory
+*/
+package org.opendaylight.controller.config.yang.config.lfm.mappingservice_shell.impl;
+public class MappingServiceShellModuleFactory extends org.opendaylight.controller.config.yang.config.lfm.mappingservice_shell.impl.AbstractMappingServiceShellModuleFactory {
+
+}
index 9bd31e70ba48cffede7eb8b92ae989d356b4fbea..a091da97b21513b2ea32392604c88cfc0cbb2ba3 100644 (file)
@@ -10,11 +10,10 @@ package org.opendaylight.lispflowmapping.implementation;
 
 import org.apache.commons.lang3.tuple.MutablePair;
 import org.apache.commons.lang3.tuple.Pair;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
-import org.opendaylight.controller.sal.binding.api.NotificationListener;
-import org.opendaylight.controller.sal.binding.api.NotificationService;
 import org.opendaylight.lispflowmapping.implementation.config.ConfigIni;
 import org.opendaylight.lispflowmapping.implementation.lisp.MapResolver;
 import org.opendaylight.lispflowmapping.implementation.lisp.MapServer;
@@ -28,11 +27,16 @@ import org.opendaylight.lispflowmapping.interfaces.lisp.IMapServerAsync;
 import org.opendaylight.lispflowmapping.interfaces.mappingservice.IMappingService;
 import org.opendaylight.lispflowmapping.lisp.util.LispAddressStringifier;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.AddMapping;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.GotMapNotify;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.GotMapReply;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.LispProtoListener;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.MapNotify;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.MapRegister;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.MapReply;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.MapRequest;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.RequestMapping;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.XtrReplyMapping;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.XtrRequestMapping;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lispaddress.LispAddressContainer;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.mapnotifymessage.MapNotifyBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.mapreplymessage.MapReplyBuilder;
@@ -44,12 +48,11 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.SendM
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.SendMapReplyInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.SendMapRequestInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-import org.opendaylight.yangtools.yang.binding.Notification;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class LispMappingService implements IFlowMapping, BindingAwareProvider, IMapRequestResultHandler,
-        IMapNotifyHandler, AutoCloseable {
+        IMapNotifyHandler, LispProtoListener, AutoCloseable {
     protected static final Logger LOG = LoggerFactory.getLogger(LispMappingService.class);
 
     private volatile boolean shouldAuthenticate = true;
@@ -79,6 +82,10 @@ public class LispMappingService implements IFlowMapping, BindingAwareProvider, I
         this.broker = broker;
     }
 
+    public void setNotificationService(NotificationService ns) {
+        this.notificationService = ns;
+    }
+
     public void setMappingService(IMappingService ms) {
         LOG.trace("MappingService set in LispMappingService");
         this.mapService = ms;
@@ -98,8 +105,13 @@ public class LispMappingService implements IFlowMapping, BindingAwareProvider, I
         }
     }
 
+    public NotificationService getNotificationService() {
+        return this.notificationService;
+    }
+
     public void initialize() {
         broker.registerProvider(this);
+        notificationService.registerNotificationListener(this);
         mapResolver = new MapResolver(mapService, smr, elpPolicy, this);
         mapServer = new MapServer(mapService, shouldAuthenticate, smr, this, notificationService);
     }
@@ -112,9 +124,6 @@ public class LispMappingService implements IFlowMapping, BindingAwareProvider, I
     @Override
     public void onSessionInitiated(ProviderContext session) {
         LOG.info("Lisp Consumer session initialized!");
-        notificationService = session.getSALService(NotificationService.class);
-        registerNotificationListener(AddMapping.class, new MapRegisterNotificationHandler());
-        registerNotificationListener(RequestMapping.class, new MapRequestNotificationHandler());
         this.session = session;
         LOG.info("LISP (RFC6830) Mapping Service init finished");
     }
@@ -169,44 +178,53 @@ public class LispMappingService implements IFlowMapping, BindingAwareProvider, I
         return shouldAuthenticate;
     }
 
-    public <T extends Notification> void registerNotificationListener(Class<T> notificationType,
-            NotificationListener<T> listener) {
-        notificationService.registerNotificationListener(notificationType, listener);
+    @Override
+    public void onAddMapping(AddMapping mapRegisterNotification) {
+        MapNotify mapNotify = handleMapRegister(mapRegisterNotification.getMapRegister());
+        if (mapNotify != null) {
+            TransportAddressBuilder tab = new TransportAddressBuilder();
+            tab.setIpAddress(mapRegisterNotification.getTransportAddress().getIpAddress());
+            tab.setPort(new PortNumber(LispMessage.PORT_NUM));
+            SendMapNotifyInputBuilder smnib = new SendMapNotifyInputBuilder();
+            smnib.setMapNotify(new MapNotifyBuilder(mapNotify).build());
+            smnib.setTransportAddress(tab.build());
+            getLispSB().sendMapNotify(smnib.build());
+        } else {
+            LOG.warn("got null map notify");
+        }
     }
 
-    private class MapRegisterNotificationHandler implements NotificationListener<AddMapping> {
-
-        @Override
-        public void onNotification(AddMapping mapRegisterNotification) {
-            MapNotify mapNotify = handleMapRegister(mapRegisterNotification.getMapRegister());
-            if (mapNotify != null) {
-                TransportAddressBuilder tab = new TransportAddressBuilder();
-                tab.setIpAddress(mapRegisterNotification.getTransportAddress().getIpAddress());
-                tab.setPort(new PortNumber(LispMessage.PORT_NUM));
-                SendMapNotifyInputBuilder smnib = new SendMapNotifyInputBuilder();
-                smnib.setMapNotify(new MapNotifyBuilder(mapNotify).build());
-                smnib.setTransportAddress(tab.build());
-                getLispSB().sendMapNotify(smnib.build());
-            } else {
-                LOG.warn("got null map notify");
-            }
+    @Override
+    public void onRequestMapping(RequestMapping mapRequestNotification) {
+        MapReply mapReply = handleMapRequest(mapRequestNotification.getMapRequest());
+        if (mapReply != null) {
+            SendMapReplyInputBuilder smrib = new SendMapReplyInputBuilder();
+            smrib.setMapReply((new MapReplyBuilder(mapReply).build()));
+            smrib.setTransportAddress(mapRequestNotification.getTransportAddress());
+            getLispSB().sendMapReply(smrib.build());
+        } else {
+            LOG.warn("got null map reply");
         }
     }
 
-    private class MapRequestNotificationHandler implements NotificationListener<RequestMapping> {
-
-        @Override
-        public void onNotification(RequestMapping mapRequestNotification) {
-            MapReply mapReply = handleMapRequest(mapRequestNotification.getMapRequest());
-            if (mapReply != null) {
-                SendMapReplyInputBuilder smrib = new SendMapReplyInputBuilder();
-                smrib.setMapReply((new MapReplyBuilder(mapReply).build()));
-                smrib.setTransportAddress(mapRequestNotification.getTransportAddress());
-                getLispSB().sendMapReply(smrib.build());
-            } else {
-                LOG.warn("got null map reply");
-            }
-        }
+    @Override
+    public void onGotMapReply(GotMapReply notification) {
+        LOG.debug("Received GotMapReply notification, ignoring");
+    }
+
+    @Override
+    public void onGotMapNotify(GotMapNotify notification) {
+        LOG.debug("Received GotMapNotify notification, ignoring");
+    }
+
+    @Override
+    public void onXtrRequestMapping(XtrRequestMapping notification) {
+        LOG.debug("Received XtrRequestMapping notification, ignoring");
+    }
+
+    @Override
+    public void onXtrReplyMapping(XtrReplyMapping notification) {
+        LOG.debug("Received XtrReplyMapping notification, ignoring");
     }
 
     private LispSbService getLispSB() {
index 6539c3ea0f75ec6e0d821db0369d79bb9864468e..237b8ff318d3daacdd6d2bb82f48bbe5faa077f3 100644 (file)
@@ -11,10 +11,10 @@ import java.util.Arrays;
 import java.util.concurrent.Future;
 
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;
 import org.opendaylight.lispflowmapping.implementation.config.ConfigIni;
@@ -87,7 +87,7 @@ public class MappingService implements MappingserviceService, IMappingService, B
     private DataBroker dataBroker;
     private RpcProviderRegistry rpcRegistry;
     private BindingAwareBroker bindingAwareBroker;
-    private NotificationProviderService notificationService;
+    private NotificationPublishService notificationPublishService;
 
     private static final ConfigIni configIni = new ConfigIni();
     private boolean overwritePolicy = configIni.mappingOverwriteIsSet();
@@ -110,8 +110,8 @@ public class MappingService implements MappingserviceService, IMappingService, B
         this.bindingAwareBroker = broker;
     }
 
-    public void setNotificationService(NotificationProviderService notification) {
-        this.notificationService = notification;
+    public void setNotificationPublishService(NotificationPublishService nps) {
+        this.notificationPublishService = nps;
     }
 
     public void setDaoService(ILispDAO dao) {
@@ -137,7 +137,7 @@ public class MappingService implements MappingserviceService, IMappingService, B
         mappingSystem.initialize();
 
         keyListener = new AuthenticationKeyDataListener(dataBroker, mappingSystem);
-        mappingListener = new MappingDataListener(dataBroker, mappingSystem, notificationService);
+        mappingListener = new MappingDataListener(dataBroker, mappingSystem, notificationPublishService);
     }
 
     @Override
index b22e9f8437c71b94d746d6ac91f336b062a42730..e473079dad7d8fdabca81e576c6a1516910450b8 100644 (file)
@@ -17,8 +17,7 @@ import java.util.Set;
 
 import org.apache.commons.lang3.BooleanUtils;
 import org.apache.commons.lang3.exception.ExceptionUtils;
-import org.opendaylight.controller.sal.binding.api.NotificationListener;
-import org.opendaylight.controller.sal.binding.api.NotificationService;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
 import org.opendaylight.lispflowmapping.implementation.authentication.LispAuthenticationUtil;
 import org.opendaylight.lispflowmapping.interfaces.dao.SubKeys;
 import org.opendaylight.lispflowmapping.interfaces.dao.SubscriberRLOC;
@@ -42,13 +41,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.ma
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingChange;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingChanged;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingOrigin;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingserviceListener;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.SiteId;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Preconditions;
 
-public class MapServer implements IMapServerAsync {
+public class MapServer implements IMapServerAsync, MappingserviceListener {
 
     protected static final Logger LOG = LoggerFactory.getLogger(MapServer.class);
     private IMappingService mapService;
@@ -66,7 +66,7 @@ public class MapServer implements IMapServerAsync {
         this.notifyHandler = notifyHandler;
         this.notificationService = notificationService;
         if (notificationService != null) {
-            subscribeToMappingNotifications();
+            notificationService.registerNotificationListener(this);
         }
     }
 
@@ -125,23 +125,17 @@ public class MapServer implements IMapServerAsync {
         return (mapRegister.getSiteId() != null) ? new SiteId(mapRegister.getSiteId()) : null;
     }
 
-    private class MappingChangedNotificationHandler implements NotificationListener<MappingChanged> {
-        @Override
-        public void onNotification(MappingChanged notification) {
-            if (subscriptionService) {
-                sendSmrs(new EidToLocatorRecordBuilder(notification.getMapping()).build(), getSubscribers(notification
-                        .getMapping().getLispAddressContainer()));
-                if (notification.getChange().equals(MappingChange.Removed)) {
-                    removeSubscribers(notification.getMapping().getLispAddressContainer());
-                }
+    @Override
+    public void onMappingChanged(MappingChanged notification) {
+        if (subscriptionService) {
+            sendSmrs(new EidToLocatorRecordBuilder(notification.getMapping()).build(), getSubscribers(notification
+                    .getMapping().getLispAddressContainer()));
+            if (notification.getChange().equals(MappingChange.Removed)) {
+                removeSubscribers(notification.getMapping().getLispAddressContainer());
             }
         }
     }
 
-    private void subscribeToMappingNotifications() {
-        notificationService.registerNotificationListener(MappingChanged.class, new MappingChangedNotificationHandler());
-    }
-
     private void sendSmrs(EidToLocatorRecord record, Set<SubscriberRLOC> subscribers) {
         LispAddressContainer eid = record.getLispAddressContainer();
         handleSmr(record, subscribers, notifyHandler);
index 7b24932e30ef19031c8daafcf2181d3b40478aff..600515353e34cb0ac576d99bb5497a45f2def425 100644 (file)
@@ -11,8 +11,8 @@ import java.util.Map;
 import java.util.Set;
 
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.opendaylight.lispflowmapping.implementation.util.MSNotificationInputUtil;
 import org.opendaylight.lispflowmapping.interfaces.mapcache.IMappingSystem;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.eidtolocatorrecords.EidToLocatorRecordBuilder;
@@ -35,20 +35,20 @@ import org.slf4j.LoggerFactory;
 public class MappingDataListener extends AbstractDataListener {
     private static final Logger LOG = LoggerFactory.getLogger(MappingDataListener.class);
     private IMappingSystem mapSystem;
-    private NotificationProviderService notificationProvider;
+    private NotificationPublishService notificationPublishService;
 
-    public MappingDataListener(DataBroker broker, IMappingSystem msmr, NotificationProviderService notificationProvider) {
+    public MappingDataListener(DataBroker broker, IMappingSystem msmr, NotificationPublishService nps) {
         setBroker(broker);
         setMappingSystem(msmr);
-        setNotificationProviderService(notificationProvider);
+        setNotificationProviderService(nps);
         setPath(InstanceIdentifier.create(MappingDatabase.class).child(InstanceId.class)
                 .child(Mapping.class));
         LOG.trace("Registering Mapping listener.");
         registerDataChangeListener();
     }
 
-    public void setNotificationProviderService(NotificationProviderService notificationProvider) {
-        this.notificationProvider = notificationProvider;
+    public void setNotificationProviderService(NotificationPublishService nps) {
+        this.notificationPublishService = nps;
     }
 
     @Override
@@ -82,7 +82,11 @@ public class MappingDataListener extends AbstractDataListener {
 
                 mapSystem.addMapping(mapping.getOrigin(), mapping.getLispAddressContainer(),
                         new EidToLocatorRecordBuilder(mapping).build());
-                notificationProvider.publish(MSNotificationInputUtil.toMappingChanged(mapping, MappingChange.Updated));
+                try {
+                    notificationPublishService.putNotification(MSNotificationInputUtil.toMappingChanged(mapping, MappingChange.Updated));
+                } catch (InterruptedException e) {
+                    LOG.warn("Notification publication interrupted!");
+                }
             }
         }
 
@@ -98,7 +102,11 @@ public class MappingDataListener extends AbstractDataListener {
                 LOG.trace("Value: {}", dataObject);
 
                 mapSystem.removeMapping(mapping.getOrigin(), mapping.getLispAddressContainer());
-                notificationProvider.publish(MSNotificationInputUtil.toMappingChanged(mapping, MappingChange.Removed));
+                try {
+                    notificationPublishService.putNotification(MSNotificationInputUtil.toMappingChanged(mapping, MappingChange.Removed));
+                } catch (InterruptedException e) {
+                    LOG.warn("Notification publication interrupted!");
+                }
             }
         }
     }
index cf4d39afeee0433389902a98e89375080ff3cfe9..70bcd050258e5f94849fb94137c3613dac2d7753 100644 (file)
@@ -7,8 +7,9 @@ module mappingservice-impl {
     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 mdsal; revision-date 2013-10-28; }
+    import opendaylight-sal-binding-broker-impl { prefix sal-broker; revision-date 2013-10-28; }
     import mappingservice { prefix mappingservice; revision-date 2015-09-06; }
-    import lfm-ms-dao { prefix ms-dao; revision-date 2015-07-13; }
+    import mappingservice-dao { prefix ms-dao; revision-date 2015-10-07; }
 
     description
         "This module contains the base YANG definitions for
@@ -66,15 +67,15 @@ module mappingservice-impl {
                 uses config:service-ref {
                     refine type {
                         mandatory true;
-                        config:required-identity ms-dao:ms-dao;
+                        config:required-identity ms-dao:mappingservice-dao;
                     }
                 }
             }
-            container notification-service {
+            container notification-publish-service {
                 uses config:service-ref {
                     refine type {
                         mandatory true;
-                        config:required-identity mdsal:binding-notification-service;
+                        config:required-identity sal-broker:binding-new-notification-publish-service;
                     }
                 }
             }
@@ -89,6 +90,14 @@ module mappingservice-impl {
                     }
                 }
             }
+            container notification-service {
+                uses config:service-ref {
+                    refine type {
+                        mandatory true;
+                        config:required-identity sal-broker:binding-new-notification-service;
+                    }
+                }
+            }
             container mappingservice {
                 uses config:service-ref {
                     refine type {
index 4b28a9cbbd5599e11476ae2ed45b52cb81a856c1..ffa2558ef1a7d9666ea1ec4735803a9b567b5128 100644 (file)
@@ -1,7 +1,7 @@
 module mappingservice-shell-impl {
 
     yang-version 1;
-    namespace "urn:opendaylight:params:xml:ns:yang:controller:config:lfm:mappingservice:shell:impl";
+    namespace "urn:opendaylight:params:xml:ns:yang:controller:config:lfm:mappingservice-shell:impl";
     prefix "mappingservice-shell-impl";
 
     import config { prefix config; revision-date 2013-04-05; }
@@ -26,7 +26,7 @@ module mappingservice-shell-impl {
     augment "/config:modules/config:module/config:configuration" {
         case mappingservice-shell-impl {
             when "/config:modules/config:module/config:type = 'mappingservice-shell-impl'";
-            container broker {
+            container osgi-broker {
                 uses config:service-ref {
                     refine type {
                         mandatory true;
index 7aabe00b01b8a2887318d1435b58978d0817ef83..4ca08875a7e4f7b2a64604dc35808b92fdba27b1 100644 (file)
@@ -1,29 +1,29 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <snapshot>
     <required-capabilities>
-        <capability>urn:opendaylight:params:xml:ns:yang:controller:config:lfm:ms:dao?module=lfm-ms-dao&amp;revision=2015-07-13</capability>
+        <capability>urn:opendaylight:params:xml:ns:yang:controller:config:lfm:mappingservice-dao:inmemorydb?module=mappingservice-dao-inmemorydb&amp;revision=2015-10-07</capability>
     </required-capabilities>
     <configuration>
         <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
             <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
                 <module>
-                    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:lfm:ms:dao:inmemorydb">
-                        prefix:lfm-ms-inmemorydb
+                    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:lfm:mappingservice-dao:inmemorydb">
+                        prefix:mappingservice-dao-inmemorydb
                     </type>
-                    <name>lfm-ms-inmemorydb-default</name>
+                    <name>mappingservice-dao-inmemorydb-default</name>
                     <record-timeout>240</record-timeout>
                 </module>
             </modules>
             <services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
               <service>
-                <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:lfm:ms:dao">prefix:ms-dao</type>
+                <type xmlns:dao="urn:opendaylight:lfm:mappingservice-dao">dao:mappingservice-dao</type>
                 <instance>
-                  <name>lfm-ms-inmemorydb</name>
-                  <provider>/modules/module[type='lfm-ms-inmemorydb'][name='lfm-ms-inmemorydb-default']
+                  <name>mappingservice-dao-inmemorydb</name>
+                  <provider>/modules/module[type='mappingservice-dao-inmemorydb'][name='mappingservice-dao-inmemorydb-default']
                   </provider>
                 </instance>
               </service>
             </services>
         </data>
     </configuration>
-</snapshot>
\ No newline at end of file
+</snapshot>
@@ -1,13 +1,13 @@
-package org.opendaylight.controller.config.yang.config.lfm.ms.dao.inmemorydb;
+package org.opendaylight.controller.config.yang.config.lfm.mappingservice_dao.inmemorydb;
 
 import org.opendaylight.lispflowmapping.inmemorydb.HashMapDb;
 
-public class InMemoryDbModule extends org.opendaylight.controller.config.yang.config.lfm.ms.dao.inmemorydb.AbstractInMemoryDbModule {
+public class InMemoryDbModule extends org.opendaylight.controller.config.yang.config.lfm.mappingservice_dao.inmemorydb.AbstractInMemoryDbModule {
     public InMemoryDbModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
         super(identifier, dependencyResolver);
     }
 
-    public InMemoryDbModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.config.lfm.ms.dao.inmemorydb.InMemoryDbModule oldModule, java.lang.AutoCloseable oldInstance) {
+    public InMemoryDbModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.config.lfm.mappingservice_dao.inmemorydb.InMemoryDbModule oldModule, java.lang.AutoCloseable oldInstance) {
         super(identifier, dependencyResolver, oldModule, oldInstance);
     }
 
@@ -22,4 +22,5 @@ public class InMemoryDbModule extends org.opendaylight.controller.config.yang.co
         hashMapDb.setRecordTimeOut(getRecordTimeout());
         return hashMapDb;
     }
+
 }
diff --git a/mappingservice/inmemorydb/src/main/java/org/opendaylight/controller/config/yang/config/lfm/mappingservice_dao/inmemorydb/InMemoryDbModuleFactory.java b/mappingservice/inmemorydb/src/main/java/org/opendaylight/controller/config/yang/config/lfm/mappingservice_dao/inmemorydb/InMemoryDbModuleFactory.java
new file mode 100644 (file)
index 0000000..22b9b64
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+* Generated file
+*
+* Generated from: yang module name: mappingservice-dao-inmemorydb yang module local name: mappingservice-dao-inmemorydb
+* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
+* Generated at: Wed Oct 07 00:21:06 EEST 2015
+*
+* Do not modify this file unless it is present under src/main directory
+*/
+package org.opendaylight.controller.config.yang.config.lfm.mappingservice_dao.inmemorydb;
+public class InMemoryDbModuleFactory extends org.opendaylight.controller.config.yang.config.lfm.mappingservice_dao.inmemorydb.AbstractInMemoryDbModuleFactory {
+
+}
diff --git a/mappingservice/inmemorydb/src/main/java/org/opendaylight/controller/config/yang/config/lfm/ms/dao/inmemorydb/InMemoryDbModuleFactory.java b/mappingservice/inmemorydb/src/main/java/org/opendaylight/controller/config/yang/config/lfm/ms/dao/inmemorydb/InMemoryDbModuleFactory.java
deleted file mode 100644 (file)
index 0a82ca8..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
-* Generated file
-*
-* Generated from: yang module name: lfm-ms-inmemorydb yang module local name: lfm-ms-inmemorydb
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Mon Jul 13 12:44:05 CEST 2015
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.controller.config.yang.config.lfm.ms.dao.inmemorydb;
-public class InMemoryDbModuleFactory extends org.opendaylight.controller.config.yang.config.lfm.ms.dao.inmemorydb.AbstractInMemoryDbModuleFactory {
-
-}
diff --git a/mappingservice/inmemorydb/src/main/yang/lfm-ms-inmemorydb.yang b/mappingservice/inmemorydb/src/main/yang/lfm-ms-inmemorydb.yang
deleted file mode 100644 (file)
index e33d050..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-module lfm-ms-inmemorydb {
-    yang-version 1;
-    namespace "urn:opendaylight:params:xml:ns:yang:controller:config:lfm:ms:dao:inmemorydb";
-    prefix "inmemorydb";
-
-    import config { prefix config; revision-date 2013-04-05; }
-    import lfm-ms-dao { prefix ms-dao; revision-date 2015-07-13; }
-
-    description
-        "Service definition for Mapping Service DAO.";
-
-    revision "2015-07-13" {
-        description
-            "Initial revision";
-    }
-
-    identity lfm-ms-inmemorydb {
-        base config:module-type;
-        config:provided-service ms-dao:ms-dao;
-        config:java-name-prefix InMemoryDb;
-    }
-
-    augment "/config:modules/config:module/config:configuration" {
-        case lfm-ms-inmemorydb {
-          when "/config:modules/config:module/config:type = 'lfm-ms-inmemorydb'";
-          leaf record-timeout {
-              type uint16;
-              description
-                  "Mapping record timeout";
-          }
-        }
-    }
-}
\ No newline at end of file
diff --git a/mappingservice/inmemorydb/src/main/yang/mappingservice-dao-inmemorydb.yang b/mappingservice/inmemorydb/src/main/yang/mappingservice-dao-inmemorydb.yang
new file mode 100644 (file)
index 0000000..c54c548
--- /dev/null
@@ -0,0 +1,33 @@
+module mappingservice-dao-inmemorydb {
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:controller:config:lfm:mappingservice-dao:inmemorydb";
+    prefix "inmemorydb";
+
+    import config { prefix config; revision-date 2013-04-05; }
+    import mappingservice-dao { prefix ms-dao; revision-date 2015-10-07; }
+
+    description
+        "InMemoryDb Mapping Service DAO implementation.";
+
+    revision "2015-10-07" {
+        description
+            "Module renamed from lfm-ms-inmemorydb";
+    }
+
+    identity mappingservice-dao-inmemorydb {
+        base config:module-type;
+        config:provided-service ms-dao:mappingservice-dao;
+        config:java-name-prefix InMemoryDb;
+    }
+
+    augment "/config:modules/config:module/config:configuration" {
+        case mappingservice-dao-inmemorydb {
+          when "/config:modules/config:module/config:type = 'mappingservice-dao-inmemorydb'";
+          leaf record-timeout {
+              type uint16;
+              description
+                  "Mapping record timeout";
+          }
+        }
+    }
+}
index 44fd949d64a56e3045a19c24d77395488dc07801..407a25a50edef14c1c78dda3e855413d24948419 100644 (file)
@@ -50,4 +50,38 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     </dependency>
     -->
   </dependencies>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <!-- Temporarily override the odlparent checkstyle configuration.
+               We want to enforce some simple rules and add more as we clean up code -->
+          <artifactId>maven-checkstyle-plugin</artifactId>
+          <configuration>
+            <configLocation>checkstyle/java_rules.xml</configLocation>
+            <includeTestSourceDirectory>true</includeTestSourceDirectory>
+            <excludes>org/opendaylight/yang/gen/**,**/config/yang/**</excludes>
+            <failsOnError>true</failsOnError>
+            <consoleOutput>true</consoleOutput>
+          </configuration>
+          <dependencies>
+            <dependency>
+              <groupId>org.opendaylight.lispflowmapping</groupId>
+              <artifactId>common.build.tools</artifactId>
+              <version>${project.version}</version>
+            </dependency>
+          </dependencies>
+          <executions>
+            <execution>
+              <goals>
+                <goal>check</goal>
+              </goals>
+              <phase>process-sources</phase>
+            </execution>
+          </executions>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
 </project>
index d73ea09a51d386122b314705d58f08b3090df286..07f50d7686ee136c0b1ee5515c203e565d2ea7a2 100644 (file)
@@ -13,32 +13,21 @@ import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 import static org.ops4j.pax.exam.CoreOptions.composite;
 import static org.ops4j.pax.exam.CoreOptions.maven;
-import static org.ops4j.pax.exam.CoreOptions.options;
 import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
 
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
 import java.net.DatagramPacket;
 import java.net.DatagramSocket;
-import java.net.HttpURLConnection;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
-import java.net.MalformedURLException;
 import java.net.SocketException;
 import java.net.SocketTimeoutException;
-import java.net.URL;
 import java.net.UnknownHostException;
 import java.nio.ByteBuffer;
-import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.Arrays;
 
 import javax.inject.Inject;
 
-import org.apache.commons.codec.binary.Base64;
 //import org.codehaus.jettison.json.JSONException;
 //import org.codehaus.jettison.json.JSONObject;
 //import org.codehaus.jettison.json.JSONTokener;
@@ -48,7 +37,6 @@ import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.opendaylight.controller.mdsal.it.base.AbstractMdsalTestBase;
-import org.opendaylight.controller.sal.binding.api.NotificationListener;
 import org.opendaylight.lispflowmapping.implementation.LispMappingService;
 import org.opendaylight.lispflowmapping.interfaces.lisp.IFlowMapping;
 import org.opendaylight.lispflowmapping.interfaces.mappingservice.IMappingService;
@@ -61,7 +49,10 @@ import org.opendaylight.lispflowmapping.lisp.serializer.MapRegisterSerializer;
 import org.opendaylight.lispflowmapping.lisp.serializer.MapReplySerializer;
 import org.opendaylight.lispflowmapping.lisp.serializer.MapRequestSerializer;
 import org.opendaylight.lispflowmapping.type.sbplugin.IConfigLispSouthboundPlugin;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.AddMapping;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.EidToLocatorRecord.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.GotMapNotify;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.GotMapReply;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.LcafApplicationDataAddress;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.LcafListAddress;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.LcafSegmentAddress;
@@ -69,11 +60,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.Lc
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.LispAFIAddress;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.LispIpv4Address;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.LispMacAddress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.LispProtoListener;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.MapNotify;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.MapRegister;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.MapReply;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.MapRequest;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.ReencapHop;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.RequestMapping;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.XtrReplyMapping;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.XtrRequestMapping;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.eidrecords.EidRecord;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.eidrecords.EidRecordBuilder;
@@ -89,17 +83,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lc
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lcaftrafficengineeringaddress.Hops;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lcaftrafficengineeringaddress.HopsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lispaddress.LispAddressContainer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lispaddress.LispAddressContainerBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lispaddress.lispaddresscontainer.address.LcafKeyValue;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lispaddress.lispaddresscontainer.address.LcafSourceDest;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lispaddress.lispaddresscontainer.address.LcafSourceDestBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lispaddress.lispaddresscontainer.address.ipv4.Ipv4Address;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lispaddress.lispaddresscontainer.address.lcafapplicationdata.LcafApplicationDataAddr;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lispaddress.lispaddresscontainer.address.lcafapplicationdata.LcafApplicationDataAddrBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lispaddress.lispaddresscontainer.address.lcafkeyvalue.LcafKeyValueAddressAddrBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lispaddress.lispaddresscontainer.address.lcaflist.LcafListAddrBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lispaddress.lispaddresscontainer.address.lcafsegment.LcafSegmentAddrBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lispaddress.lispaddresscontainer.address.lcafsourcedest.LcafSourceDestAddr;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lispaddress.lispaddresscontainer.address.lcafsourcedest.LcafSourceDestAddrBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lispaddress.lispaddresscontainer.address.lcaftrafficengineering.LcafTrafficEngineeringAddrBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lispaddress.lispaddresscontainer.address.no.NoAddressBuilder;
@@ -123,7 +114,6 @@ import org.ops4j.pax.exam.spi.reactors.PerClass;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -302,7 +292,7 @@ public class MappingServiceIntegrationTest extends AbstractMdsalTestBase {
 
     @Inject
     private BundleContext bc;
-    private HttpURLConnection connection;
+    //private HttpURLConnection connection;
     protected static boolean notificationCalled;
 
     @Inject @Filter(timeout=60000)
@@ -1618,14 +1608,14 @@ public class MappingServiceIntegrationTest extends AbstractMdsalTestBase {
         mapReply = receiveMapReply();
         assertCorrectMapReplyTTLAndAction(mapReply, 15, Action.NativelyForward);
     }
-
+/*
     private void testTTLAfterAutherize(MapRequest mapRequest) throws SocketTimeoutException {
         MapReply mapReply;
         sendMapRequest(mapRequest);
         mapReply = receiveMapReply();
         assertCorrectMapReplyTTLAndAction(mapReply, 1, Action.NativelyForward);
     }
-
+*/
     private void assertCorrectMapReplyTTLAndAction(MapReply mapReply, int expectedTTL, Action expectedAction) {
         assertEquals(expectedTTL, mapReply.getEidToLocatorRecord().get(0).getRecordTtl().intValue());
         assertEquals(expectedAction, mapReply.getEidToLocatorRecord().get(0).getAction());
@@ -1696,6 +1686,34 @@ public class MappingServiceIntegrationTest extends AbstractMdsalTestBase {
 
     }
 
+    private class XtrRequestMappingListener implements LispProtoListener {
+
+        @Override
+        public void onGotMapReply(GotMapReply notification) {
+        }
+
+        @Override
+        public void onAddMapping(AddMapping notification) {
+        }
+
+        @Override
+        public void onXtrReplyMapping(XtrReplyMapping notification) {
+        }
+
+        @Override
+        public void onRequestMapping(RequestMapping notification) {
+        }
+
+        @Override
+        public void onGotMapNotify(GotMapNotify notification) {
+        }
+
+        @Override
+        public void onXtrRequestMapping(XtrRequestMapping notification) {
+        }
+
+    }
+
     public void testRecievingNonProxyOnXtrPort() throws SocketTimeoutException, SocketException, Throwable {
         cleanUP();
         configLispPlugin.shouldListenOnXtrPort(true);
@@ -1710,10 +1728,10 @@ public class MappingServiceIntegrationTest extends AbstractMdsalTestBase {
                         new org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lcafapplicationdataaddress.AddressBuilder().setPrimitiveAddress(
                                 LispAFIConvertor.asPrimitiveIPAfiAddress(rloc)).build()).setLocalPortLow(new PortNumber(port)).build();
         final MapRequest mapRequest = createNonProxyMapRequest(eid, adLcaf);
-        ((LispMappingService) lms).registerNotificationListener(XtrRequestMapping.class, new NotificationListener<XtrRequestMapping>() {
+        ((LispMappingService) lms).getNotificationService().registerNotificationListener(new XtrRequestMappingListener() {
 
             @Override
-            public void onNotification(XtrRequestMapping notification) {
+            public void onXtrRequestMapping(XtrRequestMapping notification) {
                 assertEquals(((org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lispaddress.lispaddresscontainer.address.Ipv4) mapRequest.getEidRecord().get(0).getLispAddressContainer().getAddress()).getIpv4Address().getIpv4Address().getValue(),
                         eid);
                 notificationCalled = true;
@@ -1887,7 +1905,6 @@ public class MappingServiceIntegrationTest extends AbstractMdsalTestBase {
         }
     }
 
-    @SuppressWarnings({ "rawtypes", "unchecked" })
     private void areWeReady() throws InvalidSyntaxException {
         try {
             Thread.sleep(5000);
@@ -1928,7 +1945,6 @@ public class MappingServiceIntegrationTest extends AbstractMdsalTestBase {
         }
         // assertNotNull(broker);
 
-        ServiceReference r = null;
         configLispPlugin.setLispAddress(lispBindAddress);
 
         // Uncomment this code to Know which services were actually loaded to
@@ -1949,7 +1965,7 @@ public class MappingServiceIntegrationTest extends AbstractMdsalTestBase {
 
     private void cleanUP() {
         after();
-        mapService.cleanCachedMappings();;
+        mapService.cleanCachedMappings();
         configLispPlugin.shouldListenOnXtrPort(false);
         socket = initSocket(socket, LispMessage.PORT_NUM);
 
index 081ee5f47fd5668c7ecb4e84bc2f96b55ddba701..bc3d208afaa582b9da6ab2146257ac33962bf019 100644 (file)
@@ -50,6 +50,38 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
 
   <!-- Temporarily disable compiling non-generated code, like serializers, which won't build for now -->
   <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <!-- Temporarily override the odlparent checkstyle configuration.
+               We want to enforce some simple rules and add more as we clean up code -->
+          <artifactId>maven-checkstyle-plugin</artifactId>
+          <configuration>
+            <configLocation>checkstyle/java_rules.xml</configLocation>
+            <includeTestSourceDirectory>true</includeTestSourceDirectory>
+            <excludes>org/opendaylight/yang/gen/**,**/config/yang/**</excludes>
+            <failsOnError>true</failsOnError>
+            <consoleOutput>true</consoleOutput>
+          </configuration>
+          <dependencies>
+            <dependency>
+              <groupId>org.opendaylight.lispflowmapping</groupId>
+              <artifactId>common.build.tools</artifactId>
+              <version>${project.version}</version>
+            </dependency>
+          </dependencies>
+          <executions>
+            <execution>
+              <goals>
+                <goal>check</goal>
+              </goals>
+              <phase>process-sources</phase>
+            </execution>
+          </executions>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+
     <plugins>
       <plugin>
         <artifactId>maven-compiler-plugin</artifactId>
index 522f477569b1843085e396e48b824f042c64bbe3..3b5ea1c75421cf98857a1b1342a59713f5b0f261 100644 (file)
@@ -27,7 +27,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.li
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lispsimpleaddress.primitiveaddress.Ipv4Builder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lispsimpleaddress.primitiveaddress.MacBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lispsimpleaddress.primitiveaddress.distinguishedname.DistinguishedNameAddressBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lispsimpleaddress.primitiveaddress.ipv4.Ipv4AddressBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lispsimpleaddress.primitiveaddress.mac.MacAddressBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Address;
index bd3d187dafd07ea11b2a93e4552f1ccc264799b6..92725d297e638eacd63b0e3118c9eb24187c2249 100644 (file)
@@ -8,9 +8,7 @@
     <version>1.3.0-SNAPSHOT</version>
   </parent>
 
-  <groupId>org.opendaylight.lispflowmapping</groupId>
   <artifactId>mappingservice.neutron</artifactId>
-  <version>1.3.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
   <name>Mapping Service Neutron APIs</name>
 
index 993d835858175874938f9670ce889f774a2b3b60..aaee63b1593ad34645e77abb8b7ed04b316e92f3 100644 (file)
@@ -91,6 +91,7 @@
           <artifactId>maven-checkstyle-plugin</artifactId>
           <configuration>
             <configLocation>checkstyle/java_rules.xml</configLocation>
+            <includeTestSourceDirectory>true</includeTestSourceDirectory>
             <excludes>org/opendaylight/yang/gen/**,**/config/yang/**</excludes>
             <failsOnError>true</failsOnError>
             <consoleOutput>true</consoleOutput>
index 41a5aeb9241ee7ae7e6d30db199266507178db3e..6c4165f0085fef9175625b12b340191fb68c3cc4 100644 (file)
@@ -8,9 +8,7 @@
     <version>1.3.0-SNAPSHOT</version>
   </parent>
 
-  <groupId>org.opendaylight.lispflowmapping</groupId>
   <artifactId>mappingservice.shell</artifactId>
-  <version>1.3.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
   <name>Mapping Service Karaf Shell Commands</name>
 
index 5b5eae52f69b5225450844ef17713b9d938cfc11..5acaee1ed2559bbba5c6f6e94d8c90a4f3ae0320 100644 (file)
@@ -2,6 +2,7 @@
 <snapshot>
   <required-capabilities>
     <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&amp;revision=2013-10-28</capability>
+    <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl?module=opendaylight-sal-binding-broker-impl&amp;revision=2013-10-28</capability>
     <capability>urn:opendaylight:params:xml:ns:yang:controller:config:lfm-mappingservice-sb:impl?module=lfm-mappingservice-sb-impl&amp;revision=2015-05-17</capability>
   </required-capabilities>
   <configuration>
             <name>binding-osgi-broker</name>
           </broker>
 
-          <notification-service>
-            <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
-              binding:binding-notification-service
+          <notification-publish-service>
+            <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+              binding:binding-new-notification-publish-service
             </type>
-            <name>binding-notification-broker</name>
-          </notification-service>
+            <name>binding-notification-publish-adapter</name>
+          </notification-publish-service>
         </module>
       </modules>
 
@@ -49,4 +50,4 @@
 
   </configuration>
 
-</snapshot>
\ No newline at end of file
+</snapshot>
index 771189b92ffea01604b6cbba0988dba37f7ce213..ec4f7c6c062fe5d4679d5ffbc81aaad1ac4b3647 100644 (file)
@@ -8,13 +8,7 @@
 
 package org.opendaylight.controller.config.yang.config.lfm_mappingservice_sb.impl;
 
-import java.net.DatagramPacket;
-
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.opendaylight.lispflowmapping.southbound.LispSouthboundPlugin;
-import org.opendaylight.lispflowmapping.southbound.LispSouthboundRPC;
-import org.opendaylight.lispflowmapping.southbound.lisp.ILispSouthboundService;
 import org.slf4j.LoggerFactory;
 import org.slf4j.Logger;
 
@@ -40,7 +34,7 @@ public class LfmMappingServiceSbModule extends org.opendaylight.controller.confi
         LOG.debug("LfmMappingServiceSb Module up!");
 
         sbPlugin = new LispSouthboundPlugin();
-        sbPlugin.setNotificationProviderService(getNotificationServiceDependency());
+        sbPlugin.setNotificationPublishService(getNotificationPublishServiceDependency());
         sbPlugin.setRpcRegistryDependency(getRpcRegistryDependency());
         sbPlugin.setBindingAwareBroker(getBrokerDependency());
         sbPlugin.init();
index dda3a1def372fe79948103952ed99500584d4223..48e8e0aa1162066b33f7ad4a213487ee73878a9f 100644 (file)
@@ -18,10 +18,10 @@ import java.net.SocketTimeoutException;
 import java.nio.ByteBuffer;
 
 import org.apache.commons.lang3.exception.ExceptionUtils;
+import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
 import org.opendaylight.lispflowmapping.lisp.type.LispMessage;
 import org.opendaylight.lispflowmapping.southbound.lisp.ILispSouthboundService;
@@ -44,7 +44,7 @@ public class LispSouthboundPlugin implements IConfigLispSouthboundPlugin, AutoCl
     private LispIoThread xtrThread;
     private LispSouthboundService lispSouthboundService;
     private LispXtrSouthboundService lispXtrSouthboundService;
-    private NotificationProviderService notificationService;
+    private NotificationPublishService notificationPublishService;
     private RpcProviderRegistry rpcRegistry;
     private BindingAwareBroker broker;
     private volatile DatagramSocket socket = null;
@@ -65,8 +65,8 @@ public class LispSouthboundPlugin implements IConfigLispSouthboundPlugin, AutoCl
         synchronized (startLock) {
             lispSouthboundService = new LispSouthboundService(this);
             lispXtrSouthboundService = new LispXtrSouthboundService();
-            lispSouthboundService.setNotificationProvider(this.notificationService);
-            lispXtrSouthboundService.setNotificationProvider(this.notificationService);
+            lispSouthboundService.setNotificationProvider(this.notificationPublishService);
+            lispXtrSouthboundService.setNotificationProvider(this.notificationPublishService);
             if (bindingAddress == null) {
                 setLispAddress("0.0.0.0");
             }
@@ -74,8 +74,8 @@ public class LispSouthboundPlugin implements IConfigLispSouthboundPlugin, AutoCl
         }
     }
 
-    public void setNotificationProviderService(NotificationProviderService notificationService) {
-        this.notificationService = notificationService;
+    public void setNotificationPublishService(NotificationPublishService notificationService) {
+        this.notificationPublishService = notificationService;
     }
 
     public void setRpcRegistryDependency(RpcProviderRegistry rpcRegistry) {
index e9a075d1f5b1f62f22824a79781f9a9cb273f402..6bab0314cb671a460fb4f1aca5d4ce03b4cf4c82 100644 (file)
@@ -12,7 +12,7 @@ import java.net.DatagramPacket;
 import java.net.InetAddress;
 import java.nio.ByteBuffer;
 
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
 import org.opendaylight.lispflowmapping.southbound.LispSouthboundPlugin;
 import org.opendaylight.lispflowmapping.southbound.LispSouthboundStats;
 import org.opendaylight.lispflowmapping.southbound.util.LispNotificationHelper;
@@ -40,7 +40,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class LispSouthboundService implements ILispSouthboundService {
-    private NotificationProviderService notificationProvider;
+    private NotificationPublishService notificationPublishService;
     protected static final Logger LOG = LoggerFactory.getLogger(LispSouthboundService.class);
 
     private final LispSouthboundPlugin lispSbPlugin;
@@ -53,8 +53,8 @@ public class LispSouthboundService implements ILispSouthboundService {
         }
     }
 
-    public void setNotificationProvider(NotificationProviderService nps) {
-        this.notificationProvider = nps;
+    public void setNotificationProvider(NotificationPublishService nps) {
+        this.notificationPublishService = nps;
     }
 
     public void handlePacket(DatagramPacket packet) {
@@ -105,14 +105,16 @@ public class LispSouthboundService implements ILispSouthboundService {
             transportAddressBuilder.setIpAddress(LispNotificationHelper.getIpAddressFromInetAddress(finalSourceAddress));
             transportAddressBuilder.setPort(new PortNumber(port));
             requestMappingBuilder.setTransportAddress(transportAddressBuilder.build());
-            if (notificationProvider != null) {
-                notificationProvider.publish(requestMappingBuilder.build());
+            if (notificationPublishService != null) {
+                notificationPublishService.putNotification(requestMappingBuilder.build());
                 LOG.trace("MapRequest was published!");
             } else {
                 LOG.warn("Notification Provider is null!");
             }
         } catch (RuntimeException re) {
             throw new LispMalformedPacketException("Couldn't deserialize Map-Request (len=" + inBuffer.capacity() + ")", re);
+        } catch (InterruptedException e) {
+            LOG.warn("Notification publication interrupted!");
         }
     }
 
@@ -145,14 +147,16 @@ public class LispSouthboundService implements ILispSouthboundService {
             transportAddressBuilder.setIpAddress(LispNotificationHelper.getIpAddressFromInetAddress(sourceAddress));
             transportAddressBuilder.setPort(new PortNumber(port));
             addMappingBuilder.setTransportAddress(transportAddressBuilder.build());
-            if (notificationProvider != null) {
-                notificationProvider.publish(addMappingBuilder.build());
+            if (notificationPublishService != null) {
+                notificationPublishService.putNotification(addMappingBuilder.build());
                 LOG.trace("MapRegister was published!");
             } else {
                 LOG.warn("Notification Provider is null!");
             }
         } catch (RuntimeException re) {
             throw new LispMalformedPacketException("Couldn't deserialize Map-Register (len=" + inBuffer.capacity() + ")", re);
+        } catch (InterruptedException e) {
+            LOG.warn("Notification publication interrupted!");
         }
     }
 
@@ -165,14 +169,16 @@ public class LispSouthboundService implements ILispSouthboundService {
             transportAddressBuilder.setIpAddress(LispNotificationHelper.getIpAddressFromInetAddress(sourceAddress));
             transportAddressBuilder.setPort(new PortNumber(port));
             gotMapNotifyBuilder.setTransportAddress(transportAddressBuilder.build());
-            if (notificationProvider != null) {
-                notificationProvider.publish(gotMapNotifyBuilder.build());
+            if (notificationPublishService != null) {
+                notificationPublishService.putNotification(gotMapNotifyBuilder.build());
                 LOG.trace("MapNotify was published!");
             } else {
                 LOG.warn("Notification Provider is null!");
             }
         } catch (RuntimeException re) {
             throw new LispMalformedPacketException("Couldn't deserialize Map-Notify (len=" + inBuffer.capacity() + ")", re);
+        } catch (InterruptedException e) {
+            LOG.warn("Notification publication interrupted!");
         }
     }
 
@@ -185,14 +191,16 @@ public class LispSouthboundService implements ILispSouthboundService {
             transportAddressBuilder.setIpAddress(LispNotificationHelper.getIpAddressFromInetAddress(sourceAddress));
             transportAddressBuilder.setPort(new PortNumber(port));
             gotMapReplyBuilder.setTransportAddress(transportAddressBuilder.build());
-            if (notificationProvider != null) {
-                notificationProvider.publish(gotMapReplyBuilder.build());
+            if (notificationPublishService != null) {
+                notificationPublishService.putNotification(gotMapReplyBuilder.build());
                 LOG.trace("MapReply was published!");
             } else {
                 LOG.warn("Notification Provider is null!");
             }
         } catch (RuntimeException re) {
             throw new LispMalformedPacketException("Couldn't deserialize Map-Reply (len=" + inBuffer.capacity() + ")", re);
+        } catch (InterruptedException e) {
+            LOG.warn("Notification publication interrupted!");
         }
     }
 
index ce40e902f71ae8935b48670b040b2f3de1440941..4cda9aaedbe6e35247c6197d6be86a7c5ac18c54 100644 (file)
@@ -12,7 +12,7 @@ import java.net.DatagramPacket;
 import java.net.InetAddress;
 import java.nio.ByteBuffer;
 
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
 import org.opendaylight.lispflowmapping.southbound.util.LispNotificationHelper;
 import org.opendaylight.lispflowmapping.lisp.type.LispMessage;
 import org.opendaylight.lispflowmapping.lisp.type.LispMessageEnum;
@@ -31,11 +31,11 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class LispXtrSouthboundService implements ILispSouthboundService {
-    private NotificationProviderService notificationProvider;
+    private NotificationPublishService notificationPublishService;
     protected static final Logger LOG = LoggerFactory.getLogger(LispXtrSouthboundService.class);
 
-    public void setNotificationProvider(NotificationProviderService nps) {
-        this.notificationProvider = nps;
+    public void setNotificationProvider(NotificationPublishService nps) {
+        this.notificationPublishService = nps;
     }
 
     public void handlePacket(DatagramPacket packet) {
@@ -66,14 +66,16 @@ public class LispXtrSouthboundService implements ILispSouthboundService {
             transportAddressBuilder.setIpAddress(LispNotificationHelper.getIpAddressFromInetAddress(finalSourceAddress));
             transportAddressBuilder.setPort(new PortNumber(LispMessage.PORT_NUM));
             requestMappingBuilder.setTransportAddress(transportAddressBuilder.build());
-            if (notificationProvider != null) {
-                notificationProvider.publish(requestMappingBuilder.build());
+            if (notificationPublishService != null) {
+                notificationPublishService.putNotification(requestMappingBuilder.build());
                 LOG.trace("MapRequest was published!");
             } else {
                 LOG.warn("Notification Provider is null!");
             }
         } catch (RuntimeException re) {
             throw new LispMalformedPacketException("Couldn't deserialize Map-Request (len=" + inBuffer.capacity() + ")", re);
+        } catch (InterruptedException e) {
+            LOG.warn("Notification publication interrupted!");
         }
     }
 
@@ -84,15 +86,16 @@ public class LispXtrSouthboundService implements ILispSouthboundService {
             XtrReplyMappingBuilder replyMappingBuilder = new XtrReplyMappingBuilder();
             replyMappingBuilder.setMapReply(LispNotificationHelper.convertMapReply(reply));
 
-            if (notificationProvider != null) {
-                notificationProvider.publish(replyMappingBuilder.build());
+            if (notificationPublishService != null) {
+                notificationPublishService.putNotification(replyMappingBuilder.build());
                 LOG.trace("MapReply was published!");
             } else {
                 LOG.warn("Notification Provider is null!");
             }
         } catch (RuntimeException re) {
             throw new LispMalformedPacketException("Couldn't deserialize Map-Reply (len=" + buffer.capacity() + ")", re);
+        } catch (InterruptedException e) {
+            LOG.warn("Notification publication interrupted!");
         }
-
     }
 }
index 4b23ae0599b6bd04926b280dc0e97b7b5b1a44fe..f0098ec81803a0892eeb11b6187b85e0cb74cd18 100644 (file)
@@ -7,6 +7,7 @@ module lfm-mappingservice-sb-impl {
   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 mdsal; revision-date 2013-10-28; }
+  import opendaylight-sal-binding-broker-impl { prefix sal-broker; revision-date 2013-10-28; }
   import lisp-sb { prefix lisp-sb; revision-date 2015-09-04; }
 
   description
@@ -39,11 +40,11 @@ module lfm-mappingservice-sb-impl {
           }
       }
 
-      container notification-service {
+      container notification-publish-service {
           uses config:service-ref {
               refine type {
                   mandatory true;
-                  config:required-identity mdsal:binding-notification-service;
+                  config:required-identity sal-broker:binding-new-notification-publish-service;
               }
           }
       }
index 7efa1b02469c1b684ead9038a1e34463a9c03530..0bdf1a4de90101e07ccf97522c9889a6887ae878 100644 (file)
@@ -26,7 +26,7 @@ import org.jmock.api.Invocation;
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
 import org.opendaylight.lispflowmapping.lisp.type.AddressFamilyNumberEnum;
 import org.opendaylight.lispflowmapping.lisp.type.LispMessage;
 import org.opendaylight.lispflowmapping.lisp.type.LispMessageEnum;
@@ -39,7 +39,6 @@ import org.opendaylight.lispflowmapping.southbound.lisp.exception.LispMalformedP
 import org.opendaylight.lispflowmapping.tools.junit.BaseTestCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.AddMapping;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.EidToLocatorRecord.Action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.LispAFIAddress;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.MapRegister;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.MapRequest;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.RequestMapping;
@@ -47,20 +46,16 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.ei
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.eidtolocatorrecords.EidToLocatorRecord;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.eidtolocatorrecords.EidToLocatorRecordBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lispaddress.LispAddressContainer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lispaddress.lispaddresscontainer.address.ipv4.Ipv4AddressBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.lispaddress.lispaddresscontainer.address.ipv6.Ipv6AddressBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.locatorrecords.LocatorRecord;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.locatorrecords.LocatorRecordBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.mapnotifymessage.MapNotifyBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev150820.mapreplymessage.MapReplyBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Address;
 import org.opendaylight.yangtools.yang.binding.Notification;
 
 public class LispSouthboundServiceTest extends BaseTestCase {
 
     private LispSouthboundService testedLispService;
-    private NotificationProviderService nps;
+    private NotificationPublishService nps;
     private byte[] mapRequestPacket;
     private byte[] mapRegisterPacket;
     private ValueSaverAction<Notification> lispNotificationSaver;
@@ -96,7 +91,7 @@ public class LispSouthboundServiceTest extends BaseTestCase {
         // mapResolver = context.mock(IMapResolver.class);
         // mapServer = context.mock(IMapServer.class);
         testedLispService = new LispSouthboundService(null);
-        nps = context.mock(NotificationProviderService.class);
+        nps = context.mock(NotificationPublishService.class);
         testedLispService.setNotificationProvider(nps);
         lispNotificationSaver = new ValueSaverAction<Notification>();
         // mapRegisterSaver = new ValueSaverAction<MapRegister>();
@@ -227,7 +222,7 @@ public class LispSouthboundServiceTest extends BaseTestCase {
                 + "0060   ff 00 00 05 00 01 0a 01 00 6e 06 64 ff 00 00 05 " //
                 + "0070   00 01 c0 a8 88 33"));
 
-        oneOf(nps).publish(with(lispNotificationSaver));
+        oneOf(nps).putNotification(with(lispNotificationSaver));
 
         handleMapRegisterPacket(mapRegisterPacket);
 
@@ -262,7 +257,7 @@ public class LispSouthboundServiceTest extends BaseTestCase {
                 + "0060   01 92 00 00 00 00 00 00 00 01 01 64 ff 00 00 05 " //
                 + "0070   00 01 0a 00 3a 9c"));
 
-        oneOf(nps).publish(with(lispNotificationSaver));
+        oneOf(nps).putNotification(with(lispNotificationSaver));
 
         handleMapRegisterPacket(mapRegisterPacket);
 
@@ -276,7 +271,7 @@ public class LispSouthboundServiceTest extends BaseTestCase {
 
     @Test
     public void mapRegister__VerifyBasicFields() throws Exception {
-        oneOf(nps).publish(with(lispNotificationSaver));
+        oneOf(nps).putNotification(with(lispNotificationSaver));
         handleMapRegisterPacket(mapRegisterPacket);
 
         EidToLocatorRecord eidToLocator = lastMapRegister().getEidToLocatorRecord().get(0);
@@ -289,7 +284,7 @@ public class LispSouthboundServiceTest extends BaseTestCase {
     @Test
     @Ignore
     public void mapRegister__NoResponseFromMapServerShouldReturnNullPacket() throws Exception {
-        oneOf(nps).publish(with(lispNotificationSaver));
+        oneOf(nps).putNotification(with(lispNotificationSaver));
         mapNotifyBuilder = null;
 
         assertNull(handleMapRegisterPacket(mapRegisterPacket));
@@ -412,7 +407,7 @@ public class LispSouthboundServiceTest extends BaseTestCase {
 
     @Test
     public void mapRequest__VerifyBasicFields() throws Exception {
-        oneOf(nps).publish(with(lispNotificationSaver));
+        oneOf(nps).putNotification(with(lispNotificationSaver));
         handleMapRequestAsByteArray(mapRequestPacket);
         List<EidRecord> eids = lastMapRequest().getEidRecord();
         assertEquals(1, eids.size());
@@ -452,7 +447,7 @@ public class LispSouthboundServiceTest extends BaseTestCase {
                 + "00a0   00 02 26 10 00 d0 ff ff 01 92 00 00 00 00 00 00 " //
                 + "00b0   00 01 01 64 ff 00 00 05 00 01 0a 00 3a 9c"));
 
-        oneOf(nps).publish(with(lispNotificationSaver));
+        oneOf(nps).putNotification(with(lispNotificationSaver));
         // ret(mapReply);
 
         handleMapRequestAsByteArray(mapRequestPacket);
@@ -480,7 +475,7 @@ public class LispSouthboundServiceTest extends BaseTestCase {
                 + "0090   00 00 00 00 00 02 00 00 00 0a 01 80 10 00 00 00 " //
                 + "00a0   00 02 26 10 00 d0 ff ff 01 92 00 00 00 00 00 00 " //
                 + "00b0   00 01 01 64 ff 00 00 05 00 01 0a 00 3a 9c"));
-        oneOf(nps).publish(with(lispNotificationSaver));
+        oneOf(nps).putNotification(with(lispNotificationSaver));
         // ret(mapReply);
 
         DatagramPacket replyPacket = handleMapRequestPacket(mapRequestPacket);
@@ -502,7 +497,7 @@ public class LispSouthboundServiceTest extends BaseTestCase {
                 + "0070   10 00 00 00 00 01 99 10 fe 01 01 64 ff 00 00 05 " //
                 + "0080   00 01 0a 00 01 26"));
 
-        oneOf(nps).publish(with(lispNotificationSaver));
+        oneOf(nps).putNotification(with(lispNotificationSaver));
         // ret(mapReply);
 
         handleMapRequestAsByteArray(mapRequestPacket);
@@ -677,13 +672,16 @@ public class LispSouthboundServiceTest extends BaseTestCase {
                 + "0080   01 64 ff 00 00 05 00 01 0a 01 00 6f 06 64 ff 00 " //
                 + "0090   00 05 00 01 c0 a8 88 33"));
 
-        oneOf(nps).publish(with(lispNotificationSaver));
+        oneOf(nps).putNotification(with(lispNotificationSaver));
         handleMapRequestAsByteArray(mapRequestPacket);
 
     }
 
     private void stubMapRegister(final boolean setNotifyFromRegister) {
-        allowing(nps).publish(with(lispNotificationSaver));
+        try {
+            allowing(nps).putNotification(with(lispNotificationSaver));
+        } catch (InterruptedException e) {
+        }
         will(new SimpleAction() {
 
             @Override
@@ -697,7 +695,10 @@ public class LispSouthboundServiceTest extends BaseTestCase {
     }
 
     private void stubHandleRequest() {
-        allowing(nps).publish(wany(Notification.class));
+        try {
+            allowing(nps).putNotification(wany(Notification.class));
+        } catch (InterruptedException e) {
+        }
     }
 
     private byte[] handleMapRequestAsByteArray(byte[] inPacket) {
@@ -777,7 +778,7 @@ public class LispSouthboundServiceTest extends BaseTestCase {
     // + "40 05 c0 a8 88 0a 01 02 " // MAC (ITR-RLOC #1 of 2)
     // + "00 01 01 02 03 04 " // IP (ITR-RLOC #2 of 2)
     // + "00 20 00 01 01 02 03 04").array();
-    // oneOf(nps).publish(with(lispNotificationSaver));
+    // oneOf(nps).putNotification(with(lispNotificationSaver));
     // // ret(mapReply);
     // DatagramPacket packet = handleMapRequestPacket(mapRequestPacket);
     // assertEquals(2, lastMapRequest().getItrRlocs().size());
@@ -794,7 +795,7 @@ public class LispSouthboundServiceTest extends BaseTestCase {
     // + "00 01 01 02 03 04 " // IP (ITR-RLOC #1 of 2)
     // + "00 01 c0 a8 88 0a " // MAC (ITR-RLOC #2 of 2)
     // + "00 20 00 01 01 02 03 04").array();
-    // oneOf(nps).publish(with(lispNotificationSaver));
+    // oneOf(nps).putNotification(with(lispNotificationSaver));
     // // ret(mapReply);
     // DatagramPacket packet = handleMapRequestPacket(mapRequestPacket);
     // assertEquals(2, lastMapRequest().getItrRloc().size());