Provide Add Path support for all AFI/SAFI
[bgpcep.git] / bgp / openconfig-spi / src / main / java / org / opendaylight / protocol / bgp / openconfig / spi / BGPTableTypeRegistryConsumer.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
9 package org.opendaylight.protocol.bgp.openconfig.spi;
10
11 import java.util.Optional;
12 import javax.annotation.Nonnull;
13 import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.types.rev151009.AfiSafiType;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.BgpTableType;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.TablesKey;
16
17 /**
18  * Provides access to BGP AFI/SAFI registry.
19  */
20 public interface BGPTableTypeRegistryConsumer {
21
22     /**
23      * Looks for BgpTableType based on OpenConfig AFI/SAFI.
24      *
25      * @param afiSafiType afiSafi Type
26      * @return Optional of BgpTableType or empty, if the table type is not supported.
27      */
28     @Nonnull
29     Optional<BgpTableType> getTableType(@Nonnull Class<? extends AfiSafiType> afiSafiType);
30
31     /**
32      * Looks for BgpTableType based on OpenConfig AFI/SAFI.
33      *
34      * @param afiSafiType afiSafi Type
35      * @return Optional of TableKey or empty, if the table type is not supported.
36      */
37     @Nonnull
38     Optional<TablesKey> getTableKey(@Nonnull Class<? extends AfiSafiType> afiSafiType);
39
40     /**
41      * Looks for AfiSafiType based on BgpTableType.
42      *
43      * @param bgpTableType Bgp TableType
44      * @return Optional of OpenConfig AFI/SAFI or empty, if the table type is not supported.
45      */
46     @Nonnull
47     Optional<Class<? extends AfiSafiType>> getAfiSafiType(@Nonnull BgpTableType bgpTableType);
48
49     /**
50      * Looks for AfiSafiType based on TablesKey.
51      *
52      * @param tablesKey Tables Key
53      * @return Optional of OpenConfig AFI/SAFI or empty, if the table type is not supported.
54      */
55     @Nonnull
56     Optional<Class<? extends AfiSafiType>> getAfiSafiType(@Nonnull TablesKey tablesKey);
57 }