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;
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;
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,
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(
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();
}
@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);