MDSAL DS acces - standalone bundle. 85/39585/8
authorJozef Gloncak <jgloncak@cisco.com>
Mon, 30 May 2016 08:11:17 +0000 (10:11 +0200)
committerJozef Gloncak <jgloncak@cisco.com>
Mon, 6 Jun 2016 12:17:44 +0000 (14:17 +0200)
Move data store back end access to standalone bundle.

Change-Id: Ic44b0757e9cf0d7b82fa0b1168c26303be780084
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
13 files changed:
artifacts/pom.xml
features/pom.xml
features/src/main/features/features.xml
mappingservice/dsbackend/pom.xml [new file with mode: 0644]
mappingservice/dsbackend/src/main/java/org/opendaylight/lispflowmapping/dsbackend/DataStoreBackEnd.java [moved from mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/mdsal/DataStoreBackEnd.java with 98% similarity]
mappingservice/dsbackend/src/main/java/org/opendaylight/lispflowmapping/dsbackend/InstanceIdentifierUtil.java [moved from mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/util/InstanceIdentifierUtil.java with 98% similarity]
mappingservice/dsbackend/src/test/java/org/opendaylight/lispflowmapping/dsbackend/DataStoreBackEndTest.java [moved from mappingservice/implementation/src/test/java/org/opendaylight/lispflowmapping/implementation/mdsal/DataStoreBackEndTest.java with 99% similarity]
mappingservice/implementation/pom.xml
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/MappingService.java
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/MappingSystem.java
mappingservice/implementation/src/test/java/org/opendaylight/lispflowmapping/implementation/MappingSystemTest.java
mappingservice/implementation/src/test/java/org/opendaylight/lispflowmapping/implementation/lisp/MappingServiceTest.java
mappingservice/pom.xml

index 099fac48844219e1fabb1d45de6256da67b845df..ae6624e6c78dcba59c5ec276700e8261a0847355 100644 (file)
@@ -29,6 +29,11 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
         <artifactId>mappingservice.api</artifactId>
         <version>${project.version}</version>
       </dependency>
+      <dependency>
+        <groupId>${project.groupId}</groupId>
+        <artifactId>mappingservice.dsbackend</artifactId>
+        <version>${project.version}</version>
+      </dependency>
       <dependency>
         <groupId>${project.groupId}</groupId>
         <artifactId>mappingservice.implementation</artifactId>
index 0fc1252c1138ad070320cc4d6f1f58af9817dbe5..c7c1ed59912fbd52efefc8e2ec6b5eebef2ddcb8 100644 (file)
@@ -89,6 +89,11 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <type>xml</type>
       <scope>runtime</scope>
     </dependency>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>mappingservice.dsbackend</artifactId>
+      <version>${project.version}</version>
+    </dependency>
     <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>mappingservice.implementation</artifactId>
index fe3e7e15e2ee85d63eb0bf255cb9f193b3b7504a..9e5ee068e9afb57374624bd86a39e3b228145630 100644 (file)
@@ -31,6 +31,7 @@
         <feature version="${mdsal.version}">odl-mdsal-broker</feature>
         <feature version='${project.version}'>odl-lispflowmapping-models</feature>
         <feature version="${project.version}">odl-lispflowmapping-inmemorydb</feature>
+        <bundle>mvn:org.opendaylight.lispflowmapping/mappingservice.dsbackend/{{VERSION}}</bundle>
         <bundle>mvn:org.opendaylight.lispflowmapping/mappingservice.mapcache/{{VERSION}}</bundle>
         <bundle>mvn:org.opendaylight.lispflowmapping/mappingservice.implementation/{{VERSION}}</bundle>
         <configfile finalname="${configfile.directory}/lfm-mappingservice.xml">
diff --git a/mappingservice/dsbackend/pom.xml b/mappingservice/dsbackend/pom.xml
new file mode 100644 (file)
index 0000000..14e75da
--- /dev/null
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
+  ~
+  ~ This program and the accompanying materials are made available under the
+  ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+  ~ and is available at http://www.eclipse.org/legal/epl-v10.html
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.opendaylight.lispflowmapping</groupId>
+    <artifactId>mappingservice-parent</artifactId>
+    <version>1.4.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>mappingservice.dsbackend</artifactId>
+  <packaging>bundle</packaging>
+  <name>Mapping Service datastore backend</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>mappingservice.api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>mappingservice.lisp-proto</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>junit-addons</groupId>
+      <artifactId>junit-addons</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.powermock</groupId>
+      <artifactId>powermock-api-mockito</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.powermock</groupId>
+      <artifactId>powermock-module-junit4</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+  </dependencies>
+
+  <!--
+      Maven Site Configuration
+
+      The following configuration is necessary for maven-site-plugin to
+      correctly identify the correct deployment path for OpenDaylight Maven
+      sites.
+  -->
+  <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
+
+  <distributionManagement>
+    <site>
+      <id>opendaylight-site</id>
+      <url>${nexus.site.url}/${project.artifactId}/</url>
+    </site>
+  </distributionManagement>
+
+</project>
similarity index 98%
rename from mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/mdsal/DataStoreBackEnd.java
rename to mappingservice/dsbackend/src/main/java/org/opendaylight/lispflowmapping/dsbackend/DataStoreBackEnd.java
index aee385ac0423981bdaae8adb261256190434a68e..9d2d2a351f4255eb568d0c64269c15c16c30ff16 100644 (file)
@@ -5,7 +5,7 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.lispflowmapping.implementation.mdsal;
+package org.opendaylight.lispflowmapping.dsbackend;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -19,7 +19,6 @@ import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
 import org.opendaylight.controller.md.sal.common.api.data.TransactionChain;
 import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
-import org.opendaylight.lispflowmapping.implementation.util.InstanceIdentifierUtil;
 import org.opendaylight.lispflowmapping.lisp.util.LispAddressStringifier;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.XtrId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingDatabase;
@@ -54,6 +53,7 @@ public class DataStoreBackEnd implements TransactionChainListener {
         this.txChain = broker.createTransactionChain(this);
     }
 
+
     public void addAuthenticationKey(AuthenticationKey authenticationKey) {
         if (LOG.isDebugEnabled()) {
             LOG.debug("MD-SAL: Adding authentication key '{}' for {}",
@@ -224,10 +224,10 @@ public class DataStoreBackEnd implements TransactionChainListener {
         WriteTransaction writeTx = txChain.newWriteOnlyTransaction();
         writeTx.put(logicalDatastoreType, addIID, data, true);
         Futures.addCallback(writeTx.submit(), new FutureCallback<Void>() {
-            @Override
+
             public void onSuccess(Void result) {
             }
-            @Override
+
             public void onFailure(Throwable t) {
                 LOG.error("Transaction failed:", t);
             }
@@ -258,24 +258,22 @@ public class DataStoreBackEnd implements TransactionChainListener {
         WriteTransaction writeTx = txChain.newWriteOnlyTransaction();
         writeTx.delete(logicalDatastoreType, deleteIID);
         Futures.addCallback(writeTx.submit(), new FutureCallback<Void>() {
-            @Override
+
             public void onSuccess(Void result) {
             }
-            @Override
+
             public void onFailure(Throwable t) {
                 LOG.error("Transaction failed:", t);
             }
         });
     }
 
-    @Override
     public void onTransactionChainFailed(TransactionChain<?, ?> chain, AsyncTransaction<?, ?> transaction,
             Throwable cause) {
         LOG.error("Broken chain {} in DataStoreBackEnd, transaction {}, cause {}", chain, transaction.getIdentifier(),
                 cause);
     }
 
-    @Override
     public void onTransactionChainSuccessful(TransactionChain<?, ?> chain) {
         LOG.info("DataStoreBackEnd closed successfully, chain {}", chain);
     }
@@ -5,7 +5,7 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.lispflowmapping.implementation.util;
+package org.opendaylight.lispflowmapping.dsbackend;
 
 import org.opendaylight.lispflowmapping.lisp.util.LispAddressStringifier;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.Address;
@@ -5,7 +5,7 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.lispflowmapping.implementation.mdsal;
+package org.opendaylight.lispflowmapping.dsbackend;
 
 import static org.junit.Assert.assertEquals;
 
index 2f5e48ae5be0d4f816259038147c36dc1513ec52..70233c1c40b0a06cd3efb6a849c72dbe2056bc48 100644 (file)
       <groupId>${project.groupId}</groupId>
       <artifactId>mappingservice.api</artifactId>
     </dependency>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>mappingservice.dsbackend</artifactId>
+    </dependency>
     <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>mappingservice.lisp-proto</artifactId>
index dc26862ac06e2548d553995e99666195651993a1..a84663861093ad6d578f75776c7075b884938da3 100644 (file)
@@ -18,7 +18,7 @@ import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;
 import org.opendaylight.lispflowmapping.implementation.config.ConfigIni;
 import org.opendaylight.lispflowmapping.implementation.mdsal.AuthenticationKeyDataListener;
-import org.opendaylight.lispflowmapping.implementation.mdsal.DataStoreBackEnd;
+import org.opendaylight.lispflowmapping.dsbackend.DataStoreBackEnd;
 import org.opendaylight.lispflowmapping.implementation.mdsal.MappingDataListener;
 import org.opendaylight.lispflowmapping.implementation.util.DSBEInputUtil;
 import org.opendaylight.lispflowmapping.implementation.util.RPCInputConvertorUtil;
index bd7e0c87ad7722971464a1dc4cca1c6169adec56..55082865c40bbfdbc62d0beeb043d982c2d12fd8 100644 (file)
@@ -13,10 +13,10 @@ import java.util.EnumMap;
 import java.util.List;
 
 import org.opendaylight.lispflowmapping.implementation.config.ConfigIni;
+import org.opendaylight.lispflowmapping.dsbackend.DataStoreBackEnd;
 import org.opendaylight.lispflowmapping.mapcache.FlatMapCache;
 import org.opendaylight.lispflowmapping.mapcache.MultiTableMapCache;
 import org.opendaylight.lispflowmapping.mapcache.SimpleMapCache;
-import org.opendaylight.lispflowmapping.implementation.mdsal.DataStoreBackEnd;
 import org.opendaylight.lispflowmapping.implementation.util.DSBEInputUtil;
 import org.opendaylight.lispflowmapping.implementation.util.MappingMergeUtil;
 import org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO;
index 94fcfbf27f0b77f99bd165661e901a60eb1be404..64c91c10fa8970c13a063a82b29d55f6553e77f8 100644 (file)
@@ -27,7 +27,7 @@ import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.runners.MockitoJUnitRunner;
 import org.opendaylight.lispflowmapping.implementation.config.ConfigIni;
-import org.opendaylight.lispflowmapping.implementation.mdsal.DataStoreBackEnd;
+import org.opendaylight.lispflowmapping.dsbackend.DataStoreBackEnd;
 import org.opendaylight.lispflowmapping.implementation.util.MappingMergeUtil;
 import org.opendaylight.lispflowmapping.inmemorydb.HashMapDb;
 import org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO;
index becf95c3762b3b7d6c31d8ba92efa5b6b9a437ca..eb62809e6c4bff2a64386e4e608f743e73b0a42d 100644 (file)
@@ -23,7 +23,7 @@ import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
 import org.opendaylight.lispflowmapping.implementation.MappingService;
 import org.opendaylight.lispflowmapping.implementation.MappingSystem;
 import org.opendaylight.lispflowmapping.implementation.mdsal.AuthenticationKeyDataListener;
-import org.opendaylight.lispflowmapping.implementation.mdsal.DataStoreBackEnd;
+import org.opendaylight.lispflowmapping.dsbackend.DataStoreBackEnd;
 import org.opendaylight.lispflowmapping.implementation.mdsal.MappingDataListener;
 import org.opendaylight.lispflowmapping.implementation.util.DSBEInputUtil;
 import org.opendaylight.lispflowmapping.implementation.util.RPCInputConvertorUtil;
index 9064422b60b4b9e30ee2578b0c4db532acc88b9d..bfb25a03222ec3204a14b3a1391ff2560de310a2 100644 (file)
@@ -19,6 +19,7 @@
     <module>lisp-proto</module>
     <module>api</module>
     <module>inmemorydb</module>
+    <module>dsbackend</module>
     <module>mapcache</module>
     <module>implementation</module>
     <module>southbound</module>