2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.protocol.bgp.rib.impl;
10 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev150305.ipv6.routes.Ipv6Routes;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev150305.ipv6.routes.ipv6.routes.Ipv6Route;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev150305.update.path.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationIpv6Case;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.rib.tables.Routes;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
15 import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode;
16 import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
17 import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
20 * Class supporting IPv6 unicast RIBs.
22 final class IPv6RIBSupport extends AbstractIPRIBSupport {
23 private static final IPv6RIBSupport SINGLETON = new IPv6RIBSupport();
24 private final ChoiceNode emptyRoutes = Builders.choiceBuilder()
25 .withNodeIdentifier(new NodeIdentifier(Routes.QNAME))
26 .addChild(Builders.containerBuilder()
27 .withNodeIdentifier(new NodeIdentifier(Ipv6Routes.QNAME))
28 .withChild(ImmutableNodes.mapNodeBuilder(Ipv6Route.QNAME).build()).build()).build();
29 private final NodeIdentifier destination = new NodeIdentifier(DestinationIpv6Case.QNAME);
30 private final NodeIdentifier route = new NodeIdentifier(Ipv6Route.QNAME);
32 private IPv6RIBSupport() {
33 super(Ipv6Routes.QNAME);
36 static IPv6RIBSupport getInstance() {
41 public ChoiceNode emptyRoutes() {
42 return this.emptyRoutes;
46 protected NodeIdentifier destinationContainerIdentifier() {
47 return this.destination;
51 protected NodeIdentifier routeIdentifier() {