Merge "JUnit test - InMemoryDbModule"
authorFlorin Coras <florin.coras+odl@gmail.com>
Fri, 11 Mar 2016 18:08:17 +0000 (18:08 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 11 Mar 2016 18:08:17 +0000 (18:08 +0000)
40 files changed:
artifacts/pom.xml
commons/build_tools/pom.xml
commons/parent/pom.xml
commons/unittest_tools/pom.xml
deploy-site.xml [new file with mode: 0644]
distribution-karaf/pom.xml
features/pom.xml
integrationtest/pom.xml
integrationtest/src/test/java/org/opendaylight/lispflowmapping/integrationtest/MappingServiceIntegrationTest.java
mappingservice/api/pom.xml
mappingservice/api/src/main/java/org/opendaylight/lispflowmapping/interfaces/mappingservice/IMappingService.java
mappingservice/api/src/main/yang/odl-mappingservice.yang
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/main/java/org/opendaylight/lispflowmapping/implementation/lisp/MapServer.java
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/mapcache/SimpleMapCache.java
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/mdsal/DataStoreBackEnd.java
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/util/DSBEInputUtil.java
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/util/LispNotificationHelper.java
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/util/MappingMergeUtil.java
mappingservice/inmemorydb/pom.xml
mappingservice/lisp-proto/pom.xml
mappingservice/lisp-proto/src/main/java/org/opendaylight/lispflowmapping/lisp/serializer/MapNotifySerializer.java
mappingservice/lisp-proto/src/main/java/org/opendaylight/lispflowmapping/lisp/serializer/MapRegisterSerializer.java
mappingservice/lisp-proto/src/main/java/org/opendaylight/lispflowmapping/lisp/util/LispAddressUtil.java
mappingservice/lisp-proto/src/main/yang/odl-lisp-proto.yang
mappingservice/lisp-proto/src/test/java/org/opendaylight/lispflowmapping/lisp/util/LispAddressUtilTest.java
mappingservice/lisp-proto/src/test/java/org/opendaylight/lispflowmapping/serializer/MapRegisterSerializationTest.java
mappingservice/netconf/pom.xml
mappingservice/neutron/pom.xml
mappingservice/pom.xml
mappingservice/shell/pom.xml
mappingservice/southbound/pom.xml
pom.xml
src/main/resources/stylesheet.css [new file with mode: 0644]
src/site/site.xml [new file with mode: 0644]
ui/bundle/pom.xml
ui/module/pom.xml
ui/pom.xml

index a07f011b1a03349dc9a3efea6e1fe0146611f9d0..10beb742832d7a1f968f12ac3a2e7c6425266c91 100644 (file)
@@ -73,4 +73,21 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       </dependency>
     </dependencies>
   </dependencyManagement>
+
+  <!--
+      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>
index 80af4a4f68005d73d2a6672ef4ccd0e8945dc6aa..147e514c1f2b1584703f6ce2be72abefd95d6c93 100644 (file)
   <packaging>jar</packaging>
   <name>Build Tools</name>
 
+
+  <!--
+      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>
index 574f38571bb968b1c1b4bfdcf33873abdff8211f..3a9169bb39089d03f748c1105ac6bd273c51c9c6 100644 (file)
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-javadoc-plugin</artifactId>
-        <version>2.8.1</version>
         <configuration>
           <doclet>org.jboss.apiviz.APIviz</doclet>
           <docletArtifact>
     </plugins>
   </reporting>
 
+  <!--
+      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>
     <!-- Note: We want the nexus proxy property here because want to enable
          devs to upload this artifact using mvn deploy to other maven repositories. -->
       <url>${nexusproxy}/repositories/opendaylight.snapshot/</url>
     </snapshotRepository>
     <!-- Site deployment -->
+    <site>
+      <id>opendaylight-site</id>
+      <url>${nexus.site.url}/${project.artifactId}/</url>
+    </site>
   </distributionManagement>
 
 </project>
index fbe32b85a08493fc7d09e1c324468aa446297c70..47824f870e86ce413092faad88d7fe0eb27c5d99 100644 (file)
       <artifactId>slf4j-api</artifactId>
     </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>
diff --git a/deploy-site.xml b/deploy-site.xml
new file mode 100644 (file)
index 0000000..a6f945e
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=2 tabstop=2: -->
+<!--
+    Copyright (c) 2015 The Linux Foundation 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>
+
+  <groupId>org.opendaylight.lispflowmapping</groupId>
+  <artifactId>deploy-site</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <properties>
+    <stream>latest</stream>
+    <nexus.site.url>dav:https://nexus.opendaylight.org/content/sites/site/${project.groupId}/${stream}/</nexus.site.url>
+  </properties>
+
+  <build>
+    <extensions>
+      <extension>
+        <groupId>org.apache.maven.wagon</groupId>
+         <artifactId>wagon-webdav-jackrabbit</artifactId>
+         <version>2.9</version>
+      </extension>
+    </extensions>
+
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-site-plugin</artifactId>
+        <version>3.4</version>
+        <configuration>
+          <inputDirectory>${project.build.directory}/staged-site</inputDirectory>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+  <distributionManagement>
+    <site>
+      <id>opendaylight-site</id>
+      <url>${nexus.site.url}</url>
+    </site>
+  </distributionManagement>
+</project>
index a4f9d16abcdce070a4661d53f27069d16bbf6d13..36c7338211f0994693930be0d17478b79ea133ac 100644 (file)
@@ -70,4 +70,21 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       </plugin>
     </plugins>
   </build> 
+
+  <!--
+      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>
index d42817f807558912265c62080f3da87b421476d8..0fc1252c1138ad070320cc4d6f1f58af9817dbe5 100644 (file)
@@ -158,4 +158,21 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <type>xml</type>
     </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>
index 7d917f9e7315027012b1b173a878d351414891a3..2e329c75341eb1bafe66f969fcb8bb818664bfd5 100644 (file)
@@ -84,4 +84,21 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       </plugins>
     </pluginManagement>
   </build>
+
+  <!--
+      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>
index 44e7935b7398abdb25f43aa651da5dd9bf0e6937..1a6b9f5a1e41204b7c8ae0762137a73c53312352 100644 (file)
@@ -177,7 +177,7 @@ public class MappingServiceIntegrationTest extends AbstractMdsalTestBase {
     @Override
     public Option getLoggingOption() {
         Option option = editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG,
-                logConfiguration(MappingServiceIntegrationTest.class),
+                "log4j.logger.org.opendaylight.lispflowmapping",
                 LogLevel.DEBUG.name());
         option = composite(option, super.getLoggingOption());
         return option;
index e93bcb2968a71a04822b1ad70cacc0a21f0a015c..45e49931bcb7cfc04b967cffaa5baedbf62f15c1 100644 (file)
       <artifactId>ietf-inet-types</artifactId>
     </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>
index f81f53d87d9ad8633bc2e11f1b4f9f6490446eba..454970e45401c6e51acb5ff963dfcb0ea312e392 100644 (file)
@@ -8,9 +8,9 @@
 
 package org.opendaylight.lispflowmapping.interfaces.mappingservice;
 
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.SiteId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingOrigin;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.SiteId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.authkey.container.MappingAuthkey;
 
 /**
index 868f72dcd975d08e5fc03d9b4649e8ee59a8deec..d9772659c0cb397cf0b22519e6d4b0a2fbe02745 100644 (file)
@@ -41,13 +41,6 @@ module odl-mappingservice {
         }
     }
 
-    typedef site-id {
-        description "64 bit site identifier";
-        type binary {
-            length "8";
-        }
-    }
-
     typedef vni-uri {
         description "VNI as a string lookup key in a URI";
         type inet:uri;
@@ -58,6 +51,11 @@ module odl-mappingservice {
         type inet:uri;
     }
 
+    typedef xtr-id-uri {
+        description "xTR-ID as a string lookup key in a URI";
+        type inet:uri;
+    }
+
     typedef mapping-change {
         description "Type of mapping update";
         type enumeration {
@@ -75,6 +73,10 @@ module odl-mappingservice {
         description "A classifier for endpoint-id elements which allows direct access to a particular element in the data tree.";
     }
 
+    identity xtrid-context {
+        description "A classifier for xtr-id elements which allows direct access to a particular element in the data tree.";
+    }
+
     grouping mapping-authkey-container {
         container mapping-authkey {
             leaf key-string {
@@ -126,9 +128,19 @@ module odl-mappingservice {
             }
             leaf-list site-id {
                 description "Site ID";
-                type site-id;
+                type lisp-proto:site-id;
             }
             uses lisp-proto:mapping-record-container;
+            list xtr-id {
+                description "A list of xTR-IDs with their associated mappings";
+                config false;
+                key "xtr-id-uri";
+                ext:context-instance "xtrid-context";
+                leaf xtr-id-uri {
+                    type xtr-id-uri;
+                }
+                uses lisp-proto:mapping-record-container;
+            }
         }
         list authentication-key {
             description "A list of authentication keys for EID prefixes within the same Virtual Network Identifier";
index d557f56fe810ff3ba2c914d1d1965a0eeca8e5df..c8de0296cb1208fcb94c77370c782e7d49b00b8b 100644 (file)
       </plugin>
     </plugins>
   </build>
+
+  <!--
+      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>
index 1aa6bd5875a502bd5563cc366c3b5f6e2c2dfa2c..79a0ef4f3eb37970b0d9934ac97d53f1c558ace3 100644 (file)
@@ -24,6 +24,7 @@ import org.opendaylight.lispflowmapping.implementation.util.DSBEInputUtil;
 import org.opendaylight.lispflowmapping.implementation.util.RPCInputConvertorUtil;
 import org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO;
 import org.opendaylight.lispflowmapping.interfaces.mappingservice.IMappingService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.SiteId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecord;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.AddKeyInput;
@@ -48,7 +49,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev15090
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.RemoveKeysInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.RemoveMappingInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.RemoveMappingsInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.SiteId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.UpdateKeyInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.UpdateKeysInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.UpdateMappingInput;
index 7554e63b17eba6252ebf489bfa8d026268cee6be..6764152ea8c8aa7baf526faa1118188b9810e161 100644 (file)
@@ -30,6 +30,7 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.addres
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.ServicePath;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.explicit.locator.path.explicit.locator.path.Hop;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.SiteId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.locatorrecords.LocatorRecord;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.locatorrecords.LocatorRecordBuilder;
@@ -37,7 +38,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.ma
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecordBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.Rloc;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingOrigin;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.SiteId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.Mapping;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.authkey.container.MappingAuthkey;
index 2fcc0634ac17e1dbe411a3eb8e4b791632f4f3ec..200cd691a24814fad1f4456b0899b66feb10e587 100644 (file)
@@ -38,6 +38,7 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.SourceDestKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapRegister;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.SiteId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.list.EidItem;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.list.EidItemBuilder;
@@ -53,7 +54,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev15090
 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.OdlMappingserviceListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.SiteId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.authkey.container.MappingAuthkey;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
index bf03d3a14ced4fa0a2129c9b7111cab42b2bb85e..4304809d39b332d70488f39b7fc95a0f9b885c34 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.lispflowmapping.implementation.mapcache;
 
 import java.util.AbstractMap.SimpleImmutableEntry;
-import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashSet;
@@ -26,6 +25,7 @@ import org.opendaylight.lispflowmapping.interfaces.dao.SubKeys;
 import org.opendaylight.lispflowmapping.interfaces.mapcache.IMapCache;
 import org.opendaylight.lispflowmapping.lisp.util.MaskUtil;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.XtrId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecord;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.authkey.container.MappingAuthkey;
@@ -84,13 +84,9 @@ public class SimpleMapCache implements IMapCache {
         return table;
     }
 
-    public static Object deserializeBytes(byte[] data) {
-        return ByteBuffer.wrap(data);
-    }
-
-    private void removeExpiredXtrIdTableEntries(ILispDAO xtrIdDao, List<byte[]> expiredMappings) {
-        for (byte[] xtrId : expiredMappings) {
-            xtrIdDao.removeSpecific(deserializeBytes(xtrId), SubKeys.RECORD);
+    private void removeExpiredXtrIdTableEntries(ILispDAO xtrIdDao, List<XtrId> expiredMappings) {
+        for (XtrId xtrId : expiredMappings) {
+            xtrIdDao.removeSpecific(xtrId, SubKeys.RECORD);
         }
     }
 
@@ -118,11 +114,11 @@ public class SimpleMapCache implements IMapCache {
         ILispDAO xtrIdDao = null;
         if (!shouldOverwrite) {
             xtrIdDao = getOrInstantiateXtrIdTable(eid, table);
-            xtrIdDao.put(deserializeBytes(record.getXtrId()), new MappingEntry<>(SubKeys.RECORD, value));
+            xtrIdDao.put(record.getXtrId(), new MappingEntry<>(SubKeys.RECORD, value));
         }
 
         if (ConfigIni.getInstance().mappingMergeIsSet()) {
-            List<byte[]> expiredMappings = new ArrayList<byte[]>();
+            List<XtrId> expiredMappings = new ArrayList<XtrId>();
             Set<IpAddress> sourceRlocs = new HashSet<IpAddress>();
             MappingRecord mergedEntry = MappingMergeUtil.mergeXtrIdMappings(getXtrIdMappingList(xtrIdDao),
                     expiredMappings, sourceRlocs);
index 22a5948e651cae271d73f8dcaf8563c3e4d360ca..021ace6c400e2e5ab073509b2d81812960d67f10 100644 (file)
@@ -22,6 +22,7 @@ import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListen
 import org.opendaylight.lispflowmapping.implementation.util.InstanceIdentifierUtil;
 import org.opendaylight.lispflowmapping.lisp.util.LispAddressStringifier;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingDatabase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingOrigin;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.Mapping;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.database.VirtualNetworkIdentifier;
@@ -42,6 +43,8 @@ import com.google.common.util.concurrent.Futures;
  */
 public class DataStoreBackEnd implements TransactionChainListener {
     protected static final Logger LOG = LoggerFactory.getLogger(DataStoreBackEnd.class);
+    private static final InstanceIdentifier<MappingDatabase> DATABASE_ROOT =
+            InstanceIdentifier.create(MappingDatabase.class);
     private BindingTransactionChain txChain;
 
     public DataStoreBackEnd(DataBroker broker) {
@@ -64,7 +67,7 @@ public class DataStoreBackEnd implements TransactionChainListener {
 
         InstanceIdentifier<Mapping> path = InstanceIdentifierUtil
                 .createMappingIid(mapping.getMappingRecord().getEid(), mapping.getOrigin());
-        writePutTransaction(path, mapping, LogicalDatastoreType.CONFIGURATION,
+        writePutTransaction(path, mapping, getDestinationDatastore(mapping),
                 "Adding mapping to config datastrore failed");
     }
 
@@ -84,16 +87,25 @@ public class DataStoreBackEnd implements TransactionChainListener {
 
         InstanceIdentifier<Mapping> path = InstanceIdentifierUtil
                 .createMappingIid(mapping.getMappingRecord().getEid(), mapping.getOrigin());
-        deleteTransaction(path, LogicalDatastoreType.CONFIGURATION, "Deleting mapping from config datastrore failed");
+        deleteTransaction(path, getDestinationDatastore(mapping), "Deleting mapping from config datastrore failed");
     }
 
     public void removeAllMappings() {
         LOG.debug("MD-SAL: Removing all mappings");
-        InstanceIdentifier<MappingDatabase> path = InstanceIdentifier.create(MappingDatabase.class);
-        deleteTransaction(path, LogicalDatastoreType.CONFIGURATION,
+        removeAllConfigurationMappings();
+        removeAllOperationalMappings();
+    }
+
+    public void removeAllConfigurationMappings() {
+        deleteTransaction(DATABASE_ROOT, LogicalDatastoreType.CONFIGURATION,
                 "Removing of all mappings in config datastore failed");
     }
 
+    public void removeAllOperationalMappings() {
+        deleteTransaction(DATABASE_ROOT, LogicalDatastoreType.OPERATIONAL,
+                "Removing of all mappings in operational datastore failed");
+    }
+
     public void updateAuthenticationKey(AuthenticationKey authenticationKey) {
         LOG.debug("MD-SAL: Updating authentication key for {} with '{}'",
                 LispAddressStringifier.getString(authenticationKey.getEid()),
@@ -116,10 +128,15 @@ public class DataStoreBackEnd implements TransactionChainListener {
     }
 
     public List<Mapping> getAllMappings() {
+        List<Mapping> mappings = getAllMappings(LogicalDatastoreType.CONFIGURATION);
+        mappings.addAll(getAllMappings(LogicalDatastoreType.OPERATIONAL));
+        return mappings;
+    }
+
+    public List<Mapping> getAllMappings(LogicalDatastoreType logicalDataStore) {
         LOG.debug("MD-SAL: Get all mappings from datastore");
         List<Mapping> mappings = new ArrayList<Mapping>();
-        InstanceIdentifier<MappingDatabase> path = InstanceIdentifier.create(MappingDatabase.class);
-        MappingDatabase mdb = readTransaction(path, LogicalDatastoreType.CONFIGURATION);
+        MappingDatabase mdb = readTransaction(DATABASE_ROOT, logicalDataStore);
 
         if (mdb != null) {
             for (VirtualNetworkIdentifier id : mdb.getVirtualNetworkIdentifier()) {
@@ -136,8 +153,7 @@ public class DataStoreBackEnd implements TransactionChainListener {
     public List<AuthenticationKey> getAllAuthenticationKeys() {
         LOG.debug("MD-SAL: Get all authentication keys from datastore");
         List<AuthenticationKey> authKeys = new ArrayList<AuthenticationKey>();
-        InstanceIdentifier<MappingDatabase> path = InstanceIdentifier.create(MappingDatabase.class);
-        MappingDatabase mdb = readTransaction(path, LogicalDatastoreType.CONFIGURATION);
+        MappingDatabase mdb = readTransaction(DATABASE_ROOT, LogicalDatastoreType.CONFIGURATION);
 
         if (mdb != null) {
             for (VirtualNetworkIdentifier id : mdb.getVirtualNetworkIdentifier()) {
@@ -151,6 +167,11 @@ public class DataStoreBackEnd implements TransactionChainListener {
         return authKeys;
     }
 
+    private static LogicalDatastoreType getDestinationDatastore(Mapping mapping) {
+        return mapping.getOrigin().equals(MappingOrigin.Southbound) ? LogicalDatastoreType.OPERATIONAL
+                : LogicalDatastoreType.CONFIGURATION;
+    }
+
     private <U extends org.opendaylight.yangtools.yang.binding.DataObject> void writePutTransaction(
             InstanceIdentifier<U> addIID, U data, LogicalDatastoreType logicalDatastoreType, String errMsg) {
         WriteTransaction writeTx = txChain.newWriteOnlyTransaction();
index 38cfdb1245caa0c7f45aa923b81c44ba7cb16bf4..12835d6364bc1579f7bb4e3e3d5ad6ff826a1869 100644 (file)
@@ -12,11 +12,11 @@ import java.util.Arrays;
 import java.util.List;
 
 import org.opendaylight.lispflowmapping.lisp.util.LispAddressStringifier;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.SiteId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecord;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.EidUri;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingOrigin;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.SiteId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKeyBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.Mapping;
index 82f85a937f3f8b662c3a0de15080dfe5d0dad48b..b090b1262e65d421a944aebc6d197b1a280a8c8f 100644 (file)
@@ -8,14 +8,17 @@
 package org.opendaylight.lispflowmapping.implementation.util;
 
 import com.google.common.base.Splitter;
+
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+
 import org.opendaylight.lispflowmapping.lisp.type.LispMessage;
 import org.opendaylight.lispflowmapping.lisp.util.LispAddressStringifier;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.AddMapping;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.SiteId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecord;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapregisternotification.MapRegister;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.Rloc;
@@ -23,7 +26,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.tr
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.transport.address.TransportAddressBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.EidUri;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingOrigin;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.SiteId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.Mapping;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.MappingBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddressBuilder;
index c815ea87c9b5984ac019c69b86ecc5db40c70727..642d7adfad116779522d08e566228e1a5ce17f64 100644 (file)
@@ -24,6 +24,7 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.addres
 import org.opendaylight.lispflowmapping.lisp.util.LispAddressUtil;
 import org.opendaylight.lispflowmapping.lisp.util.MaskUtil;
 import org.opendaylight.lispflowmapping.lisp.util.SourceDestKeyHelper;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.XtrId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.locatorrecords.LocatorRecord;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.locatorrecords.LocatorRecordBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecord;
@@ -142,7 +143,7 @@ public final class MappingMergeUtil {
     }
 
     public static MappingRecord mergeMappings(MappingRecord currentMergedMapping, MappingRecord newMapping,
-            byte[] xtrId, Date regdate) {
+            XtrId xtrId, Date regdate) {
         if (currentMergedMapping == null) {
             return newMapping;
         }
@@ -159,10 +160,10 @@ public final class MappingMergeUtil {
         return mrb.build();
     }
 
-    public static MappingRecord mergeXtrIdMappings(List<Object> records, List<byte[]> expiredMappings,
+    public static MappingRecord mergeXtrIdMappings(List<Object> records, List<XtrId> expiredMappings,
             Set<IpAddress> sourceRlocs) {
         MappingRecordBuilder mrb = null;
-        byte[] xtrId = {};
+        XtrId xtrId = null;
         Long timestamp = Long.MAX_VALUE;
 
         for (int i = 0; i < records.size(); i++) {
index 843f9ddc367655fb086cddc8f07b2092dcd3a18f..889d7f2b3113d1b1fff9495e7942b8831de21bce 100644 (file)
       <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>
index 5d7b296192fc5f183f026d3f0469c740ddfe0812..55efd0ad070058aad0301e939a636dcef5d1bc8b 100644 (file)
@@ -50,6 +50,11 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <version>1.4</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-all</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
   <build>
@@ -85,4 +90,21 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       </plugins>
     </pluginManagement>
   </build>
+
+  <!--
+      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>
index ef64528a45e5967345a7c56f05bccc2b3e977c14..2d4c2de294d9eaebe5e370fb12b637d827a7f3b8 100644 (file)
@@ -17,6 +17,8 @@ import org.opendaylight.lispflowmapping.lisp.util.ByteUtil;
 import org.opendaylight.lispflowmapping.lisp.util.NumberUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapNotify;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MessageType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.SiteId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.XtrId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapnotifymessage.MapNotifyBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecordBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.list.MappingRecordItem;
@@ -75,8 +77,8 @@ public final class MapNotifySerializer {
         }
 
         if (mapNotify.isXtrSiteIdPresent() != null && mapNotify.isXtrSiteIdPresent()) {
-            replyBuffer.put(mapNotify.getXtrId());
-            replyBuffer.put(mapNotify.getSiteId());
+            replyBuffer.put(mapNotify.getXtrId().getValue());
+            replyBuffer.put(mapNotify.getSiteId().getValue());
         }
         replyBuffer.clear();
         return replyBuffer;
@@ -107,10 +109,12 @@ public final class MapNotifySerializer {
                 for (int i = 0; i < recordCount; i++) {
                     mrbs.add(MappingRecordSerializer.getInstance().deserializeToBuilder(notifyBuffer));
                 }
-                byte[] xtrId  = new byte[MapRegisterSerializer.Length.XTRID_SIZE];
-                notifyBuffer.get(xtrId);
-                byte[] siteId = new byte[MapRegisterSerializer.Length.SITEID_SIZE];
-                notifyBuffer.get(siteId);
+                byte[] xtrIdBuf  = new byte[MapRegisterSerializer.Length.XTRID_SIZE];
+                notifyBuffer.get(xtrIdBuf);
+                XtrId xtrId = new XtrId(xtrIdBuf);
+                byte[] siteIdBuf = new byte[MapRegisterSerializer.Length.SITEID_SIZE];
+                notifyBuffer.get(siteIdBuf);
+                SiteId siteId = new SiteId(siteIdBuf);
                 builder.setXtrId(xtrId);
                 builder.setSiteId(siteId);
                 for (MappingRecordBuilder mrb : mrbs) {
index bfe398d75a2ce99119c15a6ee3b27b62360b88ac..a16a501b430b5a55f0972a0d61b57b1002bb19bd 100644 (file)
@@ -22,6 +22,8 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Address;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapRegister;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MessageType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.SiteId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.XtrId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecordBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.list.MappingRecordItem;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.list.MappingRecordItemBuilder;
@@ -77,8 +79,8 @@ public final class MapRegisterSerializer {
         }
 
         if (mapRegister.isXtrSiteIdPresent() != null && mapRegister.isXtrSiteIdPresent()) {
-            registerBuffer.put(mapRegister.getXtrId());
-            registerBuffer.put(mapRegister.getSiteId());
+            registerBuffer.put(mapRegister.getXtrId().getValue());
+            registerBuffer.put(mapRegister.getSiteId().getValue());
         }
         registerBuffer.clear();
         return registerBuffer;
@@ -111,10 +113,12 @@ public final class MapRegisterSerializer {
                 for (int i = 0; i < recordCount; i++) {
                     mrbs.add(MappingRecordSerializer.getInstance().deserializeToBuilder(registerBuffer));
                 }
-                byte[] xtrId  = new byte[Length.XTRID_SIZE];
-                registerBuffer.get(xtrId);
-                byte[] siteId = new byte[Length.SITEID_SIZE];
-                registerBuffer.get(siteId);
+                byte[] xtrIdBuf  = new byte[Length.XTRID_SIZE];
+                registerBuffer.get(xtrIdBuf);
+                XtrId xtrId = new XtrId(xtrIdBuf);
+                byte[] siteIdBuf = new byte[Length.SITEID_SIZE];
+                registerBuffer.get(siteIdBuf);
+                SiteId siteId = new SiteId(siteIdBuf);
                 builder.setXtrId(xtrId);
                 builder.setSiteId(siteId);
                 for (MappingRecordBuilder mrb : mrbs) {
index 760c9d1247ce2f457cdf939f7b3638f031d81c1a..24b18167611b1756d962073bb7a2c0d62c96aa99 100644 (file)
@@ -283,7 +283,7 @@ public final class LispAddressUtil {
     public static Eid toIpPrefixEid(IpAddress addr, int vni) {
         // If you touch this, be sure that sfclisp compiles!
         int mask = addressTypeFromIpAddress(addr) == Ipv4Afi.class ? 32 : 128;
-        IpPrefix prefix = asIpPrefix(addr.getValue().toString(), mask);
+        IpPrefix prefix = asIpPrefix(String.valueOf(addr.getValue()), mask);
         // XXX getMapping rcp fails if VNI set to 0
         return toEidNoVni(prefix);
     }
@@ -551,8 +551,8 @@ public final class LispAddressUtil {
             }
             return 0;
         } else if (a instanceof Inet6Address && b instanceof Inet6Address) {
-            byte[] aBytes = ((Inet4Address) a).getAddress();
-            byte[] bBytes = ((Inet4Address) b).getAddress();
+            byte[] aBytes = ((Inet6Address) a).getAddress();
+            byte[] bBytes = ((Inet6Address) b).getAddress();
             for (i = 0; i < 16; i++) {
                 if (aBytes[i] < bBytes[i]) {
                     return -1;
index 58bf372611c9937ec6c9a373966a3c8275f548a4..4fd885e030766c2da21a5fd0c2192bd42feffead 100644 (file)
@@ -30,6 +30,22 @@ module odl-lisp-proto {
              in network byte order.";
     }
 
+    typedef xtr-id {
+        type binary {
+            length "16";
+        }
+        description
+            "128 bit xTR identifier.";
+    }
+
+    typedef site-id {
+        type binary {
+            length "8";
+        }
+        description
+            "64 bit site identifier.";
+    }
+
     typedef ipv6-address-binary {
         type binary {
             length "16";
@@ -119,16 +135,12 @@ module odl-lisp-proto {
 
     grouping mapping-record-metadata {
         leaf xtr-id {
-            type binary {
-                length "16";
-            }
+            type xtr-id;
             description
                 "128 bit xTR identifier.";
         }
         leaf site-id {
-            type binary {
-                length "8";
-            }
+            type site-id;
             description
                 "64 bit site identifier.";
         }
@@ -194,14 +206,10 @@ module odl-lisp-proto {
 
     grouping xtrSiteId {
         leaf xtrId {
-            type binary {
-                length "16";
-            }
+            type xtr-id;
         }
         leaf siteId {
-            type binary {
-                length "8";
-            }
+            type site-id;
         }
     }
 
index 492f6eb71a545c754020dcbe5a41d8a3baeec9fc..70aa85be2f1532758d643b079d1a87d6fc6af7b8 100644 (file)
@@ -9,6 +9,8 @@ package org.opendaylight.lispflowmapping.lisp.util;
 
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
@@ -16,6 +18,9 @@ import java.net.Inet4Address;
 import java.net.Inet6Address;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
+import java.util.Arrays;
+import java.util.List;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
@@ -27,48 +32,100 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.AsNumberAfi;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.DistinguishedNameAfi;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.DistinguishedNameType;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.ExplicitLocatorPathLcaf;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.InstanceIdType;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.Ipv4Afi;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.Ipv4PrefixAfi;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.Ipv6Afi;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.Ipv6PrefixAfi;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.KeyValueAddressLcaf;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.LispAddress;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.LispAddressFamily;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.MacAfi;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.NoAddressAfi;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.ServicePathIdType;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.ServicePathLcaf;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.SimpleAddress;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.SourceDestKeyLcaf;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.Address;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.DistinguishedName;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.ExplicitLocatorPath;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4Builder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6Builder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.KeyValueAddress;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Mac;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.MacBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.NoAddress;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.explicit.locator.path.explicit.locator.path.Hop;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.service.path.ServicePath;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.source.dest.key.SourceDestKey;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.source.dest.key.SourceDestKeyBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.EidBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.locatorrecords.LocatorRecord;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.Rloc;
 
 public class LispAddressUtilTest {
 
 
     private static final char[] DUMMY_CHARACTER_ARRAY_TEST = new char[]{'a', 'b', 'c', 'd'};
-    private static final String MAC_ADDRESS_TEST = "aa:bb:cc:dd:ee:ff";
-    private static final String IPV4_ADDRESS_PREFIX_TEST = "192.168.1.2/30";
-    private static final String IPV6_ADDRESS_PREFIX_TEST = "102:304:506:708:90a:b0c:d0e:f11/30";
     private static final Long NUMBER_TEST = 5L;
 
-    private static final byte[] IPV4_ADDRESS_BYTES_TEST = new byte[]{(byte) 192, (byte) 168, 1, 1};
-    private static final String IPV4_ADDRESS_TEST = "192.168.1.1";
-    private static final Ipv4Address IPV4_ADDRESS_OBJECT_TEST = new Ipv4Address(IPV4_ADDRESS_TEST);
-    private static final IpAddress IP_ADDRESS_OBJECT_GENERAL_TEST = new IpAddress(IPV4_ADDRESS_OBJECT_TEST);
-    private static final SimpleAddress SIMPLE_ADDRESS_TEST = new SimpleAddress(IP_ADDRESS_OBJECT_GENERAL_TEST);
+    private static final String MAC_ADDRESS_VALUE_TEST = "aa:bb:cc:dd:ee:ff";
+    private static final MacAddress MAC_ADDRESS_TEST = new MacAddress("aa:bb:cc:dd:ee:ff");
 
-    private static final byte[] IPV6_ADDRESS_BYTES_TEST = new byte[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+    private static final byte[] IPV4_ADDRESS_BYTES_A_TEST = new byte[]{(byte) 192, (byte) 168, 1, 1};
+    private static final byte[] IPV4_ADDRESS_BYTES_B_TEST = new byte[]{(byte) 192, (byte) 168, 1, 2};
+
+    private static final short MASK_OK_TEST = 30;
+    private static final short MASK_OK_DEFAULT_IPV4_TEST = 32;
+    private static final short MASK_OK_DEFAULT_IPV6_TEST = 128;
+
+    private static final String IPV4_ADDRESS_VALUE_TEST = "192.168.1.1";
+    private static final String IPV4_ADDRESS_PREFIX_VALUE_TEST = IPV4_ADDRESS_VALUE_TEST + "/" + MASK_OK_TEST;
+    private static final Ipv4Address IPV4_ADDRESS_TEST = new Ipv4Address(IPV4_ADDRESS_VALUE_TEST);
+    private static final IpAddress IP_ADDRESS_OBJECT_WITH_IPV4_TEST = new IpAddress(IPV4_ADDRESS_TEST);
+    private static final Ipv4Prefix IPV4_ADDRESS_PREFIX_TEST = new Ipv4Prefix(IPV4_ADDRESS_PREFIX_VALUE_TEST);
+    private static final IpPrefix IP_ADDRESS_PREFIX_WITH_IPV4_TEST = new IpPrefix(IPV4_ADDRESS_PREFIX_TEST);
+
+
+    private static final byte[] IPV6_ADDRESS_BYTES_A_TEST = new byte[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
             15, 16};
-    private static final Ipv6Address IPV6_ADDRESS_OBJECT_TEST = new Ipv6Address("102:304:506:708:90a:b0c:d0e:f10");
+    private static final byte[] IPV6_ADDRESS_BYTES_B_TEST = new byte[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+            15, 17};
+    private static final String IPV6_ADDRESS_VALUE_TEST = "102:304:506:708:90a:b0c:d0e:f10";
+    private static final String IPV6_ADDRESS_PREFIX_VALUE_TEST = IPV6_ADDRESS_VALUE_TEST + "/" + MASK_OK_TEST;
+    private static final Ipv6Prefix IPV6_ADDRESS_PREFIX_TEST = new Ipv6Prefix(IPV6_ADDRESS_PREFIX_VALUE_TEST);
+    private static final Ipv6Address IPV6_ADDRESS_TEST = new Ipv6Address(IPV6_ADDRESS_VALUE_TEST);
+    private static final IpPrefix IP_ADDRESS_PREFIX_WITH_IPV6_TEST = new IpPrefix(IPV6_ADDRESS_PREFIX_TEST);
+    private static final IpAddress IP_ADDRESS_OBJECT_WITH_IPV6_TEST = new IpAddress(IPV6_ADDRESS_TEST);
 
-    private static final String IPV6_ADDRESS_TEST = "102:304:506:708:90a:b0c:d0e:f10";
-    private static final Short DUMMY_SERVICE_INDEX = 45;
+    private static final Short SERVICE_INDEX_TEST = 45;
     private static final Long DUMMY_SERVICE_PATH_ID_TYPE = 46L;
-    private static final String DISTINGUISHED_NAME_TYPE_TEST = "dummy distinguished name type";
+    private static final String DISTINGUISHED_NAME_TYPE_VALUE_TEST = "dummy distinguished name type";
+    private static final String DISTINGUISHED_NAME_TYPE_VALUE_WITH_MAC_TEST = MAC_ADDRESS_VALUE_TEST;
+    private static final DistinguishedNameType DISTINGUISHED_NAME_TYPE_TEST = new DistinguishedNameType
+            (DISTINGUISHED_NAME_TYPE_VALUE_TEST);
+
     private static final Long AS_NUMBER_TEST = 100L;
+    private static final Long INSTANCE_ID_TYPE_VALUE_TEST = 121L;
+    private static final Short INSTANCE_ID_TYPE_VALUE_SHORT_TEST = 122;
+    private static final InstanceIdType INSTANCE_ID_TYPE_TEST = new InstanceIdType(INSTANCE_ID_TYPE_VALUE_TEST);
+    private static final String INCORRECT_IP_ADDRESS_TEST = "incorrect ip address";
 
+    private static final SimpleAddress SIMPLE_ADDRESS_A_TEST = new SimpleAddress(IP_ADDRESS_OBJECT_WITH_IPV4_TEST);
+    private static final SimpleAddress SIMPLE_ADDRESS_B_TEST = new SimpleAddress(MAC_ADDRESS_TEST);
+    private static final String SIMPLE_ADDRESS_DISTINGUISHED_VALUE_TEST = DISTINGUISHED_NAME_TYPE_VALUE_TEST;
+    private static final SimpleAddress SIMPLE_ADDRESS_DISTINGUISHED_TEST = new SimpleAddress(new DistinguishedNameType
+            (SIMPLE_ADDRESS_DISTINGUISHED_VALUE_TEST));
+    private static final SimpleAddress SIMPLE_ADDRESS_WITH_IP_PREFIX_IPV4_TEST = new SimpleAddress
+            (IP_ADDRESS_PREFIX_WITH_IPV4_TEST);
+    private static final SimpleAddress SIMPLE_ADDRESS_WITH_IP_PREFIX_IPV6_TEST = new SimpleAddress
+            (IP_ADDRESS_PREFIX_WITH_IPV6_TEST);
+    private static final Long SERVICE_PATH_ID_TEST = 2121L;
 
     /**
      * Tests {@link LispAddressUtil#addressTypeFromSimpleAddress} and {@link
@@ -78,10 +135,10 @@ public class LispAddressUtilTest {
     @Test
     public void addressFromSimpleAddressTest_asAnyIpAddress() {
         final Class<? extends LispAddressFamily> addressClass = LispAddressUtil.addressTypeFromSimpleAddress
-                (SIMPLE_ADDRESS_TEST);
+                (SIMPLE_ADDRESS_A_TEST);
         assertEquals(Ipv4Afi.class, addressClass);
 
-        final Address address = LispAddressUtil.addressFromSimpleAddress(SIMPLE_ADDRESS_TEST);
+        final Address address = LispAddressUtil.addressFromSimpleAddress(SIMPLE_ADDRESS_A_TEST);
         assertTrue(address instanceof Ipv4);
     }
 
@@ -92,7 +149,7 @@ public class LispAddressUtilTest {
      */
     @Test
     public void addressFromSimpleAddressTest_asIpPrefix() {
-        final SimpleAddress simpleAddress = new SimpleAddress(new IpPrefix(new Ipv4Prefix(IPV4_ADDRESS_PREFIX_TEST)));
+        final SimpleAddress simpleAddress = new SimpleAddress(new IpPrefix(new Ipv4Prefix(IPV4_ADDRESS_PREFIX_VALUE_TEST)));
         final Class<? extends LispAddressFamily> addressClass = LispAddressUtil.addressTypeFromSimpleAddress
                 (simpleAddress);
         assertEquals(Ipv4PrefixAfi.class, addressClass);
@@ -109,7 +166,7 @@ public class LispAddressUtilTest {
      */
     @Test
     public void addressFromSimpleAddressTest_asMacAddress() {
-        final SimpleAddress simpleAddress = new SimpleAddress(new MacAddress(MAC_ADDRESS_TEST));
+        final SimpleAddress simpleAddress = new SimpleAddress(new MacAddress(MAC_ADDRESS_VALUE_TEST));
         final Class<? extends LispAddressFamily> addressClass = LispAddressUtil.addressTypeFromSimpleAddress
                 (simpleAddress);
         assertEquals(MacAfi.class, addressClass);
@@ -160,13 +217,13 @@ public class LispAddressUtilTest {
      */
     @Test
     public void addressFromInet_ipv4() throws UnknownHostException {
-        final InetAddress ipv4InetAddress = Inet4Address.getByAddress(IPV4_ADDRESS_BYTES_TEST);
+        final InetAddress ipv4InetAddress = Inet4Address.getByAddress(IPV4_ADDRESS_BYTES_A_TEST);
         final Class<? extends LispAddressFamily> addressClass = LispAddressUtil.addressTypeFromInet(ipv4InetAddress);
         assertEquals(Ipv4Afi.class, addressClass);
 
         final Address address = LispAddressUtil.addressFromInet(ipv4InetAddress);
         assertTrue(address instanceof Ipv4);
-        assertEquals(IPV4_ADDRESS_TEST, ((Ipv4) address).getIpv4().getValue());
+        assertEquals(IPV4_ADDRESS_VALUE_TEST, ((Ipv4) address).getIpv4().getValue());
     }
 
     /**
@@ -178,13 +235,13 @@ public class LispAddressUtilTest {
      */
     @Test
     public void addressFromInet_ipv6() throws UnknownHostException {
-        final InetAddress ipv6InetAddress = Inet6Address.getByAddress(IPV6_ADDRESS_BYTES_TEST);
+        final InetAddress ipv6InetAddress = Inet6Address.getByAddress(IPV6_ADDRESS_BYTES_A_TEST);
         final Class<? extends LispAddressFamily> addressClass = LispAddressUtil.addressTypeFromInet(ipv6InetAddress);
         assertEquals(Ipv6Afi.class, addressClass);
 
         final Address address = LispAddressUtil.addressFromInet(ipv6InetAddress);
         assertTrue(address instanceof Ipv6);
-        assertEquals(IPV6_ADDRESS_TEST, ((Ipv6) address).getIpv6().getValue());
+        assertEquals(IPV6_ADDRESS_VALUE_TEST, ((Ipv6) address).getIpv6().getValue());
     }
 
     /**
@@ -194,13 +251,13 @@ public class LispAddressUtilTest {
      */
     @Test
     public void addressFromIpAddress_ipv4() {
-        final IpAddress ipv4Address = new IpAddress(IPV4_ADDRESS_OBJECT_TEST);
+        final IpAddress ipv4Address = new IpAddress(IPV4_ADDRESS_TEST);
         final Class<? extends LispAddressFamily> addressClass = LispAddressUtil.addressTypeFromIpAddress(ipv4Address);
         assertEquals(Ipv4Afi.class, addressClass);
 
         final Address address = LispAddressUtil.addressFromIpAddress(ipv4Address);
         assertTrue(address instanceof Ipv4);
-        assertEquals(IPV4_ADDRESS_TEST, ((Ipv4) address).getIpv4().getValue());
+        assertEquals(IPV4_ADDRESS_VALUE_TEST, ((Ipv4) address).getIpv4().getValue());
     }
 
     /**
@@ -210,13 +267,13 @@ public class LispAddressUtilTest {
      */
     @Test
     public void addressFromIpAddress_ipv6() {
-        final IpAddress ipv6Address = new IpAddress(new Ipv6Address(IPV6_ADDRESS_TEST));
+        final IpAddress ipv6Address = new IpAddress(new Ipv6Address(IPV6_ADDRESS_VALUE_TEST));
         final Class<? extends LispAddressFamily> addressClass = LispAddressUtil.addressTypeFromIpAddress(ipv6Address);
         assertEquals(Ipv6Afi.class, addressClass);
 
         final Address address = LispAddressUtil.addressFromIpAddress(ipv6Address);
         assertTrue(address instanceof Ipv6);
-        assertEquals(IPV6_ADDRESS_TEST, ((Ipv6) address).getIpv6().getValue());
+        assertEquals(IPV6_ADDRESS_VALUE_TEST, ((Ipv6) address).getIpv6().getValue());
     }
 
     /**
@@ -240,14 +297,14 @@ public class LispAddressUtilTest {
      */
     @Test
     public void addressFromIpPrefix_ipv4() {
-        IpPrefix ipv4Prefix = new IpPrefix(new Ipv4Prefix(IPV4_ADDRESS_PREFIX_TEST));
+        IpPrefix ipv4Prefix = new IpPrefix(new Ipv4Prefix(IPV4_ADDRESS_PREFIX_VALUE_TEST));
         final Class<? extends LispAddressFamily> addressClass = LispAddressUtil.addressTypeFromIpPrefix(ipv4Prefix);
         assertEquals(Ipv4PrefixAfi.class, addressClass);
 
         final Address address = LispAddressUtil.addressFromIpPrefix(ipv4Prefix);
         assertTrue(address instanceof org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.
                 types.rev151105.lisp.address.address.Ipv4Prefix);
-        assertEquals(IPV4_ADDRESS_PREFIX_TEST, ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.
+        assertEquals(IPV4_ADDRESS_PREFIX_VALUE_TEST, ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.
                 address.types.rev151105.lisp.address.address.Ipv4Prefix) address).getIpv4Prefix().getValue());
     }
 
@@ -258,14 +315,14 @@ public class LispAddressUtilTest {
      */
     @Test
     public void addressFromIpPrefix_ipv6() {
-        IpPrefix ipv6Address = new IpPrefix(new Ipv6Prefix(IPV6_ADDRESS_PREFIX_TEST));
+        IpPrefix ipv6Address = new IpPrefix(new Ipv6Prefix(IPV6_ADDRESS_PREFIX_VALUE_TEST));
         final Class<? extends LispAddressFamily> addressClass = LispAddressUtil.addressTypeFromIpPrefix(ipv6Address);
         assertEquals(Ipv6PrefixAfi.class, addressClass);
 
         final Address address = LispAddressUtil.addressFromIpPrefix(ipv6Address);
         assertTrue(address instanceof org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address
                 .types.rev151105.lisp.address.address.Ipv6Prefix);
-        assertEquals(IPV6_ADDRESS_PREFIX_TEST,
+        assertEquals(IPV6_ADDRESS_PREFIX_VALUE_TEST,
                 ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp
                         .address.address.Ipv6Prefix) address).getIpv6Prefix().getValue());
     }
@@ -289,9 +346,9 @@ public class LispAddressUtilTest {
      */
     @Test
     public void addressFromMacAddress_mac() {
-        final Address address = LispAddressUtil.addressFromMacAddress(new MacAddress(MAC_ADDRESS_TEST));
+        final Address address = LispAddressUtil.addressFromMacAddress(new MacAddress(MAC_ADDRESS_VALUE_TEST));
         assertTrue(address instanceof Mac);
-        assertEquals(MAC_ADDRESS_TEST, ((Mac) address).getMac().getValue());
+        assertEquals(MAC_ADDRESS_VALUE_TEST, ((Mac) address).getMac().getValue());
     }
 
     /**
@@ -313,7 +370,7 @@ public class LispAddressUtilTest {
                 .address.service.path.ServicePathBuilder servicePathBuilder = new org.opendaylight.yang.gen.v1.urn.ietf
                 .params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address
                 .address.service.path.ServicePathBuilder();
-        servicePathBuilder.setServiceIndex(DUMMY_SERVICE_INDEX);
+        servicePathBuilder.setServiceIndex(SERVICE_INDEX_TEST);
         servicePathBuilder.setServicePathId(new ServicePathIdType(DUMMY_SERVICE_PATH_ID_TYPE));
 
         ServicePath expectedAddress = servicePathBuilder.build();
@@ -321,7 +378,7 @@ public class LispAddressUtilTest {
         assertTrue(testedAddress instanceof org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address
                 .types.rev151105.lisp.address.address.ServicePath);
         assertEquals(expectedAddress, ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address
-                .types.rev151105.lisp.address.address.ServicePath)testedAddress).getServicePath());
+                .types.rev151105.lisp.address.address.ServicePath) testedAddress).getServicePath());
     }
 
     /**
@@ -338,11 +395,11 @@ public class LispAddressUtilTest {
      */
     @Test
     public void addressFromDistinguishedNameTest_withDistinguishedName() {
-        final DistinguishedNameType distinguishedNameType = new DistinguishedNameType(DISTINGUISHED_NAME_TYPE_TEST);
+        final DistinguishedNameType distinguishedNameType = new DistinguishedNameType(DISTINGUISHED_NAME_TYPE_VALUE_TEST);
         final Address testedAddress = LispAddressUtil.addressFromDistinguishedName(distinguishedNameType);
 
         assertTrue(testedAddress instanceof DistinguishedName);
-        assertEquals(distinguishedNameType, ((DistinguishedName)testedAddress).getDistinguishedName());
+        assertEquals(distinguishedNameType, ((DistinguishedName) testedAddress).getDistinguishedName());
     }
 
     /**
@@ -364,7 +421,7 @@ public class LispAddressUtilTest {
         assertTrue(testedAddress instanceof org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp
                 .address.types.rev151105.lisp.address.address.AsNumber);
         assertEquals(expectedAddress, ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp
-                .address.types.rev151105.lisp.address.address.AsNumber)testedAddress).getAsNumber());
+                .address.types.rev151105.lisp.address.address.AsNumber) testedAddress).getAsNumber());
     }
 
     /**
@@ -387,22 +444,592 @@ public class LispAddressUtilTest {
      */
     @Test
     public void toRloc() throws UnknownHostException {
-        InetAddress ipv4AddressInet = Inet4Address.getByAddress(IPV4_ADDRESS_BYTES_TEST);
+        InetAddress ipv4AddressInet = Inet4Address.getByAddress(IPV4_ADDRESS_BYTES_A_TEST);
         final Rloc rlocFromInetAddress = LispAddressUtil.toRloc(ipv4AddressInet);
         assertEquals(Ipv4Afi.class, rlocFromInetAddress.getAddressType());
-        assertEquals(IPV4_ADDRESS_TEST, ((Ipv4)rlocFromInetAddress.getAddress()).getIpv4().getValue());
+        assertEquals(IPV4_ADDRESS_VALUE_TEST, ((Ipv4)rlocFromInetAddress.getAddress()).getIpv4().getValue());
 
-        final Rloc rlocFromIpv4Address = LispAddressUtil.toRloc(IPV4_ADDRESS_OBJECT_TEST);
+        final Rloc rlocFromIpv4Address = LispAddressUtil.toRloc(IPV4_ADDRESS_TEST);
         assertEquals(Ipv4Afi.class, rlocFromIpv4Address.getAddressType());
-        assertEquals(IPV4_ADDRESS_TEST, ((Ipv4)rlocFromIpv4Address.getAddress()).getIpv4().getValue());
+        assertEquals(IPV4_ADDRESS_VALUE_TEST, ((Ipv4) rlocFromIpv4Address.getAddress()).getIpv4().getValue());
+
 
-        final Rloc rlocFromIpv6Address = LispAddressUtil.toRloc(IPV6_ADDRESS_OBJECT_TEST);
+        final Rloc rlocFromIpv6Address = LispAddressUtil.toRloc(IPV6_ADDRESS_TEST);
         assertEquals(Ipv6Afi.class, rlocFromIpv6Address.getAddressType());
-        assertEquals(IPV6_ADDRESS_TEST, ((Ipv6)rlocFromIpv6Address.getAddress()).getIpv6().getValue());
+        assertEquals(IPV6_ADDRESS_VALUE_TEST, ((Ipv6) rlocFromIpv6Address.getAddress()).getIpv6().getValue());
 
-        final Rloc rlocFromSimpleAddress = LispAddressUtil.toRloc(SIMPLE_ADDRESS_TEST);
+        final Rloc rlocFromSimpleAddress = LispAddressUtil.toRloc(SIMPLE_ADDRESS_A_TEST);
         assertEquals(Ipv4Afi.class, rlocFromSimpleAddress.getAddressType());
-        assertEquals(IPV4_ADDRESS_TEST, ((Ipv4)rlocFromSimpleAddress.getAddress()).getIpv4().getValue());
+        assertEquals(IPV4_ADDRESS_VALUE_TEST, ((Ipv4) rlocFromSimpleAddress.getAddress()).getIpv4().getValue());
+    }
+
+    /**
+     * Test {@link LispAddressUtil#asIpv4Rloc(String)} method with ipv4 or ipv6.
+     * Test {@link LispAddressUtil#asIpv6Rloc(String)} method with ipv4 or ipv6.
+     */
+    @Test
+    public void asIpvRloc() {
+        final Rloc rlocFromIpV4 = LispAddressUtil.asIpv4Rloc(IPV4_ADDRESS_VALUE_TEST);
+        assertEquals(Ipv4Afi.class, rlocFromIpV4.getAddressType());
+        assertEquals(IPV4_ADDRESS_VALUE_TEST, ((Ipv4) rlocFromIpV4.getAddress()).getIpv4().getValue());
+
+        final Rloc rlocFromIpV6 = LispAddressUtil.asIpv6Rloc(IPV6_ADDRESS_VALUE_TEST);
+        assertEquals(Ipv6Afi.class, rlocFromIpV6.getAddressType());
+        assertEquals(IPV6_ADDRESS_VALUE_TEST, ((Ipv6) rlocFromIpV6.getAddress()).getIpv6().getValue());
+    }
+
+    /**
+     * Test
+     * - {@link LispAddressUtil#toEid(Ipv6Address, InstanceIdType)}
+     * - {@link LispAddressUtil#asIpv6PrefixEid(String)}
+     * - {@link LispAddressUtil#asIpv6PrefixEid(Eid, Inet6Address, short)}
+     * - {@link LispAddressUtil#asIpv6PrefixEid(Ipv6Address, InstanceIdType)}
+     * methods.
+     */
+    @Test
+    public void toEid_ipv6Prefix() throws UnknownHostException {
+        Eid eidFromIpv6Prefix = LispAddressUtil.toEid(IPV6_ADDRESS_PREFIX_TEST, INSTANCE_ID_TYPE_TEST);
+        verifyToEidWithIpv6Prefix(eidFromIpv6Prefix, true, MASK_OK_TEST, Ipv6PrefixAfi.class);
+
+        eidFromIpv6Prefix = LispAddressUtil.asIpv6PrefixEid(IPV6_ADDRESS_PREFIX_VALUE_TEST);
+        verifyToEidWithIpv6Prefix(eidFromIpv6Prefix, false, MASK_OK_TEST, Ipv6PrefixAfi.class);
+
+        eidFromIpv6Prefix = LispAddressUtil.asIpv6PrefixEid(IPV6_ADDRESS_TEST, INSTANCE_ID_TYPE_TEST);
+        verifyToEidWithIpv6Prefix(eidFromIpv6Prefix, true, MASK_OK_DEFAULT_IPV6_TEST, Ipv6PrefixAfi.class);
+
+    }
+
+    /**
+     * Test
+     * - {@link LispAddressUtil#toEid(MacAddress, InstanceIdType)}
+     * - {@link LispAddressUtil#asMacEid(String)}
+     * - {@link LispAddressUtil#asMacEid(String, long)}
+     * methods.
+     */
+    @Test
+    public void toEid_mac() {
+        Eid eidFromMac = LispAddressUtil.toEid(MAC_ADDRESS_TEST, INSTANCE_ID_TYPE_TEST);
+        verifyToEidWithMacAddress(eidFromMac, true);
+
+        eidFromMac = LispAddressUtil.asMacEid(MAC_ADDRESS_VALUE_TEST);
+        verifyToEidWithMacAddress(eidFromMac, false);
+
+        eidFromMac = LispAddressUtil.asMacEid(MAC_ADDRESS_VALUE_TEST, INSTANCE_ID_TYPE_VALUE_TEST);
+        verifyToEidWithMacAddress(eidFromMac, true);
+    }
+
+    /**
+     * Test
+     * - {@link LispAddressUtil#toEid(Ipv6Address, InstanceIdType)}
+     * - {@link LispAddressUtil#asIpv6Eid(String)}
+     * - {@link LispAddressUtil#asIpv6Eid(String, long)}
+     * methods.
+     */
+    @Test
+    public void toEid_ipv6() {
+        Eid eidFromIpv6 = LispAddressUtil.toEid(IPV6_ADDRESS_TEST, INSTANCE_ID_TYPE_TEST);
+        verifyToEidWithIpv6(eidFromIpv6, true);
+
+        eidFromIpv6 = LispAddressUtil.asIpv6Eid(IPV6_ADDRESS_VALUE_TEST);
+        verifyToEidWithIpv6(eidFromIpv6, false);
+
+        eidFromIpv6 = LispAddressUtil.asIpv6Eid(IPV6_ADDRESS_VALUE_TEST, INSTANCE_ID_TYPE_VALUE_TEST);
+        verifyToEidWithIpv6(eidFromIpv6, true);
+    }
+
+    /**
+     * Test
+     * - {@link LispAddressUtil#toEid(Ipv4Prefix, InstanceIdType)}
+     * - {@link LispAddressUtil#asIpv4PrefixEid(String)}
+     * - {@link LispAddressUtil#asIpv4PrefixEid(Eid, Inet4Address, short)}
+     * - {@link LispAddressUtil#asIpv4PrefixEid(Ipv4Address, InstanceIdType)}  }
+     * methods.
+     */
+    @Test
+    public void toEid_ipv4Prefix() throws UnknownHostException {
+        Eid eidFromIpv4Prefix = LispAddressUtil.toEid(IPV4_ADDRESS_PREFIX_TEST, INSTANCE_ID_TYPE_TEST);
+        verifyToEidWithIpv4Prefix(eidFromIpv4Prefix, true, MASK_OK_TEST, Ipv4PrefixAfi.class);
+
+        eidFromIpv4Prefix  = LispAddressUtil.asIpv4PrefixEid(IPV4_ADDRESS_PREFIX_VALUE_TEST);
+        verifyToEidWithIpv4Prefix(eidFromIpv4Prefix, false, MASK_OK_TEST, Ipv4PrefixAfi.class);
+
+        eidFromIpv4Prefix  = LispAddressUtil.asIpv4PrefixEid(IPV4_ADDRESS_TEST, INSTANCE_ID_TYPE_TEST);
+    }
+
+    public Eid provideDummyMacEid() {
+        final EidBuilder eidBuilder = new EidBuilder();
+        eidBuilder.setAddressType(MacAfi.class);
+        eidBuilder.setVirtualNetworkId(INSTANCE_ID_TYPE_TEST);
+        return eidBuilder.build();
+    }
+
+    /**
+     * Test
+     * - {@link LispAddressUtil#toEid(Ipv4Address, InstanceIdType)}
+     * - {@link LispAddressUtil#asIpv4Eid(String)}
+     * - {@link LispAddressUtil#asIpv4Eid(String, long)}
+     * methods.
+     */
+    @Test
+    public void toEid_ipv4() {
+        Eid eidFromIpv4 = LispAddressUtil.toEid(IPV4_ADDRESS_TEST, INSTANCE_ID_TYPE_TEST);
+        verifyToEidWithIpv4(eidFromIpv4, true);
+
+        eidFromIpv4 = LispAddressUtil.asIpv4Eid(IPV4_ADDRESS_VALUE_TEST);
+        verifyToEidWithIpv4(eidFromIpv4, false);
+
+        eidFromIpv4 = LispAddressUtil.asIpv4Eid(IPV4_ADDRESS_VALUE_TEST, INSTANCE_ID_TYPE_VALUE_TEST);
+        verifyToEidWithIpv4(eidFromIpv4, true);
     }
+
+    /**
+     * Test
+     * - {@link LispAddressUtil#toEid(IpPrefix, InstanceIdType)}
+     * method.
+     */
+    @Test
+    public void toEid_ipPrefix() {
+        final Eid eidFromIpPrefix = LispAddressUtil.toEid(IP_ADDRESS_PREFIX_WITH_IPV4_TEST, INSTANCE_ID_TYPE_TEST);
+        verifyToEidWithIpv4Prefix(eidFromIpPrefix, true, MASK_OK_TEST, Ipv4PrefixAfi.class);
+    }
+
+    /**
+     * Test
+     * - {@link LispAddressUtil#toEid(DistinguishedNameType, InstanceIdType)}
+     * - {@link LispAddressUtil#asDistinguishedNameEid(String)}
+     * - {@link LispAddressUtil#asDistinguishedNameEid(String, long)}
+     * methods with various input.
+     */
+    @Test
+    public void toEid_distinguishedName() {
+        Eid eidFromDistinguishedName = LispAddressUtil.toEid(DISTINGUISHED_NAME_TYPE_TEST, INSTANCE_ID_TYPE_TEST);
+        verifyToEidWithDistinguishedName(eidFromDistinguishedName, true);
+
+        eidFromDistinguishedName = LispAddressUtil.asDistinguishedNameEid(DISTINGUISHED_NAME_TYPE_VALUE_TEST);
+        verifyToEidWithDistinguishedName(eidFromDistinguishedName, false);
+
+        eidFromDistinguishedName = LispAddressUtil.asDistinguishedNameEid
+                (DISTINGUISHED_NAME_TYPE_VALUE_WITH_MAC_TEST, INSTANCE_ID_TYPE_VALUE_TEST);
+        verifyToEidWithMacAddress(eidFromDistinguishedName, true);
+    }
+
+    private void verifyToEidWithIpv6Prefix(final Eid eidFromIpv6Prefix, final boolean isVniChecked, short
+            expectedMask, final Class<? extends org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp
+            .address.types.rev151105.LispAddressFamily> addressType) {
+        assertEquals(addressType, eidFromIpv6Prefix.getAddressType());
+        if (isVniChecked) {
+            assertEquals(INSTANCE_ID_TYPE_TEST, eidFromIpv6Prefix.getVirtualNetworkId());
+        }
+        assertEquals(IPV6_ADDRESS_VALUE_TEST + "/" + expectedMask, ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml
+                .ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6Prefix) eidFromIpv6Prefix
+                .getAddress()).getIpv6Prefix().getValue());
+    }
+
+    private void verifyToEidWithIpv4(final Eid eidFromIpv4, final boolean isVniChecked) {
+        assertEquals(Ipv4Afi.class, eidFromIpv4.getAddressType());
+        if (isVniChecked) {
+            assertEquals(INSTANCE_ID_TYPE_TEST, eidFromIpv4.getVirtualNetworkId());
+        }
+        assertEquals(IPV4_ADDRESS_VALUE_TEST, ((Ipv4) eidFromIpv4.getAddress()).getIpv4().getValue());
+    }
+
+    private void verifyToEidWithIpv6(final Eid eidFromIpv6, final boolean isVniChecked) {
+        assertEquals(Ipv6Afi.class, eidFromIpv6.getAddressType());
+        if (isVniChecked) {
+            assertEquals(INSTANCE_ID_TYPE_TEST, eidFromIpv6.getVirtualNetworkId());
+        }
+        assertEquals(IPV6_ADDRESS_VALUE_TEST, ((Ipv6) eidFromIpv6.getAddress()).getIpv6().getValue());
+    }
+
+    private void verifyToEidWithIpv4Prefix(final Eid eidFromIpv4Prefix, final boolean isVniChecked, short
+            expectedMask, Class<? extends org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address
+            .types.rev151105.LispAddressFamily>  addressType) {
+        assertEquals(addressType, eidFromIpv4Prefix.getAddressType());
+        if (isVniChecked) {
+            assertEquals(INSTANCE_ID_TYPE_TEST, eidFromIpv4Prefix.getVirtualNetworkId());
+        }
+        assertEquals(IPV4_ADDRESS_VALUE_TEST + "/" + expectedMask, ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns
+                .yang.ietf
+                .lisp.address.types.rev151105.lisp.address.address.Ipv4Prefix) eidFromIpv4Prefix.getAddress())
+                .getIpv4Prefix().getValue());
+    }
+
+    private void verifyToEidWithDistinguishedName(final Eid eidFromDistinguishedName, final boolean isVniChecked) {
+        assertEquals(DistinguishedNameAfi.class, eidFromDistinguishedName.getAddressType());
+        if (isVniChecked) {
+            assertEquals(INSTANCE_ID_TYPE_TEST, eidFromDistinguishedName.getVirtualNetworkId());
+        }
+        assertEquals(DISTINGUISHED_NAME_TYPE_TEST, ((DistinguishedName) eidFromDistinguishedName.getAddress())
+                .getDistinguishedName());
+    }
+
+    private void verifyToEidWithMacAddress(final Eid eidFromMac, final boolean isVniChecked) {
+        assertEquals(MacAfi.class, eidFromMac.getAddressType());
+        if (isVniChecked) {
+            assertEquals(INSTANCE_ID_TYPE_TEST, eidFromMac.getVirtualNetworkId());
+        }
+        assertEquals(MAC_ADDRESS_VALUE_TEST, ((Mac) eidFromMac.getAddress()).getMac().getValue());
+    }
+
+    /**
+     * Tests {@link LispAddressUtil#asIpPrefix(String, int)} with ipv4 address and correct mask
+     */
+    @Test
+    public void asIpPrefix_ipv4() {
+        final IpPrefix ipPrefix = LispAddressUtil.asIpPrefix(IPV4_ADDRESS_VALUE_TEST, MASK_OK_TEST);
+        assertNotNull(ipPrefix);
+        final Ipv4Prefix ipv4Prefix = ipPrefix.getIpv4Prefix();
+        assertNotNull(ipv4Prefix);
+        assertEquals(IPV4_ADDRESS_PREFIX_TEST, ipv4Prefix);
+    }
+
+    /**
+     * Tests {@link LispAddressUtil#asIpPrefix(String, int)} with ipv6 address and correct mask
+     */
+    @Test
+    public void asIpPrefix_ipv6() {
+        final IpPrefix ipPrefix = LispAddressUtil.asIpPrefix(IPV6_ADDRESS_VALUE_TEST, MASK_OK_TEST);
+        assertNotNull(ipPrefix);
+        final Ipv6Prefix ipv6Prefix = ipPrefix.getIpv6Prefix();
+        assertNotNull(ipv6Prefix);
+        assertEquals(IPV6_ADDRESS_PREFIX_TEST, ipv6Prefix);
+    }
+
+    /**
+     * Tests {@link LispAddressUtil#asIpPrefix(String, int)} with incorrect ip address and correct mask
+     */
+    @Test
+    public void asIpPrefix_other() {
+        final IpPrefix ipPrefix = LispAddressUtil.asIpPrefix(INCORRECT_IP_ADDRESS_TEST, MASK_OK_TEST);
+        assertNull(ipPrefix);
+    }
+
+    /**
+     * Tests {@link LispAddressUtil#ipVersionFromString(String)} with ipv4
+     */
+    @Test
+    public void ipVersionFromString_ipv4() {
+        final int addressType = LispAddressUtil.ipVersionFromString(IPV4_ADDRESS_VALUE_TEST);
+        assertEquals(4, addressType);
+    }
+
+    /**
+     * Tests {@link LispAddressUtil#ipVersionFromString(String)} with ipv6
+     */
+    @Test
+    public void ipVersionFromString_ipv6() {
+        final int addressType = LispAddressUtil.ipVersionFromString(IPV6_ADDRESS_VALUE_TEST);
+        assertEquals(6, addressType);
+    }
+
+    /**
+     * Tests {@link LispAddressUtil#ipVersionFromString(String)} with incorrect ip address format
+     */
+    @Test
+    public void ipVersionFromString_other() {
+        final int addressType = LispAddressUtil.ipVersionFromString(INCORRECT_IP_ADDRESS_TEST);
+        assertEquals(0, addressType);
+
+    }
+
+    /**
+     * Tests {@link LispAddressUtil#asKeyValueAddressEid(SimpleAddress, SimpleAddress)} method.
+     */
+    @Test
+    public void asKeyValueAddressEid() {
+        final Eid eid = LispAddressUtil.asKeyValueAddressEid(SIMPLE_ADDRESS_A_TEST, SIMPLE_ADDRESS_B_TEST);
+        verifyKeyValueAddress(eid, SIMPLE_ADDRESS_A_TEST);
+    }
+
+    /**
+     * Tests {@link LispAddressUtil#asKeyValueAddressRloc(SimpleAddress, SimpleAddress)} method.
+     */
+    @Test
+    public void asKeyValueAddressRloc() {
+        final Rloc rloc = LispAddressUtil.asKeyValueAddressRloc(SIMPLE_ADDRESS_A_TEST, SIMPLE_ADDRESS_B_TEST);
+        verifyKeyValueAddress(rloc, SIMPLE_ADDRESS_A_TEST);
+    }
+
+    /**
+     * Tests {@link LispAddressUtil#asKeyValueAddress(String, SimpleAddress)} method.
+     */
+    @Test
+    public void asKeyValueAddress() {
+        final Rloc rloc = LispAddressUtil.asKeyValueAddress(SIMPLE_ADDRESS_DISTINGUISHED_VALUE_TEST, SIMPLE_ADDRESS_B_TEST);
+        verifyKeyValueAddress(rloc, SIMPLE_ADDRESS_DISTINGUISHED_TEST);
+    }
+
+    private void verifyKeyValueAddress(final LispAddress lispAddress, final SimpleAddress keyValue) {
+        assertEquals(KeyValueAddressLcaf.class, lispAddress.getAddressType());
+        assertNull(lispAddress.getVirtualNetworkId());
+        final org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address
+                .address.key.value.address.KeyValueAddress keyValueAddress = ((KeyValueAddress) lispAddress.getAddress()).
+                getKeyValueAddress();
+        assertNotNull(keyValueAddress);
+        assertEquals(keyValue, keyValueAddress.getKey());
+        assertEquals(SIMPLE_ADDRESS_B_TEST, keyValueAddress.getValue());
+    }
+
+    /**
+     * Tests {@link LispAddressUtil#asSrcDst(String, String, int, int)} method.
+     */
+    @Test
+    public void asSrcDst() {
+        final SourceDestKey sourceDestKey = LispAddressUtil.asSrcDst(IPV4_ADDRESS_VALUE_TEST,
+                IPV6_ADDRESS_VALUE_TEST, MASK_OK_TEST, MASK_OK_TEST);
+        assertNotNull(sourceDestKey);
+        assertEquals(SIMPLE_ADDRESS_WITH_IP_PREFIX_IPV4_TEST, sourceDestKey.getSource());
+        assertEquals(SIMPLE_ADDRESS_WITH_IP_PREFIX_IPV6_TEST, sourceDestKey.getDest());
+    }
+
+    /**
+     * Tests {@link LispAddressUtil#asSrcDstEid(String, String, int, int, int)} method.
+     */
+    @Test
+    public void asSrcDstEid_addressesAsString() {
+        final Eid srcDstEid = LispAddressUtil.asSrcDstEid(IPV4_ADDRESS_VALUE_TEST,
+                IPV6_ADDRESS_VALUE_TEST, MASK_OK_TEST, MASK_OK_TEST, INSTANCE_ID_TYPE_VALUE_SHORT_TEST);
+        assertNotNull(srcDstEid);
+        assertEquals(SourceDestKeyLcaf.class, srcDstEid.getAddressType());
+        final SourceDestKey sourceDestKey = ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns
+                .yang.ietf.lisp.address.types.rev151105.lisp.address.address.SourceDestKey) srcDstEid.getAddress())
+                .getSourceDestKey();
+        assertNotNull(sourceDestKey);
+        assertEquals(SIMPLE_ADDRESS_WITH_IP_PREFIX_IPV4_TEST, sourceDestKey.getSource());
+        assertEquals(SIMPLE_ADDRESS_WITH_IP_PREFIX_IPV6_TEST, sourceDestKey.getDest());
+    }
+
+    /**
+     * Tests {@link LispAddressUtil#asSrcDstEid(SourceDestKey, InstanceIdType)}  method.
+     */
+    @Test
+    public void asSrcDstEid_addressesAsSrcDstKey() {
+        final SourceDestKey expectedSourceDestKey = new SourceDestKeyBuilder().setSource
+                (SIMPLE_ADDRESS_WITH_IP_PREFIX_IPV4_TEST).setDest(SIMPLE_ADDRESS_WITH_IP_PREFIX_IPV6_TEST).build();
+        final Eid srcDstEid = LispAddressUtil.asSrcDstEid(expectedSourceDestKey, INSTANCE_ID_TYPE_TEST);
+        assertNotNull(srcDstEid);
+        assertEquals(SourceDestKeyLcaf.class, srcDstEid.getAddressType());
+        final SourceDestKey testedSourceDestKey = ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns
+                .yang.ietf.lisp.address.types.rev151105.lisp.address.address.SourceDestKey) srcDstEid.getAddress())
+                .getSourceDestKey();
+        assertNotNull(testedSourceDestKey);
+        assertEquals(SIMPLE_ADDRESS_WITH_IP_PREFIX_IPV4_TEST, testedSourceDestKey.getSource());
+        assertEquals(SIMPLE_ADDRESS_WITH_IP_PREFIX_IPV6_TEST, testedSourceDestKey.getDest());
+    }
+
+    /**
+     * Tests {@link LispAddressUtil#asSrcDstEid(SourceDestKey, InstanceIdType)}  method.
+     */
+    @Test
+    public void asTeLcafRloc() {
+        final List<IpAddress> ipAddresses = Arrays.asList(IP_ADDRESS_OBJECT_WITH_IPV4_TEST, IP_ADDRESS_OBJECT_WITH_IPV6_TEST);
+        final Rloc rloc = LispAddressUtil.asTeLcafRloc(ipAddresses);
+        assertNotNull(rloc);
+        assertEquals(ExplicitLocatorPathLcaf.class, rloc.getAddressType());
+        final List<Hop> hops = ((ExplicitLocatorPath) rloc.getAddress()).getExplicitLocatorPath().getHop();
+        assertEquals(hops.size(), ipAddresses.size());
+
+        for(IpAddress ipAddress : ipAddresses) {
+            assertTrue("Ip address "+ipAddress+"should be part of hops list.",isIpAddressInHops(ipAddress, hops));
+        }
+
+        for(Hop hop : hops) {
+            final Hop.LrsBits lrsBits = hop.getLrsBits();
+            assertFalse(lrsBits.isLookup());
+            assertFalse(lrsBits.isRlocProbe());
+            assertFalse(lrsBits.isStrict());
+
+            final IpAddress ipAddressFromHop = hop.getAddress().getIpAddress();
+            assertNotNull(ipAddressFromHop);
+        }
+    }
+
+    private boolean isIpAddressInHops(final IpAddress ipAddress, final List<Hop> hops) {
+        for (Hop hop : hops) {
+            if (hop.getAddress().getIpAddress().equals(ipAddress)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Tests {@link LispAddressUtil#asLocatorRecords(List)}  method.
+     */
+    @Test
+    public void asLocatorRecords() {
+        final List<Rloc> expectedRlocs = Arrays.asList(LispAddressUtil.toRloc(IPV4_ADDRESS_TEST), LispAddressUtil.toRloc
+                (IPV6_ADDRESS_TEST));
+        final List<LocatorRecord> locatorRecords = LispAddressUtil.asLocatorRecords(expectedRlocs);
+
+        assertEquals(expectedRlocs.size(), locatorRecords.size());
+
+        for (Rloc rloc : expectedRlocs) {
+            assertTrue("Rloc " + rloc + " should be part of " +
+                    "locator records list list", isRlocInLocatorRecords(locatorRecords, rloc));
+        }
+
+        for (LocatorRecord locatorRecord : locatorRecords) {
+            assertFalse(locatorRecord.isLocalLocator());
+            assertFalse(locatorRecord.isRlocProbed());
+            assertTrue(locatorRecord.isRouted());
+            assertTrue(1 == locatorRecord.getWeight());
+            assertTrue(1 == locatorRecord.getPriority());
+            assertTrue(1 == locatorRecord.getMulticastWeight());
+            assertTrue(1 == locatorRecord.getMulticastPriority());
+            assertEquals("SFC_LISP", locatorRecord.getLocatorId());
+        }
+    }
+
+    private boolean isRlocInLocatorRecords(final List<LocatorRecord> locatorRecords, final Rloc rloc) {
+        for (LocatorRecord locatorRecord : locatorRecords) {
+            if (locatorRecord.getRloc().equals(rloc)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Tests {@link LispAddressUtil#getNoAddressEid()}  method.
+     */
+    @Test
+    public void getNoAddressEid() {
+        final Eid noAddressEid = LispAddressUtil.getNoAddressEid();
+        assertEquals(NoAddressAfi.class, noAddressEid.getAddressType());
+        assertNull(noAddressEid.getVirtualNetworkId());
+        assertTrue(((NoAddress) noAddressEid.getAddress()).isNoAddress());
+    }
+
+    /**
+     * Tests {@link LispAddressUtil#ipAddressToInet(Address)} method with ipv4 value.
+     */
+    @Test
+    public void ipAddressToInet_ipv4() {
+        final Ipv4 expectedIpv4 = new Ipv4Builder().setIpv4(IPV4_ADDRESS_TEST).build();
+        final InetAddress testedAddress = LispAddressUtil.ipAddressToInet(expectedIpv4);
+        assertEquals(IPV4_ADDRESS_TEST.getValue(), testedAddress.getHostAddress());
+    }
+
+    /**
+     * Tests {@link LispAddressUtil#ipAddressToInet(Address)} method with ipv6 value.
+     */
+    @Test
+    public void ipAddressToInet_ipv6() {
+        final Ipv6 expectedIpv6 = new Ipv6Builder().setIpv6(IPV6_ADDRESS_TEST).build();
+        final InetAddress testedAddress = LispAddressUtil.ipAddressToInet(expectedIpv6);
+        assertEquals(IPV6_ADDRESS_TEST.getValue(), testedAddress.getHostAddress());
+    }
+
+    /**
+     * Tests {@link LispAddressUtil#ipAddressToInet(Address)} method with mac value.
+     */
+    @Test
+    public void ipAddressToInet_other() {
+        final InetAddress testedAddress = LispAddressUtil.ipAddressToInet(new MacBuilder().build());
+        assertNull(testedAddress);
+    }
+
+    /**
+     * Tests {@link LispAddressUtil#compareInetAddresses(InetAddress, InetAddress)} with all possible combination
+     * of input parameters to reach 100 % coverage.
+     */
+    @Test
+    public void compareInetAddresses() throws UnknownHostException {
+        final InetAddress inetIpv4A = Inet4Address.getByAddress(IPV4_ADDRESS_BYTES_A_TEST);
+        final InetAddress inetIpv6A = Inet6Address.getByAddress(IPV6_ADDRESS_BYTES_A_TEST);
+        final InetAddress inetIpv4B = Inet4Address.getByAddress(IPV4_ADDRESS_BYTES_B_TEST);
+        final InetAddress inetIpv6B = Inet6Address.getByAddress(IPV6_ADDRESS_BYTES_B_TEST);
+
+        int comparisonResult = LispAddressUtil.compareInetAddresses(inetIpv4A, inetIpv6A);
+        assertEquals(-1, comparisonResult);
+
+        comparisonResult = LispAddressUtil.compareInetAddresses(inetIpv6A, inetIpv4A);
+        assertEquals(1, comparisonResult);
+
+        comparisonResult = LispAddressUtil.compareInetAddresses(inetIpv4A, inetIpv4B);
+        assertEquals(-1, comparisonResult);
+
+        comparisonResult = LispAddressUtil.compareInetAddresses(inetIpv4B, inetIpv4A);
+        assertEquals(1, comparisonResult);
+
+        comparisonResult = LispAddressUtil.compareInetAddresses(inetIpv4B, inetIpv4B);
+        assertEquals(0, comparisonResult);
+
+        // remove this ignore once https://git.opendaylight.org/gerrit/#/c/35682/1 will be merged */
+/*
+        comparisonResult = LispAddressUtil.compareInetAddresses(inetIpv6A, inetIpv6B);
+        assertEquals(-1, comparisonResult);
+
+        comparisonResult = LispAddressUtil.compareInetAddresses(inetIpv6B, inetIpv6A);
+        assertEquals(1, comparisonResult);
+
+        comparisonResult = LispAddressUtil.compareInetAddresses(inetIpv6B, inetIpv6B);
+        assertEquals(0, comparisonResult);
+*/
+
+    }
+
+    /**
+     * Tests {@link LispAddressUtil#asServicePathEid(long, long, short)} method.
+     */
+    @Test
+    public void asServicePathEid() {
+        final Eid eid = LispAddressUtil.asServicePathEid(INSTANCE_ID_TYPE_VALUE_TEST, SERVICE_PATH_ID_TEST,
+                SERVICE_INDEX_TEST);
+
+        assertNotNull(eid);
+        assertEquals(ServicePathLcaf.class, eid.getAddressType());
+        assertEquals(INSTANCE_ID_TYPE_TEST, eid.getVirtualNetworkId());
+        ServicePath servicePath = ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.
+                address.types.rev151105.lisp.address.address.ServicePath) eid.getAddress()).getServicePath();
+        assertNotNull(servicePath);
+        assertEquals(SERVICE_INDEX_TEST, servicePath.getServiceIndex());
+        assertEquals(SERVICE_PATH_ID_TEST, servicePath.getServicePathId().getValue());
+    }
+
+    /**
+     * Tests {@link LispAddressUtil#toIpPrefixEid(IpAddress, int)} method.
+     */
+    @Ignore /* remove when https://git.opendaylight.org/gerrit/#/c/35681/2 will be merged */
+    @Test
+    public void toIpPrefixEid() throws UnknownHostException {
+        final Eid eid = LispAddressUtil.toIpPrefixEid(IP_ADDRESS_OBJECT_WITH_IPV4_TEST, INSTANCE_ID_TYPE_VALUE_SHORT_TEST);
+        verifyEidContainsIpPrefix(eid, MASK_OK_DEFAULT_IPV4_TEST);
+    }
+
+    /**
+     * Tests {@link LispAddressUtil#toEidNoVni(IpPrefix)} method.
+     */
+    @Test
+    public void toEidNoVni() {
+        final Eid eid = LispAddressUtil.toEidNoVni(IP_ADDRESS_PREFIX_WITH_IPV4_TEST);
+        verifyEidContainsIpPrefix(eid, MASK_OK_TEST);
+    }
+
+    public void verifyEidContainsIpPrefix(final Eid eid, final short mask) {
+        final Ipv4Prefix expectedPrefix = new Ipv4Prefix(IPV4_ADDRESS_VALUE_TEST + "/" + mask);
+        assertNotNull(eid);
+        assertTrue(eid.getAddress() instanceof org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp
+                .address.types.rev151105.lisp.address.address.Ipv4Prefix);
+        final org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address
+                .address.Ipv4Prefix address = (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp
+                .address.types.rev151105.lisp.address.address.Ipv4Prefix) eid.getAddress();
+        assertEquals(expectedPrefix, address.getIpv4Prefix());
+    }
+
+    /**
+     * Tests {@link LispAddressUtil#asEid(SimpleAddress, InstanceIdType)} method.
+     */
+    @Test
+    public void asEid() {
+        final Eid eid = LispAddressUtil.asEid(SIMPLE_ADDRESS_A_TEST, INSTANCE_ID_TYPE_TEST);
+        assertNotNull(eid);
+        assertEquals(Ipv4Afi.class, eid.getAddressType());
+        final Ipv4 address = (Ipv4) eid.getAddress();
+        assertEquals(SIMPLE_ADDRESS_A_TEST.getIpAddress().getIpv4Address(), address.getIpv4());
+        assertEquals(INSTANCE_ID_TYPE_TEST, eid.getVirtualNetworkId());
+    }
+
 }
 
index 4bc12eb61736f5485b115f6fd4b695eba92fc46e..dc446a8e732580cba50744c28bc58019ef6e046a 100644 (file)
@@ -24,6 +24,8 @@ import org.opendaylight.lispflowmapping.lisp.serializer.exception.LispSerializat
 import org.opendaylight.lispflowmapping.lisp.util.LispAddressUtil;
 import org.opendaylight.lispflowmapping.tools.junit.BaseTestCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapRegister;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.SiteId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.XtrId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.locatorrecords.LocatorRecord;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecord.Action;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecord;
@@ -53,14 +55,16 @@ public class MapRegisterSerializationTest extends BaseTestCase {
         mrBuilder.setWantMapNotify(true);
         mrBuilder.setProxyMapReply(true);
         mrBuilder.setXtrSiteIdPresent(true);
-        byte[] authenticationData = new byte[] { (byte) 0x16, (byte) 0x98, (byte) 0x96, (byte) 0xeb, (byte) 0x88, (byte) 0x2d, (byte) 0x4d,
-                (byte) 0x22, (byte) 0xe5, (byte) 0x8f, (byte) 0xe6, (byte) 0x89, (byte) 0x64, (byte) 0xb9, (byte) 0x17, (byte) 0xa4, (byte) 0xba,
-                (byte) 0x4e, (byte) 0x8c, (byte) 0x41 };
+        byte[] authenticationData = new byte[] { (byte) 0x16, (byte) 0x98, (byte) 0x96, (byte) 0xeb, (byte) 0x88,
+                (byte) 0x2d, (byte) 0x4d, (byte) 0x22, (byte) 0xe5, (byte) 0x8f, (byte) 0xe6, (byte) 0x89, (byte) 0x64,
+                (byte) 0xb9, (byte) 0x17, (byte) 0xa4, (byte) 0xba, (byte) 0x4e, (byte) 0x8c, (byte) 0x41 };
         mrBuilder.setAuthenticationData(authenticationData);
-        byte[] xtrId  = new byte[] { (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
-                (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01 };
+        XtrId xtrId  = new XtrId(new byte[] { (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+                (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+                (byte) 0x00, (byte) 0x00, (byte) 0x01 });
         mrBuilder.setXtrId(xtrId);
-        byte[] siteId = new byte[] { (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01 };
+        SiteId siteId = new SiteId(new byte[] { (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+                (byte) 0x00, (byte) 0x00, (byte) 0x01 });
         mrBuilder.setSiteId(siteId);
 
         ByteBuffer bb = MapRegisterSerializer.getInstance().serialize(mrBuilder.build());
@@ -83,11 +87,11 @@ public class MapRegisterSerializationTest extends BaseTestCase {
 
         byte[] actualXtrId  = new byte[Length.XTRID_SIZE];
         bb.get(actualXtrId);
-        ArrayAssert.assertEquals(xtrId, actualXtrId);
+        ArrayAssert.assertEquals(xtrId.getValue(), actualXtrId);
 
         byte[] actualSiteId = new byte[Length.SITEID_SIZE];
         bb.get(actualSiteId);
-        ArrayAssert.assertEquals(siteId, actualSiteId);
+        ArrayAssert.assertEquals(siteId.getValue(), actualSiteId);
 
         assertEquals(bb.position(), bb.capacity());
     }
@@ -114,17 +118,17 @@ public class MapRegisterSerializationTest extends BaseTestCase {
         mrBuilder.setKeyId((short) 0x0001);
         mrBuilder.setWantMapNotify(true);
         mrBuilder.setProxyMapReply(true);
-        byte[] authenticationData = new byte[] { (byte) 0x16, (byte) 0x98, (byte) 0x96, (byte) 0xeb, (byte) 0x88, (byte) 0x2d, (byte) 0x4d,
-                (byte) 0x22, (byte) 0xe5, (byte) 0x8f, (byte) 0xe6, (byte) 0x89, (byte) 0x64, (byte) 0xb9, (byte) 0x17, (byte) 0xa4, (byte) 0xba,
-                (byte) 0x4e, (byte) 0x8c, (byte) 0x41 };
+        byte[] authenticationData = new byte[] { (byte) 0x16, (byte) 0x98, (byte) 0x96, (byte) 0xeb, (byte) 0x88,
+                (byte) 0x2d, (byte) 0x4d, (byte) 0x22, (byte) 0xe5, (byte) 0x8f, (byte) 0xe6, (byte) 0x89, (byte) 0x64,
+                (byte) 0xb9, (byte) 0x17, (byte) 0xa4, (byte) 0xba, (byte) 0x4e, (byte) 0x8c, (byte) 0x41 };
         mrBuilder.setAuthenticationData(authenticationData);
 
         MapRegister mapRegister = mrBuilder.build();
         ArrayAssert.assertEquals(
                 MapRegisterSerializer.getInstance().serialize(mapRegister).array(),
                 MapRegisterSerializer.getInstance()
-                        .serialize(MapRegisterSerializer.getInstance().deserialize(MapRegisterSerializer.getInstance().serialize(mapRegister), null))
-                        .array());
+                        .serialize(MapRegisterSerializer.getInstance().deserialize(MapRegisterSerializer.getInstance()
+                                .serialize(mapRegister), null)).array());
     }
 
     @Test
@@ -440,9 +444,9 @@ public class MapRegisterSerializationTest extends BaseTestCase {
         assertEquals(1, mr.getMappingRecordItem().size());
         assertEquals(0xFFBB000000000000L, mr.getNonce().longValue());
         assertEquals(0x0001, mr.getKeyId().shortValue());
-        byte[] expectedAuthenticationData = { (byte) 0x2c, (byte) 0x61, (byte) 0xb9, (byte) 0xc9, (byte) 0x9a, (byte) 0x20, (byte) 0xba, (byte) 0xd8, //
-                (byte) 0xf5, (byte) 0x40, (byte) 0xd3, (byte) 0x55, (byte) 0x6f, (byte) 0x5f, (byte) 0x6e, (byte) 0x5a, //
-                (byte) 0xb2, (byte) 0x0a, (byte) 0xbf, (byte) 0xb5 };
+        byte[] expectedAuthenticationData = { (byte) 0x2c, (byte) 0x61, (byte) 0xb9, (byte) 0xc9, (byte) 0x9a,
+                (byte) 0x20, (byte) 0xba, (byte) 0xd8, (byte) 0xf5, (byte) 0x40, (byte) 0xd3, (byte) 0x55, (byte) 0x6f,
+                (byte) 0x5f, (byte) 0x6e, (byte) 0x5a, (byte) 0xb2, (byte) 0x0a, (byte) 0xbf, (byte) 0xb5 };
         ArrayAssert.assertEquals(expectedAuthenticationData, mr.getAuthenticationData());
     }
 
@@ -474,10 +478,11 @@ public class MapRegisterSerializationTest extends BaseTestCase {
         assertEquals(1, mr.getMappingRecordItem().size());
         assertEquals(0xFFBB000000000000L, mr.getNonce().longValue());
         assertEquals(0x0002, mr.getKeyId().shortValue());
-        byte[] expectedAuthenticationData = { (byte) 0x70, (byte) 0x30, (byte) 0xd4, (byte) 0xc6, (byte) 0x10, (byte) 0x44, (byte) 0x0d, (byte) 0x83,
-                (byte) 0xbe, (byte) 0x4d, (byte) 0xbf, (byte) 0xfd, (byte) 0xa9, (byte) 0x8c, (byte) 0x57, (byte) 0x6d, (byte) 0x68, (byte) 0xa5,
-                (byte) 0xbf, (byte) 0x32, (byte) 0x11, (byte) 0xc9, (byte) 0x7b, (byte) 0x58, (byte) 0xc4, (byte) 0xb9, (byte) 0x9f, (byte) 0x06,
-                (byte) 0x11, (byte) 0x23, (byte) 0xb9, (byte) 0x38 };
+        byte[] expectedAuthenticationData = { (byte) 0x70, (byte) 0x30, (byte) 0xd4, (byte) 0xc6, (byte) 0x10,
+                (byte) 0x44, (byte) 0x0d, (byte) 0x83, (byte) 0xbe, (byte) 0x4d, (byte) 0xbf, (byte) 0xfd, (byte) 0xa9,
+                (byte) 0x8c, (byte) 0x57, (byte) 0x6d, (byte) 0x68, (byte) 0xa5, (byte) 0xbf, (byte) 0x32, (byte) 0x11,
+                (byte) 0xc9, (byte) 0x7b, (byte) 0x58, (byte) 0xc4, (byte) 0xb9, (byte) 0x9f, (byte) 0x06, (byte) 0x11,
+                (byte) 0x23, (byte) 0xb9, (byte) 0x38 };
         ArrayAssert.assertEquals(expectedAuthenticationData, mr.getAuthenticationData());
     }
 }
index 73fc54b992db670cd79257e44a0115bf6d954b77..120088072983682f92b98dace08282d78758c5af 100644 (file)
       </plugin>
     </plugins>
   </build>
+
+  <!--
+      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>
index 19cc5d89bd04876e9379b988e0ab6da64f5daeba..4ff5a6c36d54635ddf4b6d570f273a7c5db06300 100644 (file)
       </plugin>
     </plugins>
   </build>
+
+  <!--
+      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>
index 297bb7673670643c563b36707214ecb651a3a1d6..6cf913ab4e8cc3760d60da9761d562e4195f15e0 100644 (file)
       </plugins>
     </pluginManagement>
   </build>
+
+  <!--
+      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>
index e6b11bb4b9dd99813671c73052886e0b4199a418..b3004575b6ca0a7149e512ffd3731abe1d243c4a 100644 (file)
       </plugin>
     </plugins>
   </build>
+
+  <!--
+      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>
index 73e08bd55bbd39e8da72c22a3fac911aff6492c1..c38c445cbd182cb839a55b9937af4a27fcbd9fd4 100644 (file)
       <artifactId>junit-addons</artifactId>
     </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>
diff --git a/pom.xml b/pom.xml
index d4c3323f2aa4b85690994bb6550dfe47ad2314d0..0e8fcd1619de45aa55d15d121bc498ef471976e1 100644 (file)
--- a/pom.xml
+++ b/pom.xml
       </plugin>
     </plugins>
   </build>
+
+  <profiles>
+    <profile>
+      <!--
+          This profile is to ensure we only build javadocs reports
+          when we plan to deploy Maven site for our project.
+      -->
+      <id>maven-site</id>
+      <activation>
+        <file>
+          <exists>${user.dir}/deploy-site.xml</exists>
+        </file>
+      </activation>
+
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-javadoc-plugin</artifactId>
+            <inherited>false</inherited>
+            <executions>
+              <execution>
+                <id>aggregate</id>
+                <goals>
+                  <goal>aggregate</goal>
+                </goals>
+                <phase>package</phase>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
+  <!--
+      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}/</url>
+
+  <distributionManagement>
+    <site>
+      <id>opendaylight-site</id>
+      <url>${nexus.site.url}/</url>
+    </site>
+  </distributionManagement>
+
 </project>
diff --git a/src/main/resources/stylesheet.css b/src/main/resources/stylesheet.css
new file mode 100644 (file)
index 0000000..76de82b
--- /dev/null
@@ -0,0 +1,475 @@
+/* Javadoc style sheet */
+/*
+Overall document style
+*/
+body {
+    background-color:#ffffff;
+    color:#353833;
+    font-family:Arial, Helvetica, sans-serif;
+    font-size:76%;
+    margin:0;
+}
+a:link, a:visited {
+    text-decoration:none;
+    color:#4c6b87;
+}
+a:hover, a:focus {
+    text-decoration:none;
+    color:#bb7a2a;
+}
+a:active {
+    text-decoration:none;
+    color:#4c6b87;
+}
+a[name] {
+    color:#353833;
+}
+a[name]:hover {
+    text-decoration:none;
+    color:#353833;
+}
+pre {
+    font-size:1.3em;
+}
+h1 {
+    font-size:1.8em;
+}
+h2 {
+    font-size:1.5em;
+}
+h3 {
+    font-size:1.4em;
+}
+h4 {
+    font-size:1.3em;
+}
+h5 {
+    font-size:1.2em;
+}
+h6 {
+    font-size:1.1em;
+}
+ul {
+    list-style-type:disc;
+}
+code, tt {
+    font-size:1.2em;
+}
+dt code {
+    font-size:1.2em;
+}
+table tr td dt code {
+    font-size:1.2em;
+    vertical-align:top;
+}
+sup {
+    font-size:.6em;
+}
+/*
+Document title and Copyright styles
+*/
+.clear {
+    clear:both;
+    height:0px;
+    overflow:hidden;
+}
+.aboutLanguage {
+    float:right;
+    padding:0px 21px;
+    font-size:.8em;
+    z-index:200;
+    margin-top:-7px;
+}
+.legalCopy {
+    margin-left:.5em;
+}
+.bar a, .bar a:link, .bar a:visited, .bar a:active {
+    color:#FFFFFF;
+    text-decoration:none;
+}
+.bar a:hover, .bar a:focus {
+    color:#bb7a2a;
+}
+.tab {
+    background-color:#0066FF;
+    background-image:url(resources/titlebar.gif);
+    background-position:left top;
+    background-repeat:no-repeat;
+    color:#ffffff;
+    padding:8px;
+    width:5em;
+    font-weight:bold;
+}
+/*
+Navigation bar styles
+*/
+.bar {
+    background-image:url(resources/background.gif);
+    background-repeat:repeat-x;
+    color:#FFFFFF;
+    padding:.8em .5em .4em .8em;
+    height:auto;/*height:1.8em;*/
+    font-size:1em;
+    margin:0;
+}
+.topNav {
+    background-image:url(resources/background.gif);
+    background-repeat:repeat-x;
+    color:#FFFFFF;
+    float:left;
+    padding:0;
+    width:100%;
+    clear:right;
+    height:2.8em;
+    padding-top:10px;
+    overflow:hidden;
+}
+.bottomNav {
+    margin-top:10px;
+    background-image:url(resources/background.gif);
+    background-repeat:repeat-x;
+    color:#FFFFFF;
+    float:left;
+    padding:0;
+    width:100%;
+    clear:right;
+    height:2.8em;
+    padding-top:10px;
+    overflow:hidden;
+}
+.subNav {
+    background-color:#dee3e9;
+    border-bottom:1px solid #9eadc0;
+    float:left;
+    width:100%;
+    overflow:hidden;
+}
+.subNav div {
+    clear:left;
+    float:left;
+    padding:0 0 5px 6px;
+}
+ul.navList, ul.subNavList {
+    float:left;
+    margin:0 25px 0 0;
+    padding:0;
+}
+ul.navList li{
+    list-style:none;
+    float:left;
+    padding:3px 6px;
+}
+ul.subNavList li{
+    list-style:none;
+    float:left;
+    font-size:90%;
+}
+.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited {
+    color:#FFFFFF;
+    text-decoration:none;
+}
+.topNav a:hover, .bottomNav a:hover {
+    text-decoration:none;
+    color:#bb7a2a;
+}
+.navBarCell1Rev {
+    background-image:url(resources/tab.gif);
+    background-color:#a88834;
+    color:#FFFFFF;
+    margin: auto 5px;
+    border:1px solid #c9aa44;
+}
+/*
+Page header and footer styles
+*/
+.header, .footer {
+    clear:both;
+    margin:0 20px;
+    padding:5px 0 0 0;
+}
+.indexHeader {
+    margin:10px;
+    position:relative;
+}
+.indexHeader h1 {
+    font-size:1.3em;
+}
+.title {
+    color:#2c4557;
+    margin:10px 0;
+}
+.subTitle {
+    margin:5px 0 0 0;
+}
+.header ul {
+    margin:0 0 25px 0;
+    padding:0;
+}
+.footer ul {
+    margin:20px 0 5px 0;
+}
+.header ul li, .footer ul li {
+    list-style:none;
+    font-size:1.2em;
+}
+/*
+Heading styles
+*/
+div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 {
+    background-color:#dee3e9;
+    border-top:1px solid #9eadc0;
+    border-bottom:1px solid #9eadc0;
+    margin:0 0 6px -8px;
+    padding:2px 5px;
+}
+ul.blockList ul.blockList ul.blockList li.blockList h3 {
+    background-color:#dee3e9;
+    border-top:1px solid #9eadc0;
+    border-bottom:1px solid #9eadc0;
+    margin:0 0 6px -8px;
+    padding:2px 5px;
+}
+ul.blockList ul.blockList li.blockList h3 {
+    padding:0;
+    margin:15px 0;
+}
+ul.blockList li.blockList h2 {
+    padding:0px 0 20px 0;
+}
+/*
+Page layout container styles
+*/
+.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer {
+    clear:both;
+    padding:10px 20px;
+    position:relative;
+}
+.indexContainer {
+    margin:10px;
+    position:relative;
+    font-size:1.0em;
+}
+.indexContainer h2 {
+    font-size:1.1em;
+    padding:0 0 3px 0;
+}
+.indexContainer ul {
+    margin:0;
+    padding:0;
+}
+.indexContainer ul li {
+    list-style:none;
+}
+.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt {
+    font-size:1.1em;
+    font-weight:bold;
+    margin:10px 0 0 0;
+    color:#4E4E4E;
+}
+.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd {
+    margin:10px 0 10px 20px;
+}
+.serializedFormContainer dl.nameValue dt {
+    margin-left:1px;
+    font-size:1.1em;
+    display:inline;
+    font-weight:bold;
+}
+.serializedFormContainer dl.nameValue dd {
+    margin:0 0 0 1px;
+    font-size:1.1em;
+    display:inline;
+}
+/*
+List styles
+*/
+ul.horizontal li {
+    display:inline;
+    font-size:0.9em;
+}
+ul.inheritance {
+    margin:0;
+    padding:0;
+}
+ul.inheritance li {
+    display:inline;
+    list-style:none;
+}
+ul.inheritance li ul.inheritance {
+    margin-left:15px;
+    padding-left:15px;
+    padding-top:1px;
+}
+ul.blockList, ul.blockListLast {
+    margin:10px 0 10px 0;
+    padding:0;
+}
+ul.blockList li.blockList, ul.blockListLast li.blockList {
+    list-style:none;
+    margin-bottom:25px;
+}
+ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList {
+    padding:0px 20px 5px 10px;
+    border:1px solid #9eadc0;
+    background-color:#f9f9f9;
+}
+ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList {
+    padding:0 0 5px 8px;
+    background-color:#ffffff;
+    border:1px solid #9eadc0;
+    border-top:none;
+}
+ul.blockList ul.blockList ul.blockList ul.blockList li.blockList {
+    margin-left:0;
+    padding-left:0;
+    padding-bottom:15px;
+    border:none;
+    border-bottom:1px solid #9eadc0;
+}
+ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast {
+    list-style:none;
+    border-bottom:none;
+    padding-bottom:0;
+}
+table tr td dl, table tr td dl dt, table tr td dl dd {
+    margin-top:0;
+    margin-bottom:1px;
+}
+/*
+Table styles
+*/
+.contentContainer table, .classUseContainer table, .constantValuesContainer table {
+    border-bottom:1px solid #9eadc0;
+    width:100%;
+}
+.contentContainer ul li table, .classUseContainer ul li table, .constantValuesContainer ul li table {
+    width:100%;
+}
+.contentContainer .description table, .contentContainer .details table {
+    border-bottom:none;
+}
+.contentContainer ul li table th.colOne, .contentContainer ul li table th.colFirst, .contentContainer ul li table th.colLast, .classUseContainer ul li table th, .constantValuesContainer ul li table th, .contentContainer ul li table td.colOne, .contentContainer ul li table td.colFirst, .contentContainer ul li table td.colLast, .classUseContainer ul li table td, .constantValuesContainer ul li table td{
+    vertical-align:top;
+    padding-right:20px;
+}
+.contentContainer ul li table th.colLast, .classUseContainer ul li table th.colLast,.constantValuesContainer ul li table th.colLast,
+.contentContainer ul li table td.colLast, .classUseContainer ul li table td.colLast,.constantValuesContainer ul li table td.colLast,
+.contentContainer ul li table th.colOne, .classUseContainer ul li table th.colOne,
+.contentContainer ul li table td.colOne, .classUseContainer ul li table td.colOne {
+    padding-right:3px;
+}
+.overviewSummary caption, .packageSummary caption, .contentContainer ul.blockList li.blockList caption, .summary caption, .classUseContainer caption, .constantValuesContainer caption {
+    position:relative;
+    text-align:left;
+    background-repeat:no-repeat;
+    color:#FFFFFF;
+    font-weight:bold;
+    clear:none;
+    overflow:hidden;
+    padding:0px;
+    margin:0px;
+}
+caption a:link, caption a:hover, caption a:active, caption a:visited {
+    color:#FFFFFF;
+}
+.overviewSummary caption span, .packageSummary caption span, .contentContainer ul.blockList li.blockList caption span, .summary caption span, .classUseContainer caption span, .constantValuesContainer caption span {
+    white-space:nowrap;
+    padding-top:8px;
+    padding-left:8px;
+    display:block;
+    float:left;
+    background-image:url(resources/titlebar.gif);
+    height:18px;
+}
+.overviewSummary .tabEnd, .packageSummary .tabEnd, .contentContainer ul.blockList li.blockList .tabEnd, .summary .tabEnd, .classUseContainer .tabEnd, .constantValuesContainer .tabEnd {
+    width:10px;
+    background-image:url(resources/titlebar_end.gif);
+    background-repeat:no-repeat;
+    background-position:top right;
+    position:relative;
+    float:left;
+}
+ul.blockList ul.blockList li.blockList table {
+    margin:0 0 12px 0px;
+    width:100%;
+}
+.tableSubHeadingColor {
+    background-color: #EEEEFF;
+}
+.altColor {
+    background-color:#eeeeef;
+}
+.rowColor {
+    background-color:#ffffff;
+}
+.overviewSummary td, .packageSummary td, .contentContainer ul.blockList li.blockList td, .summary td, .classUseContainer td, .constantValuesContainer td {
+    text-align:left;
+    padding:3px 3px 3px 7px;
+}
+th.colFirst, th.colLast, th.colOne, .constantValuesContainer th {
+    background:#dee3e9;
+    border-top:1px solid #9eadc0;
+    border-bottom:1px solid #9eadc0;
+    text-align:left;
+    padding:3px 3px 3px 7px;
+}
+td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover {
+    font-weight:bold;
+}
+td.colFirst, th.colFirst {
+    border-left:1px solid #9eadc0;
+    white-space:nowrap;
+}
+td.colLast, th.colLast {
+    border-right:1px solid #9eadc0;
+}
+td.colOne, th.colOne {
+    border-right:1px solid #9eadc0;
+    border-left:1px solid #9eadc0;
+}
+table.overviewSummary  {
+    padding:0px;
+    margin-left:0px;
+}
+table.overviewSummary td.colFirst, table.overviewSummary th.colFirst,
+table.overviewSummary td.colOne, table.overviewSummary th.colOne {
+    width:25%;
+    vertical-align:middle;
+}
+table.packageSummary td.colFirst, table.overviewSummary th.colFirst {
+    width:25%;
+    vertical-align:middle;
+}
+/*
+Content styles
+*/
+.description pre {
+    margin-top:0;
+}
+.deprecatedContent {
+    margin:0;
+    padding:10px 0;
+}
+.docSummary {
+    padding:0;
+}
+/*
+Formatting effect styles
+*/
+.sourceLineNo {
+    color:green;
+    padding:0 30px 0 0;
+}
+h1.hidden {
+    visibility:hidden;
+    overflow:hidden;
+    font-size:.9em;
+}
+.block {
+    display:block;
+    margin:3px 0 0 0;
+}
+.strong {
+    font-weight:bold;
+}
+
diff --git a/src/site/site.xml b/src/site/site.xml
new file mode 100644 (file)
index 0000000..3f2172a
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="lispflowmapping">
+    <body>
+        <menu name="Overview">
+            <item name="Javadocs" href="apidocs/index.html" />
+        </menu>
+    </body>
+</project>
+
index 5f728edd31b6beaf3f7d3ec6e43f9575b29ad1c6..1c02cba59c8d9da67c5db2147624f213c8771cb8 100644 (file)
 
 
 
+
+  <!--
+      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>
index 4f107741fcfdcd17ae607c4a594b8a052b91090d..85b4d48b2439830cc05fa263f3baf15e4ba9633d 100644 (file)
     <artifactId>lispflowmapping-ui-module</artifactId>
     <packaging>jar</packaging>
     <name>LISP Flow Mapping UI - Module</name>
+
+  <!--
+      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>
index 05ebcfd283b53b80469d9d4fe77d57a9e2684961..42014f286c72a10282584f90f559fdc2d606abb1 100644 (file)
         <module>module</module>
         <module>bundle</module>
     </modules>
+
+  <!--
+      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>