From: Lori Jakab Date: Fri, 5 Aug 2016 13:24:47 +0000 (+0000) Subject: Merge "Bug 6297: Change subscriber's RLOC selection algo" X-Git-Tag: release/boron~22 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=acfb335aef5783e74455751b7aa92f267cf4bce3;hp=e55be28ba935a7578e9e5b66acca6bb7cbfa5053;p=lispflowmapping.git Merge "Bug 6297: Change subscriber's RLOC selection algo" --- diff --git a/mappingservice/lisp-proto/pom.xml b/mappingservice/lisp-proto/pom.xml index efd988e20..cea7dbc72 100644 --- a/mappingservice/lisp-proto/pom.xml +++ b/mappingservice/lisp-proto/pom.xml @@ -47,6 +47,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.lispflowmapping common.unittest.tools ${project.version} + test junit-addons diff --git a/mappingservice/neutron/pom.xml b/mappingservice/neutron/pom.xml index 6875b5a58..c4ab77555 100644 --- a/mappingservice/neutron/pom.xml +++ b/mappingservice/neutron/pom.xml @@ -31,6 +31,10 @@ model 0.7.0-SNAPSHOT + + org.opendaylight.lispflowmapping + common.unittest.tools + diff --git a/mappingservice/pom.xml b/mappingservice/pom.xml index 818488324..a1d1346cf 100644 --- a/mappingservice/pom.xml +++ b/mappingservice/pom.xml @@ -59,6 +59,7 @@ ${project.groupId} common.unittest.tools ${project.version} + test junit-addons diff --git a/mappingservice/southbound/pom.xml b/mappingservice/southbound/pom.xml index acdfe0f23..40368ea51 100644 --- a/mappingservice/southbound/pom.xml +++ b/mappingservice/southbound/pom.xml @@ -17,10 +17,6 @@ ${project.groupId} mappingservice.api - - ${project.groupId} - mappingservice.clustering - ${project.groupId} mappingservice.inmemorydb @@ -45,6 +41,10 @@ junit-addons junit-addons + + org.opendaylight.lispflowmapping + common.unittest.tools + org.powermock powermock-api-mockito diff --git a/mappingservice/southbound/src/main/java/org/opendaylight/lispflowmapping/southbound/LispSouthboundPlugin.java b/mappingservice/southbound/src/main/java/org/opendaylight/lispflowmapping/southbound/LispSouthboundPlugin.java index a437edd6f..13e3beef6 100644 --- a/mappingservice/southbound/src/main/java/org/opendaylight/lispflowmapping/southbound/LispSouthboundPlugin.java +++ b/mappingservice/southbound/src/main/java/org/opendaylight/lispflowmapping/southbound/LispSouthboundPlugin.java @@ -31,10 +31,7 @@ import java.util.concurrent.ThreadFactory; 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.clustering.EntityOwnershipService; import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration; -import org.opendaylight.lispflowmapping.clustering.ClusterNodeModulSwitcherImpl; -import org.opendaylight.lispflowmapping.clustering.api.ClusterNodeModuleSwitcher; import org.opendaylight.lispflowmapping.lisp.type.LispMessage; import org.opendaylight.lispflowmapping.southbound.lisp.LispSouthboundHandler; import org.opendaylight.lispflowmapping.southbound.lisp.LispXtrSouthboundHandler; @@ -46,7 +43,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.OdlLi import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class LispSouthboundPlugin implements IConfigLispSouthboundPlugin, AutoCloseable, ClusterNodeModuleSwitcher { +public class LispSouthboundPlugin implements IConfigLispSouthboundPlugin, AutoCloseable { protected static final Logger LOG = LoggerFactory.getLogger(LispSouthboundPlugin.class); private volatile String bindingAddress; @@ -54,7 +51,6 @@ public class LispSouthboundPlugin implements IConfigLispSouthboundPlugin, AutoCl private long mapRegisterCacheTimeout; private static Object startLock = new Object(); - private final ClusterNodeModulSwitcherImpl clusterNodeModulSwitcher; private LispSouthboundHandler lispSouthboundHandler; private LispXtrSouthboundHandler lispXtrSouthboundHandler; private NotificationPublishService notificationPublishService; @@ -71,12 +67,9 @@ public class LispSouthboundPlugin implements IConfigLispSouthboundPlugin, AutoCl private DataBroker dataBroker; public LispSouthboundPlugin(final DataBroker dataBroker, - final NotificationPublishService notificationPublishService, - final EntityOwnershipService entityOwnershipService) { + final NotificationPublishService notificationPublishService) { this.dataBroker = dataBroker; this.notificationPublishService = notificationPublishService; - clusterNodeModulSwitcher = new ClusterNodeModulSwitcherImpl(entityOwnershipService); - clusterNodeModulSwitcher.setModule(this); } public void init() { @@ -106,7 +99,6 @@ public class LispSouthboundPlugin implements IConfigLispSouthboundPlugin, AutoCl LOG.info("LISP (RFC6830) Southbound Plugin is up!"); } - clusterNodeModulSwitcher.switchModuleByEntityOwnership(); } private void start() { @@ -284,27 +276,4 @@ public class LispSouthboundPlugin implements IConfigLispSouthboundPlugin, AutoCl lispSouthboundHandler.close(); unloadActions(); } - - @Override - public void stopModule() { - if (lispSouthboundHandler != null) { - lispSouthboundHandler.setNotificationProvider(null); - lispSouthboundHandler.setIsReadFromChannelEnabled(false); - } - if (lispXtrSouthboundHandler != null) { - lispXtrSouthboundHandler.setNotificationProvider(null); - } - } - - @Override - public void startModule() { - if (lispSouthboundHandler != null) { - lispSouthboundHandler.setNotificationProvider(notificationPublishService); - lispSouthboundHandler.restoreDaoFromDatastore(); - lispSouthboundHandler.setIsReadFromChannelEnabled(true); - } - if (lispXtrSouthboundHandler != null) { - lispXtrSouthboundHandler.setNotificationProvider(notificationPublishService); - } - } } diff --git a/mappingservice/southbound/src/main/java/org/opendaylight/lispflowmapping/southbound/lisp/LispSouthboundHandler.java b/mappingservice/southbound/src/main/java/org/opendaylight/lispflowmapping/southbound/lisp/LispSouthboundHandler.java index 38793b5b6..dba899a53 100644 --- a/mappingservice/southbound/src/main/java/org/opendaylight/lispflowmapping/southbound/lisp/LispSouthboundHandler.java +++ b/mappingservice/southbound/src/main/java/org/opendaylight/lispflowmapping/southbound/lisp/LispSouthboundHandler.java @@ -94,7 +94,6 @@ public class LispSouthboundHandler extends SimpleChannelInboundHandler - @@ -27,7 +25,6 @@ init-method="init" destroy-method="close"> - diff --git a/mappingservice/southbound/src/test/java/org/opendaylight/lispflowmapping/southbound/LispSouthboundPluginTest.java b/mappingservice/southbound/src/test/java/org/opendaylight/lispflowmapping/southbound/LispSouthboundPluginTest.java index c7add0d73..9242172f6 100644 --- a/mappingservice/southbound/src/test/java/org/opendaylight/lispflowmapping/southbound/LispSouthboundPluginTest.java +++ b/mappingservice/southbound/src/test/java/org/opendaylight/lispflowmapping/southbound/LispSouthboundPluginTest.java @@ -28,7 +28,6 @@ import org.mockito.ArgumentCaptor; import org.mockito.Mockito; 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.clustering.EntityOwnershipService; import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; import org.opendaylight.lispflowmapping.lisp.type.LispMessage; import org.opendaylight.lispflowmapping.southbound.lisp.LispSouthboundHandler; @@ -74,8 +73,7 @@ public class LispSouthboundPluginTest { public void init() throws NoSuchFieldException, IllegalAccessException, InterruptedException { lispSouthboundPlugin = new LispSouthboundPlugin( Mockito.mock(DataBroker.class), - Mockito.mock(NotificationPublishService.class), - Mockito.mock(EntityOwnershipService.class)); + Mockito.mock(NotificationPublishService.class)); lispSouthboundPlugin.setBindingAddress(ADDRESS_1); lispSouthboundPlugin.setMapRegisterCacheEnabled(false); channel = PowerMockito.mock(NioDatagramChannel.class);