Remove trailing whitespace
[openflowjava.git] / openflow-protocol-api / src / main / java / org / opendaylight / openflowjava / protocol / api / connection / ConnectionAdapter.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.api.connection;
11
12 import java.net.InetSocketAddress;
13 import java.util.concurrent.Future;
14
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OpenflowProtocolListener;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OpenflowProtocolService;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.system.rev130927.SystemNotificationsListener;
18
19 /**
20  * @author mirehak
21  * @author michal.polkorab
22  */
23 public interface ConnectionAdapter extends OpenflowProtocolService {
24
25     /**
26      * disconnect corresponding switch
27      * @return future set to true, when disconnect completed
28      */
29     Future<Boolean> disconnect();
30
31     /**
32      * @return true, if connection to switch is alive
33      */
34     boolean isAlive();
35
36     /**
37      * @return address of the remote end - address of a switch if connected
38      */
39     InetSocketAddress getRemoteAddress();
40     /**
41      * @param messageListener here will be pushed all messages from switch
42      */
43     void setMessageListener(OpenflowProtocolListener messageListener);
44
45     /**
46      * @param systemListener here will be pushed all system messages from library
47      */
48     void setSystemListener(SystemNotificationsListener systemListener);
49
50     /**
51      * Throws exception if any of required listeners is missing
52      */
53     void checkListeners();
54
55     /**
56      * notify listener about connection ready-to-use event
57      */
58     void fireConnectionReadyNotification();
59
60     /**
61      * set listener for connection became ready-to-use event
62      * @param connectionReadyListener
63      */
64     void setConnectionReadyListener(ConnectionReadyListener connectionReadyListener);
65
66 }