BUG-4197: BGP OpenConfig SPI
[bgpcep.git] / bgp / openconfig-spi / src / main / java / org / opendaylight / protocol / bgp / openconfig / spi / BGPOpenconfigMapper.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
9 package org.opendaylight.protocol.bgp.openconfig.spi;
10
11 import javax.annotation.Nonnull;
12
13 /**
14  * The BGPOpenconfigMapper provides operations for adding/removing of BGP OpenConfig
15  * components mapped to BGP configuration modules
16  *
17  * @param <T> The type of a BGP module configuration holder to which the mapper is binded
18  */
19 public interface BGPOpenconfigMapper<T extends InstanceConfiguration> {
20
21     /**
22      * Add a new or replace an exiting configuration. The write operation is done in
23      * non-blocking fashion.
24      * @param instanceConfiguration An input configuration is mapped to OpenConfig API
25      * @throws NullPointerException when the instanceConfiguration is null
26      */
27     void writeConfiguration(@Nonnull T instanceConfiguration);
28
29     /**
30      * Remove an existing configuration identified by InstanceConfigurationIdentifier.
31      * @param instanceConfiguration an identifier of the configuration instance
32      * @throws NullPointerException when instanceConfiguration is null
33      */
34     void removeConfiguration(@Nonnull InstanceConfigurationIdentifier instanceConfiguration);
35
36 }