Ordered message execution ensured
[openflowjava.git] / openflow-protocol-api / src / main / java / org / opendaylight / openflowjava / protocol / api / connection / ConnectionAdapter.java
1 /* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */
2
3 package org.opendaylight.openflowjava.protocol.api.connection;
4
5 import java.util.concurrent.Future;
6
7 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OpenflowProtocolListener;
8 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OpenflowProtocolService;
9 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.system.rev130927.SystemNotificationsListener;
10
11 /**
12  * @author mirehak
13  * @author michal.polkorab
14  */
15 public interface ConnectionAdapter extends OpenflowProtocolService {
16
17     /**
18      * disconnect corresponding switch
19      * @return future set to true, when disconnect completed
20      */
21     public Future<Boolean> disconnect();
22     
23     /**
24      * @return true, if connection to switch is alive
25      */
26     public boolean isAlive();
27     
28     /**
29      * @param messageListener here will be pushed all messages from switch
30      */
31     public void setMessageListener(OpenflowProtocolListener messageListener);
32     
33     /**
34      * @param systemListener here will be pushed all system messages from library
35      */
36     public void setSystemListener(SystemNotificationsListener systemListener);
37
38     /**
39      * Throws exception if any of required listeners is missing
40      */
41     public void checkListeners();
42
43     /**
44      * notify listener about connection ready-to-use event
45      */
46     public void fireConnectionReadyNotification();
47
48     /**
49      * set listener for connection became ready-to-use event  
50      * @param connectionReadyListener
51      */
52     public void setConnectionReadyListener(ConnectionReadyListener connectionReadyListener);
53
54 }