/* * Copyright (c) 2015 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.impl; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev150305.ipv6.routes.Ipv6Routes; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev150305.ipv6.routes.ipv6.routes.Ipv6Route; 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; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.rib.tables.Routes; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode; import org.opendaylight.yangtools.yang.data.impl.schema.Builders; import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes; /** * Class supporting IPv6 unicast RIBs. */ final class IPv6RIBSupport extends AbstractIPRIBSupport { private static final IPv6RIBSupport SINGLETON = new IPv6RIBSupport(); private final ChoiceNode emptyRoutes = Builders.choiceBuilder() .withNodeIdentifier(new NodeIdentifier(Routes.QNAME)) .addChild(Builders.containerBuilder() .withNodeIdentifier(new NodeIdentifier(Ipv6Routes.QNAME)) .withChild(ImmutableNodes.mapNodeBuilder(Ipv6Route.QNAME).build()).build()).build(); private final NodeIdentifier destination = new NodeIdentifier(DestinationIpv6Case.QNAME); private final NodeIdentifier route = new NodeIdentifier(Ipv6Route.QNAME); private IPv6RIBSupport() { super(Ipv6Routes.QNAME); } static IPv6RIBSupport getInstance() { return SINGLETON; } @Override public ChoiceNode emptyRoutes() { return this.emptyRoutes; } @Override protected NodeIdentifier destinationContainerIdentifier() { return this.destination; } @Override protected NodeIdentifier routeIdentifier() { return this.route; } }