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.flowspec;
10 import java.util.ArrayList;
11 import java.util.List;
12 import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
13 import org.opendaylight.protocol.bgp.flowspec.l3vpn.ipv4.FlowspecL3vpnIpv4RIBSupport;
14 import org.opendaylight.protocol.bgp.flowspec.l3vpn.ipv6.FlowspecL3vpnIpv6RIBSupport;
15 import org.opendaylight.protocol.bgp.rib.spi.AbstractRIBExtensionProviderActivator;
16 import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderContext;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.FlowspecL3vpnSubsequentAddressFamily;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.FlowspecSubsequentAddressFamily;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.Ipv4AddressFamily;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.Ipv6AddressFamily;
22 public final class RIBActivator extends AbstractRIBExtensionProviderActivator {
24 private final SimpleFlowspecExtensionProviderContext fsContext;
26 public RIBActivator(SimpleFlowspecExtensionProviderContext context) {
28 this.fsContext = context;
32 protected List<AutoCloseable> startRIBExtensionProviderImpl(
33 final RIBExtensionProviderContext context,
34 final BindingNormalizedNodeSerializer mappingService) {
35 final List<AutoCloseable> regs = new ArrayList<>(4);
36 regs.add(context.registerRIBSupport(Ipv4AddressFamily.class, FlowspecSubsequentAddressFamily.class,
37 FlowspecIpv4RIBSupport.getInstance(this.fsContext, mappingService)));
38 regs.add(context.registerRIBSupport(Ipv6AddressFamily.class, FlowspecSubsequentAddressFamily.class,
39 FlowspecIpv6RIBSupport.getInstance(this.fsContext, mappingService)));
40 regs.add(context.registerRIBSupport(Ipv4AddressFamily.class, FlowspecL3vpnSubsequentAddressFamily.class,
41 FlowspecL3vpnIpv4RIBSupport.getInstance(this.fsContext, mappingService)));
42 regs.add(context.registerRIBSupport(Ipv6AddressFamily.class, FlowspecL3vpnSubsequentAddressFamily.class,
43 FlowspecL3vpnIpv6RIBSupport.getInstance(this.fsContext, mappingService)));