BUG-58: refactor to take advantage of netty
[bgpcep.git] / pcep / api / src / main / java / org / opendaylight / protocol / pcep / PCEPDispatcher.java
index 49e9cf0c35886e559d81dade4137d0155c7845a7..1eeb58a91af9b2876b2051bfa3249418472f9931 100644 (file)
@@ -7,19 +7,19 @@
  */
 package org.opendaylight.protocol.pcep;
 
+import io.netty.channel.ChannelFuture;
 import io.netty.util.concurrent.Future;
 
 import java.io.IOException;
 import java.net.InetSocketAddress;
 
-import org.opendaylight.protocol.framework.ProtocolServer;
 import org.opendaylight.protocol.framework.ReconnectStrategy;
+import org.opendaylight.protocol.framework.SessionListenerFactory;
 
 /**
  * Dispatcher class for creating servers and clients.
  */
 public interface PCEPDispatcher {
-
        /**
         * Creates server. Each server needs three factories to pass their instances to client sessions.
         * @param address to be bound with the server
@@ -29,7 +29,7 @@ public interface PCEPDispatcher {
         * @return instance of PCEPServer
         * @throws IOException if some IO error occurred
         */
-       public Future<ProtocolServer> createServer(final InetSocketAddress address, final PCEPConnectionFactory connectionFactory) throws IOException;
+       public ChannelFuture createServer(final InetSocketAddress address, final SessionListenerFactory<PCEPSessionListener> listenerFactory);
 
        /**
         * Creates a client. Needs to be started via the start method.
@@ -37,12 +37,6 @@ public interface PCEPDispatcher {
         * @param strategy Reconnection strategy to be used for TCP-level connection
         * @throws IOException if some IO error occurred
         */
-       public Future<? extends PCEPSession> createClient(PCEPConnection connection, final ReconnectStrategy strategy) throws IOException;
-
-       /**
-        * Sets the limit of maximum unknown messages per minute. If not set by the user, default is 5 messages/minute.
-        * @param limit maximum unknown messages per minute
-        */
-       public void setMaxUnknownMessages(final int limit);
+       public Future<? extends PCEPSession> createClient(InetSocketAddress address, final PCEPSessionListener listener, final ReconnectStrategy strategy);
 }