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.tcpmd5.api.KeyMapping;
18 * Dispatcher class for creating BGP clients.
20 public interface BGPDispatcher{
25 * @param remoteAddress remote Peer address
26 * @param peerRegistry BGP peer registry
27 * @param retryTimer Retry timer
28 * @return Future promising a client session
30 Future<? extends BGPSession> createClient(InetSocketAddress remoteAddress, BGPPeerRegistry peerRegistry, int retryTimer);
33 * Creates Reconnecting client.
35 * @param remoteAddress remote Peer Address
36 * @param peerRegistry BGP peer registry
37 * @param retryTimer Retry timer
38 * @param keys for TCPMD5
39 * @return Future promising a client session
41 Future<Void> createReconnectingClient(InetSocketAddress remoteAddress,
42 BGPPeerRegistry peerRegistry, int retryTimer, Optional<KeyMapping> keys);
45 * Create new BGP server to accept incoming bgp connections (bound to provided socket localAddress).
47 * @param peerRegistry BGP peer registry
48 * @param localAddress Peer localAddress
50 * @return ChannelFuture promising a client session
52 ChannelFuture createServer(BGPPeerRegistry peerRegistry, InetSocketAddress localAddress);