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.bgp.rib.rib.loc.rib.tables.routes.Ipv6RoutesCase;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev150305.ipv6.prefixes.DestinationIpv6;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev150305.ipv6.routes.Ipv6Routes;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev150305.ipv6.routes.ipv6.routes.Ipv6Route;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.rib.tables.Routes;
15 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
16 import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode;
17 import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
18 import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
21 * Class supporting IPv6 unicast RIBs.
23 final class IPv6RIBSupport extends AbstractIPRIBSupport {
24 private static final IPv6RIBSupport SINGLETON = new IPv6RIBSupport();
25 private final ChoiceNode emptyRoutes = Builders.choiceBuilder()
26 .withNodeIdentifier(new NodeIdentifier(Routes.QNAME))
27 .addChild(Builders.containerBuilder()
28 .withNodeIdentifier(new NodeIdentifier(Ipv6Routes.QNAME))
29 .withChild(ImmutableNodes.mapNodeBuilder(Ipv6Route.QNAME).build()).build()).build();
30 private final NodeIdentifier destination = new NodeIdentifier(DestinationIpv6.QNAME);
31 private final NodeIdentifier route = new NodeIdentifier(Ipv6Route.QNAME);
33 private IPv6RIBSupport() {
34 super(Ipv6RoutesCase.class, Ipv6Routes.class, Ipv6Route.class);
37 static IPv6RIBSupport getInstance() {
42 public ChoiceNode emptyRoutes() {
43 return this.emptyRoutes;
47 protected NodeIdentifier destinationContainerIdentifier() {
48 return this.destination;
52 protected NodeIdentifier routeIdentifier() {