Remove deprecated methods 86/57886/3
authorClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Thu, 25 May 2017 08:04:02 +0000 (10:04 +0200)
committerDana Kutenicsova <dana.kutenics@gmail.com>
Thu, 1 Jun 2017 13:04:25 +0000 (13:04 +0000)
Change-Id: I8d38181081702c692a4d093761b95d5a2dddeca2
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
36 files changed:
bgp/bmp-parser-impl/src/main/java/org/opendaylight/protocol/bmp/parser/message/InitiationHandler.java
bgp/bmp-parser-impl/src/main/java/org/opendaylight/protocol/bmp/parser/message/PeerDownHandler.java
bgp/bmp-parser-impl/src/main/java/org/opendaylight/protocol/bmp/parser/message/PeerUpHandler.java
bgp/bmp-parser-impl/src/main/java/org/opendaylight/protocol/bmp/parser/message/RouteMonitoringMessageHandler.java
bgp/inet/src/test/java/org/opendaylight/protocol/bgp/inet/codec/BGPParserTest.java
bgp/inet/src/test/java/org/opendaylight/protocol/bgp/inet/codec/Ipv4NlriParserTest.java
bgp/labeled-unicast/src/main/java/org/opendaylight/protocol/bgp/labeled/unicast/LUNlriParser.java
bgp/labeled-unicast/src/test/java/org/opendaylight/protocol/bgp/labeled/unicast/LUNlriParserTest.java
bgp/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/impl/tlvs/ReachTlvParser.java
bgp/linkstate/src/test/java/org/opendaylight/protocol/bgp/linkstate/ParserTest.java
bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/ParserTest.java
bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/PathAttributeParserTest.java
bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/CommunitiesAttributeParserTest.java
bgp/parser-mock/src/main/java/org/opendaylight/protocol/bgp/parser/mock/BGPMessageParserMock.java
bgp/parser-mock/src/test/java/org/opendaylight/protocol/bgp/parser/mock/BGPMessageParserMockTest.java
bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/AbstractMessageRegistry.java
bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/AttributeRegistry.java
bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/BGPExtensionProviderContext.java
bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/MessageRegistry.java
bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/NlriRegistry.java
bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/pojo/SimpleAttributeRegistry.java
bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/pojo/SimpleBGPExtensionProviderContext.java
bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/pojo/SimpleNlriRegistry.java
bgp/parser-spi/src/test/java/org/opendaylight/protocol/bgp/parser/spi/AbstractMessageRegistryTest.java
bgp/parser-spi/src/test/java/org/opendaylight/protocol/bgp/parser/spi/pojo/UnrecognizedAttributesTest.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/PeerExportGroupImpl.java
bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/ExportPolicyPeerTracker.java
bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/PeerExportGroup.java
bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/RouteEncoder.java [deleted file]
bgp/topology-provider/src/main/java/org/opendaylight/bgpcep/bgp/topology/provider/AbstractTopologyBuilder.java
bgp/topology-provider/src/test/java/org/opendaylight/bgpcep/bgp/topology/provider/Ipv4ReachabilityTopologyBuilderTest.java
bgp/topology-provider/src/test/java/org/opendaylight/bgpcep/bgp/topology/provider/Ipv6ReachabilityTopologyBuilderTest.java
bgp/topology-provider/src/test/java/org/opendaylight/bgpcep/bgp/topology/provider/LinkstateTopologyBuilderTest.java
util/src/main/java/org/opendaylight/protocol/util/Ipv4Util.java
util/src/main/java/org/opendaylight/protocol/util/Ipv6Util.java
util/src/test/java/org/opendaylight/protocol/util/IPAddressesAndPrefixesTest.java

index 325159fec529f1b3b60673618c9aa0e0a6934ecb..4b57c329241f7306a3c9982ddca10f837916c58e 100644 (file)
@@ -27,9 +27,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.mess
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev150512.string.tlv.StringTlvBuilder;
 import org.opendaylight.yangtools.yang.binding.Notification;
 
-/**
- * Created by cgasparini on 13.5.2015.
- */
 public class InitiationHandler extends AbstractBmpMessageWithTlvParser<TlvsBuilder> {
 
     public InitiationHandler(final BmpTlvRegistry tlvRegistry) {
index bfbb95a471d6919b2e303c4566357d4f9954b98c..02a8fd79d7756fc7a1aee6179ef1cbfc2b720d84 100644 (file)
@@ -34,9 +34,11 @@ import org.opendaylight.yangtools.yang.binding.Notification;
 public class PeerDownHandler extends AbstractBmpPerPeerMessageParser<PeerDownNotificationBuilder> {
 
     private static final int MESSAGE_TYPE = 2;
+    private final MessageRegistry msgRegistry;
 
     public PeerDownHandler(final MessageRegistry bgpMssageRegistry) {
         super(bgpMssageRegistry);
+        this.msgRegistry = getBgpMessageRegistry();
     }
 
     @Override
@@ -67,7 +69,7 @@ public class PeerDownHandler extends AbstractBmpPerPeerMessageParser<PeerDownNot
     private void serializePDU(final Data data, final ByteBuf buffer) {
         final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev150512.peer.down.data.Notification notification
             = (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev150512.peer.down.data.Notification) data;
-        this.getBgpMessageRegistry().serializeMessage(new NotifyBuilder(notification.getNotification()).build(), buffer);
+        this.msgRegistry.serializeMessage(new NotifyBuilder(notification.getNotification()).build(), buffer);
     }
 
     @Override
@@ -107,7 +109,7 @@ public class PeerDownHandler extends AbstractBmpPerPeerMessageParser<PeerDownNot
         final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev150512.peer.down.data.notification.NotificationBuilder notificationBuilder
             = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev150512.peer.down.data.notification.NotificationBuilder();
         try {
-            final Notification not = this.getBgpMessageRegistry().parseMessage(bytes);
+            final Notification not = this.msgRegistry.parseMessage(bytes, null);
             Preconditions.checkNotNull(not, "Notify message may not be null.");
             Preconditions.checkArgument(not instanceof NotifyMessage, "An instance of NotifyMessage is required");
             notificationBuilder.fieldsFrom((NotifyMessage) not);
index c797760339cf2da26433e989280faedbf8c67629..18292060f90c40ba6b0391e7f4306144f9920b8d 100644 (file)
@@ -39,21 +39,21 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.mess
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev150512.string.tlv.StringTlvBuilder;
 import org.opendaylight.yangtools.yang.binding.Notification;
 
-/**
- * Created by cgasparini on 13.5.2015.
- */
 public class PeerUpHandler extends AbstractBmpPerPeerMessageParser<InformationBuilder> {
 
     private static final int MESSAGE_TYPE = 3;
+    private final MessageRegistry msgRegistry;
 
     public PeerUpHandler(final MessageRegistry bgpMssageRegistry, final BmpTlvRegistry tlvRegistry) {
         super(bgpMssageRegistry, tlvRegistry);
+        this.msgRegistry = getBgpMessageRegistry();
     }
 
     @Override
     public void serializeMessageBody(final Notification message, final ByteBuf buffer) {
         super.serializeMessageBody(message, buffer);
-        Preconditions.checkArgument(message instanceof PeerUpNotification, "An instance of Peer Up notification is required");
+        Preconditions.checkArgument(message instanceof PeerUpNotification,
+            "An instance of Peer Up notification is required");
         final PeerUpNotification peerUp = (PeerUpNotification) message;
 
         if (peerUp.getLocalAddress().getIpv4Address() != null) {
@@ -65,8 +65,8 @@ public class PeerUpHandler extends AbstractBmpPerPeerMessageParser<InformationBu
         ByteBufWriteUtil.writeUnsignedShort(peerUp.getLocalPort().getValue(), buffer);
         ByteBufWriteUtil.writeUnsignedShort(peerUp.getRemotePort().getValue(), buffer);
 
-        getBgpMessageRegistry().serializeMessage(new OpenBuilder(peerUp.getSentOpen()).build(), buffer);
-        getBgpMessageRegistry().serializeMessage(new OpenBuilder(peerUp.getReceivedOpen()).build(), buffer);
+        this.msgRegistry.serializeMessage(new OpenBuilder(peerUp.getSentOpen()).build(), buffer);
+        this.msgRegistry.serializeMessage(new OpenBuilder(peerUp.getReceivedOpen()).build(), buffer);
         serializeTlvs(peerUp.getInformation(), buffer);
     }
 
@@ -82,7 +82,8 @@ public class PeerUpHandler extends AbstractBmpPerPeerMessageParser<InformationBu
 
     @Override
     public Notification parseMessageBody(final ByteBuf bytes) throws BmpDeserializationException {
-        final PeerUpNotificationBuilder peerUpNot = new PeerUpNotificationBuilder().setPeerHeader(parsePerPeerHeader(bytes));
+        final PeerUpNotificationBuilder peerUpNot = new PeerUpNotificationBuilder()
+            .setPeerHeader(parsePerPeerHeader(bytes));
 
         if (peerUpNot.getPeerHeader().isIpv4()) {
             bytes.skipBytes(Ipv6Util.IPV6_LENGTH - Ipv4Util.IP4_LENGTH);
@@ -93,14 +94,20 @@ public class PeerUpHandler extends AbstractBmpPerPeerMessageParser<InformationBu
         peerUpNot.setLocalPort(new PortNumber(bytes.readUnsignedShort()));
         peerUpNot.setRemotePort(new PortNumber(bytes.readUnsignedShort()));
         try {
-            final Notification opSent = getBgpMessageRegistry().parseMessage(bytes.readSlice(getBgpMessageLength(bytes)));
-            Preconditions.checkNotNull(opSent, "Error on parse Sent OPEN Message, Sent OPEN Message is null");
-            Preconditions.checkArgument(opSent instanceof OpenMessage, "An instance of OpenMessage notification is required");
+            final Notification opSent = this.msgRegistry
+                .parseMessage(bytes.readSlice(getBgpMessageLength(bytes)), null);
+            Preconditions.checkNotNull(opSent,
+                "Error on parse Sent OPEN Message, Sent OPEN Message is null");
+            Preconditions.checkArgument(opSent instanceof OpenMessage,
+                "An instance of OpenMessage notification is required");
             final OpenMessage sent = (OpenMessage) opSent;
 
-            final Notification opRec = getBgpMessageRegistry().parseMessage(bytes.readSlice(getBgpMessageLength(bytes)));
-            Preconditions.checkNotNull(opRec, "Error on parse Received  OPEN Message, Received  OPEN Message is null");
-            Preconditions.checkArgument(opRec instanceof OpenMessage, "An instance of OpenMessage notification is required");
+            final Notification opRec = this.msgRegistry
+                .parseMessage(bytes.readSlice(getBgpMessageLength(bytes)), null);
+            Preconditions.checkNotNull(opRec,
+                "Error on parse Received  OPEN Message, Received  OPEN Message is null");
+            Preconditions.checkArgument(opRec instanceof OpenMessage,
+                "An instance of OpenMessage notification is required");
             final OpenMessage received = (OpenMessage) opRec;
 
             peerUpNot.setSentOpen(new SentOpenBuilder(sent).build());
@@ -126,9 +133,8 @@ public class PeerUpHandler extends AbstractBmpPerPeerMessageParser<InformationBu
             if ( builder.getStringInformation() != null ) {
                 stringInfoListBuilder.addAll(builder.getStringInformation());
             }
-            builder.setStringInformation(stringInfoListBuilder
-                .add(new StringInformationBuilder().setStringTlv(
-                    new StringTlvBuilder((StringTlv) tlv).build()).build()).build());
+            builder.setStringInformation(stringInfoListBuilder.add(new StringInformationBuilder().setStringTlv(
+                new StringTlvBuilder((StringTlv) tlv).build()).build()).build());
         }
     }
 
index 2017863c22d6cdbb6c79134b2280606a7f06525f..c79bfdd0124c78bed0aa0113c5c52ff9d54a4c80 100644 (file)
@@ -21,15 +21,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.mess
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev150512.RouteMonitoringMessageBuilder;
 import org.opendaylight.yangtools.yang.binding.Notification;
 
-/**
- * Created by cgasparini on 13.5.2015.
- */
 public class RouteMonitoringMessageHandler extends AbstractBmpPerPeerMessageParser<RouteMonitoringMessageBuilder> {
 
     private static final int MESSAGE_TYPE = 0;
+    private final MessageRegistry msgRegistry;
 
     public RouteMonitoringMessageHandler(final MessageRegistry bgpMssageRegistry) {
         super(bgpMssageRegistry);
+        this.msgRegistry = getBgpMessageRegistry();
     }
 
     @Override
@@ -37,14 +36,14 @@ public class RouteMonitoringMessageHandler extends AbstractBmpPerPeerMessagePars
         super.serializeMessageBody(message, buffer);
         Preconditions.checkArgument(message instanceof RouteMonitoringMessage, "An instance of RouteMonitoringMessage is required");
         final RouteMonitoringMessage routeMonitor = (RouteMonitoringMessage) message;
-        getBgpMessageRegistry().serializeMessage(new UpdateBuilder(routeMonitor.getUpdate()).build(), buffer);
+        this.msgRegistry.serializeMessage(new UpdateBuilder(routeMonitor.getUpdate()).build(), buffer);
     }
 
     @Override
     public Notification parseMessageBody(final ByteBuf bytes) throws BmpDeserializationException {
         final RouteMonitoringMessageBuilder routeMonitor = new RouteMonitoringMessageBuilder().setPeerHeader(parsePerPeerHeader(bytes));
         try {
-            final Notification message = getBgpMessageRegistry().parseMessage(bytes);
+            final Notification message = this.msgRegistry.parseMessage(bytes, null);
             Preconditions.checkNotNull(message, "UpdateMessage may not be null");
             Preconditions.checkArgument(message instanceof UpdateMessage, "An instance of UpdateMessage is required");
             final UpdateMessage updateMessage = (UpdateMessage) message;
index 546b3676d2f0066d10ef44a012fe8f978004bf5b..7e2b15160e586f75e1851ff4c8d72abfe4e64918 100644 (file)
@@ -59,7 +59,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 
 public class BGPParserTest {
 
-    private static int MAX_SIZE = 300;
+    private static final int MAX_SIZE = 300;
 
     private static MessageRegistry messageRegistry;
 
index 7cb98b90b84976d2a2818e91b9e26e71d3b37cf9..61b5ff9233506b822a9f14f98a853dca2802b943 100644 (file)
@@ -28,7 +28,7 @@ import org.mockito.MockitoAnnotations;
 import org.opendaylight.protocol.bgp.parser.BGPParsingException;
 import org.opendaylight.protocol.bgp.parser.spi.MultiPathSupport;
 import org.opendaylight.protocol.bgp.parser.spi.PeerSpecificParserConstraint;
-import org.opendaylight.protocol.util.Ipv4Util;
+import org.opendaylight.protocol.util.ByteBufWriteUtil;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev150305.ipv4.prefixes.DestinationIpv4Builder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev150305.ipv4.prefixes.destination.ipv4.Ipv4Prefixes;
@@ -101,8 +101,13 @@ public class Ipv4NlriParserTest {
                 new DestinationIpv4Builder().setIpv4Prefixes(fakePrefixes).build()).build();
         this.ip4caseADWrong = new DestinationIpv4CaseBuilder().setDestinationIpv4(new DestinationIpv4Builder().setIpv4Prefixes(fakePrefixes).build()).build();
 
-        this.inputBytes.writeBytes(Ipv4Util.bytesForPrefixBegin(prefix1));
-        this.inputBytes.writeBytes(Ipv4Util.bytesForPrefixBegin(prefix2));
+        final ByteBuf buffer1 = Unpooled.buffer(5);
+        ByteBufWriteUtil.writeMinimalPrefix(prefix1, buffer1);
+        this.inputBytes.writeBytes(buffer1.array());
+
+        final ByteBuf buffer2 = Unpooled.buffer(5);
+        ByteBufWriteUtil.writeMinimalPrefix(prefix2, buffer2);
+        this.inputBytes.writeBytes(buffer2.array());
 
         Mockito.doReturn(Optional.of(this.muliPathSupport)).when(this.constraint).getPeerConstraint(Mockito.any());
         Mockito.doReturn(true).when(this.muliPathSupport).isTableTypeSupported(Mockito.any());
index eaa3e0ed8579e5f9ebc7b326291a828612a87fb7..09fec6458c39c8df09de769c9a5a76f23e0f6fa3 100644 (file)
@@ -24,6 +24,7 @@ import org.opendaylight.protocol.bgp.parser.spi.NlriSerializer;
 import org.opendaylight.protocol.bgp.parser.spi.PathIdUtil;
 import org.opendaylight.protocol.bgp.parser.spi.PeerSpecificParserConstraint;
 import org.opendaylight.protocol.util.ByteArray;
+import org.opendaylight.protocol.util.ByteBufWriteUtil;
 import org.opendaylight.protocol.util.Ipv4Util;
 import org.opendaylight.protocol.util.Ipv6Util;
 import org.opendaylight.protocol.util.MplsLabelUtil;
@@ -85,11 +86,15 @@ public class LUNlriParser implements NlriParser, NlriSerializer {
             if (mpUnreachNlri.getWithdrawnRoutes() != null) {
                 final DestinationType destinationType = mpUnreachNlri.getWithdrawnRoutes().getDestinationType();
                 if (destinationType instanceof DestinationLabeledUnicastCase) {
-                    final DestinationLabeledUnicastCase labeledUnicastCase = (DestinationLabeledUnicastCase) mpUnreachNlri.getWithdrawnRoutes().getDestinationType();
-                    serializeNlri(labeledUnicastCase.getDestinationLabeledUnicast().getCLabeledUnicastDestination(), true, byteAggregator);
+                    final DestinationLabeledUnicastCase labeledUnicastCase = (DestinationLabeledUnicastCase)
+                        mpUnreachNlri.getWithdrawnRoutes().getDestinationType();
+                    serializeNlri(labeledUnicastCase.getDestinationLabeledUnicast().getCLabeledUnicastDestination(),
+                        true, byteAggregator);
                 } else if(destinationType instanceof DestinationIpv6LabeledUnicastCase) {
-                    final DestinationIpv6LabeledUnicastCase labeledUnicastCase = (DestinationIpv6LabeledUnicastCase) mpUnreachNlri.getWithdrawnRoutes().getDestinationType();
-                    serializeNlri(labeledUnicastCase.getDestinationIpv6LabeledUnicast().getCLabeledUnicastDestination(), true, byteAggregator);
+                    final DestinationIpv6LabeledUnicastCase labeledUnicastCase = (DestinationIpv6LabeledUnicastCase)
+                        mpUnreachNlri.getWithdrawnRoutes().getDestinationType();
+                    serializeNlri(labeledUnicastCase.getDestinationIpv6LabeledUnicast().getCLabeledUnicastDestination(),
+                        true, byteAggregator);
                 }
             }
         }
@@ -143,10 +148,14 @@ public class LUNlriParser implements NlriParser, NlriSerializer {
     }
 
     private static byte[] getPrefixBytes(final IpPrefix prefix) {
+        final ByteBuf buffer = Unpooled.buffer();
+
         if (prefix.getIpv4Prefix() != null) {
-            return Ipv4Util.bytesForPrefixBegin(prefix.getIpv4Prefix());
+            ByteBufWriteUtil.writeMinimalPrefix(prefix.getIpv4Prefix(), buffer);
+        } else {
+            ByteBufWriteUtil.writeMinimalPrefix(prefix.getIpv6Prefix(), buffer);
         }
-        return Ipv6Util.bytesForPrefixBegin(prefix.getIpv6Prefix());
+        return ByteArray.readAllBytes(buffer);
     }
 
     @Override
@@ -210,12 +219,14 @@ public class LUNlriParser implements NlriParser, NlriSerializer {
     }
 
     @Override
-    public void parseNlri(@Nonnull final ByteBuf nlri, @Nonnull final MpReachNlriBuilder builder, @Nullable final PeerSpecificParserConstraint constraint) throws BGPParsingException {
+    public void parseNlri(final ByteBuf nlri, final MpReachNlriBuilder builder,
+        final PeerSpecificParserConstraint constraint) throws BGPParsingException {
         if (!nlri.isReadable()) {
             return;
         }
         final Class<? extends AddressFamily> afi = builder.getAfi();
-        final boolean mPathSupported = MultiPathSupportUtil.isTableTypeSupported(constraint, new BgpTableTypeImpl(builder.getAfi(), builder.getSafi()));
+        final boolean mPathSupported = MultiPathSupportUtil.isTableTypeSupported(constraint,
+            new BgpTableTypeImpl(builder.getAfi(), builder.getSafi()));
         final List<CLabeledUnicastDestination> dst = parseNlri(nlri, afi, mPathSupported);
 
         DestinationType destination = null;
index 695e2913383ac65c66f55c1a5160802f2135a67f..9a3681c7753188d52090925e3200c819524709b3 100755 (executable)
@@ -7,6 +7,9 @@
  */
 package org.opendaylight.protocol.bgp.labeled.unicast;
 
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+
 import com.google.common.collect.Lists;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
@@ -230,10 +233,12 @@ public class LUNlriParserTest {
         final MpReachNlriBuilder mpBuilder = new MpReachNlriBuilder();
         mpBuilder.setAfi(Ipv4AddressFamily.class);
         mpBuilder.setSafi(LabeledUnicastSubsequentAddressFamily.class);
-        final CLabeledUnicastDestination lu = new CLabeledUnicastDestinationBuilder().setPrefix(IPv4_PREFIX).setLabelStack(LABEL_STACK).build();
+        final CLabeledUnicastDestination lu = new CLabeledUnicastDestinationBuilder().setPrefix(IPv4_PREFIX)
+            .setLabelStack(LABEL_STACK).build();
         mpBuilder.setAdvertizedRoutes(new AdvertizedRoutesBuilder().setDestinationType(
             new DestinationLabeledUnicastCaseBuilder().setDestinationLabeledUnicast(
-                new DestinationLabeledUnicastBuilder().setCLabeledUnicastDestination(Lists.newArrayList(lu)).build()).build()).build());
+                new DestinationLabeledUnicastBuilder().setCLabeledUnicastDestination(Lists.newArrayList(lu)).build())
+                .build()).build());
         final MpReachNlri mpReachExpected = mpBuilder.build();
 
         //test parser
@@ -241,13 +246,13 @@ public class LUNlriParserTest {
         testBuilder.setAfi(Ipv4AddressFamily.class);
         testBuilder.setSafi(LabeledUnicastSubsequentAddressFamily.class);
         parser.parseNlri(Unpooled.copiedBuffer(LU_REACH_NLRI_IPv4), testBuilder);
-        Assert.assertEquals(mpReachExpected, testBuilder.build());
+        assertEquals(mpReachExpected, testBuilder.build());
 
         //test serializer
         final ByteBuf output = Unpooled.buffer();
         parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes1.class,
             new Attributes1Builder().setMpReachNlri(mpReachExpected).build()).build(), output);
-        Assert.assertArrayEquals(LU_REACH_NLRI_IPv4, ByteArray.readAllBytes(output));
+        assertArrayEquals(LU_REACH_NLRI_IPv4, ByteArray.readAllBytes(output));
     }
 
     @Test
@@ -256,11 +261,13 @@ public class LUNlriParserTest {
         final MpReachNlriBuilder mpBuilder = new MpReachNlriBuilder();
         mpBuilder.setAfi(Ipv4AddressFamily.class);
         mpBuilder.setSafi(LabeledUnicastSubsequentAddressFamily.class);
-        final CLabeledUnicastDestination lu = new CLabeledUnicastDestinationBuilder().setPathId(PATH_ID).setPrefix(IPv4_PREFIX).setLabelStack
+        final CLabeledUnicastDestination lu = new CLabeledUnicastDestinationBuilder().setPathId(PATH_ID)
+            .setPrefix(IPv4_PREFIX).setLabelStack
             (LABEL_STACK).build();
         mpBuilder.setAdvertizedRoutes(new AdvertizedRoutesBuilder().setDestinationType(
             new DestinationLabeledUnicastCaseBuilder().setDestinationLabeledUnicast(
-                new DestinationLabeledUnicastBuilder().setCLabeledUnicastDestination(Lists.newArrayList(lu)).build()).build()).build());
+                new DestinationLabeledUnicastBuilder().setCLabeledUnicastDestination(Lists.newArrayList(lu))
+                    .build()).build()).build());
         final MpReachNlri mpReachExpected = mpBuilder.build();
 
         //test parser
@@ -268,13 +275,13 @@ public class LUNlriParserTest {
         testBuilder.setAfi(Ipv4AddressFamily.class);
         testBuilder.setSafi(LabeledUnicastSubsequentAddressFamily.class);
         parser.parseNlri(Unpooled.copiedBuffer(LU_REACH_NLRI_IPv4_ADD_PATH), testBuilder, this.constraint);
-        Assert.assertEquals(mpReachExpected, testBuilder.build());
+        assertEquals(mpReachExpected, testBuilder.build());
 
         //test serializer
         final ByteBuf output = Unpooled.buffer();
         parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes1.class,
             new Attributes1Builder().setMpReachNlri(mpReachExpected).build()).build(), output);
-        Assert.assertArrayEquals(LU_REACH_NLRI_IPv4_ADD_PATH, ByteArray.readAllBytes(output));
+        assertArrayEquals(LU_REACH_NLRI_IPv4_ADD_PATH, ByteArray.readAllBytes(output));
     }
 
     @Test
@@ -286,15 +293,24 @@ public class LUNlriParserTest {
 
         final CLabeledUnicastDestination lu1 = new CLabeledUnicastDestinationBuilder().setPrefix(IPv4_PREFIX).build();
         mpBuilder.setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(
-            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev150525.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationLabeledUnicastCaseBuilder().setDestinationLabeledUnicast(
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev150525.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.destination.labeled.unicast._case.DestinationLabeledUnicastBuilder().setCLabeledUnicastDestination(Lists.newArrayList(lu1)).build())
+            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev150525.update
+                .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationLabeledUnicastCaseBuilder()
+                .setDestinationLabeledUnicast(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp
+                    .labeled.unicast.rev150525.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type
+                    .destination.labeled.unicast._case.DestinationLabeledUnicastBuilder()
+                    .setCLabeledUnicastDestination(Lists.newArrayList(lu1)).build())
                 .build()).build());
         final MpUnreachNlri mpUnreachExpected1 = mpBuilder.build();
 
-        final CLabeledUnicastDestination lu2 = new CLabeledUnicastDestinationBuilder().setPrefix(IPv4_PREFIX).setLabelStack(LABEL_STACK).build();
+        final CLabeledUnicastDestination lu2 = new CLabeledUnicastDestinationBuilder().setPrefix(IPv4_PREFIX)
+            .setLabelStack(LABEL_STACK).build();
         mpBuilder.setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(
-            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev150525.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationLabeledUnicastCaseBuilder().setDestinationLabeledUnicast(
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev150525.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.destination.labeled.unicast._case.DestinationLabeledUnicastBuilder().setCLabeledUnicastDestination(Lists.newArrayList(lu2)).build())
+            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev150525.update
+                .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationLabeledUnicastCaseBuilder()
+                .setDestinationLabeledUnicast(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp
+                    .labeled.unicast.rev150525.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.
+                    destination.labeled.unicast._case.DestinationLabeledUnicastBuilder()
+                    .setCLabeledUnicastDestination(Lists.newArrayList(lu2)).build())
                 .build()).build());
         final MpUnreachNlri mpUnreachExpected2 = mpBuilder.build();
 
@@ -303,18 +319,18 @@ public class LUNlriParserTest {
         testBuilder.setAfi(Ipv4AddressFamily.class);
         testBuilder.setSafi(LabeledUnicastSubsequentAddressFamily.class);
         parser.parseNlri(Unpooled.copiedBuffer(LU_UNREACH_NLRI_IPv4), testBuilder);
-        Assert.assertEquals(mpUnreachExpected1, testBuilder.build());
+        assertEquals(mpUnreachExpected1, testBuilder.build());
 
         //test serializer
         final ByteBuf output = Unpooled.buffer();
         parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class,
             new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected2).build()).build(), output);
-        Assert.assertArrayEquals(LU_UNREACH_NLRI_IPv4, ByteArray.readAllBytes(output));
+        assertArrayEquals(LU_UNREACH_NLRI_IPv4, ByteArray.readAllBytes(output));
 
         final ByteBuf output1 = Unpooled.buffer();
         parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class,
             new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected1).build()).build(), output1);
-        Assert.assertArrayEquals(LU_UNREACH_NLRI_IPv4, ByteArray.readAllBytes(output1));
+        assertArrayEquals(LU_UNREACH_NLRI_IPv4, ByteArray.readAllBytes(output1));
     }
 
     @Test
@@ -324,17 +340,27 @@ public class LUNlriParserTest {
         mpBuilder.setAfi(Ipv4AddressFamily.class);
         mpBuilder.setSafi(LabeledUnicastSubsequentAddressFamily.class);
 
-        final CLabeledUnicastDestination lu1 = new CLabeledUnicastDestinationBuilder().setPathId(PATH_ID).setPrefix(IPv4_PREFIX).build();
+        final CLabeledUnicastDestination lu1 = new CLabeledUnicastDestinationBuilder().setPathId(PATH_ID)
+            .setPrefix(IPv4_PREFIX).build();
         mpBuilder.setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(
-            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev150525.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationLabeledUnicastCaseBuilder().setDestinationLabeledUnicast(
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev150525.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.destination.labeled.unicast._case.DestinationLabeledUnicastBuilder().setCLabeledUnicastDestination(Lists.newArrayList(lu1)).build())
+            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev150525.update
+                .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationLabeledUnicastCaseBuilder()
+                .setDestinationLabeledUnicast(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp
+                    .labeled.unicast.rev150525.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type
+                    .destination.labeled.unicast._case.DestinationLabeledUnicastBuilder()
+                    .setCLabeledUnicastDestination(Lists.newArrayList(lu1)).build())
                 .build()).build());
         final MpUnreachNlri mpUnreachExpected1 = mpBuilder.build();
 
-        final CLabeledUnicastDestination lu2 = new CLabeledUnicastDestinationBuilder().setPathId(PATH_ID).setPrefix(IPv4_PREFIX).setLabelStack(LABEL_STACK).build();
+        final CLabeledUnicastDestination lu2 = new CLabeledUnicastDestinationBuilder().setPathId(PATH_ID)
+            .setPrefix(IPv4_PREFIX).setLabelStack(LABEL_STACK).build();
         mpBuilder.setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(
-            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev150525.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationLabeledUnicastCaseBuilder().setDestinationLabeledUnicast(
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev150525.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.destination.labeled.unicast._case.DestinationLabeledUnicastBuilder().setCLabeledUnicastDestination(Lists.newArrayList(lu2)).build())
+            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev150525.update
+                .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationLabeledUnicastCaseBuilder()
+                .setDestinationLabeledUnicast(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp
+                    .labeled.unicast.rev150525.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type
+                    .destination.labeled.unicast._case.DestinationLabeledUnicastBuilder()
+                    .setCLabeledUnicastDestination(Lists.newArrayList(lu2)).build())
                 .build()).build());
         final MpUnreachNlri mpUnreachExpected2 = mpBuilder.build();
 
@@ -343,18 +369,18 @@ public class LUNlriParserTest {
         testBuilder.setAfi(Ipv4AddressFamily.class);
         testBuilder.setSafi(LabeledUnicastSubsequentAddressFamily.class);
         parser.parseNlri(Unpooled.copiedBuffer(LU_UNREACH_NLRI_IPv4_ADD_PATH), testBuilder, this.constraint);
-        Assert.assertEquals(mpUnreachExpected1, testBuilder.build());
+        assertEquals(mpUnreachExpected1, testBuilder.build());
 
         //test serializer
         final ByteBuf output = Unpooled.buffer();
         parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class,
             new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected2).build()).build(), output);
-        Assert.assertArrayEquals(LU_UNREACH_NLRI_IPv4_ADD_PATH, ByteArray.readAllBytes(output));
+        assertArrayEquals(LU_UNREACH_NLRI_IPv4_ADD_PATH, ByteArray.readAllBytes(output));
 
         final ByteBuf output1 = Unpooled.buffer();
         parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class,
             new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected1).build()).build(), output1);
-        Assert.assertArrayEquals(LU_UNREACH_NLRI_IPv4_ADD_PATH, ByteArray.readAllBytes(output1));
+        assertArrayEquals(LU_UNREACH_NLRI_IPv4_ADD_PATH, ByteArray.readAllBytes(output1));
     }
 
     @Test
@@ -363,9 +389,12 @@ public class LUNlriParserTest {
         final MpReachNlriBuilder mpBuilder = new MpReachNlriBuilder();
         mpBuilder.setAfi(Ipv6AddressFamily.class);
         mpBuilder.setSafi(LabeledUnicastSubsequentAddressFamily.class);
-        final CLabeledUnicastDestination lu = new CLabeledUnicastDestinationBuilder().setPrefix(IPv6_PREFIX).setLabelStack(LABEL_STACK).build();
-        mpBuilder.setAdvertizedRoutes(new AdvertizedRoutesBuilder().setDestinationType(new DestinationIpv6LabeledUnicastCaseBuilder()
-            .setDestinationIpv6LabeledUnicast(new DestinationIpv6LabeledUnicastBuilder().setCLabeledUnicastDestination(Lists.newArrayList(lu)).build())
+        final CLabeledUnicastDestination lu = new CLabeledUnicastDestinationBuilder().setPrefix(IPv6_PREFIX)
+            .setLabelStack(LABEL_STACK).build();
+        mpBuilder.setAdvertizedRoutes(new AdvertizedRoutesBuilder().setDestinationType(
+            new DestinationIpv6LabeledUnicastCaseBuilder()
+            .setDestinationIpv6LabeledUnicast(new DestinationIpv6LabeledUnicastBuilder()
+                .setCLabeledUnicastDestination(Lists.newArrayList(lu)).build())
             .build()).build());
         final MpReachNlri mpReachExpected = mpBuilder.build();
 
@@ -374,13 +403,13 @@ public class LUNlriParserTest {
         testBuilder.setAfi(Ipv6AddressFamily.class);
         testBuilder.setSafi(LabeledUnicastSubsequentAddressFamily.class);
         parser.parseNlri(Unpooled.copiedBuffer(LU_REACH_NLRI_IPv6), testBuilder);
-        Assert.assertEquals(mpReachExpected, testBuilder.build());
+        assertEquals(mpReachExpected, testBuilder.build());
 
         //test serializer
         final ByteBuf output = Unpooled.buffer();
         parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes1.class,
             new Attributes1Builder().setMpReachNlri(mpReachExpected).build()).build(), output);
-        Assert.assertArrayEquals(LU_REACH_NLRI_IPv6, ByteArray.readAllBytes(output));
+        assertArrayEquals(LU_REACH_NLRI_IPv6, ByteArray.readAllBytes(output));
     }
 
     @Test
@@ -389,11 +418,12 @@ public class LUNlriParserTest {
         final MpReachNlriBuilder mpBuilder = new MpReachNlriBuilder();
         mpBuilder.setAfi(Ipv6AddressFamily.class);
         mpBuilder.setSafi(LabeledUnicastSubsequentAddressFamily.class);
-        final CLabeledUnicastDestination lu = new CLabeledUnicastDestinationBuilder().setPathId(PATH_ID).setPrefix(IPv6_PREFIX).setLabelStack(LABEL_STACK).build();
+        final CLabeledUnicastDestination lu = new CLabeledUnicastDestinationBuilder().setPathId(PATH_ID)
+            .setPrefix(IPv6_PREFIX).setLabelStack(LABEL_STACK).build();
         mpBuilder.setAdvertizedRoutes(new AdvertizedRoutesBuilder().setDestinationType(
             new DestinationIpv6LabeledUnicastCaseBuilder().setDestinationIpv6LabeledUnicast(
-                new DestinationIpv6LabeledUnicastBuilder().setCLabeledUnicastDestination(Lists.newArrayList(lu)).build())
-                .build())
+                new DestinationIpv6LabeledUnicastBuilder()
+                    .setCLabeledUnicastDestination(Lists.newArrayList(lu)).build()).build())
             .build());
         final MpReachNlri mpReachExpected = mpBuilder.build();
 
@@ -402,13 +432,13 @@ public class LUNlriParserTest {
         testBuilder.setAfi(Ipv6AddressFamily.class);
         testBuilder.setSafi(LabeledUnicastSubsequentAddressFamily.class);
         parser.parseNlri(Unpooled.copiedBuffer(LU_REACH_NLRI_IPv6_ADD_PATH), testBuilder, this.constraint);
-        Assert.assertEquals(mpReachExpected, testBuilder.build());
+        assertEquals(mpReachExpected, testBuilder.build());
 
         //test serializer
         final ByteBuf output = Unpooled.buffer();
         parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes1.class,
             new Attributes1Builder().setMpReachNlri(mpReachExpected).build()).build(), output);
-        Assert.assertArrayEquals(LU_REACH_NLRI_IPv6_ADD_PATH, ByteArray.readAllBytes(output));
+        assertArrayEquals(LU_REACH_NLRI_IPv6_ADD_PATH, ByteArray.readAllBytes(output));
     }
 
     @Test
@@ -420,19 +450,22 @@ public class LUNlriParserTest {
 
         final CLabeledUnicastDestination lu1 = new CLabeledUnicastDestinationBuilder().setPrefix(IPv6_PREFIX).build();
         mpBuilder.setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(
-            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev150525.update.attributes.mp.unreach
-                .nlri.withdrawn.routes.destination.type.DestinationIpv6LabeledUnicastCaseBuilder().setDestinationIpv6LabeledUnicast(
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev150525.update.attributes.mp
-                    .unreach.nlri.withdrawn.routes.destination.type.destination.ipv6.labeled.unicast._case.DestinationIpv6LabeledUnicastBuilder()
+            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev150525.update
+                .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationIpv6LabeledUnicastCaseBuilder()
+                .setDestinationIpv6LabeledUnicast(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
+                    .bgp.labeled.unicast.rev150525.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type
+                    .destination.ipv6.labeled.unicast._case.DestinationIpv6LabeledUnicastBuilder()
                     .setCLabeledUnicastDestination(Lists.newArrayList(lu1)).build()).build()).build());
         final MpUnreachNlri mpUnreachExpected1 = mpBuilder.build();
 
-        final CLabeledUnicastDestination lu2 = new CLabeledUnicastDestinationBuilder().setPrefix(IPv6_PREFIX).setLabelStack(LABEL_STACK).build();
-        mpBuilder.setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(
-            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev150525.update.attributes.mp.unreach
-                .nlri.withdrawn.routes.destination.type.DestinationIpv6LabeledUnicastCaseBuilder().setDestinationIpv6LabeledUnicast(
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev150525.update.attributes.mp
-                    .unreach.nlri.withdrawn.routes.destination.type.destination.ipv6.labeled.unicast._case.DestinationIpv6LabeledUnicastBuilder()
+        final CLabeledUnicastDestination lu2 = new CLabeledUnicastDestinationBuilder().setPrefix(IPv6_PREFIX)
+            .setLabelStack(LABEL_STACK).build();
+        mpBuilder.setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(new org.opendaylight.yang.gen.v1
+            .urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev150525.update.attributes.mp.unreach
+                .nlri.withdrawn.routes.destination.type.DestinationIpv6LabeledUnicastCaseBuilder()
+            .setDestinationIpv6LabeledUnicast(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp
+                .labeled.unicast.rev150525.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type
+                .destination.ipv6.labeled.unicast._case.DestinationIpv6LabeledUnicastBuilder()
                     .setCLabeledUnicastDestination(Lists.newArrayList(lu2)).build()).build()).build());
         final MpUnreachNlri mpUnreachExpected2 = mpBuilder.build();
 
@@ -441,18 +474,18 @@ public class LUNlriParserTest {
         testBuilder.setAfi(Ipv6AddressFamily.class);
         testBuilder.setSafi(LabeledUnicastSubsequentAddressFamily.class);
         parser.parseNlri(Unpooled.copiedBuffer(LU_UNREACH_NLRI_IPv6), testBuilder);
-        Assert.assertEquals(mpUnreachExpected1, testBuilder.build());
+        assertEquals(mpUnreachExpected1, testBuilder.build());
 
         //test serializer
         final ByteBuf output = Unpooled.buffer();
         parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class,
             new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected2).build()).build(), output);
-        Assert.assertArrayEquals(LU_UNREACH_NLRI_IPv6, ByteArray.readAllBytes(output));
+        assertArrayEquals(LU_UNREACH_NLRI_IPv6, ByteArray.readAllBytes(output));
 
         final ByteBuf output1 = Unpooled.buffer();
         parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class,
             new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected1).build()).build(), output1);
-        Assert.assertArrayEquals(LU_UNREACH_NLRI_IPv6, ByteArray.readAllBytes(output1));
+        assertArrayEquals(LU_UNREACH_NLRI_IPv6, ByteArray.readAllBytes(output1));
     }
 
     @Test
@@ -462,22 +495,26 @@ public class LUNlriParserTest {
         mpBuilder.setAfi(Ipv6AddressFamily.class);
         mpBuilder.setSafi(LabeledUnicastSubsequentAddressFamily.class);
 
-        final CLabeledUnicastDestination lu1 = new CLabeledUnicastDestinationBuilder().setPathId(PATH_ID).setPrefix(IPv6_PREFIX).build();
+        final CLabeledUnicastDestination lu1 = new CLabeledUnicastDestinationBuilder().setPathId(PATH_ID)
+            .setPrefix(IPv6_PREFIX).build();
         mpBuilder.setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(
-            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev150525.update.attributes.mp.unreach
-                .nlri.withdrawn.routes.destination.type.DestinationIpv6LabeledUnicastCaseBuilder().setDestinationIpv6LabeledUnicast(
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev150525.update.attributes.mp
-                    .unreach.nlri.withdrawn.routes.destination.type.destination.ipv6.labeled.unicast._case.DestinationIpv6LabeledUnicastBuilder()
+            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev150525.update
+                .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationIpv6LabeledUnicastCaseBuilder()
+                .setDestinationIpv6LabeledUnicast(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
+                    .bgp.labeled.unicast.rev150525.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type
+                    .destination.ipv6.labeled.unicast._case.DestinationIpv6LabeledUnicastBuilder()
                     .setCLabeledUnicastDestination(Lists.newArrayList(lu1)).build()).build()).build());
         final MpUnreachNlri mpUnreachExpected1 = mpBuilder.build();
 
-        final CLabeledUnicastDestination lu2 = new CLabeledUnicastDestinationBuilder().setPathId(PATH_ID).setPrefix(IPv6_PREFIX).setLabelStack
-                (LABEL_STACK).build();
+        final CLabeledUnicastDestination lu2 = new CLabeledUnicastDestinationBuilder().setPathId(PATH_ID)
+            .setPrefix(IPv6_PREFIX).setLabelStack(LABEL_STACK).build();
             mpBuilder.setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev150525.update.attributes.mp.unreach
-                    .nlri.withdrawn.routes.destination.type.DestinationIpv6LabeledUnicastCaseBuilder().setDestinationIpv6LabeledUnicast(
-                    new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev150525.update.attributes.mp
-                        .unreach.nlri.withdrawn.routes.destination.type.destination.ipv6.labeled.unicast._case.DestinationIpv6LabeledUnicastBuilder()
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev150525
+                    .update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type
+                    .DestinationIpv6LabeledUnicastCaseBuilder().setDestinationIpv6LabeledUnicast(
+                    new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev150525
+                        .update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.destination.ipv6.labeled
+                        .unicast._case.DestinationIpv6LabeledUnicastBuilder()
                         .setCLabeledUnicastDestination(Lists.newArrayList(lu2)).build()).build()).build());
             final MpUnreachNlri mpUnreachExpected2 = mpBuilder.build();
 
@@ -486,17 +523,17 @@ public class LUNlriParserTest {
         testBuilder.setAfi(Ipv6AddressFamily.class);
         testBuilder.setSafi(LabeledUnicastSubsequentAddressFamily.class);
         parser.parseNlri(Unpooled.copiedBuffer(LU_UNREACH_NLRI_IPv6_ADD_PATH), testBuilder, this.constraint);
-        Assert.assertEquals(mpUnreachExpected1, testBuilder.build());
+        assertEquals(mpUnreachExpected1, testBuilder.build());
 
         //test serializer
         final ByteBuf output = Unpooled.buffer();
         parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class,
             new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected2).build()).build(), output);
-        Assert.assertArrayEquals(LU_UNREACH_NLRI_IPv6_ADD_PATH, ByteArray.readAllBytes(output));
+        assertArrayEquals(LU_UNREACH_NLRI_IPv6_ADD_PATH, ByteArray.readAllBytes(output));
 
         final ByteBuf output1 = Unpooled.buffer();
         parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class,
             new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected1).build()).build(), output1);
-        Assert.assertArrayEquals(LU_UNREACH_NLRI_IPv6_ADD_PATH, ByteArray.readAllBytes(output1));
+        assertArrayEquals(LU_UNREACH_NLRI_IPv6_ADD_PATH, ByteArray.readAllBytes(output1));
     }
 }
index 128f8efb6230e9072d995391bb556c67380ac69f..a1fec857451c925e4509ec105ebbfb29df4ac06a 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.protocol.bgp.linkstate.impl.tlvs;
 
 import com.google.common.annotations.VisibleForTesting;
 import io.netty.buffer.ByteBuf;
+import io.netty.buffer.Unpooled;
 import org.opendaylight.protocol.bgp.linkstate.spi.LinkstateTlvParser;
 import org.opendaylight.protocol.util.ByteBufWriteUtil;
 import org.opendaylight.protocol.util.Ipv4Util;
@@ -58,7 +59,8 @@ public final class ReachTlvParser implements LinkstateTlvParser.LinkstateTlvSeri
         if (prefixDesc.getChild(IP_REACH_NID).isPresent()) {
             final String prefix = (String) prefixDesc.getChild(IP_REACH_NID).get().getValue();
             try {
-                Ipv4Util.bytesForPrefixBegin(new Ipv4Prefix(prefix));
+                final ByteBuf buffer = Unpooled.buffer(5);
+                ByteBufWriteUtil.writeMinimalPrefix(new Ipv4Prefix(prefix), buffer);
                 return new IpPrefix(new Ipv4Prefix(prefix));
             } catch (final IllegalArgumentException e) {
                 LOG.debug("Creating Ipv6 prefix because", e);
index 9f0be7748bcc3586179c33c06dbfe7d6d2517c88..83cb169a3536cb07bd48c008b69a3b8277171ef1 100644 (file)
@@ -108,7 +108,8 @@ public class ParserTest {
 
     @Before
     public void setUp() throws Exception {
-        updateParser = new BGPUpdateMessageParser(ServiceLoaderBGPExtensionProviderContext.getSingletonInstance().getAttributeRegistry());
+        updateParser = new BGPUpdateMessageParser(ServiceLoaderBGPExtensionProviderContext
+            .getSingletonInstance().getAttributeRegistry());
         for (int i = 1; i <= COUNTER; i++) {
             final String name = "/up" + i + ".bin";
             try (final InputStream is = ParserTest.class.getResourceAsStream(name)){
@@ -152,11 +153,14 @@ public class ParserTest {
     @Test
     public void testEORLS() throws Exception {
         final byte[] body = ByteArray.cutBytes(inputBytes.get(0), MessageUtil.COMMON_HEADER_LENGTH);
-        final int messageLength = ByteArray.bytesToInt(ByteArray.subByte(inputBytes.get(0), MessageUtil.MARKER_LENGTH, LENGTH_FIELD_LENGTH));
+        final int messageLength = ByteArray.bytesToInt(ByteArray.subByte(inputBytes.get(0),
+            MessageUtil.MARKER_LENGTH, LENGTH_FIELD_LENGTH));
         final Update message = ParserTest.updateParser.parseMessageBody(Unpooled.copiedBuffer(body), messageLength);
 
-        final Class<? extends AddressFamily> afi = message.getAttributes().getAugmentation(Attributes2.class).getMpUnreachNlri().getAfi();
-        final Class<? extends SubsequentAddressFamily> safi = message.getAttributes().getAugmentation(Attributes2.class).getMpUnreachNlri().getSafi();
+        final Class<? extends AddressFamily> afi = message.getAttributes()
+            .getAugmentation(Attributes2.class).getMpUnreachNlri().getAfi();
+        final Class<? extends SubsequentAddressFamily> safi = message.getAttributes()
+            .getAugmentation(Attributes2.class).getMpUnreachNlri().getSafi();
 
         assertEquals(LinkstateAddressFamily.class, afi);
         assertEquals(LinkstateSubsequentAddressFamily.class, safi);
@@ -318,7 +322,8 @@ public class ParserTest {
     @Test
     public void testBGPLink() throws Exception {
         final byte[] body = ByteArray.cutBytes(inputBytes.get(1), MessageUtil.COMMON_HEADER_LENGTH);
-        final int messageLength = ByteArray.bytesToInt(ByteArray.subByte(inputBytes.get(1), MessageUtil.MARKER_LENGTH, LENGTH_FIELD_LENGTH));
+        final int messageLength = ByteArray.bytesToInt(ByteArray.subByte(inputBytes.get(1),
+            MessageUtil.MARKER_LENGTH, LENGTH_FIELD_LENGTH));
         final Update message = ParserTest.updateParser.parseMessageBody(Unpooled.copiedBuffer(body), messageLength);
 
         final UpdateBuilder builder = new UpdateBuilder();
@@ -330,10 +335,12 @@ public class ParserTest {
         final Ipv4NextHopCase nextHop = new Ipv4NextHopCaseBuilder().setIpv4NextHop(
             new Ipv4NextHopBuilder().setGlobal(new Ipv4Address("25.25.25.1")).build()).build();
 
-        final LocalNodeDescriptorsBuilder ndBuilder = new LocalNodeDescriptorsBuilder().setAsNumber(new AsNumber((long) 100)).setDomainId(
+        final LocalNodeDescriptorsBuilder ndBuilder = new LocalNodeDescriptorsBuilder()
+            .setAsNumber(new AsNumber((long) 100)).setDomainId(
             new DomainIdentifier(0x19191901L)).setAreaId(new AreaIdentifier(0L));
 
-        final RemoteNodeDescriptorsBuilder rdBuilder = new RemoteNodeDescriptorsBuilder().setAsNumber(new AsNumber((long) 100)).setDomainId(
+        final RemoteNodeDescriptorsBuilder rdBuilder = new RemoteNodeDescriptorsBuilder()
+            .setAsNumber(new AsNumber((long) 100)).setDomainId(
             new DomainIdentifier(0x19191901L)).setAreaId(new AreaIdentifier(0L));
 
         final CLinkstateDestinationBuilder clBuilder = new CLinkstateDestinationBuilder();
@@ -349,23 +356,29 @@ public class ParserTest {
         final List<CLinkstateDestination> linkstates = Lists.newArrayList();
         final LinkCaseBuilder lCase = new LinkCaseBuilder().setLocalNodeDescriptors(ndBuilder.setCRouterIdentifier(
             new OspfPseudonodeCaseBuilder().setOspfPseudonode(
-                new OspfPseudonodeBuilder().setOspfRouterId(0x03030304L).setLanInterface(new OspfInterfaceIdentifier(0x0b0b0b03L)).build()).build()).build());
+                new OspfPseudonodeBuilder().setOspfRouterId(0x03030304L)
+                    .setLanInterface(new OspfInterfaceIdentifier(0x0b0b0b03L)).build()).build()).build());
         lCase.setRemoteNodeDescriptors(rdBuilder.setCRouterIdentifier(
-            new OspfNodeCaseBuilder().setOspfNode(new OspfNodeBuilder().setOspfRouterId(0x03030304L).build()).build()).build());
+            new OspfNodeCaseBuilder().setOspfNode(new OspfNodeBuilder()
+                .setOspfRouterId(0x03030304L).build()).build()).build());
         lCase.setLinkDescriptors(new LinkDescriptorsBuilder().setIpv4InterfaceAddress(
             new Ipv4InterfaceIdentifier(new Ipv4Address("11.11.11.3"))).build());
         linkstates.add(clBuilder.setObjectType(lCase.build()).build());
 
         lCase.setRemoteNodeDescriptors(rdBuilder.setCRouterIdentifier(
-            new OspfNodeCaseBuilder().setOspfNode(new OspfNodeBuilder().setOspfRouterId(0x01010102L).build()).build()).build());
+            new OspfNodeCaseBuilder().setOspfNode(new OspfNodeBuilder()
+                .setOspfRouterId(0x01010102L).build()).build()).build());
         lCase.setLinkDescriptors(new LinkDescriptorsBuilder().setIpv4InterfaceAddress(
             new Ipv4InterfaceIdentifier(new Ipv4Address("11.11.11.1"))).build());
         linkstates.add(clBuilder.setObjectType(lCase.build()).build());
 
         lCase.setLocalNodeDescriptors(ndBuilder.setCRouterIdentifier(
-            new OspfNodeCaseBuilder().setOspfNode(new OspfNodeBuilder().setOspfRouterId(0x01010102L).build()).build()).build());
+            new OspfNodeCaseBuilder().setOspfNode(new OspfNodeBuilder()
+                .setOspfRouterId(0x01010102L).build()).build()).build());
         lCase.setRemoteNodeDescriptors(rdBuilder.setCRouterIdentifier(
-            new OspfPseudonodeCaseBuilder().setOspfPseudonode(new OspfPseudonodeBuilder().setOspfRouterId(0x03030304L).setLanInterface(new OspfInterfaceIdentifier(0x0b0b0b03L)).build()).build()).build());
+            new OspfPseudonodeCaseBuilder().setOspfPseudonode(new OspfPseudonodeBuilder()
+                .setOspfRouterId(0x03030304L)
+                .setLanInterface(new OspfInterfaceIdentifier(0x0b0b0b03L)).build()).build()).build());
         linkstates.add(clBuilder.setObjectType(lCase.build()).build());
 
         lsBuilder.setMpReachNlri(mpBuilder.build());
@@ -398,10 +411,13 @@ public class ParserTest {
 
         paBuilder.addAugmentation(Attributes1.class, lsBuilder.build());
 
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.Attributes1Builder lsAttrBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.Attributes1Builder();
+        final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.
+            Attributes1Builder lsAttrBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.
+            bgp.linkstate.rev150210.Attributes1Builder();
 
         lsAttrBuilder.setLinkStateAttribute(
-            new LinkAttributesCaseBuilder().setLinkAttributes(new LinkAttributesBuilder().setMetric(new Metric(1L)).build()).build());
+            new LinkAttributesCaseBuilder().setLinkAttributes(new LinkAttributesBuilder()
+                .setMetric(new Metric(1L)).build()).build());
         paBuilder.addAugmentation(
             org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.Attributes1.class,
             lsAttrBuilder.build());
@@ -409,10 +425,11 @@ public class ParserTest {
 
         assertEquals(
             lsAttrBuilder.build(),
-            attrs.getAugmentation(
-                org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.Attributes1.class));
+            attrs.getAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp
+                .linkstate.rev150210.Attributes1.class));
 
-        final List<CLinkstateDestination> dests = ((DestinationLinkstateCase) mp.getAdvertizedRoutes().getDestinationType()).getDestinationLinkstate().getCLinkstateDestination();
+        final List<CLinkstateDestination> dests = ((DestinationLinkstateCase) mp.getAdvertizedRoutes()
+            .getDestinationType()).getDestinationLinkstate().getCLinkstateDestination();
 
         assertEquals(linkstates.size(), dests.size());
 
@@ -512,7 +529,8 @@ public class ParserTest {
     @Test
     public void testBGPNode() throws Exception {
         final byte[] body = ByteArray.cutBytes(inputBytes.get(2), MessageUtil.COMMON_HEADER_LENGTH);
-        final int messageLength = ByteArray.bytesToInt(ByteArray.subByte(inputBytes.get(2), MessageUtil.MARKER_LENGTH, LENGTH_FIELD_LENGTH));
+        final int messageLength = ByteArray
+            .bytesToInt(ByteArray.subByte(inputBytes.get(2), MessageUtil.MARKER_LENGTH, LENGTH_FIELD_LENGTH));
         final Update message = ParserTest.updateParser.parseMessageBody(Unpooled.copiedBuffer(body), messageLength);
 
         final UpdateBuilder builder = new UpdateBuilder();
@@ -531,21 +549,25 @@ public class ParserTest {
         clBuilder.setProtocolId(ProtocolId.Ospf);
 
         final NodeDescriptorsBuilder n = new NodeDescriptorsBuilder();
-        n.setAsNumber(new AsNumber((long) 100)).setDomainId(new DomainIdentifier(0x19191901L)).setAreaId(new AreaIdentifier(0L));
+        n.setAsNumber(new AsNumber((long) 100)).setDomainId(new DomainIdentifier(0x19191901L))
+            .setAreaId(new AreaIdentifier(0L));
 
         final List<CLinkstateDestination> linkstates = Lists.newArrayList();
         final NodeCaseBuilder nCase = new NodeCaseBuilder();
         nCase.setNodeDescriptors(n.setCRouterIdentifier(
             new OspfPseudonodeCaseBuilder().setOspfPseudonode(
-                new OspfPseudonodeBuilder().setOspfRouterId(0x03030304L).setLanInterface(new OspfInterfaceIdentifier(0x0b0b0b03L)).build()).build()).build());
+                new OspfPseudonodeBuilder().setOspfRouterId(0x03030304L)
+                    .setLanInterface(new OspfInterfaceIdentifier(0x0b0b0b03L)).build()).build()).build());
         linkstates.add(clBuilder.setObjectType(nCase.build()).build());
 
         nCase.setNodeDescriptors(n.setCRouterIdentifier(
-            new OspfNodeCaseBuilder().setOspfNode(new OspfNodeBuilder().setOspfRouterId(0x03030304L).build()).build()).build());
+            new OspfNodeCaseBuilder().setOspfNode(new OspfNodeBuilder()
+                .setOspfRouterId(0x03030304L).build()).build()).build());
         linkstates.add(clBuilder.setObjectType(nCase.build()).build());
 
         nCase.setNodeDescriptors(n.setCRouterIdentifier(
-            new OspfNodeCaseBuilder().setOspfNode(new OspfNodeBuilder().setOspfRouterId(0x01010102L).build()).build()).build());
+            new OspfNodeCaseBuilder().setOspfNode(new OspfNodeBuilder()
+                .setOspfRouterId(0x01010102L).build()).build()).build());
         linkstates.add(clBuilder.setObjectType(nCase.build()).build());
 
         final Attributes1Builder lsBuilder = new Attributes1Builder();
@@ -583,7 +605,8 @@ public class ParserTest {
         assertEquals(mpBuilder.getSafi(), mp.getSafi());
         assertEquals(mpBuilder.getCNextHop(), mp.getCNextHop());
 
-        final List<CLinkstateDestination> dests = ((DestinationLinkstateCase) mp.getAdvertizedRoutes().getDestinationType()).getDestinationLinkstate().getCLinkstateDestination();
+        final List<CLinkstateDestination> dests = ((DestinationLinkstateCase) mp.getAdvertizedRoutes()
+            .getDestinationType()).getDestinationLinkstate().getCLinkstateDestination();
 
         assertEquals(linkstates.size(), dests.size());
 
@@ -630,8 +653,9 @@ public class ParserTest {
      */
     @Test
     public void testOpenMessage() throws Exception {
-        final MessageRegistry msgReg = ServiceLoaderBGPExtensionProviderContext.getSingletonInstance().getMessageRegistry();
-        final Notification o = msgReg.parseMessage(Unpooled.copiedBuffer(inputBytes.get(3)));
+        final MessageRegistry msgReg = ServiceLoaderBGPExtensionProviderContext
+            .getSingletonInstance().getMessageRegistry();
+        final Notification o = msgReg.parseMessage(Unpooled.copiedBuffer(inputBytes.get(3)), null);
         final Open open = (Open) o;
         final Set<BgpTableType> types = Sets.newHashSet();
         for (final BgpParameters param : open.getBgpParameters()) {
@@ -639,7 +663,8 @@ public class ParserTest {
                 final CParameters cParam = optCapa.getCParameters();
                 if(cParam != null && cParam.getAugmentation(CParameters1.class) != null && cParam.getAugmentation
                     (CParameters1.class).getMultiprotocolCapability() != null) {
-                    final MultiprotocolCapability mp = cParam.getAugmentation(CParameters1.class).getMultiprotocolCapability();
+                    final MultiprotocolCapability mp = cParam
+                        .getAugmentation(CParameters1.class).getMultiprotocolCapability();
                     final BgpTableType type = new BgpTableTypeImpl(mp.getAfi(), mp.getSafi());
                     types.add(type);
                 }
index 7fc2ef3ec2b932b401800c7c82158df14e71c6a8..c5242e128944e9f849eeaf962112c71da605ff5a 100644 (file)
@@ -44,29 +44,38 @@ import org.opendaylight.yangtools.yang.binding.Notification;
 
 public class ParserTest {
 
-    private static final byte[] openBMsg = new byte[] { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
-        (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
-        (byte) 0xff, (byte) 0x00, (byte) 0x1d, (byte) 0x01, (byte) 0x04, (byte) 0x00, (byte) 0x64, (byte) 0x00, (byte) 0xb4,
-        (byte) 0x14, (byte) 0x14, (byte) 0x14, (byte) 0x14, (byte) 0x00 };
+    private static final byte[] openBMsg = new byte[] { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+        (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+        (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x1d, (byte) 0x01, (byte) 0x04,
+        (byte) 0x00, (byte) 0x64, (byte) 0x00, (byte) 0xb4, (byte) 0x14, (byte) 0x14, (byte) 0x14, (byte) 0x14,
+        (byte) 0x00 };
 
-    private static final byte[] keepAliveBMsg = new byte[] { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
-        (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
-        (byte) 0xff, (byte) 0x00, (byte) 0x13, (byte) 0x04 };
+    private static final byte[] keepAliveBMsg = new byte[] { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+        (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+        (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x13, (byte) 0x04 };
 
-    private static final byte[] notificationBMsg = new byte[] { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
-        (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
-        (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x17, (byte) 0x03, (byte) 0x02, (byte) 0x04, (byte) 0x04, (byte) 0x09 };
+    private static final byte[] notificationBMsg = new byte[] { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+        (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+        (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x17, (byte) 0x03, (byte) 0x02,
+        (byte) 0x04, (byte) 0x04, (byte) 0x09 };
 
     private static final byte[] updMsgWithUnrecognizedAttribute = new byte[] {
         (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
-        (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x79, (byte) 0x02,
-        (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x62, (byte) 0x90, (byte) 0x0e, (byte) 0x00, (byte) 0x34, (byte) 0x40, (byte) 0x04, (byte) 0x47, (byte) 0x04, (byte) 0x0a, (byte) 0x19,
-        (byte) 0x02, (byte) 0x1b, (byte) 0x00, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x27, (byte) 0x02, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte)0x00,
-        (byte) 0x01, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x1a, (byte) 0x02, (byte) 0x00, (byte) 0x00, (byte) 0x04, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x48, (byte) 0x02, (byte)0x01,
-        (byte) 0x00, (byte) 0x04, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x02, (byte) 0x03, (byte) 0x00, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte)0x00,
-        (byte) 0x43, (byte) 0x40, (byte) 0x01, (byte) 0x01, (byte) 0x00, (byte) 0x40, (byte) 0x02, (byte) 0x00, (byte) 0x40, (byte) 0x05, (byte) 0x04, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte)0x64,
-        (byte) 0x00, (byte) 0x63, (byte) 0x19, (byte) 0x04, (byte) 0x02, (byte) 0x00, (byte) 0x08, (byte) 0x4f, (byte) 0x66, (byte) 0x2d, (byte) 0x39, (byte) 0x6b, (byte) 0x2d, (byte) 0x30, (byte)0x33,
-        (byte) 0x04, (byte) 0x03, (byte) 0x00, (byte) 0x01, (byte) 0x72, (byte) 0x04, (byte) 0x04, (byte) 0x00, (byte) 0x04, (byte) 0x2b, (byte) 0x2b, (byte) 0x2b, (byte) 0x2b
+        (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+        (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x79, (byte) 0x02, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+        (byte) 0x62, (byte) 0x90, (byte) 0x0e, (byte) 0x00, (byte) 0x34, (byte) 0x40, (byte) 0x04, (byte) 0x47,
+        (byte) 0x04, (byte) 0x0a, (byte) 0x19, (byte) 0x02, (byte) 0x1b, (byte) 0x00, (byte) 0x00, (byte) 0x01,
+        (byte) 0x00, (byte) 0x27, (byte) 0x02, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+        (byte) 0x00, (byte)0x00, (byte) 0x01, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x1a, (byte) 0x02,
+        (byte) 0x00, (byte) 0x00, (byte) 0x04, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x48, (byte) 0x02,
+        (byte)0x01, (byte) 0x00, (byte) 0x04, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x02,
+        (byte) 0x03, (byte) 0x00, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte)0x00,
+        (byte) 0x43, (byte) 0x40, (byte) 0x01, (byte) 0x01, (byte) 0x00, (byte) 0x40, (byte) 0x02, (byte) 0x00,
+        (byte) 0x40, (byte) 0x05, (byte) 0x04, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte)0x64, (byte) 0x00,
+        (byte) 0x63, (byte) 0x19, (byte) 0x04, (byte) 0x02, (byte) 0x00, (byte) 0x08, (byte) 0x4f, (byte) 0x66,
+        (byte) 0x2d, (byte) 0x39, (byte) 0x6b, (byte) 0x2d, (byte) 0x30, (byte)0x33, (byte) 0x04, (byte) 0x03,
+        (byte) 0x00, (byte) 0x01, (byte) 0x72, (byte) 0x04, (byte) 0x04, (byte) 0x00, (byte) 0x04, (byte) 0x2b,
+        (byte) 0x2b, (byte) 0x2b, (byte) 0x2b
     };
 
     // Update message with one IPv4 prefix NLRI and all mandatory path attributes present
@@ -101,11 +110,12 @@ public class ParserTest {
         (byte) 0xfe, (byte) 0x03
     };
 
-    private static final byte[] RR_MSG = new byte[] { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
-        (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
-        (byte) 0xff, (byte) 0x00, (byte) 0x17, (byte) 0x05, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x01 };
+    private static final byte[] RR_MSG = new byte[] { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+        (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+        (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x17, (byte) 0x05, (byte) 0x00, (byte) 0x01,
+        (byte) 0x00, (byte) 0x01 };
 
-    static MessageRegistry reg;
+    private static MessageRegistry reg;
 
     @BeforeClass
     public static void setupClass() throws Exception {
@@ -114,13 +124,16 @@ public class ParserTest {
 
     @Test
     public void testHeaderErrors() throws BGPParsingException, BGPDocumentedException {
-        byte[] wrong = new byte[] { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00 };
+        byte[] wrong = new byte[] { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+            (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+            (byte) 0xff, (byte) 0xff, (byte) 0x00 };
         wrong = ByteArray.cutBytes(wrong, 16);
         try {
-            ParserTest.reg.parseMessage(Unpooled.copiedBuffer(wrong));
+            ParserTest.reg.parseMessage(Unpooled.copiedBuffer(wrong), null);
             fail("Exception should have occcured.");
         } catch (final IllegalArgumentException e) {
-            assertEquals("Too few bytes in passed array. Passed: " + wrong.length + ". Expected: >= 19.", e.getMessage());
+            assertEquals("Too few bytes in passed array. Passed: " + wrong.length + ". Expected: >= 19.",
+                e.getMessage());
             return;
         }
         fail();
@@ -128,11 +141,11 @@ public class ParserTest {
 
     @Test
     public void testBadMsgType() throws BGPParsingException {
-        final byte[] bytes = { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
-            (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
-            (byte) 0x00, (byte) 0x13, (byte) 0x08 };
+        final byte[] bytes = { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+            (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+            (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x13, (byte) 0x08 };
         try {
-            ParserTest.reg.parseMessage(Unpooled.copiedBuffer(bytes));
+            ParserTest.reg.parseMessage(Unpooled.copiedBuffer(bytes), null);
             fail("Exception should have occured.");
         } catch (final BGPDocumentedException e) {
             assertEquals(BGPError.BAD_MSG_TYPE, e.getError());
@@ -148,19 +161,20 @@ public class ParserTest {
         ParserTest.reg.serializeMessage(keepAlive, buffer);
         assertArrayEquals(keepAliveBMsg, ByteArray.getAllBytes(buffer));
 
-        final Notification m = ParserTest.reg.parseMessage(Unpooled.copiedBuffer(ByteArray.getAllBytes(buffer)));
+        final Notification m = ParserTest.reg.parseMessage(Unpooled.
+            copiedBuffer(ByteArray.getAllBytes(buffer)), null);
 
         assertTrue(m instanceof Keepalive);
     }
 
     @Test
     public void testBadKeepAliveMsg() throws BGPParsingException {
-        final byte[] bytes = new byte[] { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
-            (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
-            (byte) 0x00, (byte) 0x14, (byte) 0x04, (byte) 0x05 };
+        final byte[] bytes = new byte[] { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+            (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+            (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x14, (byte) 0x04, (byte) 0x05 };
 
         try {
-            ParserTest.reg.parseMessage(Unpooled.copiedBuffer(bytes));
+            ParserTest.reg.parseMessage(Unpooled.copiedBuffer(bytes), null);
             fail("Exception should have occured.");
         } catch (final BGPDocumentedException e) {
             assertThat(e.getMessage(), containsString("Message length field not within valid range."));
@@ -172,13 +186,14 @@ public class ParserTest {
 
     @Test
     public void testOpenMessage() throws UnknownHostException, BGPParsingException, BGPDocumentedException {
-        final Notification open = new OpenBuilder().setMyAsNumber(100).setHoldTimer(180).setBgpIdentifier(new Ipv4Address("20.20.20.20")).setVersion(
+        final Notification open = new OpenBuilder().setMyAsNumber(100).setHoldTimer(180)
+            .setBgpIdentifier(new Ipv4Address("20.20.20.20")).setVersion(
             new ProtocolVersion((short) 4)).build();
         final ByteBuf bytes = Unpooled.buffer();
         ParserTest.reg.serializeMessage(open, bytes);
         assertArrayEquals(openBMsg, ByteArray.getAllBytes(bytes));
 
-        final Notification m = ParserTest.reg.parseMessage(Unpooled.copiedBuffer(bytes));
+        final Notification m = ParserTest.reg.parseMessage(Unpooled.copiedBuffer(bytes), null);
 
         assertTrue(m instanceof Open);
         assertEquals(100, ((Open) m).getMyAsNumber().intValue());
@@ -189,13 +204,13 @@ public class ParserTest {
 
     @Test
     public void testBadHoldTimeError() throws BGPParsingException {
-        final byte[] bMsg = new byte[] { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
-            (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
-            (byte) 0x00, (byte) 0x1d, (byte) 0x01, (byte) 0x04, (byte) 0x00, (byte) 0x64, (byte) 0x00, (byte) 0x01, (byte) 0x14,
-            (byte) 0x14, (byte) 0x14, (byte) 0x14, (byte) 0x00 };
+        final byte[] bMsg = new byte[] { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+            (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+            (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x1d, (byte) 0x01, (byte) 0x04, (byte) 0x00, (byte) 0x64,
+            (byte) 0x00, (byte) 0x01, (byte) 0x14, (byte) 0x14, (byte) 0x14, (byte) 0x14, (byte) 0x00 };
 
         try {
-            ParserTest.reg.parseMessage(Unpooled.copiedBuffer(bMsg));
+            ParserTest.reg.parseMessage(Unpooled.copiedBuffer(bMsg), null);
             fail("Exception should have occured.");
         } catch (final BGPDocumentedException e) {
             assertEquals("Hold time value not acceptable.", e.getMessage());
@@ -207,13 +222,13 @@ public class ParserTest {
 
     @Test
     public void testBadMsgLength() throws BGPParsingException {
-        final byte[] bMsg = new byte[] { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
-            (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
-            (byte) 0x00, (byte) 0x1b, (byte) 0x01, (byte) 0x04, (byte) 0x00, (byte) 0x64, (byte) 0x00, (byte) 0xb4, (byte) 0xff,
-            (byte) 0xff, (byte) 0xff };
+        final byte[] bMsg = new byte[] { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+            (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+            (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x1b, (byte) 0x01, (byte) 0x04, (byte) 0x00, (byte) 0x64,
+            (byte) 0x00, (byte) 0xb4, (byte) 0xff, (byte) 0xff, (byte) 0xff };
 
         try {
-            ParserTest.reg.parseMessage(Unpooled.copiedBuffer(bMsg));
+            ParserTest.reg.parseMessage(Unpooled.copiedBuffer(bMsg), null);
             fail("Exception should have occured.");
         } catch (final BGPDocumentedException e) {
             assertEquals("Open message too small.", e.getMessage());
@@ -223,13 +238,13 @@ public class ParserTest {
 
     @Test
     public void testBadVersion() throws BGPParsingException {
-        final byte[] bMsg = new byte[] { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
-            (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
-            (byte) 0x00, (byte) 0x1d, (byte) 0x01, (byte) 0x08, (byte) 0x00, (byte) 0x64, (byte) 0x00, (byte) 0xb4, (byte) 0x14,
-            (byte) 0x14, (byte) 0x14, (byte) 0x14, (byte) 0x00 };
+        final byte[] bMsg = new byte[] { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+            (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+            (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x1d, (byte) 0x01, (byte) 0x08, (byte) 0x00, (byte) 0x64,
+            (byte) 0x00, (byte) 0xb4, (byte) 0x14, (byte) 0x14, (byte) 0x14, (byte) 0x14, (byte) 0x00 };
 
         try {
-            ParserTest.reg.parseMessage(Unpooled.copiedBuffer(bMsg));
+            ParserTest.reg.parseMessage(Unpooled.copiedBuffer(bMsg), null);
             fail("Exception should have occured.");
         } catch (final BGPDocumentedException e) {
             assertEquals("BGP Protocol version 8 not supported.", e.getMessage());
@@ -241,16 +256,17 @@ public class ParserTest {
 
     @Test
     public void testNotificationMsg() throws BGPParsingException, BGPDocumentedException {
-        Notification notMsg = new NotifyBuilder().setErrorCode(BGPError.OPT_PARAM_NOT_SUPPORTED.getCode()).setErrorSubcode(
-            BGPError.OPT_PARAM_NOT_SUPPORTED.getSubcode()).setData(new byte[] { 4, 9 }).build();
+        Notification notMsg = new NotifyBuilder().setErrorCode(BGPError.OPT_PARAM_NOT_SUPPORTED.getCode())
+            .setErrorSubcode(BGPError.OPT_PARAM_NOT_SUPPORTED.getSubcode()).setData(new byte[] { 4, 9 }).build();
         final ByteBuf bytes = Unpooled.buffer();
         ParserTest.reg.serializeMessage(notMsg, bytes);
         assertArrayEquals(notificationBMsg, ByteArray.subByte(bytes.array(),0,bytes.writerIndex()));
 
-        Notification m = ParserTest.reg.parseMessage(Unpooled.copiedBuffer(bytes));
+        Notification m = ParserTest.reg.parseMessage(Unpooled.copiedBuffer(bytes), null);
 
         assertTrue(m instanceof Notify);
-        assertEquals(BGPError.OPT_PARAM_NOT_SUPPORTED, BGPError.forValue(((Notify) m).getErrorCode(), ((Notify) m).getErrorSubcode()));
+        assertEquals(BGPError.OPT_PARAM_NOT_SUPPORTED, BGPError.forValue(((Notify) m).getErrorCode(),
+            ((Notify) m).getErrorSubcode()));
         assertArrayEquals(new byte[] { 4, 9 }, ((Notify) m).getData());
 
         notMsg = new NotifyBuilder().setErrorCode(BGPError.CONNECTION_NOT_SYNC.getCode()).setErrorSubcode(
@@ -260,21 +276,22 @@ public class ParserTest {
 
         ParserTest.reg.serializeMessage(notMsg, bytes);
 
-        m = ParserTest.reg.parseMessage(Unpooled.copiedBuffer(bytes));
+        m = ParserTest.reg.parseMessage(Unpooled.copiedBuffer(bytes), null);
 
         assertTrue(m instanceof Notify);
-        assertEquals(BGPError.CONNECTION_NOT_SYNC, BGPError.forValue(((Notify) m).getErrorCode(), ((Notify) m).getErrorSubcode()));
+        assertEquals(BGPError.CONNECTION_NOT_SYNC, BGPError.forValue(((Notify) m).getErrorCode(),
+            ((Notify) m).getErrorSubcode()));
         assertNull(((Notify) m).getData());
     }
 
     @Test
     public void testWrongLength() throws BGPParsingException {
-        final byte[] bMsg = new byte[] { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
-            (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
-            (byte) 0x00, (byte) 0x14, (byte) 0x03, (byte) 0x02 };
+        final byte[] bMsg = new byte[] { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+            (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+            (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x14, (byte) 0x03, (byte) 0x02 };
 
         try {
-            ParserTest.reg.parseMessage(Unpooled.copiedBuffer(bMsg));
+            ParserTest.reg.parseMessage(Unpooled.copiedBuffer(bMsg), null);
             fail("Exception should have occured.");
         } catch (final BGPDocumentedException e) {
             assertEquals("Notification message too small.", e.getMessage());
@@ -286,12 +303,12 @@ public class ParserTest {
 
     @Test
     public void testUnrecognizedError() throws BGPParsingException, BGPDocumentedException {
-        final byte[] bMsg = new byte[] { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
-            (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
-            (byte) 0x00, (byte) 0x15, (byte) 0x03, (byte) 0x02, (byte) 0xaa };
+        final byte[] bMsg = new byte[] { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+            (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+            (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x15, (byte) 0x03, (byte) 0x02, (byte) 0xaa };
 
         try {
-            ParserTest.reg.parseMessage(Unpooled.copiedBuffer(bMsg));
+            ParserTest.reg.parseMessage(Unpooled.copiedBuffer(bMsg), null);
             fail("Exception should have occured.");
         } catch (final IllegalArgumentException e) {
             assertEquals("BGP Error code 2 and subcode 170 not recognized.", e.getMessage());
@@ -303,7 +320,7 @@ public class ParserTest {
     @Test
     public void testParseUpdMsgWithUnrecognizedAttribute() throws BGPDocumentedException, BGPParsingException {
         try {
-            reg.parseMessage(Unpooled.copiedBuffer(updMsgWithUnrecognizedAttribute));
+            reg.parseMessage(Unpooled.copiedBuffer(updMsgWithUnrecognizedAttribute), null);
             fail("Exception should have occured.");
         } catch (final BGPDocumentedException e) {
             assertEquals("Well known attribute not recognized.", e.getMessage());
@@ -316,7 +333,8 @@ public class ParserTest {
     @Test
     public void testParseUpdMsgWithMandatoryAttributesPresent() throws BGPDocumentedException, BGPParsingException {
         try {
-            Notification msg = reg.parseMessage(Unpooled.copiedBuffer(updMsgWithMandatoryAttributesPresent));
+            final Notification msg = reg.parseMessage(Unpooled.copiedBuffer(updMsgWithMandatoryAttributesPresent),
+                null);
             assertTrue(msg instanceof Update);
         } catch (final BGPDocumentedException e) {
             fail("Exception should not have occured.");
@@ -324,9 +342,10 @@ public class ParserTest {
     }
 
     @Test
-    public void testParseUpdMsgWithOneMandatoryAttributeNotPresent() throws BGPDocumentedException, BGPParsingException {
+    public void testParseUpdMsgWithOneMandatoryAttributeNotPresent()
+        throws BGPDocumentedException, BGPParsingException {
         try {
-            reg.parseMessage(Unpooled.copiedBuffer(updMsgWithOneMandatoryAttributeNotPresent));
+            reg.parseMessage(Unpooled.copiedBuffer(updMsgWithOneMandatoryAttributeNotPresent), null);
             fail("Exception should have occured.");
         } catch (final BGPDocumentedException e) {
             assertEquals(BGPError.MANDATORY_ATTR_MISSING_MSG + "ORIGIN", e.getMessage());
@@ -338,9 +357,10 @@ public class ParserTest {
     }
 
     @Test
-    public void testParseUpdMsgWithMultipleMandatoryAttributesNotPresent() throws BGPDocumentedException, BGPParsingException {
+    public void testParseUpdMsgWithMultipleMandatoryAttributesNotPresent()
+        throws BGPDocumentedException, BGPParsingException {
         try {
-            reg.parseMessage(Unpooled.copiedBuffer(updMsgWithMultipleMandatoryAttributesNotPresent));
+            reg.parseMessage(Unpooled.copiedBuffer(updMsgWithMultipleMandatoryAttributesNotPresent), null);
             fail("Exception should have occured.");
         } catch (final BGPDocumentedException e) {
             assertEquals(BGPError.MANDATORY_ATTR_MISSING_MSG + "NEXT_HOP", e.getMessage());
@@ -353,12 +373,14 @@ public class ParserTest {
 
     @Test
     public void testRouteRefreshMsg() throws BGPDocumentedException, BGPParsingException {
-        final Notification rrMsg = new RouteRefreshBuilder().setAfi(Ipv4AddressFamily.class).setSafi(UnicastSubsequentAddressFamily.class).build();
+        final Notification rrMsg = new RouteRefreshBuilder().setAfi(Ipv4AddressFamily.class)
+            .setSafi(UnicastSubsequentAddressFamily.class).build();
         final ByteBuf buffer = Unpooled.buffer();
         ParserTest.reg.serializeMessage(rrMsg, buffer);
         assertArrayEquals(RR_MSG, ByteArray.getAllBytes(buffer));
 
-        final Notification m = ParserTest.reg.parseMessage(Unpooled.copiedBuffer(ByteArray.getAllBytes(buffer)));
+        final Notification m = ParserTest.reg.parseMessage(
+            Unpooled.copiedBuffer(ByteArray.getAllBytes(buffer)), null);
 
         assertTrue(m instanceof RouteRefresh);
     }
index 7be43ba9c7e16e40bd48f858dae682b4d7ac4284..9977f127d7929064f40da6aaf0a5469119fc1bda 100644 (file)
@@ -37,7 +37,7 @@ public class PathAttributeParserTest {
     public void testOriginParser() {
         try {
             ServiceLoaderBGPExtensionProviderContext.getSingletonInstance().getAttributeRegistry().parseAttributes(
-                    Unpooled.copiedBuffer(new byte[] { 0x40, 0x01, 0x01, 0x04 }));
+                    Unpooled.copiedBuffer(new byte[] { 0x40, 0x01, 0x01, 0x04 }), null);
             fail("This needs to fail.");
         } catch (final BGPDocumentedException e) {
             assertEquals("Unknown Origin type.", e.getMessage());
@@ -52,15 +52,19 @@ public class PathAttributeParserTest {
         final byte[] value = new byte[] { 1, 0, 11, 0, 0, 0, 0, 0, 0, 0, 8 };
         final ByteBuf buffer = Unpooled.buffer();
 
-        AttributeUtil.formatAttribute(AttributeUtil.OPTIONAL, AigpAttributeParser.TYPE, Unpooled.copiedBuffer(value), buffer);
+        AttributeUtil.formatAttribute(AttributeUtil.OPTIONAL, AigpAttributeParser.TYPE,
+            Unpooled.copiedBuffer(value), buffer);
 
-        final BGPExtensionProviderContext providerContext = ServiceLoaderBGPExtensionProviderContext.getSingletonInstance();
-        final Attributes pathAttributes = providerContext.getAttributeRegistry().parseAttributes(buffer);
+        final BGPExtensionProviderContext providerContext = ServiceLoaderBGPExtensionProviderContext
+            .getSingletonInstance();
+        final Attributes pathAttributes = providerContext.getAttributeRegistry()
+            .parseAttributes(buffer, null);
         final Aigp aigp = pathAttributes.getAigp();
         final AigpTlv tlv = aigp.getAigpTlv();
 
         assertNotNull("Tlv should not be null.", tlv);
-        assertEquals("Aigp tlv should have metric with value 8.", 8, tlv.getMetric().getValue().intValue());
+        assertEquals("Aigp tlv should have metric with value 8.", 8,
+            tlv.getMetric().getValue().intValue());
     }
 
     @Test
@@ -69,10 +73,13 @@ public class PathAttributeParserTest {
         final ByteBuf inputData = Unpooled.buffer();
         final ByteBuf testBuffer = Unpooled.buffer();
 
-        AttributeUtil.formatAttribute(AttributeUtil.OPTIONAL, AigpAttributeParser.TYPE, Unpooled.copiedBuffer(value), inputData);
+        AttributeUtil.formatAttribute(AttributeUtil.OPTIONAL, AigpAttributeParser.TYPE,
+            Unpooled.copiedBuffer(value), inputData);
 
-        final BGPExtensionProviderContext providerContext = ServiceLoaderBGPExtensionProviderContext.getSingletonInstance();
-        final Attributes pathAttributes = providerContext.getAttributeRegistry().parseAttributes(inputData);
+        final BGPExtensionProviderContext providerContext = ServiceLoaderBGPExtensionProviderContext
+            .getSingletonInstance();
+        final Attributes pathAttributes = providerContext.getAttributeRegistry()
+            .parseAttributes(inputData, null);
         final Aigp aigp = pathAttributes.getAigp();
 
         final AttributesBuilder pathAttributesBuilder = new AttributesBuilder();
index 55af0528ab821bcdfadae167475bd4dc098e6ef3..c0915ea0839c5babfedf587f9c8a863416b1f055 100644 (file)
@@ -46,8 +46,8 @@ public class CommunitiesAttributeParserTest {
         ServiceLoaderBGPExtensionProviderContext.getSingletonInstance().getAttributeRegistry()
             .serializeAttribute(paBuilder.build(), actual);
         assertArrayEquals(CommunitiesBytes, ByteArray.getAllBytes(actual));
-        final Attributes attributeOut = ServiceLoaderBGPExtensionProviderContext.getSingletonInstance().getAttributeRegistry()
-            .parseAttributes(actual);
+        final Attributes attributeOut = ServiceLoaderBGPExtensionProviderContext.getSingletonInstance()
+            .getAttributeRegistry().parseAttributes(actual, null);
         assertEquals(comms, attributeOut.getCommunities());
     }
 
index 2b1460d876e893c2262522b8f10ecc1b95fac97f..6ad57d5506c98e294c39a9cb4c529855d23e130e 100644 (file)
@@ -33,13 +33,6 @@ public class BGPMessageParserMock implements MessageRegistry {
         this.messages = messages;
     }
 
-    @Override
-    public Notification parseMessage(final ByteBuf buffer) throws BGPParsingException, BGPDocumentedException {
-        final Notification ret = this.messages.get(buffer);
-        Preconditions.checkArgument(ret != null, "Undefined message encountered");
-        return ret;
-    }
-
     @Override
     public void serializeMessage(final Notification msg, final ByteBuf buffer) {
         // no action needed, it's a mock for parsing, not serializing
@@ -47,8 +40,10 @@ public class BGPMessageParserMock implements MessageRegistry {
     }
 
     @Override
-    public Notification parseMessage(final ByteBuf bytes, final PeerSpecificParserConstraint constraint)
+    public Notification parseMessage(final ByteBuf buffer, final PeerSpecificParserConstraint constraint)
             throws BGPDocumentedException, BGPParsingException {
-        return parseMessage(bytes);
+        final Notification ret = this.messages.get(buffer);
+        Preconditions.checkArgument(ret != null, "Undefined message encountered");
+        return ret;
     }
 }
index 3362d9b3ffcfc71a2ef3fb53171c16b196d05c4a..876fcfa5e5524fb59e803b80f1fc294f28207795 100644 (file)
@@ -97,9 +97,9 @@ public class BGPMessageParserMockTest {
         final BGPMessageParserMock mockParser = new BGPMessageParserMock(updateMap);
 
         for (int i = 0; i < this.inputBytes.length; i++) {
-            assertEquals(this.messages.get(i), mockParser.parseMessage(Unpooled.copiedBuffer(this.inputBytes[i])));
+            assertEquals(this.messages.get(i), mockParser.parseMessage(Unpooled.copiedBuffer(this.inputBytes[i]), null));
         }
-        assertNotSame(this.messages.get(3), mockParser.parseMessage(Unpooled.copiedBuffer(this.inputBytes[8])));
+        assertNotSame(this.messages.get(3), mockParser.parseMessage(Unpooled.copiedBuffer(this.inputBytes[8]), null));
     }
 
     /**
@@ -116,7 +116,7 @@ public class BGPMessageParserMockTest {
             updateMap.put(Unpooled.copiedBuffer(this.inputBytes[i]), this.messages.get(i));
         }
         final BGPMessageParserMock mockParser = new BGPMessageParserMock(updateMap);
-        mockParser.parseMessage(Unpooled.copiedBuffer(new byte[] { 7, 4, 6 }));
+        mockParser.parseMessage(Unpooled.copiedBuffer(new byte[] { 7, 4, 6 }), null);
     }
 
     /**
@@ -194,13 +194,13 @@ public class BGPMessageParserMockTest {
 
         final byte[] input = new byte[] { 5, 8, 13, 21 };
 
-        openMap.put(Unpooled.copiedBuffer(input), new OpenBuilder().setMyAsNumber(30).setHoldTimer(30).setBgpParameters(params).setVersion(
-            new ProtocolVersion((short) 4)).build());
+        openMap.put(Unpooled.copiedBuffer(input), new OpenBuilder().setMyAsNumber(30).setHoldTimer(30)
+            .setBgpParameters(params).setVersion(new ProtocolVersion((short) 4)).build());
 
         final BGPMessageParserMock mockParser = new BGPMessageParserMock(openMap);
 
         final Set<BgpTableType> result = Sets.newHashSet();
-        for (final BgpParameters p : ((Open) mockParser.parseMessage(Unpooled.copiedBuffer(input))).getBgpParameters()) {
+        for (final BgpParameters p : ((Open) mockParser.parseMessage(Unpooled.copiedBuffer(input), null)).getBgpParameters()) {
             for (final OptionalCapabilities capa : p.getOptionalCapabilities()) {
                 final CParameters cp = capa.getCParameters();
                 if (cp.getAugmentation(CParameters1.class) != null && cp.getAugmentation(CParameters1.class).getMultiprotocolCapability() != null) {
index 10bcae982b5e5d0f79b6a6b9e561699f238b0f42..e5ff6eff1568c2774a44156201e3b748b06b0cc7 100644 (file)
@@ -31,11 +31,6 @@ public abstract class AbstractMessageRegistry implements MessageRegistry {
         Arrays.fill(MARKER, UnsignedBytes.MAX_VALUE);
     }
 
-    @Override
-    public final Notification parseMessage(final ByteBuf buffer) throws BGPDocumentedException, BGPParsingException {
-        return parseMessage(buffer, null);
-    }
-
     @Override
     public Notification parseMessage(final ByteBuf buffer, final PeerSpecificParserConstraint constraint)
             throws BGPDocumentedException, BGPParsingException {
index 97bdd0cc1cf271a795c80cbc4f488e2454d69819..faf747b8e702aeb015a4b5ab7fefa66328f284c3 100644 (file)
@@ -19,13 +19,6 @@ import org.opendaylight.yangtools.yang.binding.DataObject;
  *
  */
 public interface AttributeRegistry {
-
-    /**
-     * @deprecated Use {@link #parseAttributes(ByteBuf, PeerSpecificParserConstraint)}
-     */
-    @Deprecated
-    Attributes parseAttributes(ByteBuf buffer) throws BGPDocumentedException, BGPParsingException;
-
     /**
      * Parse BGP Attribute from buffer.
      * @param buffer Input buffer.
index 646b8dd7db9d8b9c9a6498bba2cd6decc38d6742..6ae61e72d5ae5d0f3d254e70a68aabf4e0d202fb 100644 (file)
@@ -45,13 +45,6 @@ public interface BGPExtensionProviderContext extends BGPExtensionConsumerContext
 
     AutoCloseable registerBgpPrefixSidTlvSerializer(Class<? extends BgpPrefixSidTlv> tlvClass, BgpPrefixSidTlvSerializer serializer);
 
-    /**
-     * Each extension requires a specific NextHop handler. Therefore this method has been deprecated  for
-     * the method which enforce user to register it.
-     */
-    @Deprecated
-    AutoCloseable registerNlriParser(Class<? extends AddressFamily> afi, Class<? extends SubsequentAddressFamily> safi, NlriParser parser);
-
     AutoCloseable registerNlriParser(Class<? extends AddressFamily> afi, Class<? extends SubsequentAddressFamily> safi,
         NlriParser parser, final NextHopParserSerializer nextHopHandler, final Class<? extends CNextHop> cNextHopClass,
         final Class<? extends CNextHop>... cNextHopClassList);
index 3ee9f5f763278abf7636b3da48fea0e99a89542d..6db2b4fd891811b5a85cede06d9c70c125ac05eb 100644 (file)
@@ -19,13 +19,6 @@ import org.opendaylight.yangtools.yang.binding.Notification;
  * to encode/decode messages.
  */
 public interface MessageRegistry {
-
-    /**
-     * @deprecated Use {@link #parseMessage(ByteBuf, PeerSpecificParserConstraint)}
-     */
-    @Deprecated
-    Notification parseMessage(ByteBuf bytes) throws BGPDocumentedException, BGPParsingException;
-
     /**
      * Decode input buffer to BGP Message.
      * @param bytes Input buffer with encoded message.
index 133443b2f8fc00998c6b46a3d786c349feda3664..cedba04eda19008a230b0d7a24a80ecceab68835 100644 (file)
@@ -20,19 +20,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mult
  *
  */
 public interface NlriRegistry {
-
-    /**
-     * @deprecated Use {@link #parseMpReach(ByteBuf, PeerSpecificParserConstraint)}
-     */
-    @Deprecated
-    MpReachNlri parseMpReach(ByteBuf buffer) throws BGPParsingException;
-
-    /**
-     * @deprecated Use {@link #parseMpUnreach(ByteBuf, PeerSpecificParserConstraint)}
-     */
-    @Deprecated
-    MpUnreachNlri parseMpUnreach(ByteBuf buffer) throws BGPParsingException;
-
     /**
      * Decode MP REACH NLRI Attribute.
      * @param buffer Input buffer.
index 3a05df0c5ce28e11a464eda622d30aa61003b608..14fe9809cd6e7cd6d626deae81448b01d3769867 100644 (file)
@@ -114,11 +114,6 @@ final class SimpleAttributeRegistry implements AttributeRegistry {
         LOG.debug("Unrecognized attribute were parsed: {}", unrecognizedAttribute);
     }
 
-    @Override
-    public Attributes parseAttributes(final ByteBuf buffer) throws BGPDocumentedException, BGPParsingException {
-        return parseAttributes(buffer, null);
-    }
-
     @Override
     public Attributes parseAttributes(final ByteBuf buffer, final PeerSpecificParserConstraint constraint)
             throws BGPDocumentedException, BGPParsingException {
index 72256a2671efcbba186711bb26209b38ce540461..ae663c8520f908623b1ba826f04e2841be4d8bf0 100644 (file)
@@ -101,16 +101,6 @@ public class SimpleBGPExtensionProviderContext extends SimpleBGPExtensionConsume
         return this.getMessageRegistry().registerMessageSerializer(messageClass, serializer);
     }
 
-    /**
-     * Each extension requires a specific NextHop handler. Therefore this method has been deprecated  for
-     * the method which enforce user to register it.
-     */
-    @Deprecated
-    @Override
-    public AutoCloseable registerNlriParser(final Class<? extends AddressFamily> afi, final Class<? extends SubsequentAddressFamily> safi, final NlriParser parser) {
-        return this.getNlriRegistry().registerNlriParser(afi, safi, parser, null, null);
-    }
-
     @Override
     public AutoCloseable registerNlriParser(final Class<? extends AddressFamily> afi, final Class<? extends SubsequentAddressFamily> safi,
         final NlriParser parser, final NextHopParserSerializer nextHopParserSerializer, final Class<? extends
index 49945239b4c88640839de8a5c8901ae861deedd2..fb3c13e3e4d237d60d33fca434137ccd15e8740b 100644 (file)
@@ -140,11 +140,6 @@ final class SimpleNlriRegistry implements NlriRegistry {
         return safi;
     }
 
-    @Override
-    public MpUnreachNlri parseMpUnreach(final ByteBuf buffer) throws BGPParsingException {
-        return parseMpUnreach(buffer, null);
-    }
-
     @Override
     public MpUnreachNlri parseMpUnreach(final ByteBuf buffer, final PeerSpecificParserConstraint constraint)
             throws BGPParsingException {
@@ -176,13 +171,7 @@ final class SimpleNlriRegistry implements NlriRegistry {
                 new BgpTableTypeImpl(afi, safi));
             final NextHopParserSerializer nextHopSerializer = this.nextHopSerializers.get(key);
             final ByteBuf nextHopBuffer = Unpooled.buffer();
-            if (nextHopSerializer == null) {
-                //TODO Remove once deprecated registerNlriParser is removed
-                LOG.warn("NexHop Parser/Serializer for AFI/SAFI ({},{}) not bound", afi, safi);
-                NextHopUtil.serializeNextHop(cNextHop, nextHopBuffer);
-            } else {
-                nextHopSerializer.serializeNextHop(cNextHop, nextHopBuffer);
-            }
+            nextHopSerializer.serializeNextHop(cNextHop, nextHopBuffer);
             byteAggregator.writeByte(nextHopBuffer.writerIndex());
             byteAggregator.writeBytes(nextHopBuffer);
 
@@ -203,11 +192,6 @@ final class SimpleNlriRegistry implements NlriRegistry {
         return Iterables.unmodifiableIterable(this.serializers.values());
     }
 
-    @Override
-    public MpReachNlri parseMpReach(final ByteBuf buffer) throws BGPParsingException {
-        return parseMpReach(buffer, null);
-    }
-
     @Override
     public MpReachNlri parseMpReach(final ByteBuf buffer, final PeerSpecificParserConstraint constraint)
             throws BGPParsingException {
index 97ac39437c38c51128c6d41f164b620b2e5f199c..83fb3ec8ce51f80fe1607885933043e5f4df1bf1 100644 (file)
@@ -51,7 +51,7 @@ public class AbstractMessageRegistryTest {
         this.registry.serializeMessage(keepAlive, buffer);
         assertArrayEquals(keepAliveBMsg, ByteArray.getAllBytes(buffer));
 
-        final Notification not = this.registry.parseMessage(Unpooled.copiedBuffer(keepAliveBMsg));
+        final Notification not = this.registry.parseMessage(Unpooled.copiedBuffer(keepAliveBMsg), null);
         assertTrue(not instanceof Keepalive);
     }
 
@@ -61,7 +61,7 @@ public class AbstractMessageRegistryTest {
             (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
             (byte) 0xff, (byte) 0x00, (byte) 0x13, (byte) 0x04 };
         try {
-            this.registry.parseMessage(Unpooled.copiedBuffer(testBytes));
+            this.registry.parseMessage(Unpooled.copiedBuffer(testBytes), null);
             Assert.fail();
         } catch (BGPDocumentedException | BGPParsingException e) {
             assertTrue(e instanceof BGPDocumentedException);
@@ -75,7 +75,7 @@ public class AbstractMessageRegistryTest {
             (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
             (byte) 0xff, (byte) 0x00, (byte) 0x12, (byte) 0x04 };
         try {
-            this.registry.parseMessage(Unpooled.copiedBuffer(testBytes));
+            this.registry.parseMessage(Unpooled.copiedBuffer(testBytes), null);
             Assert.fail();
         } catch (BGPDocumentedException | BGPParsingException e) {
             assertTrue(e instanceof BGPDocumentedException);
@@ -89,7 +89,7 @@ public class AbstractMessageRegistryTest {
             (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
             (byte) 0xff, (byte) 0x00, (byte) 0x13, (byte) 0x04, (byte) 0x04 };
         try {
-            this.registry.parseMessage(Unpooled.copiedBuffer(testBytes));
+            this.registry.parseMessage(Unpooled.copiedBuffer(testBytes), null);
             Assert.fail();
         } catch (BGPDocumentedException | BGPParsingException e) {
             assertTrue(e instanceof BGPParsingException);
@@ -101,7 +101,7 @@ public class AbstractMessageRegistryTest {
     public void testBGPHeaderParser() throws Exception {
         final MessageRegistry msgReg = ServiceLoaderBGPExtensionProviderContext.getSingletonInstance().getMessageRegistry();
         try {
-            msgReg.parseMessage(Unpooled.copiedBuffer(new byte[] { (byte) 0, (byte) 0 }));
+            msgReg.parseMessage(Unpooled.copiedBuffer(new byte[] { (byte) 0, (byte) 0 }), null);
             fail("Exception should have occured.");
         } catch (final IllegalArgumentException e) {
             assertEquals("Too few bytes in passed array. Passed: 2. Expected: >= 19.", e.getMessage());
index c57ec00434daf3245d08c47f3d758836b4a83e3f..06ca1c8208e015503fbc90f84cc56d1dfec57501 100644 (file)
@@ -39,16 +39,19 @@ public class UnrecognizedAttributesTest {
     public void testUnrecognizedAttributesWithoutOptionalFlag() throws BGPDocumentedException, BGPParsingException {
         this.expException.expect(BGPDocumentedException.class);
         this.expException.expectMessage("Well known attribute not recognized.");
-        simpleAttrReg.parseAttributes(Unpooled.wrappedBuffer(new byte[] { 0x03, 0x00, 0x05, 0x01, 0x02, 0x03, 0x04, 0x05 }));
+        simpleAttrReg.parseAttributes(
+            Unpooled.wrappedBuffer(new byte[] { 0x03, 0x00, 0x05, 0x01, 0x02, 0x03, 0x04, 0x05 }), null);
     }
 
     @Test
     public void testUnrecognizedAttributes() throws BGPDocumentedException, BGPParsingException {
         final byte[] attributeBytes = { (byte)0xe0, 0x00, 0x05, 0x01, 0x02, 0x03, 0x04, 0x05 };
-        final List<UnrecognizedAttributes> unrecogAttribs = simpleAttrReg.parseAttributes(Unpooled.wrappedBuffer(attributeBytes)).getUnrecognizedAttributes();
+        final List<UnrecognizedAttributes> unrecogAttribs = simpleAttrReg
+            .parseAttributes(Unpooled.wrappedBuffer(attributeBytes), null).getUnrecognizedAttributes();
         assertEquals(UNRECOGNIZED_ATTRIBUTE_COUNT, unrecogAttribs.size());
         final UnrecognizedAttributes unrecogAttrib = unrecogAttribs.get(FIRST_ATTRIBUTE);
-        final UnrecognizedAttributesKey expectedAttribKey = new UnrecognizedAttributesKey(unrecogAttrib.getType().shortValue());
+        final UnrecognizedAttributesKey expectedAttribKey =
+            new UnrecognizedAttributesKey(unrecogAttrib.getType().shortValue());
 
         assertTrue(unrecogAttrib.isPartial());
         assertTrue(unrecogAttrib.isTransitive());
index dd6dbc66d21c390562e65a9bc7382adb969ba977..43703542d6143d637e310234fe0aa4a3245167d1 100644 (file)
@@ -34,13 +34,6 @@ final class PeerExportGroupImpl implements PeerExportGroupRegistry {
         return attributes == null || role == null ? null : this.policy.effectiveAttributes(role, attributes);
     }
 
-    @Override
-    public Collection<Map.Entry<PeerId, PeerExporTuple>> getPeers() {
-        synchronized (this.peers) {
-            return this.peers.entrySet();
-        }
-    }
-
     @Override
     public boolean containsPeer(final PeerId routePeerId) {
         synchronized (this.peers) {
index bbbbbdd8a85c821eb297e80787093b9f9bf0db54..d2539027af9d95dcf78d44de8a28f6da1fe113fe 100644 (file)
@@ -23,14 +23,6 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNod
  * Tracks peers for adj-rib-out writeout.
  */
 public interface ExportPolicyPeerTracker {
-    /**
-     * Update set with supported tables per peer
-     * @param peerId which receveid the change
-     * @param node data change
-     */
-    @Deprecated
-    default void onTablesChanged(PeerId peerId, DataTreeCandidateNode node) {}
-
     /**
      * Register Peer
      * @param peerId Peer Id
@@ -69,16 +61,6 @@ public interface ExportPolicyPeerTracker {
      */
     boolean isAddPathSupportedByPeer(@Nonnull PeerId peerId);
 
-    /**
-     * Invoked whenever a peer role changes.
-     *
-     * @param peerPath Peer's path
-     * @param role Peer's new role, null indicates the peer has disappeared.
-     */
-    @Deprecated
-    default void peerRoleChanged(@Nonnull YangInstanceIdentifier peerPath,  @Nullable PeerRole role) {
-    }
-
     /**
      * Flags peers once empty structure has been created, then changes under it can
      * be applied
index 31bb7ed57cd1283f3495bfaea44c9d1f569b3732..68adfc86c6f7d871c3e3166addf8fd002b975ff9 100644 (file)
@@ -47,13 +47,6 @@ public interface PeerExportGroup {
      */
     ContainerNode effectiveAttributes(PeerRole role, ContainerNode attributes);
 
-    /**
-     * @return map of peer
-     * @deprecated Use {@link #forEach}
-     */
-    @Deprecated
-    Collection<Map.Entry<PeerId, PeerExporTuple>> getPeers();
-
     /**
      *
      * @param routePeerId PeerId
diff --git a/bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/RouteEncoder.java b/bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/RouteEncoder.java
deleted file mode 100644 (file)
index 36afb21..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.protocol.bgp.rib.spi;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.Update;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.Route;
-
-@Deprecated
-public interface RouteEncoder {
-    Update updateMessageFor(Object key, Route route);
-}
index 63f4a9714adf4b1e364b48aafc56f7a653ce8200..38922437251d0b6bed658bd8428025c299ef9f66 100644 (file)
@@ -106,12 +106,6 @@ public abstract class AbstractTopologyBuilder<T extends Route> implements Cluste
         registerDataChangeListener();
     }
 
-    @Deprecated
-    public final InstanceIdentifier<Tables> tableInstanceIdentifier(final Class<? extends AddressFamily> afi,
-            final Class<? extends SubsequentAddressFamily> safi) {
-        return this.locRibReference.getInstanceIdentifier().builder().child(LocRib.class).child(Tables.class, new TablesKey(afi, safi)).build();
-    }
-
     /**
      * Register to data tree change listener
      */
index 543260727303eb1776cb9babba3cba65d0acf255..2b51597056a9c0304857345eaccfca89b0cd46d8 100755 (executable)
@@ -29,7 +29,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mess
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.path.attributes.Attributes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.path.attributes.AttributesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.path.attributes.attributes.OriginBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.bgp.rib.rib.LocRib;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.rib.Tables;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.rib.TablesKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.BgpOrigin;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.Ipv4AddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.UnicastSubsequentAddressFamily;
@@ -56,11 +58,11 @@ public class Ipv4ReachabilityTopologyBuilderTest extends AbstractTopologyBuilder
         super.setUp();
         this.ipv4TopoBuilder = new Ipv4ReachabilityTopologyBuilder(getDataBroker(), LOC_RIB_REF, TEST_TOPOLOGY_ID);
         this.ipv4TopoBuilder.start();
-        final InstanceIdentifier<Tables> path = this.ipv4TopoBuilder.tableInstanceIdentifier(Ipv4AddressFamily.class,
-            UnicastSubsequentAddressFamily.class);
+        final InstanceIdentifier<Tables> path = LOC_RIB_REF.getInstanceIdentifier().builder().child(LocRib.class)
+            .child(Tables.class, new TablesKey(Ipv4AddressFamily.class, UnicastSubsequentAddressFamily.class)).build();
+
         this.ipv4RouteIID = path.builder().child((Class) Ipv4Routes.class)
-            .child(Ipv4Route.class, new Ipv4RouteKey(new PathId(PATH_ID),
-                new Ipv4Prefix(ROUTE_IP4PREFIX))).build();
+            .child(Ipv4Route.class, new Ipv4RouteKey(new PathId(PATH_ID), new Ipv4Prefix(ROUTE_IP4PREFIX))).build();
     }
 
     @Test
index 30eeadc97d76a46ff761cd7bd7bb95697083a0a6..3b2ac97a52cee0f57dd0cb30a44fa15312273964 100755 (executable)
@@ -29,9 +29,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.PathId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.path.attributes.Attributes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.path.attributes.AttributesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.path.attributes.attributes.Origin;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.path.attributes.attributes.OriginBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.bgp.rib.rib.LocRib;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.rib.Tables;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.rib.TablesKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.BgpOrigin;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.Ipv6AddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.UnicastSubsequentAddressFamily;
@@ -57,8 +58,8 @@ public class Ipv6ReachabilityTopologyBuilderTest extends AbstractTopologyBuilder
         super.setUp();
         this.ipv6TopoBuilder = new Ipv6ReachabilityTopologyBuilder(getDataBroker(), LOC_RIB_REF, TEST_TOPOLOGY_ID);
         this.ipv6TopoBuilder.start();
-        final InstanceIdentifier<Tables> path = this.ipv6TopoBuilder
-            .tableInstanceIdentifier(Ipv6AddressFamily.class, UnicastSubsequentAddressFamily.class);
+        final InstanceIdentifier<Tables> path = LOC_RIB_REF.getInstanceIdentifier().builder().child(LocRib.class)
+            .child(Tables.class, new TablesKey(Ipv6AddressFamily.class, UnicastSubsequentAddressFamily.class)).build();
         this.ipv6RouteIID = path.builder().child((Class) Ipv6Routes.class)
             .child(Ipv6Route.class, new Ipv6RouteKey(new PathId(PATH_ID),
                 new Ipv6Prefix(ROUTE_IP6PREFIX))).build();
index 2d4c48c77444b2e825af67c0da44ceedede2be3e..347a7cac1e91cba9d33759f6810d8f8bdd40610a 100755 (executable)
@@ -78,7 +78,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.link
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.node.identifier.c.router.identifier.isis.node._case.IsisNodeBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.path.attributes.AttributesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.path.attributes.attributes.OriginBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.bgp.rib.rib.LocRib;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.rib.Tables;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.rib.TablesKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.BgpOrigin;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.Bandwidth;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.IgpMetric;
@@ -98,7 +100,8 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 public class LinkstateTopologyBuilderTest extends AbstractTopologyBuilderTest {
 
-    private static final byte[] LINKSTATE_ROUTE_KEY = Unpooled.wrappedBuffer(StandardCharsets.UTF_8.encode("linkstate-route")).array();
+    private static final byte[] LINKSTATE_ROUTE_KEY = Unpooled.wrappedBuffer(
+        StandardCharsets.UTF_8.encode("linkstate-route")).array();
     private static final String ROUTER_1_ID = "127.0.0.1";
     private static final String ROUTER_2_ID = "127.0.0.2";
     private static final String NODE_1_PREFIX = "127.0.1.1/32";
@@ -119,10 +122,14 @@ public class LinkstateTopologyBuilderTest extends AbstractTopologyBuilderTest {
     @Override
     public void setUp() {
         super.setUp();
-        this.linkstateTopoBuilder = new LinkstateTopologyBuilder(getDataBroker(), LOC_RIB_REF, TEST_TOPOLOGY_ID, LISTENER_RESTART_TIME, LISTENER_ENFORCE_COUNTER);
+        this.linkstateTopoBuilder = new LinkstateTopologyBuilder(getDataBroker(), LOC_RIB_REF, TEST_TOPOLOGY_ID,
+            LISTENER_RESTART_TIME, LISTENER_ENFORCE_COUNTER);
         this.linkstateTopoBuilder.start();
-        final InstanceIdentifier<Tables> path = this.linkstateTopoBuilder.tableInstanceIdentifier(LinkstateAddressFamily.class, LinkstateSubsequentAddressFamily.class);
-        this.linkstateRouteIID = path.builder().child((Class) LinkstateRoutes.class).child(LinkstateRoute.class, new LinkstateRouteKey(LINKSTATE_ROUTE_KEY)).build();
+        final InstanceIdentifier<Tables> path = LOC_RIB_REF.getInstanceIdentifier().builder().child(LocRib.class)
+            .child(Tables.class, new TablesKey(LinkstateAddressFamily.class, LinkstateSubsequentAddressFamily.class))
+            .build();
+        this.linkstateRouteIID = path.builder().child((Class) LinkstateRoutes.class)
+            .child(LinkstateRoute.class, new LinkstateRouteKey(LINKSTATE_ROUTE_KEY)).build();
 
     }
 
index 8561444afbba7440a126b278cb9534dc9ee6b8a5..dff3b7e922c2f72d3bea81c153088957f0a933e0 100644 (file)
@@ -93,34 +93,6 @@ public final class Ipv4Util {
         return IetfInetUtil.INSTANCE.ipv4PrefixToBytes(prefix);
     }
 
-    /**
-     * Converts Ipv4Prefix to byte array. Prefix length at the beginning.
-     * Prefix bytes are trimmed from the end to match prefix length.
-     *
-     * @param prefix Ipv4Prefix to be converted
-     * @return byte array with the prefix length at the beginning
-     *
-     * @deprecated This is inefficient, refactor code to use {@link #bytesForAddress(Ipv4Address)} or
-     *             {@link ByteBufWriteUtil#writeMinimalPrefix(Ipv4Prefix, ByteBuf)}.
-     */
-    @Deprecated
-    public static byte[] bytesForPrefixBegin(final Ipv4Prefix prefix) {
-        final byte[] addrWithPrefix = bytesForPrefix(prefix);
-        return prefixedBytes(addrWithPrefix[IP4_LENGTH], addrWithPrefix);
-    }
-
-    static byte[] prefixedBytes(final byte prefixBits, final byte[] address) {
-        if (prefixBits != 0) {
-            final int prefixBytes = prefixBitsToBytes(Byte.toUnsignedInt(prefixBits));
-            final byte[] ret = new byte[prefixBytes + 1];
-            ret[0] = prefixBits;
-            System.arraycopy(address, 0, ret, 1, prefixBytes);
-            return ret;
-        } else {
-            return new byte[] { 0 };
-        }
-    }
-
     /**
      * Creates an Ipv4Prefix object from given byte array.
      *
index a6fefaf22592d3cdfd0aec27ac7ef41a73c60f6f..734208e637f16971de38a7958860463549dd105a 100644 (file)
@@ -81,22 +81,6 @@ public final class Ipv6Util {
         return IetfInetUtil.INSTANCE.ipv6PrefixToBytes(prefix);
     }
 
-    /**
-     * Converts Ipv6Prefix to byte array. Prefix length at the beginning.
-     * Prefix bytes are trimmed from the end to match prefix length.
-     *
-     * @param prefix Ipv6Prefix to be converted
-     * @return byte array with the prefix length at the beginning
-     *
-     * @deprecated This is inefficient, refactor code to use {@link #bytesForAddress(Ipv6Address)} or
-     *             {@link ByteBufWriteUtil#writeMinimalPrefix(Ipv6Prefix, ByteBuf)}.
-     */
-    @Deprecated
-    public static byte[] bytesForPrefixBegin(final Ipv6Prefix prefix) {
-        final byte[] addrWithPrefix = bytesForPrefix(prefix);
-        return Ipv4Util.prefixedBytes(addrWithPrefix[IPV6_LENGTH], addrWithPrefix);
-    }
-
     /**
      * Creates an Ipv6Prefix object from given byte array.
      *
index 7c8e0e342e9535f82c11e235d97fa4f4c6b7dcd5..7166144d44807f9f2b76db61a767b83a6e089d93 100644 (file)
@@ -75,18 +75,12 @@ public class IPAddressesAndPrefixesTest {
     public void testBytesForPrefix4Begin() {
         byte[] bytes = new byte[] { 123, 122, 4, 5 };
         assertEquals(new Ipv4Prefix("123.122.4.5/8"), Ipv4Util.prefixForBytes(bytes, 8));
-        assertArrayEquals(new byte[] { 8, 102 }, Ipv4Util.bytesForPrefixBegin(new Ipv4Prefix("102.0.0.0/8")));
 
         bytes = new byte[] { (byte) 255, (byte) 255, 0, 0 };
         assertEquals(new Ipv4Prefix("255.255.0.0/16"), Ipv4Util.prefixForBytes(bytes, 16));
 
-        assertArrayEquals(new byte[] { 16, (byte) 255, (byte) 255 }, Ipv4Util.bytesForPrefixBegin(new Ipv4Prefix("255.255.0.0/16")));
-
         bytes = new byte[] { (byte) 0, (byte) 0, (byte) 0, (byte) 0 };
         assertEquals(new Ipv4Prefix("0.0.0.0/0"), Ipv4Util.prefixForBytes(bytes, 0));
-
-        bytes = new byte[] { (byte) 0 };
-        assertArrayEquals(bytes, Ipv4Util.bytesForPrefixBegin(new Ipv4Prefix("0.0.0.0/0")));
     }
 
     @Test
@@ -149,11 +143,9 @@ public class IPAddressesAndPrefixesTest {
     public void testBytesForPrefix6Begin() {
         byte[] bytes = new byte[] { 0x20, 0x01, 0x0d, (byte) 0xb8, 0x00, 0x01, 0x00, 0x02 };
         assertEquals(new Ipv6Prefix("2001:db8:1:2::/64"), Ipv6Util.prefixForBytes(bytes, 64));
-        assertArrayEquals(new byte[] { 0x40, 0x20, (byte) 0x01, 0x0d, (byte) 0xb8, 0x00, 0x01, 0x00, 0x02 }, Ipv6Util.bytesForPrefixBegin(new Ipv6Prefix("2001:db8:1:2::/64")));
 
         bytes = new byte[] { (byte) 0 };
         assertEquals(new Ipv6Prefix("::/0"), Ipv6Util.prefixForBytes(bytes, 0));
-        assertArrayEquals(bytes, Ipv6Util.bytesForPrefixBegin(new Ipv6Prefix("::/0")));
     }
 
     @Test