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