Merge "Reorder public/private modifiers as per JLS. (fixes sonar warnings)"
[controller.git] / third-party / openflowj / src / main / java / org / openflow / io / OFMessageOutStream.java
1 /**
2  *
3  */
4 package org.openflow.io;
5
6 import java.util.List;
7 import org.openflow.protocol.OFMessage;
8
9 /**
10  * Interface for writing OFMessages to a buffered stream
11  *
12  * @author Rob Sherwood (rob.sherwood@stanford.edu)
13  *
14  */
15 public interface OFMessageOutStream {
16     /**
17      * Write an OpenFlow message to the stream
18      * @param m An OF Message
19      */
20     public void write(OFMessage m) throws java.io.IOException;
21
22     /**
23      * Write an OpenFlow message to the stream.
24      *  Messages are sent in one large write() for efficiency
25      * @param l A list of OF Messages
26      */
27     public void write(List<OFMessage> l) throws java.io.IOException;
28
29     /**
30      * Pushes buffered data out the Stream; this is NOT guranteed to flush all
31      * data, multiple flush() calls may be required, until needFlush() returns
32      * false.
33      */
34     public void flush() throws java.io.IOException;
35
36     /**
37      * Is there buffered data that needs to be flushed?
38      * @return true if there is buffered data and flush() should be called
39      */
40     public boolean needsFlush();
41 }