2 * Copyright (c) 2016 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.l3vpn.ipv4;
10 import java.util.ArrayList;
11 import java.util.List;
12 import org.opendaylight.protocol.bgp.parser.spi.AbstractBGPExtensionProviderActivator;
13 import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.Ipv4AddressFamily;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.MplsLabeledVpnSubsequentAddressFamily;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.next.hop.c.next.hop.Ipv4NextHopCase;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev180329.l3vpn.ipv4.routes.VpnIpv4Routes;
19 public final class BgpIpv4Activator extends AbstractBGPExtensionProviderActivator {
22 protected List<AutoCloseable> startImpl(final BGPExtensionProviderContext context) {
23 final List<AutoCloseable> regs = new ArrayList<>();
25 final VpnIpv4NlriParser nlriParser = new VpnIpv4NlriParser();
26 final VpnIpv4NextHopParserSerializer nextHopParser = new VpnIpv4NextHopParserSerializer();
28 regs.add(context.registerNlriParser(Ipv4AddressFamily.class, MplsLabeledVpnSubsequentAddressFamily.class,
29 nlriParser, nextHopParser, Ipv4NextHopCase.class));
30 regs.add(context.registerNlriSerializer(VpnIpv4Routes.class, nlriParser));