BGPCEP-576: Neighbor’s local address configurable
[bgpcep.git] / bgp / rib-impl / src / main / java / org / opendaylight / protocol / bgp / rib / impl / spi / BGPDispatcher.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.impl.spi;
9
10 import io.netty.channel.ChannelFuture;
11 import io.netty.util.concurrent.Future;
12 import java.net.InetSocketAddress;
13 import javax.annotation.Nonnull;
14 import javax.annotation.Nullable;
15 import org.opendaylight.protocol.concepts.KeyMapping;
16
17 /**
18  * Dispatcher class for creating BGP clients.
19  */
20 public interface BGPDispatcher {
21     /**
22      * Creates Reconnecting client.
23      *
24      * @param remoteAddress remote Peer Address
25      * @param localAddress  local Peer address
26      * @param retryTimer    Retry timer
27      * @param keys          for TCPMD5
28      * @return Future promising a client session
29      */
30     @Nonnull
31     Future<Void> createReconnectingClient(@Nonnull InetSocketAddress remoteAddress,
32             @Nullable InetSocketAddress localAddress, int retryTimer, @Nonnull KeyMapping keys);
33
34     /**
35      * Create new BGP server to accept incoming bgp connections (bound to provided socket localAddress).
36      *
37      * @param localAddress Peer localAddress
38      * @return ChannelFuture promising a client session
39      */
40     @Nonnull
41     ChannelFuture createServer(InetSocketAddress localAddress);
42
43     /**
44      * Return BGP Peer Registry
45      *
46      * @return BGPPeerRegistry
47      */
48     @Nonnull
49     BGPPeerRegistry getBGPPeerRegistry();
50 }