Bump MRI upstreams
[bgpcep.git] / bgp / extensions / labeled-unicast / src / main / java / org / opendaylight / protocol / bgp / labeled / unicast / LabeledUnicastIpv6RIBSupport.java
index 29d1fc4e02118d147f159ebe5a2bd09a16553350..e4a3639304b9b109898365267d316d20511951c9 100644 (file)
@@ -10,8 +10,7 @@ package org.opendaylight.protocol.bgp.labeled.unicast;
 import static com.google.common.base.Verify.verify;
 
 import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
+import java.util.Map;
 import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix;
@@ -19,6 +18,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labe
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev180329.labeled.unicast.ipv6.routes.LabeledUnicastIpv6Routes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev180329.labeled.unicast.ipv6.routes.LabeledUnicastIpv6RoutesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev180329.labeled.unicast.routes.list.LabeledUnicastRoute;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev180329.labeled.unicast.routes.list.LabeledUnicastRouteKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationIpv6LabeledUnicastCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.destination.ipv6.labeled.unicast._case.DestinationIpv6LabeledUnicast;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.destination.ipv6.labeled.unicast._case.DestinationIpv6LabeledUnicastBuilder;
@@ -31,12 +31,9 @@ import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
 
 final class LabeledUnicastIpv6RIBSupport
         extends AbstractLabeledUnicastRIBSupport<LabeledUnicastIpv6RoutesCase, LabeledUnicastIpv6Routes> {
+    private static final LabeledUnicastIpv6Routes EMPTY_CONTAINER = new LabeledUnicastIpv6RoutesBuilder().build();
 
-    private static final LabeledUnicastIpv6Routes EMPTY_CONTAINER
-            = new LabeledUnicastIpv6RoutesBuilder().setLabeledUnicastRoute(Collections.emptyList()).build();
-    private static LabeledUnicastIpv6RIBSupport SINGLETON;
-
-    private LabeledUnicastIpv6RIBSupport(final BindingNormalizedNodeSerializer mappingService) {
+    LabeledUnicastIpv6RIBSupport(final BindingNormalizedNodeSerializer mappingService) {
         super(mappingService,
                 LabeledUnicastIpv6RoutesCase.class,
                 LabeledUnicastIpv6Routes.class,
@@ -44,13 +41,6 @@ final class LabeledUnicastIpv6RIBSupport
                 DestinationIpv6LabeledUnicast.QNAME);
     }
 
-    static synchronized LabeledUnicastIpv6RIBSupport getInstance(final BindingNormalizedNodeSerializer mappingService) {
-        if (SINGLETON == null) {
-            SINGLETON = new LabeledUnicastIpv6RIBSupport(mappingService);
-        }
-        return SINGLETON;
-    }
-
     @Override
     protected DestinationType buildDestination(final Collection<MapEntryNode> routes) {
         return new DestinationIpv6LabeledUnicastCaseBuilder().setDestinationIpv6LabeledUnicast(
@@ -63,7 +53,7 @@ final class LabeledUnicastIpv6RIBSupport
         return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev180329
                 .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.rev180329
+                    new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev180329
                         .update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.destination.ipv6
                         .labeled.unicast._case.DestinationIpv6LabeledUnicastBuilder()
                         .setCLabeledUnicastDestination(extractRoutes(routes)).build()).build();
@@ -85,7 +75,7 @@ final class LabeledUnicastIpv6RIBSupport
     }
 
     @Override
-    public List<LabeledUnicastRoute> extractAdjRibInRoutes(final Routes routes) {
+    public Map<LabeledUnicastRouteKey, LabeledUnicastRoute> extractAdjRibInRoutes(final Routes routes) {
         verify(routes instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast
             .rev180329.bgp.rib.rib.peer.adj.rib.in.tables.routes.LabeledUnicastIpv6RoutesCase, "Unrecognized routes %s",
             routes);