BUG-338 Allow incomming BGP connections.
[bgpcep.git] / bgp / rib-impl / src / main / java / org / opendaylight / protocol / bgp / rib / impl / spi / BGPDispatcher.java
index 433bfbafd046c9b76d516ad8811a10a2a8eee38b..6d4d436779f2a2b94f39ccbb02fa95369e75ac86 100644 (file)
@@ -8,25 +8,33 @@
 package org.opendaylight.protocol.bgp.rib.impl.spi;
 
 import io.netty.util.concurrent.Future;
-
 import java.net.InetSocketAddress;
-
+import org.opendaylight.bgpcep.tcpmd5.KeyMapping;
 import org.opendaylight.protocol.bgp.parser.BGPSession;
-import org.opendaylight.protocol.bgp.parser.BGPSessionListener;
 import org.opendaylight.protocol.framework.ReconnectStrategy;
+import org.opendaylight.protocol.framework.ReconnectStrategyFactory;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
 
 /**
  * Dispatcher class for creating BGP clients.
  */
-public interface BGPDispatcher {
+public interface BGPDispatcher extends BGPServerDispatcher {
+
+    /**
+     * Creates BGP client.
+     *
+     * @param address Peer address
+     * @param peerRegistry BGP peer registry
+     * @return Future promising a client session
+     */
+    Future<? extends BGPSession> createClient(InetSocketAddress address, AsNumber remoteAs,
+            BGPPeerRegistry peerRegistry, ReconnectStrategy strategy);
+
+    Future<Void> createReconnectingClient(InetSocketAddress address, AsNumber remoteAs,
+                                          BGPPeerRegistry peerRegistry, ReconnectStrategyFactory connectStrategyFactory,
+            ReconnectStrategyFactory reestablishStrategyFactory);
 
-       /**
-        * 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);
+    Future<Void> createReconnectingClient(InetSocketAddress address, AsNumber remoteAs,
+                                          BGPPeerRegistry peerRegistry, ReconnectStrategyFactory connectStrategyFactory,
+            ReconnectStrategyFactory reestablishStrategyFactory, KeyMapping keys);
 }