Bump upstreams to 2022.09
[bgpcep.git] / bgp / extensions / flowspec / src / main / java / org / opendaylight / protocol / bgp / flowspec / RIBActivator.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.protocol.bgp.flowspec;
9
10 import java.util.List;
11 import javax.inject.Inject;
12 import javax.inject.Singleton;
13 import org.kohsuke.MetaInfServices;
14 import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
15 import org.opendaylight.protocol.bgp.flowspec.l3vpn.ipv4.FlowspecL3vpnIpv4RIBSupport;
16 import org.opendaylight.protocol.bgp.flowspec.l3vpn.ipv6.FlowspecL3vpnIpv6RIBSupport;
17 import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator;
18 import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderContext;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev200120.FlowspecL3vpnSubsequentAddressFamily;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev200120.FlowspecSubsequentAddressFamily;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.Ipv4AddressFamily;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.Ipv6AddressFamily;
23 import org.opendaylight.yangtools.concepts.Registration;
24 import org.osgi.service.component.annotations.Component;
25
26 @Singleton
27 @Component(immediate = true, property = "type=org.opendaylight.protocol.bgp.flowspec.RIBActivator")
28 @MetaInfServices
29 public final class RIBActivator implements RIBExtensionProviderActivator {
30     @Inject
31     public RIBActivator() {
32         // Exposed for DI
33     }
34
35     @Override
36     public List<Registration> startRIBExtensionProvider(final RIBExtensionProviderContext context,
37             final BindingNormalizedNodeSerializer mappingService) {
38         return List.of(
39             context.registerRIBSupport(Ipv4AddressFamily.VALUE, FlowspecSubsequentAddressFamily.VALUE,
40                 new FlowspecIpv4RIBSupport(mappingService)),
41             context.registerRIBSupport(Ipv6AddressFamily.VALUE, FlowspecSubsequentAddressFamily.VALUE,
42                 new FlowspecIpv6RIBSupport(mappingService)),
43             context.registerRIBSupport(Ipv4AddressFamily.VALUE, FlowspecL3vpnSubsequentAddressFamily.VALUE,
44                 new FlowspecL3vpnIpv4RIBSupport(mappingService)),
45             context.registerRIBSupport(Ipv6AddressFamily.VALUE, FlowspecL3vpnSubsequentAddressFamily.VALUE,
46                 new FlowspecL3vpnIpv6RIBSupport(mappingService)));
47     }
48 }