fixed map request yang model, changed embeded map reply to be an eid to locator record 08/6308/1 lispflowmapping-bulk-release-prepare-only-35 jenkins-lispflowmapping-bulk-release-prepare-only-35
authorDavid Goldberg <david.goldberg@contextream.com>
Tue, 22 Apr 2014 10:25:19 +0000 (13:25 +0300)
committerDavid Goldberg <david.goldberg@contextream.com>
Tue, 22 Apr 2014 10:25:19 +0000 (13:25 +0300)
Change-Id: Ia0ec2fbb3a0d37c4a38f269746b0297e9e05f55c
Signed-off-by: David Goldberg <david.goldberg@contextream.com>
19 files changed:
mappingservice/api/src/main/java/org/opendaylight/lispflowmapping/interfaces/dao/MappingServiceRLOCGroup.java
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/lisp/MapResolver.java
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/lisp/MapServer.java
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/serializer/EidToLocatorRecordSerializer.java
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/serializer/MapNotifySerializer.java
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/serializer/MapRegisterSerializer.java
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/serializer/MapReplySerializer.java
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/serializer/MapRequestSerializer.java
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/util/LispNotificationHelper.java
mappingservice/implementation/src/test/java/org/opendaylight/lispflowmapping/implementation/lisp/MapResolverTest.java
mappingservice/implementation/src/test/java/org/opendaylight/lispflowmapping/implementation/lisp/MapServerTest.java
mappingservice/implementation/src/test/java/org/opendaylight/lispflowmapping/implementation/serializer/MapNotifySerializationTest.java
mappingservice/implementation/src/test/java/org/opendaylight/lispflowmapping/implementation/serializer/MapRegisterSerializationTest.java
mappingservice/implementation/src/test/java/org/opendaylight/lispflowmapping/implementation/serializer/MapReplySerializationTest.java
mappingservice/implementation/src/test/java/org/opendaylight/lispflowmapping/implementation/serializer/MapRequestSerializationTest.java
mappingservice/integrationtest/src/test/java/org/opendaylight/lispflowmapping/integrationtest/MappingServiceIntegrationTest.java
mappingservice/northbound/src/main/java/org/opendaylight/lispflowmapping/northbound/YangTransformerNB.java
mappingservice/southbound/src/test/java/org/opendaylight/lispflowmapping/southbound/lisp/LispSouthboundServiceTest.java
mappingservice/yangmodel/src/main/yang/mappingservice.yang

index ae1ac6c5dca2a4313c18dfa5bd40f5d67050ea43..ce431b4def9c7d84b84e08a990f6dec388caa033 100644 (file)
@@ -11,7 +11,7 @@ import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
-import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord.Action;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.EidToLocatorRecord.Action;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.locatorrecords.LocatorRecord;
 
 /**
index 8a3a3f0b0ce2a121fdbbcfd40b9bacca6ecfcce9..0153cd9e82e91ef8cae4781320e2c801814a9773 100644 (file)
@@ -9,9 +9,10 @@
 package org.opendaylight.lispflowmapping.implementation.lisp;
 
 import java.util.ArrayList;
-import java.util.List;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Map;
+
 import org.opendaylight.lispflowmapping.implementation.dao.MappingServiceKeyUtil;
 import org.opendaylight.lispflowmapping.implementation.util.LispNotificationHelper;
 import org.opendaylight.lispflowmapping.implementation.util.MaskUtil;
@@ -22,10 +23,10 @@ import org.opendaylight.lispflowmapping.interfaces.dao.MappingServiceRLOCGroup;
 import org.opendaylight.lispflowmapping.interfaces.dao.MappingServiceSubscriberRLOC;
 import org.opendaylight.lispflowmapping.interfaces.lisp.IMapRequestResultHandler;
 import org.opendaylight.lispflowmapping.interfaces.lisp.IMapResolverAsync;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.EidToLocatorRecord.Action;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.MapRequest;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidrecords.EidRecord;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord;
-import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord.Action;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecordBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.LispAddressContainer;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.LispAddressContainerBuilder;
@@ -93,7 +94,11 @@ public class MapResolver extends AbstractLispComponent implements IMapResolverAs
                         if (subscribers == null) {
                             subscribers = new HashSet<MappingServiceSubscriberRLOC>();
                         } else if (subscribers.contains(subscriberRloc)) {
-                            /* If there is an entry already for this subscriberRloc, remove it, so that it gets the new timestamp */
+                            /*
+                             * If there is an entry already for this
+                             * subscriberRloc, remove it, so that it gets the
+                             * new timestamp
+                             */
                             subscribers.remove(subscriberRloc);
                         }
                         IMappingServiceKey key = MappingServiceKeyUtil.generateMappingServiceKey(eid.getLispAddressContainer(), eid.getMask());
index f20c465c002ff0f0ec1309e180e4f2525933e174..88754b95e15df29618e7dc1b13e156f655a0a756 100644 (file)
@@ -36,10 +36,10 @@ import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.MapRequest;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidrecords.EidRecordBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.LispAddressContainer;
-import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.LcafKeyValue;
-import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.DistinguishedName;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.LispAddressContainerBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.Ipv4Builder;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.LcafKeyValue;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.DistinguishedName;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.locatorrecords.LocatorRecord;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.mapnotifymessage.MapNotifyBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.maprequest.ItrRloc;
@@ -75,15 +75,18 @@ public class MapServer extends AbstractLispComponent implements IMapServerAsync
     private static InetAddress getLocalAddress() {
         try {
             Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
-            while (interfaces.hasMoreElements()){
+            while (interfaces.hasMoreElements()) {
                 NetworkInterface current = interfaces.nextElement();
                 logger.debug("Interface " + current.toString());
-                if (!current.isUp() || current.isLoopback() || current.isVirtual()) continue;
+                if (!current.isUp() || current.isLoopback() || current.isVirtual())
+                    continue;
                 Enumeration<InetAddress> addresses = current.getInetAddresses();
-                while (addresses.hasMoreElements()){
+                while (addresses.hasMoreElements()) {
                     InetAddress current_addr = addresses.nextElement();
-                    // Skip loopback addresses but not link local or RFC 1918 addresses
-                    if (current_addr.isLoopbackAddress()) continue;
+                    // Skip loopback addresses but not link local or RFC 1918
+                    // addresses
+                    if (current_addr.isLoopbackAddress())
+                        continue;
                     logger.debug(current_addr.getHostAddress());
                     return current_addr;
                 }
@@ -92,6 +95,7 @@ public class MapServer extends AbstractLispComponent implements IMapServerAsync
         }
         return null;
     }
+
     private static MapRequest buildSMR(EidToLocatorRecord eidRecord) {
         MapRequestBuilder builder = new MapRequestBuilder();
         builder.setAuthoritative(false);
@@ -106,10 +110,11 @@ public class MapServer extends AbstractLispComponent implements IMapServerAsync
         builder.getEidRecord().add(new EidRecordBuilder().setMask((short) eidRecord.getMaskLength()).setLispAddressContainer(container).build());
 
         builder.setItrRloc(new ArrayList<ItrRloc>());
-        builder.getItrRloc().add(new ItrRlocBuilder().setLispAddressContainer(
-                new LispAddressContainerBuilder().setAddress(
-                new Ipv4Builder().setIpv4Address(
-                new Ipv4Address(getLocalAddress().getHostAddress())).setAfi((short) AddressFamilyNumberEnum.IP.getIanaCode()).build()).build()).build());
+        builder.getItrRloc().add(
+                new ItrRlocBuilder().setLispAddressContainer(
+                        new LispAddressContainerBuilder().setAddress(
+                                new Ipv4Builder().setIpv4Address(new Ipv4Address(getLocalAddress().getHostAddress()))
+                                        .setAfi((short) AddressFamilyNumberEnum.IP.getIanaCode()).build()).build()).build());
 
         builder.setMapReply(null);
         builder.setNonce(new Random().nextLong());
@@ -149,7 +154,8 @@ public class MapServer extends AbstractLispComponent implements IMapServerAsync
                                 callback.handleSMR(mapRequest, rloc.getSrcRloc());
                             }
                         }
-                        IMappingServiceKey key = MappingServiceKeyUtil.generateMappingServiceKey(eidRecord.getLispAddressContainer(), eidRecord.getMaskLength());
+                        IMappingServiceKey key = MappingServiceKeyUtil.generateMappingServiceKey(eidRecord.getLispAddressContainer(),
+                                eidRecord.getMaskLength());
                         dao.put(key, new MappingEntry<HashSet<MappingServiceSubscriberRLOC>>(SUBSCRIBERS_SUBKEY, subscribers));
                     }
                 }
index 519f20927da5e9e93e3611d2b13874a080c2daf3..a3b4621249900e0b82b440cfe2ac6dc4adcb60fb 100644 (file)
@@ -15,9 +15,9 @@ import org.opendaylight.lispflowmapping.implementation.serializer.address.LispAd
 import org.opendaylight.lispflowmapping.implementation.util.ByteUtil;
 import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
 import org.opendaylight.lispflowmapping.implementation.util.NumberUtil;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.EidToLocatorRecord;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.EidToLocatorRecord.Action;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispAFIAddress;
-import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord;
-import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord.Action;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecordBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.LispAddressContainer;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.locatorrecords.LocatorRecord;
index e49b84043185a32f8906ca9245de994bf496cdc5..8b2595bc21dae6cb50603f2b3862874d9981ba82 100644 (file)
@@ -15,6 +15,7 @@ import org.opendaylight.lispflowmapping.implementation.util.ByteUtil;
 import org.opendaylight.lispflowmapping.implementation.util.NumberUtil;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.MapNotify;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecordBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.mapnotifymessage.MapNotifyBuilder;
 
 /**
@@ -84,7 +85,8 @@ public class MapNotifySerializer {
 
             builder.setEidToLocatorRecord(new ArrayList<EidToLocatorRecord>());
             for (int i = 0; i < recordCount; i++) {
-                builder.getEidToLocatorRecord().add(EidToLocatorRecordSerializer.getInstance().deserialize(notifyBuffer));
+                builder.getEidToLocatorRecord().add(
+                        new EidToLocatorRecordBuilder(EidToLocatorRecordSerializer.getInstance().deserialize(notifyBuffer)).build());
             }
             notifyBuffer.limit(notifyBuffer.position());
             return builder.build();
index 9ebf67a558f6e2610ceded745e7cd9236bbebc6f..ba57c4bca83d3c2fdddfd97ea9743150c850ede3 100644 (file)
@@ -16,6 +16,7 @@ import org.opendaylight.lispflowmapping.implementation.util.ByteUtil;
 import org.opendaylight.lispflowmapping.implementation.util.NumberUtil;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.MapRegister;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecordBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.mapregisternotification.MapRegisterBuilder;
 
 /**
@@ -82,7 +83,8 @@ public class MapRegisterSerializer {
             builder.setAuthenticationData(authenticationData);
 
             for (int i = 0; i < recordCount; i++) {
-                builder.getEidToLocatorRecord().add(EidToLocatorRecordSerializer.getInstance().deserialize(registerBuffer));
+                builder.getEidToLocatorRecord().add(
+                        new EidToLocatorRecordBuilder(EidToLocatorRecordSerializer.getInstance().deserialize(registerBuffer)).build());
             }
             registerBuffer.limit(registerBuffer.position());
             byte[] mapRegisterBytes = new byte[registerBuffer.position()];
index 35a693775562536e6ea9c6e28c23f89c90e823de..b9f752926b22f9f33e1a1da9c86a4ac69a9df635 100644 (file)
@@ -15,6 +15,7 @@ import org.opendaylight.lispflowmapping.implementation.util.ByteUtil;
 import org.opendaylight.lispflowmapping.implementation.util.NumberUtil;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.MapReply;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecordBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.mapreplymessage.MapReplyBuilder;
 
 /**
@@ -71,7 +72,8 @@ public class MapReplySerializer {
         builder.setNonce(replyBuffer.getLong());
         builder.setEidToLocatorRecord(new ArrayList<EidToLocatorRecord>());
         for (int i = 0; i < recordCount; i++) {
-            builder.getEidToLocatorRecord().add(EidToLocatorRecordSerializer.getInstance().deserialize(replyBuffer));
+            builder.getEidToLocatorRecord().add(
+                    new EidToLocatorRecordBuilder(EidToLocatorRecordSerializer.getInstance().deserialize(replyBuffer)).build());
         }
 
         return builder.build();
index 550d328ac85e2d154c03a627ec826708d79e1247..025a780cdacf24ef89f139fefaa4522e5881cd07 100644 (file)
@@ -18,11 +18,11 @@ import org.opendaylight.lispflowmapping.implementation.util.NumberUtil;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispAFIAddress;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.MapRequest;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidrecords.EidRecord;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecordBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.LispAddressContainerBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.Address;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.maprequest.ItrRloc;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.maprequest.ItrRlocBuilder;
-import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.maprequest.MapReplyBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.maprequest.SourceEidBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.maprequestnotification.MapRequestBuilder;
 import org.slf4j.Logger;
@@ -106,7 +106,8 @@ public class MapRequestSerializer {
             }
         }
         if (mapRequest.getMapReply() != null) {
-            ByteBuffer replyBuffer = MapReplySerializer.getInstance().serialize(mapRequest.getMapReply());
+            ByteBuffer replyBuffer = ByteBuffer.allocate(EidToLocatorRecordSerializer.getInstance().getSerializationSize(mapRequest.getMapReply()));
+            EidToLocatorRecordSerializer.getInstance().serialize(replyBuffer, mapRequest.getMapReply());
             ByteBuffer combinedBuffer = ByteBuffer.allocate(requestBuffer.capacity() + replyBuffer.capacity());
             combinedBuffer.put(requestBuffer.array());
             combinedBuffer.put(replyBuffer.array());
@@ -154,7 +155,8 @@ public class MapRequestSerializer {
             }
             if (builder.isMapDataPresent() && requestBuffer.hasRemaining()) {
                 try {
-                    builder.setMapReply(new MapReplyBuilder(MapReplySerializer.getInstance().deserialize(requestBuffer)).build());
+                    builder.setMapReply(new org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.maprequest.MapReplyBuilder(
+                            new EidToLocatorRecordBuilder(EidToLocatorRecordSerializer.getInstance().deserialize(requestBuffer)).build()).build());
                 } catch (RuntimeException re) {
                     logger.warn("couldn't deserialize map reply encapsulated in map request. {}", re.getMessage());
                 }
index 6ee9e72d026ef84a2e2191da860e1ee244a54147..9901720e28fd806fb48a0d33141601e0c26665a8 100644 (file)
@@ -17,7 +17,6 @@ import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispAFIAddress;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispIpv4Address;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.LispAddressContainer;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.Ipv4;
-import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.LcafApplicationData;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.mapregisternotification.MapRegister;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.mapregisternotification.MapRegisterBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.maprequestnotification.MapRequest;
index 83fbfcb84a96a4e1720ac98049ba2336411c9721..be9f8e6ec788aa14117daf99b175a6083b6376e3 100644 (file)
@@ -26,13 +26,13 @@ import org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO;
 import org.opendaylight.lispflowmapping.interfaces.dao.IMappingServiceKey;
 import org.opendaylight.lispflowmapping.interfaces.dao.MappingServiceRLOCGroup;
 import org.opendaylight.lispflowmapping.tools.junit.BaseTestCase;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.EidToLocatorRecord.Action;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispAFIAddress;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.MapReply;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.MapRequest;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidrecords.EidRecord;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidrecords.EidRecordBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord;
-import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord.Action;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecordBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.locatorrecords.LocatorRecord;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.locatorrecords.LocatorRecordBuilder;
index a9bc66d5b4685199f0bb186169878f6b7177b9fb..2e7dc47d0cc9a776b5e397025d38a17180926333 100644 (file)
@@ -26,11 +26,11 @@ import org.opendaylight.lispflowmapping.interfaces.dao.IMappingServiceKey;
 import org.opendaylight.lispflowmapping.interfaces.dao.MappingEntry;
 import org.opendaylight.lispflowmapping.interfaces.dao.MappingServiceRLOCGroup;
 import org.opendaylight.lispflowmapping.tools.junit.BaseTestCase;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.EidToLocatorRecord.Action;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispAFIAddress;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.MapNotify;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.MapRegister;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord;
-import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord.Action;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecordBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.Ipv4;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.NoBuilder;
index 8be81b95c86042353023420e3f8bee334a9ef4e4..2fb9e188076ffc79b9814f9872f784a7ba5b1b58 100644 (file)
@@ -22,9 +22,9 @@ import org.opendaylight.lispflowmapping.implementation.lisp.exception.LispSerial
 import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
 import org.opendaylight.lispflowmapping.tools.junit.BaseTestCase;
 import org.opendaylight.lispflowmapping.type.AddressFamilyNumberEnum;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.EidToLocatorRecord.Action;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.MapNotify;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord;
-import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord.Action;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecordBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.NoBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.locatorrecords.LocatorRecord;
index d7305a15faf31c9eb55644b14094969b8dd148cb..cc4f63f451ddbc58e7a3909f9d205050a23a7232 100644 (file)
@@ -22,9 +22,9 @@ import org.opendaylight.lispflowmapping.implementation.lisp.exception.LispSerial
 import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
 import org.opendaylight.lispflowmapping.tools.junit.BaseTestCase;
 import org.opendaylight.lispflowmapping.type.AddressFamilyNumberEnum;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.EidToLocatorRecord.Action;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.MapRegister;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord;
-import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord.Action;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecordBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.NoBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.locatorrecords.LocatorRecord;
index 5ee4824ad27acead8d78b9201e21978b46022898..845780a54c5327824d0d56e67161ee11742da1db 100644 (file)
@@ -19,9 +19,9 @@ import org.junit.Ignore;
 import org.junit.Test;
 import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
 import org.opendaylight.lispflowmapping.tools.junit.BaseTestCase;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.EidToLocatorRecord.Action;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.MapReply;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord;
-import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord.Action;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecordBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.locatorrecords.LocatorRecord;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.locatorrecords.LocatorRecordBuilder;
index fe507d6c70589483b1f9bd67e8f09d08c567b364..021e6959d4f854b48f19c065ae6f26439552b0a9 100644 (file)
@@ -20,13 +20,12 @@ import org.junit.Test;
 import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
 import org.opendaylight.lispflowmapping.tools.junit.BaseTestCase;
 import org.opendaylight.lispflowmapping.type.AddressFamilyNumberEnum;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.EidToLocatorRecord.Action;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispIpv4Address;
-import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.MapReply;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.MapRequest;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidrecords.EidRecord;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidrecords.EidRecordBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord;
-import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord.Action;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecordBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.LispAddressContainerBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.NoBuilder;
@@ -34,6 +33,7 @@ import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.locatorrecords.Loc
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.locatorrecords.LocatorRecordBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.maprequest.ItrRloc;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.maprequest.ItrRlocBuilder;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.maprequest.MapReply;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.maprequest.MapReplyBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.maprequest.SourceEidBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.maprequestnotification.MapRequestBuilder;
@@ -177,14 +177,11 @@ public class MapRequestSerializationTest extends BaseTestCase {
                 + "01 " // single record
                 + "3d 8d 2a cd 39 c8 d6 08 00 00 00 01 c0 a8 88 0a " //
                 + "00 20 00 01 01 02 03 04 "// end of map request
-                + "20 00 00 02 00 00 " //
-                + "00 00 00 00 00 02 00 00 " //
-                + "00 02 02 20 00 00 00 00 " //
+                + "00 00 " //
+                + "00 02 01 20 00 00 00 00 " //
                 + "00 01 01 02 03 04 01 02 " //
                 + "03 04 00 06 00 01 0a 0a " //
-                + "0a 0a 04 03 02 01 00 01 " //
-                + "00 02 00 01 00 02 00 03 " //
-                + "00 04 00 05 00 06 00 07 00 08 00 00 00 00 00 10 30 00 00 02 00 01 04 03 02 01"
+                + "0a 0a"
 
         ));
 
@@ -193,39 +190,21 @@ public class MapRequestSerializationTest extends BaseTestCase {
         assertEquals(0x20, eid.getMask().byteValue());
         assertEquals(LispAFIConvertor.toContainer(LispAFIConvertor.asIPAfiAddress("1.2.3.4")), eid.getLispAddressContainer());
         MapReply mapReply = mr.getMapReply();
-        assertEquals(2, mapReply.getNonce().longValue());
-        assertEquals(LispAFIConvertor.toContainer(LispAFIConvertor.asIPAfiAddress(("1.2.3.4"))), mapReply.getEidToLocatorRecord().get(0)
+        assertEquals(LispAFIConvertor.toContainer(LispAFIConvertor.asIPAfiAddress(("1.2.3.4"))), mapReply.getLispAddressContainer());
+        assertEquals(false, mapReply.isAuthoritative());
+        assertEquals(Action.NoAction, mapReply.getAction());
+        assertEquals(0, mapReply.getMapVersion().shortValue());
+        assertEquals(32, mapReply.getMaskLength().shortValue());
+        assertEquals(2, mapReply.getRecordTtl().byteValue());
+        assertEquals(LispAFIConvertor.toContainer(LispAFIConvertor.asIPAfiAddress(("10.10.10.10"))), mapReply.getLocatorRecord().get(0)
                 .getLispAddressContainer());
-        assertEquals(LispAFIConvertor.toContainer(LispAFIConvertor.asIPAfiAddress(("4.3.2.1"))), mapReply.getEidToLocatorRecord().get(1)
-                .getLispAddressContainer());
-        assertEquals(false, mapReply.getEidToLocatorRecord().get(0).isAuthoritative());
-        assertEquals(true, mapReply.getEidToLocatorRecord().get(1).isAuthoritative());
-        assertEquals(Action.NoAction, mapReply.getEidToLocatorRecord().get(0).getAction());
-        assertEquals(Action.NativelyForward, mapReply.getEidToLocatorRecord().get(1).getAction());
-        assertEquals(0, mapReply.getEidToLocatorRecord().get(0).getMapVersion().shortValue());
-        assertEquals(2, mapReply.getEidToLocatorRecord().get(1).getMapVersion().shortValue());
-        assertEquals(32, mapReply.getEidToLocatorRecord().get(0).getMaskLength().shortValue());
-        assertEquals(16, mapReply.getEidToLocatorRecord().get(1).getMaskLength().shortValue());
-        assertEquals(2, mapReply.getEidToLocatorRecord().get(0).getRecordTtl().byteValue());
-        assertEquals(0, mapReply.getEidToLocatorRecord().get(1).getRecordTtl().byteValue());
-        assertEquals(LispAFIConvertor.toContainer(LispAFIConvertor.asIPv6AfiAddress(("1:2:3:4:5:6:7:8"))), mapReply.getEidToLocatorRecord().get(0)
-                .getLocatorRecord().get(1).getLispAddressContainer());
-        assertEquals(LispAFIConvertor.toContainer(LispAFIConvertor.asIPAfiAddress(("10.10.10.10"))), mapReply.getEidToLocatorRecord().get(0)
-                .getLocatorRecord().get(0).getLispAddressContainer());
-        assertEquals(1, mapReply.getEidToLocatorRecord().get(0).getLocatorRecord().get(0).getPriority().byteValue());
-        assertEquals(2, mapReply.getEidToLocatorRecord().get(0).getLocatorRecord().get(0).getWeight().byteValue());
-        assertEquals(3, mapReply.getEidToLocatorRecord().get(0).getLocatorRecord().get(0).getMulticastPriority().byteValue());
-        assertEquals(4, mapReply.getEidToLocatorRecord().get(0).getLocatorRecord().get(0).getMulticastWeight().byteValue());
-        assertEquals(4, mapReply.getEidToLocatorRecord().get(0).getLocatorRecord().get(1).getPriority().byteValue());
-        assertEquals(3, mapReply.getEidToLocatorRecord().get(0).getLocatorRecord().get(1).getWeight().byteValue());
-        assertEquals(2, mapReply.getEidToLocatorRecord().get(0).getLocatorRecord().get(1).getMulticastPriority().byteValue());
-        assertEquals(1, mapReply.getEidToLocatorRecord().get(0).getLocatorRecord().get(1).getMulticastWeight().byteValue());
-        assertEquals(true, mapReply.getEidToLocatorRecord().get(0).getLocatorRecord().get(0).isLocalLocator());
-        assertEquals(true, mapReply.getEidToLocatorRecord().get(0).getLocatorRecord().get(0).isRlocProbed());
-        assertEquals(false, mapReply.getEidToLocatorRecord().get(0).getLocatorRecord().get(0).isRouted());
-        assertEquals(false, mapReply.getEidToLocatorRecord().get(0).getLocatorRecord().get(1).isLocalLocator());
-        assertEquals(false, mapReply.getEidToLocatorRecord().get(0).getLocatorRecord().get(1).isRlocProbed());
-        assertEquals(true, mapReply.getEidToLocatorRecord().get(0).getLocatorRecord().get(1).isRouted());
+        assertEquals(1, mapReply.getLocatorRecord().get(0).getPriority().byteValue());
+        assertEquals(2, mapReply.getLocatorRecord().get(0).getWeight().byteValue());
+        assertEquals(3, mapReply.getLocatorRecord().get(0).getMulticastPriority().byteValue());
+        assertEquals(4, mapReply.getLocatorRecord().get(0).getMulticastWeight().byteValue());
+        assertEquals(true, mapReply.getLocatorRecord().get(0).isLocalLocator());
+        assertEquals(true, mapReply.getLocatorRecord().get(0).isRlocProbed());
+        assertEquals(false, mapReply.getLocatorRecord().get(0).isRouted());
     }
 
     @Test
@@ -376,22 +355,19 @@ public class MapRequestSerializationTest extends BaseTestCase {
                 new EidRecordBuilder().setMask((short) 32)
                         .setLispAddressContainer(LispAFIConvertor.toContainer(LispAFIConvertor.asIPAfiAddress("1.2.3.4"))).build());
         MapReplyBuilder mapreplyBuilder = new MapReplyBuilder();
-        mapreplyBuilder.setEidToLocatorRecord(new ArrayList<EidToLocatorRecord>());
 
-        EidToLocatorRecordBuilder eidToLocatorBuilder = new EidToLocatorRecordBuilder();
-        eidToLocatorBuilder.setLispAddressContainer(LispAFIConvertor.toContainer(LispAFIConvertor.asIPAfiAddress("0.0.0.1")));
-        eidToLocatorBuilder.setLocatorRecord(new ArrayList<LocatorRecord>());
+        mapreplyBuilder.setLispAddressContainer(LispAFIConvertor.toContainer(LispAFIConvertor.asIPAfiAddress("0.0.0.1")));
+        mapreplyBuilder.setLocatorRecord(new ArrayList<LocatorRecord>());
 
         LocatorRecordBuilder locatorBuilder = new LocatorRecordBuilder();
         locatorBuilder.setLispAddressContainer(LispAFIConvertor.toContainer(LispAFIConvertor.asIPAfiAddress("0.0.0.2")));
-        eidToLocatorBuilder.getLocatorRecord().add(locatorBuilder.build());
-        mapreplyBuilder.getEidToLocatorRecord().add(eidToLocatorBuilder.build());
+        mapreplyBuilder.getLocatorRecord().add(locatorBuilder.build());
         mapRequestBuilder.setMapReply(mapreplyBuilder.build());
 
         ByteBuffer expected = hexToByteBuffer("16 80 01 01 00 00 " //
                 + "00 00 00 00 00 0D 00 01 0a 00 00 01 00 01 01 02 03 04 00 02 00 01 00 02 00 03 00 04 00 05 00 06 00 07 00 08 00 20 00 01 01 02 03 04 "// map
                                                                                                                                                         // request
-                + "20 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 01 00 00 00 02");
+                + "00 00 00 00 01 00 00 00 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 01 00 00 00 02");
         assertArrayEquals(expected.array(), MapRequestSerializer.getInstance().serialize(mapRequestBuilder.build()).array());
     }
 
index 6e9e05c1ae61b61a6aa4bf5f4869102a3d618f4a..6c7c4b81f5c4e93697856fb1200f7dc3be3e7615 100644 (file)
@@ -58,6 +58,7 @@ import org.opendaylight.lispflowmapping.interfaces.lisp.IFlowMapping;
 import org.opendaylight.lispflowmapping.type.AddressFamilyNumberEnum;
 import org.opendaylight.lispflowmapping.type.LispCanonicalAddressFormatEnum;
 import org.opendaylight.lispflowmapping.type.sbplugin.IConfigLispPlugin;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.EidToLocatorRecord.Action;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafApplicationDataAddress;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafKeyValueAddress;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafListAddress;
@@ -76,7 +77,6 @@ import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.XtrRequestMapping;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidrecords.EidRecord;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidrecords.EidRecordBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord;
-import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord.Action;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecordBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lcafkeyvalueaddress.KeyBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lcafkeyvalueaddress.ValueBuilder;
index 0f77bcb85784e71257e2ad41f261785f5c013d1d..9f527607ca386c008492b763aba29244e925bf89 100644 (file)
@@ -13,12 +13,12 @@ import java.util.List;
 
 import javax.xml.bind.DatatypeConverter;
 
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.EidToLocatorRecord.Action;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispAFIAddress;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.MapRegister;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.MapRequest;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidrecords.EidRecordBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord;
-import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord.Action;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecordBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lcaflistaddress.Addresses;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lcafsourcedestaddress.DstAddress;
@@ -91,82 +91,73 @@ public class YangTransformerNB {
     public static LispAFIAddress toAFI(LispAddressContainer container) {
         return (LispAFIAddress) container.getAddress();
     }
-    
+
     public static PrimitiveAddress toPrimitive(LispAFIAddress address) {
         if (address instanceof Ipv4) {
             return new org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.Ipv4Builder()
-               .setIpv4Address(((Ipv4) address).getIpv4Address())
-               .setAfi(address.getAfi())
-               .build();
+                    .setIpv4Address(((Ipv4) address).getIpv4Address()).setAfi(address.getAfi()).build();
         }
         if (address instanceof Ipv6) {
             return new org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.Ipv6Builder()
-               .setIpv6Address(((Ipv6) address).getIpv6Address())
-               .setAfi(address.getAfi())
-               .build();
+                    .setIpv6Address(((Ipv6) address).getIpv6Address()).setAfi(address.getAfi()).build();
         }
         if (address instanceof Mac) {
             return new org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.MacBuilder()
-               .setAfi(address.getAfi())
-               .setMacAddress(((Mac) address).getMacAddress())
-               .build();
+                    .setAfi(address.getAfi()).setMacAddress(((Mac) address).getMacAddress()).build();
         }
         if (address instanceof DistinguishedName) {
             return new org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.DistinguishedNameBuilder()
-               .setAfi(address.getAfi())
-               .setDistinguishedName(((DistinguishedName) address).getDistinguishedName())
-               .build();
+                    .setAfi(address.getAfi()).setDistinguishedName(((DistinguishedName) address).getDistinguishedName()).build();
         }
         if (address instanceof AS) {
-            return new org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.ASBuilder()
-               .setAfi(address.getAfi())
-               .setAS(((AS) address).getAS())
-               .build();
+            return new org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.ASBuilder().setAfi(address.getAfi())
+                    .setAS(((AS) address).getAS()).build();
         }
         return null;
     }
-    
+
     public static LispAFIAddress toAFIfromPrimitive(PrimitiveAddress primitive) {
-    
+
         if (primitive instanceof org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.Ipv4) {
-               return new org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.Ipv4Builder()
-               .setAfi(((LispAFIAddress) primitive).getAfi())        
-               .setIpv4Address(((org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.Ipv4) primitive).getIpv4Address())
-               .build();
+            return new org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.Ipv4Builder()
+                    .setAfi(((LispAFIAddress) primitive).getAfi())
+                    .setIpv4Address(
+                            ((org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.Ipv4) primitive)
+                                    .getIpv4Address()).build();
         }
         if (primitive instanceof org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.Ipv6) {
             return new org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.Ipv6Builder()
-               .setAfi(((LispAFIAddress) primitive).getAfi())        
-               .setIpv6Address(((org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.Ipv6) primitive).getIpv6Address())    
-               .build();
+                    .setAfi(((LispAFIAddress) primitive).getAfi())
+                    .setIpv6Address(
+                            ((org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.Ipv6) primitive)
+                                    .getIpv6Address()).build();
         }
         if (primitive instanceof org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.Mac) {
             return new org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.MacBuilder()
-               .setAfi(((LispAFIAddress) primitive).getAfi())
-               .setMacAddress(((org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.Mac) primitive).getMacAddress())
-               .build();
+                    .setAfi(((LispAFIAddress) primitive).getAfi())
+                    .setMacAddress(
+                            ((org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.Mac) primitive)
+                                    .getMacAddress()).build();
         }
         if (primitive instanceof org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.DistinguishedName) {
             return new org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.DistinguishedNameBuilder()
-               .setAfi(((LispAFIAddress) primitive).getAfi())
-               .setDistinguishedName(((org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.DistinguishedName) primitive).getDistinguishedName())
-               .build();
+                    .setAfi(((LispAFIAddress) primitive).getAfi())
+                    .setDistinguishedName(
+                            ((org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.DistinguishedName) primitive)
+                                    .getDistinguishedName()).build();
         }
         if (primitive instanceof org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.AS) {
             return new org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.ASBuilder()
-               .setAfi(((LispAFIAddress) primitive).getAfi())
-               .setAS(((org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.AS) primitive).getAS())
-               .build();
+                    .setAfi(((LispAFIAddress) primitive).getAfi())
+                    .setAS(((org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.AS) primitive).getAS())
+                    .build();
         }
         return null;
     }
-    
-    
-    
-    
+
     public static LispAddressContainer transformLispAddress(LispAddress lispAddress) {
 
-       if (lispAddress == null) {
+        if (lispAddress == null) {
             return null;
         }
 
@@ -187,7 +178,7 @@ public class YangTransformerNB {
             lispAFIAddress = new ASBuilder().setAS(lispASAddress.getAS()).setAfi(ianaCode).build();
             break;
         case DISTINGUISHED_NAME:
-               LispDistinguishedNameAddress lispDNAddress = (LispDistinguishedNameAddress) lispAddress;
+            LispDistinguishedNameAddress lispDNAddress = (LispDistinguishedNameAddress) lispAddress;
             lispAFIAddress = new DistinguishedNameBuilder().setDistinguishedName(lispDNAddress.getDistinguishedName()).setAfi(ianaCode).build();
             break;
         case IP6:
@@ -195,175 +186,137 @@ public class YangTransformerNB {
             Ipv6Address ipv6Address = new Ipv6Address(lispIpv6Address.getAddress().getHostAddress());
             lispAFIAddress = new Ipv6Builder().setIpv6Address(ipv6Address).setAfi(ianaCode).build();
             break;
-            
+
         case MAC:
-               lispAFIAddress = transformLispMACAddress(lispAddress);
+            lispAFIAddress = transformLispMACAddress(lispAddress);
             break;
-            
+
         case LCAF:
-               
-               LispLCAFAddress lispLcafAddress = (LispLCAFAddress) lispAddress;
-               LispCanonicalAddressFormatEnum lcafEnum = lispLcafAddress.getType();
-               
-               switch(lcafEnum){
-                       case APPLICATION_DATA:
-                               lispAFIAddress = transformLispApplicationDataLCAFAddress(lispLcafAddress);
-                               break;
-                       case LIST:
-                               lispAFIAddress = transformLispListLCAFAddress(lispLcafAddress);
-                               break;
-                       case SEGMENT:
-                               lispAFIAddress = transformLispSegmentLCAFAddress(lispLcafAddress);
-                               break;
-                       case SOURCE_DEST:
-                               lispAFIAddress = transformLispSourceDestLCAFAddress(lispLcafAddress);
-                               break;
-                       case TRAFFIC_ENGINEERING:
-                               lispAFIAddress = transformLispTrafficEngineeringLCAFAddress(lispLcafAddress);
-                               break;
-                       case UNKNOWN:
-                       default:
-                               throw new IllegalArgumentException("LCAF type " + lcafEnum + " not supported by this transoformer");
-               }
+
+            LispLCAFAddress lispLcafAddress = (LispLCAFAddress) lispAddress;
+            LispCanonicalAddressFormatEnum lcafEnum = lispLcafAddress.getType();
+
+            switch (lcafEnum) {
+            case APPLICATION_DATA:
+                lispAFIAddress = transformLispApplicationDataLCAFAddress(lispLcafAddress);
+                break;
+            case LIST:
+                lispAFIAddress = transformLispListLCAFAddress(lispLcafAddress);
+                break;
+            case SEGMENT:
+                lispAFIAddress = transformLispSegmentLCAFAddress(lispLcafAddress);
+                break;
+            case SOURCE_DEST:
+                lispAFIAddress = transformLispSourceDestLCAFAddress(lispLcafAddress);
+                break;
+            case TRAFFIC_ENGINEERING:
+                lispAFIAddress = transformLispTrafficEngineeringLCAFAddress(lispLcafAddress);
+                break;
+            case UNKNOWN:
+            default:
+                throw new IllegalArgumentException("LCAF type " + lcafEnum + " not supported by this transoformer");
+            }
             break;
 
-        case UNKNOWN:            
+        case UNKNOWN:
         default:
-               throw new IllegalArgumentException("AFI " + lispAddress.getAfi() + " not supported by this transformer");
+            throw new IllegalArgumentException("AFI " + lispAddress.getAfi() + " not supported by this transformer");
         }
 
         return toContainer(lispAFIAddress);
 
     }
-    
+
     public static LispAFIAddress transformLispMACAddress(LispAddress lispAddress) {
-       LispMACAddress lispMacAddress = (LispMACAddress) lispAddress;           
+        LispMACAddress lispMacAddress = (LispMACAddress) lispAddress;
         StringBuilder sb = new StringBuilder(17);
         for (byte b : lispMacAddress.getMAC()) {
             if (sb.length() > 0)
                 sb.append(':');
             sb.append(String.format("%02x", b));
         }
-        
-        return new MacBuilder()
-               .setAfi(lispMacAddress.getAfi().getIanaCode())
-               .setMacAddress(new MacAddress(sb.toString()))
-               .build();
+
+        return new MacBuilder().setAfi(lispMacAddress.getAfi().getIanaCode()).setMacAddress(new MacAddress(sb.toString())).build();
     }
-    
+
     public static LispAFIAddress transformLispApplicationDataLCAFAddress(LispLCAFAddress lispLcafAddress) {
-       LispApplicationDataLCAFAddress lispApplicationDataLCAFAddress = (LispApplicationDataLCAFAddress) lispLcafAddress;
-       org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lcafapplicationdataaddress.Address address;
-       address = new org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lcafapplicationdataaddress.AddressBuilder()
-               .setPrimitiveAddress(toPrimitive(toAFI(transformLispAddress(lispApplicationDataLCAFAddress.getAddress()))))
-               .build();
-               return new LcafApplicationDataBuilder()
-                       .setAfi(lispLcafAddress.getAfi().getIanaCode())
-                       .setLcafType((short) lispLcafAddress.getType().getLispCode())
-                       .setIpTos(lispApplicationDataLCAFAddress.getIPTos())
-                       .setLocalPort(new PortNumber((int) lispApplicationDataLCAFAddress.getLocalPort()))
-                       .setRemotePort(new PortNumber((int) lispApplicationDataLCAFAddress.getRemotePort()))
-                       .setAddress(address)
-                       .build();
+        LispApplicationDataLCAFAddress lispApplicationDataLCAFAddress = (LispApplicationDataLCAFAddress) lispLcafAddress;
+        org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lcafapplicationdataaddress.Address address;
+        address = new org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lcafapplicationdataaddress.AddressBuilder().setPrimitiveAddress(
+                toPrimitive(toAFI(transformLispAddress(lispApplicationDataLCAFAddress.getAddress())))).build();
+        return new LcafApplicationDataBuilder().setAfi(lispLcafAddress.getAfi().getIanaCode())
+                .setLcafType((short) lispLcafAddress.getType().getLispCode()).setIpTos(lispApplicationDataLCAFAddress.getIPTos())
+                .setLocalPort(new PortNumber((int) lispApplicationDataLCAFAddress.getLocalPort()))
+                .setRemotePort(new PortNumber((int) lispApplicationDataLCAFAddress.getRemotePort())).setAddress(address).build();
     }
-    
+
     public static LispAFIAddress transformLispListLCAFAddress(LispLCAFAddress lispLcafAddress) {
-       
-       LispListLCAFAddress lispListLCAFAddress = (LispListLCAFAddress) lispLcafAddress;
-               
-               List<Addresses> listAddresses = new ArrayList<Addresses>();
-               
-               for (int i=0; i<lispListLCAFAddress.getAddresses().size(); i++){
-                       org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lcaflistaddress.Addresses addresses;
-                       addresses = new org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lcaflistaddress.AddressesBuilder()
-                               .setPrimitiveAddress(toPrimitive(toAFI(transformLispAddress(lispListLCAFAddress.getAddresses().get(i)))))
-                               .build();
-                       listAddresses.add(addresses);
-               }
-               
-               return new LcafListBuilder()
-                       .setAfi(lispLcafAddress.getAfi().getIanaCode())
-                       .setLcafType((short) lispLcafAddress.getType().getLispCode())
-                       .setAddresses(listAddresses)
-                       .build();
+
+        LispListLCAFAddress lispListLCAFAddress = (LispListLCAFAddress) lispLcafAddress;
+
+        List<Addresses> listAddresses = new ArrayList<Addresses>();
+
+        for (int i = 0; i < lispListLCAFAddress.getAddresses().size(); i++) {
+            org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lcaflistaddress.Addresses addresses;
+            addresses = new org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lcaflistaddress.AddressesBuilder().setPrimitiveAddress(
+                    toPrimitive(toAFI(transformLispAddress(lispListLCAFAddress.getAddresses().get(i))))).build();
+            listAddresses.add(addresses);
+        }
+
+        return new LcafListBuilder().setAfi(lispLcafAddress.getAfi().getIanaCode()).setLcafType((short) lispLcafAddress.getType().getLispCode())
+                .setAddresses(listAddresses).build();
     }
 
     public static LispAFIAddress transformLispSegmentLCAFAddress(LispLCAFAddress lispLcafAddress) {
-       LispSegmentLCAFAddress lispSegmentLCAFAddress = (LispSegmentLCAFAddress) lispLcafAddress;
-       org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lcafsegmentaddress.Address address;
-       address = new org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lcafsegmentaddress.AddressBuilder()
-               .setPrimitiveAddress(toPrimitive(toAFI(transformLispAddress(lispSegmentLCAFAddress.getAddress()))))
-               .build();
-       
-               return new LcafSegmentBuilder()
-                       .setAfi(lispLcafAddress.getAfi().getIanaCode())
-                       .setLcafType((short) lispLcafAddress.getType().getLispCode())
-                       .setInstanceId((long) lispSegmentLCAFAddress.getInstanceId())
-                       .setAddress(address)
-                       .build();
-               
+        LispSegmentLCAFAddress lispSegmentLCAFAddress = (LispSegmentLCAFAddress) lispLcafAddress;
+        org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lcafsegmentaddress.Address address;
+        address = new org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lcafsegmentaddress.AddressBuilder().setPrimitiveAddress(
+                toPrimitive(toAFI(transformLispAddress(lispSegmentLCAFAddress.getAddress())))).build();
+
+        return new LcafSegmentBuilder().setAfi(lispLcafAddress.getAfi().getIanaCode()).setLcafType((short) lispLcafAddress.getType().getLispCode())
+                .setInstanceId((long) lispSegmentLCAFAddress.getInstanceId()).setAddress(address).build();
+
     }
-    
+
     public static LispAFIAddress transformLispSourceDestLCAFAddress(LispLCAFAddress lispLcafAddress) {
-       LispSourceDestLCAFAddress lispSourceDestLCAFAddress = (LispSourceDestLCAFAddress) lispLcafAddress;
-               
-       
-       
-       SrcAddress srcAddress = new SrcAddressBuilder()
-               .setPrimitiveAddress(toPrimitive(toAFI(transformLispAddress(lispSourceDestLCAFAddress.getSrcAddress()))))
-               .build();
-       
-       DstAddress dstAddress = new DstAddressBuilder()
-                       .setPrimitiveAddress(toPrimitive(toAFI(transformLispAddress(lispSourceDestLCAFAddress.getDstAddress()))))
-                       .build();
-       
-               return new LcafSourceDestBuilder()
-                       .setAfi(lispLcafAddress.getAfi().getIanaCode())
-                       .setLcafType((short) lispLcafAddress.getType().getLispCode())
-                       .setSrcMaskLength((short) lispSourceDestLCAFAddress.getSrcMaskLength())
-                       .setDstMaskLength((short) lispSourceDestLCAFAddress.getDstMaskLength())
-                       .setSrcAddress(srcAddress)
-                       .setDstAddress(dstAddress)
-                       .build();
+        LispSourceDestLCAFAddress lispSourceDestLCAFAddress = (LispSourceDestLCAFAddress) lispLcafAddress;
+
+        SrcAddress srcAddress = new SrcAddressBuilder().setPrimitiveAddress(
+                toPrimitive(toAFI(transformLispAddress(lispSourceDestLCAFAddress.getSrcAddress())))).build();
+
+        DstAddress dstAddress = new DstAddressBuilder().setPrimitiveAddress(
+                toPrimitive(toAFI(transformLispAddress(lispSourceDestLCAFAddress.getDstAddress())))).build();
+
+        return new LcafSourceDestBuilder().setAfi(lispLcafAddress.getAfi().getIanaCode())
+                .setLcafType((short) lispLcafAddress.getType().getLispCode()).setSrcMaskLength((short) lispSourceDestLCAFAddress.getSrcMaskLength())
+                .setDstMaskLength((short) lispSourceDestLCAFAddress.getDstMaskLength()).setSrcAddress(srcAddress).setDstAddress(dstAddress).build();
     }
-    
+
     public static LispAFIAddress transformLispTrafficEngineeringLCAFAddress(LispLCAFAddress lispLcafAddress) {
-               LispTrafficEngineeringLCAFAddress lispTrafficEngineeringLCAFAddress = (LispTrafficEngineeringLCAFAddress) lispLcafAddress;
-               
-               List<Hops> listHops = new ArrayList<Hops>();
-               
-               for (int i = 0; i < lispTrafficEngineeringLCAFAddress.getHops().size();i++){
-                       ReencapHop reencapHop = lispTrafficEngineeringLCAFAddress.getHops().get(i);
-                       
-                       org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.reencaphop.Hop hop;
-                       hop = new HopBuilder()
-                               .setPrimitiveAddress(toPrimitive(toAFI(transformLispAddress(reencapHop.getHop()))))
-                               .build();
-                       
-                       Hops hops = new HopsBuilder()
-                               .setLookup(reencapHop.isLookup())
-                               .setRLOCProbe(reencapHop.isRLOCProbe())
-                               .setStrict(reencapHop.isStrict())
-                               .setHop(hop)
-                               .build();
-                       
-                       listHops.add(hops);
-                       
-               }
-               
-               return new LcafTrafficEngineeringBuilder()
-                       .setAfi(lispLcafAddress.getAfi().getIanaCode())
-                       .setLcafType((short) lispLcafAddress.getType().getLispCode())
-                       .setHops(listHops)
-                       .build();
+        LispTrafficEngineeringLCAFAddress lispTrafficEngineeringLCAFAddress = (LispTrafficEngineeringLCAFAddress) lispLcafAddress;
+
+        List<Hops> listHops = new ArrayList<Hops>();
+
+        for (int i = 0; i < lispTrafficEngineeringLCAFAddress.getHops().size(); i++) {
+            ReencapHop reencapHop = lispTrafficEngineeringLCAFAddress.getHops().get(i);
+
+            org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.reencaphop.Hop hop;
+            hop = new HopBuilder().setPrimitiveAddress(toPrimitive(toAFI(transformLispAddress(reencapHop.getHop())))).build();
+
+            Hops hops = new HopsBuilder().setLookup(reencapHop.isLookup()).setRLOCProbe(reencapHop.isRLOCProbe()).setStrict(reencapHop.isStrict())
+                    .setHop(hop).build();
+
+            listHops.add(hops);
+
+        }
+
+        return new LcafTrafficEngineeringBuilder().setAfi(lispLcafAddress.getAfi().getIanaCode())
+                .setLcafType((short) lispLcafAddress.getType().getLispCode()).setHops(listHops).build();
     }
-    
 
-    
-    
     public static LispAddress transformToLispAddress(LispAddressContainer lispAddress) {
 
-       LispAddress legacyAddress = null;
+        LispAddress legacyAddress = null;
         LispAFIAddress address = (LispAFIAddress) lispAddress.getAddress();
         AddressFamilyNumberEnum afi = AddressFamilyNumberEnum.valueOf(address.getAfi());
 
@@ -379,142 +332,129 @@ public class YangTransformerNB {
             lispIpv6Address = (org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispIpv6Address) address;
             legacyAddress = new LispIpv6Address(lispIpv6Address.getIpv6Address().getValue());
             break;
-               case AS:
-                       org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispASAddress lispASAddress;
-                       lispASAddress = (org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispASAddress) address;
+        case AS:
+            org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispASAddress lispASAddress;
+            lispASAddress = (org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispASAddress) address;
             legacyAddress = new LispASAddress(lispASAddress.getAS());
-                       break;
-               case DISTINGUISHED_NAME:
-                       org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispDistinguishedNameAddress lispDistinguishedNameAddress;
-                       lispDistinguishedNameAddress = (org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispDistinguishedNameAddress) address;
+            break;
+        case DISTINGUISHED_NAME:
+            org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispDistinguishedNameAddress lispDistinguishedNameAddress;
+            lispDistinguishedNameAddress = (org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispDistinguishedNameAddress) address;
             legacyAddress = new LispDistinguishedNameAddress(lispDistinguishedNameAddress.getDistinguishedName());
-                       break;
-               case MAC:
-                       org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispMacAddress lispMacAddress;
-                       lispMacAddress = (org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispMacAddress) address;
-               String macString = lispMacAddress.getMacAddress().getValue();
-               macString = macString.replaceAll(":", "");
+            break;
+        case MAC:
+            org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispMacAddress lispMacAddress;
+            lispMacAddress = (org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispMacAddress) address;
+            String macString = lispMacAddress.getMacAddress().getValue();
+            macString = macString.replaceAll(":", "");
             legacyAddress = new LispMACAddress(DatatypeConverter.parseHexBinary(macString));
-                       break;
-               case NO_ADDRESS:
-                       legacyAddress = new LispNoAddress();
-                       break;
-               case LCAF:
-                       org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispLcafAddress lispLcafAddress;
-                       lispLcafAddress = (org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispLcafAddress) address;
-                       
-                       LispCanonicalAddressFormatEnum lcafEnum = 
-                                       LispCanonicalAddressFormatEnum.valueOf(lispLcafAddress.getLcafType());
-                       
-                       switch (lcafEnum){
-                       case APPLICATION_DATA:
-                               legacyAddress = transformToLispApplicationDataLCAFAddress(lispLcafAddress);
-                               break;
-                       case LIST:
-                               legacyAddress = transformToLispListLCAFAddress(lispLcafAddress);
-                               break;
-                       case SEGMENT:
-                               legacyAddress = transformToLispSegmentLCAFAddress(lispLcafAddress);
-                               break;
-                       case SOURCE_DEST:
-                               legacyAddress = transformToLispSourceDestLCAFAddress(lispLcafAddress);
-                               break;
-                       case TRAFFIC_ENGINEERING:
-                               legacyAddress = transformToLispTrafficEngineeringLCAFAddress(lispLcafAddress);
-                               break;
-                       case UNKNOWN:
-                       default:
-                               throw new IllegalArgumentException("LCAF type " + lcafEnum + " not supported by this transoformer");
-                       }
-                       break;
-               case UNKNOWN:
+            break;
+        case NO_ADDRESS:
+            legacyAddress = new LispNoAddress();
+            break;
+        case LCAF:
+            org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispLcafAddress lispLcafAddress;
+            lispLcafAddress = (org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispLcafAddress) address;
+
+            LispCanonicalAddressFormatEnum lcafEnum = LispCanonicalAddressFormatEnum.valueOf(lispLcafAddress.getLcafType());
+
+            switch (lcafEnum) {
+            case APPLICATION_DATA:
+                legacyAddress = transformToLispApplicationDataLCAFAddress(lispLcafAddress);
+                break;
+            case LIST:
+                legacyAddress = transformToLispListLCAFAddress(lispLcafAddress);
+                break;
+            case SEGMENT:
+                legacyAddress = transformToLispSegmentLCAFAddress(lispLcafAddress);
+                break;
+            case SOURCE_DEST:
+                legacyAddress = transformToLispSourceDestLCAFAddress(lispLcafAddress);
+                break;
+            case TRAFFIC_ENGINEERING:
+                legacyAddress = transformToLispTrafficEngineeringLCAFAddress(lispLcafAddress);
+                break;
+            case UNKNOWN:
+            default:
+                throw new IllegalArgumentException("LCAF type " + lcafEnum + " not supported by this transoformer");
+            }
+            break;
+        case UNKNOWN:
         default:
-               throw new IllegalArgumentException("AFI " + afi + " not supported by this transformer");
+            throw new IllegalArgumentException("AFI " + afi + " not supported by this transformer");
         }
 
         return legacyAddress;
     }
-    
-    public static LispAddress transformToLispApplicationDataLCAFAddress(org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispLcafAddress lispLcafAddress){
-       org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafApplicationDataAddress lcafApplicationDataAddress;
-               lcafApplicationDataAddress = (org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafApplicationDataAddress) lispLcafAddress; 
-               
-               return new LispApplicationDataLCAFAddress(
-                               (byte)0,
-                               lcafApplicationDataAddress.getProtocol().byteValue(),
-                               lcafApplicationDataAddress.getIpTos().intValue(),
-                               lcafApplicationDataAddress.getLocalPort().getValue().shortValue(),
-                               lcafApplicationDataAddress.getRemotePort().getValue().shortValue(),
-                               transformToLispAddress(toContainer(toAFIfromPrimitive(lcafApplicationDataAddress.getAddress().getPrimitiveAddress()))));
+
+    public static LispAddress transformToLispApplicationDataLCAFAddress(
+            org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispLcafAddress lispLcafAddress) {
+        org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafApplicationDataAddress lcafApplicationDataAddress;
+        lcafApplicationDataAddress = (org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafApplicationDataAddress) lispLcafAddress;
+
+        return new LispApplicationDataLCAFAddress((byte) 0, lcafApplicationDataAddress.getProtocol().byteValue(), lcafApplicationDataAddress
+                .getIpTos().intValue(), lcafApplicationDataAddress.getLocalPort().getValue().shortValue(), lcafApplicationDataAddress.getRemotePort()
+                .getValue().shortValue(), transformToLispAddress(toContainer(toAFIfromPrimitive(lcafApplicationDataAddress.getAddress()
+                .getPrimitiveAddress()))));
     }
-    
-    public static LispAddress transformToLispListLCAFAddress(org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispLcafAddress lispLcafAddress){
-       org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafListAddress lcafListAddress;
-               lcafListAddress = (org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafListAddress) lispLcafAddress;
-               
-               List<LispAddress> listLegacyAddress = new ArrayList<LispAddress>();
-               
-               for (int i=0;i<lcafListAddress.getAddresses().size();i++){
-                       listLegacyAddress.add(transformToLispAddress(toContainer(toAFIfromPrimitive(lcafListAddress.getAddresses().get(i).getPrimitiveAddress()))));
-               }
-               return new LispListLCAFAddress((byte)0, listLegacyAddress);
+
+    public static LispAddress transformToLispListLCAFAddress(org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispLcafAddress lispLcafAddress) {
+        org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafListAddress lcafListAddress;
+        lcafListAddress = (org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafListAddress) lispLcafAddress;
+
+        List<LispAddress> listLegacyAddress = new ArrayList<LispAddress>();
+
+        for (int i = 0; i < lcafListAddress.getAddresses().size(); i++) {
+            listLegacyAddress
+                    .add(transformToLispAddress(toContainer(toAFIfromPrimitive(lcafListAddress.getAddresses().get(i).getPrimitiveAddress()))));
+        }
+        return new LispListLCAFAddress((byte) 0, listLegacyAddress);
     }
 
-    
-    public static LispAddress transformToLispSegmentLCAFAddress(org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispLcafAddress lispLcafAddress){
-       org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafSegmentAddress lcafSegmentAddress;
-               lcafSegmentAddress = (org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafSegmentAddress) lispLcafAddress;
-               
-               byte iidMaskLen = 0;
-               
-               return new LispSegmentLCAFAddress(
-                               iidMaskLen,
-                               lcafSegmentAddress.getInstanceId().intValue(),
-                               transformToLispAddress(toContainer(toAFIfromPrimitive(lcafSegmentAddress.getAddress().getPrimitiveAddress()))));
-               
+    public static LispAddress transformToLispSegmentLCAFAddress(org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispLcafAddress lispLcafAddress) {
+        org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafSegmentAddress lcafSegmentAddress;
+        lcafSegmentAddress = (org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafSegmentAddress) lispLcafAddress;
+
+        byte iidMaskLen = 0;
+
+        return new LispSegmentLCAFAddress(iidMaskLen, lcafSegmentAddress.getInstanceId().intValue(),
+                transformToLispAddress(toContainer(toAFIfromPrimitive(lcafSegmentAddress.getAddress().getPrimitiveAddress()))));
+
     }
-    
-    public static LispAddress transformToLispSourceDestLCAFAddress(org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispLcafAddress lispLcafAddress){
-       org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafSourceDestAddress lcafSourceDestAddress;
-               lcafSourceDestAddress = (org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafSourceDestAddress) lispLcafAddress;
-               
-               return new LispSourceDestLCAFAddress(
-                               (byte) 0, 
-                               (short) 0, 
-                               lcafSourceDestAddress.getSrcMaskLength().byteValue(), 
-                               lcafSourceDestAddress.getDstMaskLength().byteValue(), 
-                               transformToLispAddress(toContainer(toAFIfromPrimitive(lcafSourceDestAddress.getSrcAddress().getPrimitiveAddress()))), 
-                               transformToLispAddress(toContainer(toAFIfromPrimitive(lcafSourceDestAddress.getDstAddress().getPrimitiveAddress()))));
-               
+
+    public static LispAddress transformToLispSourceDestLCAFAddress(
+            org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispLcafAddress lispLcafAddress) {
+        org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafSourceDestAddress lcafSourceDestAddress;
+        lcafSourceDestAddress = (org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafSourceDestAddress) lispLcafAddress;
+
+        return new LispSourceDestLCAFAddress((byte) 0, (short) 0, lcafSourceDestAddress.getSrcMaskLength().byteValue(), lcafSourceDestAddress
+                .getDstMaskLength().byteValue(), transformToLispAddress(toContainer(toAFIfromPrimitive(lcafSourceDestAddress.getSrcAddress()
+                .getPrimitiveAddress()))), transformToLispAddress(toContainer(toAFIfromPrimitive(lcafSourceDestAddress.getDstAddress()
+                .getPrimitiveAddress()))));
+
     }
 
-    public static LispAddress transformToLispTrafficEngineeringLCAFAddress(org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispLcafAddress lispLcafAddress){
-       org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafTrafficEngineeringAddress lcafTrafficEngineeringAddress;
-               lcafTrafficEngineeringAddress = (org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafTrafficEngineeringAddress) lispLcafAddress;
-               
-               List<ReencapHop> listLegacyHops = new ArrayList<ReencapHop>();
-               
-               ReencapHop legacyHop;
-               org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.ReencapHop hop;
-               
-               //for (Addresses addresses : lcafListAddress.getAddresses()){
-               for (int i=0;i<lcafTrafficEngineeringAddress.getHops().size();i++){
-                       hop = (org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.ReencapHop) lcafTrafficEngineeringAddress.getHops().get(i);
-                       
-                       legacyHop = new ReencapHop(
-                                       transformToLispAddress(toContainer(toAFIfromPrimitive(hop.getHop().getPrimitiveAddress()))),
-                                       (short) 0,
-                                       hop.isLookup(),
-                                       hop.isRLOCProbe(),
-                                       hop.isStrict());
-                       
-                       listLegacyHops.add(legacyHop);
-               }
-               return new LispTrafficEngineeringLCAFAddress((byte)0, listLegacyHops);
+    public static LispAddress transformToLispTrafficEngineeringLCAFAddress(
+            org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispLcafAddress lispLcafAddress) {
+        org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafTrafficEngineeringAddress lcafTrafficEngineeringAddress;
+        lcafTrafficEngineeringAddress = (org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafTrafficEngineeringAddress) lispLcafAddress;
+
+        List<ReencapHop> listLegacyHops = new ArrayList<ReencapHop>();
+
+        ReencapHop legacyHop;
+        org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.ReencapHop hop;
+
+        // for (Addresses addresses : lcafListAddress.getAddresses()){
+        for (int i = 0; i < lcafTrafficEngineeringAddress.getHops().size(); i++) {
+            hop = (org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.ReencapHop) lcafTrafficEngineeringAddress.getHops().get(i);
+
+            legacyHop = new ReencapHop(transformToLispAddress(toContainer(toAFIfromPrimitive(hop.getHop().getPrimitiveAddress()))), (short) 0,
+                    hop.isLookup(), hop.isRLOCProbe(), hop.isStrict());
+
+            listLegacyHops.add(legacyHop);
+        }
+        return new LispTrafficEngineeringLCAFAddress((byte) 0, listLegacyHops);
     }
-    
-    
-    
 
     public static MapRegister transformMapRegister(org.opendaylight.lispflowmapping.type.lisp.MapRegister legacyMapRegister) {
 
@@ -582,13 +522,10 @@ public class YangTransformerNB {
 
             legacyLocatorRecord.setLocator(YangTransformerNB.transformToLispAddress(rloc));
 
-            legacyLocatorRecord.setLocalLocator(locatorRecord.isLocalLocator())
-                               .setPriority(locatorRecord.getPriority())
-                               .setWeight(locatorRecord.getWeight())
-                               .setMulticastPriority(locatorRecord.getMulticastPriority())
-                               .setMulticastWeight(locatorRecord.getMulticastWeight())
-                               .setRlocProbed(locatorRecord.isRlocProbed())
-                               .setRouted(locatorRecord.isRouted());
+            legacyLocatorRecord.setLocalLocator(locatorRecord.isLocalLocator()).setPriority(locatorRecord.getPriority())
+                    .setWeight(locatorRecord.getWeight()).setMulticastPriority(locatorRecord.getMulticastPriority())
+                    .setMulticastWeight(locatorRecord.getMulticastWeight()).setRlocProbed(locatorRecord.isRlocProbed())
+                    .setRouted(locatorRecord.isRouted());
 
             legacyRecord.addLocator(legacyLocatorRecord);
         }
index 27d24d527a478ef7f0e9a777b3db628c3e18371e..6628ea011e278a2020a21db50314ecdffb95a5a8 100644 (file)
@@ -37,13 +37,13 @@ import org.opendaylight.lispflowmapping.southbound.lisp.exception.LispMalformedP
 import org.opendaylight.lispflowmapping.tools.junit.BaseTestCase;
 import org.opendaylight.lispflowmapping.type.AddressFamilyNumberEnum;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.AddMapping;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.EidToLocatorRecord.Action;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispAFIAddress;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.MapRegister;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.MapRequest;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.RequestMapping;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidrecords.EidRecord;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord;
-import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord.Action;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecordBuilder;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.LispAddressContainer;
 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.LispAddressContainerBuilder;
index 7f4606296830040b3e8bbedc1bf5be76223f6bc0..fea73786ab511fb50ff91f72ef7a33517219d443 100755 (executable)
     }  
     }
     
-    grouping EidToLocatorRecords {
-    list EidToLocatorRecord {          
+    grouping EidToLocatorRecord {      
        leaf recordTtl {
                type int32;
        }
         // locator record list
         uses LocatorRecords;
     }
+    
+    grouping EidToLocatorRecords {
+       list eidToLocatorRecord {
+               uses EidToLocatorRecord;
+       }
     }
     
     grouping MapRegister {
                uses LispAddress; 
        }
        uses EidRecords;
-       container MapReply {
-               uses MapReply;
+       container MapReply
+               uses EidToLocatorRecord;
        }
     }