Bump versions to 0.21.7-SNAPSHOT
[bgpcep.git] / bgp / extensions / inet / src / main / java / org / opendaylight / protocol / bgp / inet / TableTypeActivator.java
1 /*
2  * Copyright (c) 2016 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.inet;
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.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProvider;
15 import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator;
16 import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.types.rev151009.IPV4UNICAST;
17 import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.types.rev151009.IPV6UNICAST;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.Ipv4AddressFamily;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.Ipv6AddressFamily;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.UnicastSubsequentAddressFamily;
21 import org.opendaylight.yangtools.concepts.Registration;
22 import org.osgi.service.component.annotations.Component;
23
24 @Singleton
25 @Component(immediate = true, property = "type=org.opendaylight.protocol.bgp.inet.TableTypeActivator")
26 @MetaInfServices
27 public final class TableTypeActivator implements BGPTableTypeRegistryProviderActivator {
28     @Inject
29     public TableTypeActivator() {
30         // Exposed for DI
31     }
32
33     @Override
34     public List<Registration> startBGPTableTypeRegistryProvider(final BGPTableTypeRegistryProvider provider) {
35         return List.of(
36             provider.registerBGPTableType(Ipv4AddressFamily.VALUE, UnicastSubsequentAddressFamily.VALUE,
37                 IPV4UNICAST.VALUE),
38             provider.registerBGPTableType(Ipv6AddressFamily.VALUE, UnicastSubsequentAddressFamily.VALUE,
39                 IPV6UNICAST.VALUE));
40     }
41 }