Move adsal into its own subdirectory.
[controller.git] / opendaylight / adsal / protocol_plugins / openflow / src / main / java / org / opendaylight / controller / protocol_plugin / openflow / core / IMessageReadWrite.java
1
2 /*
3  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
4  *
5  * This program and the accompanying materials are made available under the
6  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7  * and is available at http://www.eclipse.org/legal/epl-v10.html
8  */
9
10 package org.opendaylight.controller.protocol_plugin.openflow.core;
11
12 import java.util.List;
13
14 import org.openflow.protocol.OFMessage;
15
16 /**
17  * This interface defines low level routines to read/write messages on an open
18  * socket channel. If secure communication is desired, these methods also perform
19  * encryption and decryption of the network data.
20  */
21 public interface IMessageReadWrite {
22         /**
23          * Sends the OF message out over the socket channel. For secure
24          * communication, the data will be encrypted.
25          *
26          * @param msg OF message to be sent
27          * @throws Exception
28          */
29         public void asyncSend(OFMessage msg) throws Exception;
30
31         /**
32          * Resumes sending the remaining messages in the outgoing buffer
33          * @throws Exception
34          */
35         public void resumeSend() throws Exception;
36
37         /**
38          * Reads the incoming network data from the socket and retrieves the OF
39          * messages. For secure communication, the data will be decrypted first.
40          *
41          * @return list of OF messages
42          * @throws Exception
43          */
44     public List<OFMessage> readMessages() throws Exception;
45
46         /**
47          * Proper clean up when the switch connection is closed
48          *
49          * @return
50          * @throws Exception
51          */
52     public void stop() throws Exception;
53 }