56766a7bfd2258ab6fb5ef4ffea289e60399f8cc
[openflowjava.git] / openflow-protocol-spi / src / main / java / org / opendaylight / openflowjava / protocol / spi / connection / SwitchConnectionProvider.java
1 /*
2  * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9
10 package org.opendaylight.openflowjava.protocol.spi.connection;
11
12 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionConfiguration;
13 import org.opendaylight.openflowjava.protocol.api.connection.SwitchConnectionHandler;
14
15 import com.google.common.util.concurrent.ListenableFuture;
16
17 /**
18  * @author mirehak
19  * @author michal.polkorab
20  *
21  */
22 public interface SwitchConnectionProvider extends AutoCloseable {
23
24     /**
25      * @param configuration [protocol, port, address and supported features]
26      */
27     void setConfiguration(ConnectionConfiguration configuration);
28     
29     /**
30      * start listening to switches, but please don't forget to do
31      * {@link #setSwitchConnectionHandler(SwitchConnectionHandler)} first
32      * @return future, triggered to true, when listening channel is up and running
33      */
34     ListenableFuture<Boolean> startup();
35     
36     /**
37      * stop listening to switches
38      * @return future, triggered to true, when all listening channels are down
39      */
40     ListenableFuture<Boolean> shutdown();
41     
42     /**
43      * @param switchConHandler instance being informed when new switch connects
44      */
45     void setSwitchConnectionHandler(SwitchConnectionHandler switchConHandler);
46     
47 }