dc2e98b4ad9483a16d1a0c7e25e3420f77cd46fd
[bgpcep.git] / bgp / rib-spi / src / main / java / org / opendaylight / protocol / bgp / rib / spi / RIBExtensionProviderContext.java
1 /*
2  * Copyright (c) 2013 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.rib.spi;
9
10 import javax.annotation.Nonnull;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.AddressFamily;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.SubsequentAddressFamily;
13
14 /**
15  * Interface for registering AdjRIBsIn factories. In order for a model-driven RIB implementation to work correctly, it
16  * has to know how to handle individual NLRI fields, whose encoding is specific to a AFI/SAFI pair. This interface
17  * exposes an interface for registration of factories for creating AdjRIBsIn instances, which handle the specifics.
18  */
19 public interface RIBExtensionProviderContext extends RIBExtensionConsumerContext {
20
21     /**
22      * Register a RIBSupport instance for a particular AFI/SAFI combination.
23      *
24      * @param afi     Address Family identifier
25      * @param safi    Subsequent Address Family identifier
26      * @param support T RIBSupport instance
27      * @return Registration handle. Call {@link RIBSupportRegistration#close()} method to remove it.
28      * @throws NullPointerException if any of the arguments is null
29      */
30     <T extends RIBSupport> RIBSupportRegistration<T> registerRIBSupport(
31             @Nonnull Class<? extends AddressFamily> afi,
32             @Nonnull Class<? extends SubsequentAddressFamily> safi, T support);
33 }