Upgrade ietf-{inet,yang}-types to 2013-07-15
[bgpcep.git] / bgp / rib-impl / src / main / java / org / opendaylight / protocol / bgp / rib / impl / spi / BGPDispatcher.java
old mode 100644 (file)
new mode 100755 (executable)
index e00b096..0b2b35a
@@ -7,27 +7,47 @@
  */
 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.io.IOException;
 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 peerRegistry BGP peer registry
+     * @param retryTimer Retry timer
+     * @return Future promising a client session
+     */
+    Future<? extends BGPSession> createClient(InetSocketAddress remoteAddress, BGPPeerRegistry peerRegistry, int retryTimer);
+
+    /**
+     * Creates Reconnecting client.
+     *
+     * @param remoteAddress remote Peer Address
+     * @param peerRegistry BGP peer registry
+     * @param retryTimer Retry timer
+     * @param keys for TCPMD5
+     * @return Future promising a client session
+     */
+    Future<Void> createReconnectingClient(InetSocketAddress remoteAddress,
+        BGPPeerRegistry peerRegistry, int retryTimer, Optional<KeyMapping> keys);
 
-       /**
-        * Creates BGP client.
-        * 
-        * @param connection attributes required for connection
-        * @param parser BGP message parser
-        * @return client session
-        * @throws IOException
-        */
-       Future<? extends BGPSession> createClient(InetSocketAddress address, BGPSessionPreferences preferences, BGPSessionListener listener, final ReconnectStrategy strategy);
+    /**
+     * Create new BGP server to accept incoming bgp connections (bound to provided socket localAddress).
+     *
+     * @param peerRegistry BGP peer registry
+     * @param localAddress Peer localAddress
+     *
+     * @return ChannelFuture promising a client session
+     */
+    ChannelFuture createServer(BGPPeerRegistry peerRegistry, InetSocketAddress localAddress);
 }