Initial framework migration to netty.
[bgpcep.git] / framework / src / main / java / org / opendaylight / protocol / framework / Dispatcher.java
index 45ac09642c664626abdb9933f18dca348cd7a368..4dbd80daedd5f4d7307d85adacc88a5f6c719360 100644 (file)
@@ -7,65 +7,36 @@
  */
 package org.opendaylight.protocol.framework;
 
+import io.netty.util.concurrent.Future;
+
 import java.io.IOException;
 import java.net.InetSocketAddress;
 
-import javax.net.ssl.SSLContext;
-
 /**
- * Dispatcher class for creating protocol servers and clients. The idea is to first create servers and clients and the run the start method
- * that will handle sockets in different thread.
+ * Dispatcher class for creating protocol servers and clients.
  */
 public interface Dispatcher {
        /**
         * Creates server. Each server needs factories to pass their instances to client sessions.
-        * @param address to be bound with the server
-        * @param connectionFactory factory for connection specific attributes
-        * @param sfactory to create specific session
-        * @param isFactory protocol specific input stream factory
-        *
-        * @return instance of ProtocolServer
-        * @throws IOException if some IO error occurred
-        */
-       public ProtocolServer createServer(final InetSocketAddress address, final ProtocolConnectionFactory connectionFactory,
-                       final ProtocolSessionFactory sfactory, final ProtocolInputStreamFactory isFactory) throws IOException;
-
-       /**
-        * Creates secure server. Each server needs factories to pass their instances to client sessions.
-        * @param address to be bound with the server
+        * 
         * @param connectionFactory factory for connection specific attributes
         * @param sfactory to create specific session
-        * @param isFactory protocol-specific input stream factory
-        * @param context SSLContext to use in secure communications
-        *
+        * @param handlerFactory protocol specific channel handlers factory
+        * 
         * @return instance of ProtocolServer
-        * @throws IOException if some IO error occurred
         */
        public ProtocolServer createServer(final InetSocketAddress address, final ProtocolConnectionFactory connectionFactory,
-                       final ProtocolSessionFactory sfactory, final ProtocolInputStreamFactory isFactory, final SSLContext context) throws IOException;
+                       final ProtocolSessionFactory sfactory) throws IOException;
 
        /**
         * Creates a client.
+        * 
         * @param connection connection specific attributes
-        * @param sfactory protocol message factory to be passed to session
-        * @param isFactory protocol-specific input stream factory
-        *
-        * @return session associated with this client
-        * @throws IOException if some IO error occurred
-        */
-       public ProtocolSession createClient(final ProtocolConnection connection, final ProtocolSessionFactory sfactory,
-                       final ProtocolInputStreamFactory isFactory) throws IOException;
-
-       /**
-        * Creates secure client.
-        * @param connection connection specific attributes
-        * @param sfactory protocol message factory to be passed to session
-        * @param isFactory protocol-specific input stream factory
-        * @param context SSLContext to use in secure communications
-        *
+        * @param sfactory protocol session factory to create a specific session
+        * @param handlerFactory protocol-specific channel handlers factory
+        * 
         * @return session associated with this client
-        * @throws IOException if some IO error occurred
         */
-       public ProtocolSession createClient(final ProtocolConnection connection, final ProtocolSessionFactory sfactory,
-                       final ProtocolInputStreamFactory isFactory, final SSLContext context) throws IOException;
+       public Future<ProtocolSession> createClient(final ProtocolConnection connection, final ProtocolSessionFactory sfactory)
+                       throws IOException;
 }