Merge "Bug 2347: DOMConcurrentDataCommitCoordinator uses wrong phase name"
[controller.git] / third-party / openflowj / src / main / java / org / openflow / io / OFMessageInStream.java
1 /**
2  *
3  */
4 package org.openflow.io;
5
6 import java.util.List;
7
8 import org.openflow.protocol.OFMessage;
9 import org.openflow.protocol.factory.OFMessageFactory;
10
11 /**
12  * Interface for reading OFMessages from a buffered stream
13  * 
14  * @author Rob Sherwood (rob.sherwood@stanford.edu)
15  * 
16  */
17 public interface OFMessageInStream {
18     /**
19      * Read OF messages from the stream
20      * 
21      * @return a list of OF Messages, empty if no complete messages are
22      *         available, null if the stream has closed
23      */
24     public List<OFMessage> read() throws java.io.IOException;
25
26     /**
27      * Read OF messages from the stream
28      * 
29      * @param limit
30      *            The maximum number of messages to read: 0 means all that are
31      *            buffered
32      * @return a list of OF Messages, empty if no complete messages are
33      *         available, null if the stream has closed
34      * 
35      */
36     public List<OFMessage> read(int limit) throws java.io.IOException;
37
38     /**
39      * Sets the OFMessageFactory used to create messages on this stream
40      * 
41      * @param factory
42      */
43     public void setMessageFactory(OFMessageFactory factory);
44
45     /**
46      * Returns the OFMessageFactory used to create messages on this stream
47      * 
48      * @return
49      */
50     public OFMessageFactory getMessageFactory();
51 }