*/
package org.opendaylight.protocol.bgp.rib.impl.spi;
+import com.google.common.base.Optional;
+import io.netty.channel.ChannelFuture;
import io.netty.util.concurrent.Future;
-
import java.net.InetSocketAddress;
-
-import org.opendaylight.protocol.bgp.parser.BGPSession;
-import org.opendaylight.protocol.bgp.parser.BGPSessionListener;
-import org.opendaylight.protocol.framework.ReconnectStrategy;
+import org.opendaylight.protocol.bgp.rib.spi.BGPSession;
+import org.opendaylight.protocol.concepts.KeyMapping;
/**
* Dispatcher class for creating BGP clients.
*/
-public interface BGPDispatcher {
+public interface BGPDispatcher{
+
+ /**
+ * Creates BGP client.
+ *
+ * @param remoteAddress remote Peer address
+ * @param retryTimer Retry timer
+ * @return Future promising a client session
+ */
+ Future<? extends BGPSession> createClient(InetSocketAddress remoteAddress, int retryTimer);
+
+ /**
+ * Creates Reconnecting client.
+ *
+ * @param remoteAddress remote Peer Address
+ * @param retryTimer Retry timer
+ * @param keys for TCPMD5
+ * @return Future promising a client session
+ */
+ Future<Void> createReconnectingClient(InetSocketAddress remoteAddress, int retryTimer, Optional<KeyMapping> keys);
+
+ /**
+ * Create new BGP server to accept incoming bgp connections (bound to provided socket localAddress).
+ *
+ * @param localAddress Peer localAddress
+ *
+ * @return ChannelFuture promising a client session
+ */
+ ChannelFuture createServer(InetSocketAddress localAddress);
- /**
- * Creates BGP client.
- *
- * @param connection attributes required for connection
- * @param parser BGP message parser
- * @return client session
- */
- Future<? extends BGPSession> createClient(InetSocketAddress address, BGPSessionPreferences preferences, BGPSessionListener listener,
- final ReconnectStrategy strategy);
+ /**
+ * Return BGP Peer Registry
+ * @return BGPPeerRegistry
+ */
+ BGPPeerRegistry getBGPPeerRegistry();
}