Add get configuration function to be able to access the openflow connection config...
[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 import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerExtensionProvider;
15 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerExtensionProvider;
16
17 import com.google.common.util.concurrent.ListenableFuture;
18
19 /**
20  * @author mirehak
21  * @author michal.polkorab
22  *
23  */
24 public interface SwitchConnectionProvider extends AutoCloseable,
25         SerializerExtensionProvider, DeserializerExtensionProvider {
26
27     /**
28      * @param configuration [protocol, port, address and supported features]
29      */
30     void setConfiguration(ConnectionConfiguration configuration);
31
32     /**
33      * return the connection configuration
34      * @return configuration [protocol, port, address and supported features]
35      */
36     ConnectionConfiguration getConfiguration();
37
38     /**
39      * start listening to switches, but please don't forget to do
40      * {@link #setSwitchConnectionHandler(SwitchConnectionHandler)} first
41      * @return future, triggered to true, when listening channel is up and running
42      */
43     ListenableFuture<Boolean> startup();
44
45     /**
46      * stop listening to switches
47      * @return future, triggered to true, when all listening channels are down
48      */
49     ListenableFuture<Boolean> shutdown();
50
51     /**
52      * @param switchConHandler instance being informed when new switch connects
53      */
54     void setSwitchConnectionHandler(SwitchConnectionHandler switchConHandler);
55 }