2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.protocol.bgp.rib.impl.spi;
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;
18 * Dispatcher class for creating BGP clients.
20 public interface BGPDispatcher {
22 * Creates Reconnecting client.
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
31 Future<Void> createReconnectingClient(@Nonnull InetSocketAddress remoteAddress,
32 @Nullable InetSocketAddress localAddress, int retryTimer, @Nonnull KeyMapping keys);
35 * Create new BGP server to accept incoming bgp connections (bound to provided socket localAddress).
37 * @param localAddress Peer localAddress
38 * @return ChannelFuture promising a client session
41 ChannelFuture createServer(InetSocketAddress localAddress);
44 * Return BGP Peer Registry
46 * @return BGPPeerRegistry
49 BGPPeerRegistry getBGPPeerRegistry();