package org.opendaylight.openflowjava.protocol.spi.connection;
-import java.util.Collection;
-import java.util.List;
-import java.util.concurrent.Future;
-
import org.opendaylight.openflowjava.protocol.api.connection.ConnectionConfiguration;
import org.opendaylight.openflowjava.protocol.api.connection.SwitchConnectionHandler;
+import com.google.common.util.concurrent.ListenableFuture;
+
/**
* @author mirehak
* @author michal.polkorab
*
*/
-public interface SwitchConnectionProvider {
+public interface SwitchConnectionProvider extends AutoCloseable {
/**
- * @param configurations list of [protocol, port, address and supported features]
+ * @param configuration [protocol, port, address and supported features]
*/
- public void configure(Collection<ConnectionConfiguration> configurations);
+ void setConfiguration(ConnectionConfiguration configuration);
/**
* start listening to switches, but please don't forget to do
* {@link #setSwitchConnectionHandler(SwitchConnectionHandler)} first
- * @return future, triggered to true, when all listening channels are up and running
+ * @return future, triggered to true, when listening channel is up and running
*/
- public Future<List<Boolean>> startup();
+ ListenableFuture<Boolean> startup();
/**
* stop listening to switches
* @return future, triggered to true, when all listening channels are down
*/
- public Future<List<Boolean>> shutdown();
+ ListenableFuture<Boolean> shutdown();
/**
* @param switchConHandler instance being informed when new switch connects
*/
- public void setSwitchConnectionHandler(SwitchConnectionHandler switchConHandler);
+ void setSwitchConnectionHandler(SwitchConnectionHandler switchConHandler);
}