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 com.google.common.base.Optional;
11 import io.netty.channel.ChannelFuture;
12 import io.netty.util.concurrent.Future;
13 import java.net.InetSocketAddress;
14 import org.opendaylight.protocol.bgp.rib.spi.BGPSession;
15 import org.opendaylight.protocol.concepts.KeyMapping;
18 * Dispatcher class for creating BGP clients.
20 public interface BGPDispatcher{
25 * @param remoteAddress remote Peer address
26 * @param retryTimer Retry timer
27 * @return Future promising a client session
29 Future<? extends BGPSession> createClient(InetSocketAddress remoteAddress, int retryTimer);
32 * Creates Reconnecting client.
34 * @param remoteAddress remote Peer Address
35 * @param retryTimer Retry timer
36 * @param keys for TCPMD5
37 * @return Future promising a client session
39 Future<Void> createReconnectingClient(InetSocketAddress remoteAddress, int retryTimer, Optional<KeyMapping> keys);
42 * Create new BGP server to accept incoming bgp connections (bound to provided socket localAddress).
44 * @param localAddress Peer localAddress
46 * @return ChannelFuture promising a client session
48 ChannelFuture createServer(InetSocketAddress localAddress);
51 * Return BGP Peer Registry
52 * @return BGPPeerRegistry
54 BGPPeerRegistry getBGPPeerRegistry();