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 org.eclipse.jdt.annotation.NonNull;
14 import org.eclipse.jdt.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
30 @NonNull Future<Void> createReconnectingClient(@NonNull InetSocketAddress remoteAddress,
31 @Nullable InetSocketAddress localAddress, int retryTimer, @NonNull KeyMapping keys);
34 * Create new BGP server to accept incoming bgp connections (bound to provided socket localAddress).
36 * @param localAddress Peer localAddress
37 * @return ChannelFuture promising a client session
39 @NonNull ChannelFuture createServer(InetSocketAddress localAddress);
42 * Return BGP Peer Registry.
44 * @return BGPPeerRegistry
46 @NonNull BGPPeerRegistry getBGPPeerRegistry();