Merge "Bug 2347: DOMConcurrentDataCommitCoordinator uses wrong phase name"
[controller.git] / third-party / openflowj / src / main / java / org / openflow / protocol / factory / OFMessageFactory.java
1 package org.openflow.protocol.factory;
2
3 import java.nio.ByteBuffer;
4 import java.util.List;
5
6 import org.openflow.protocol.OFMessage;
7 import org.openflow.protocol.OFType;
8
9
10 /**
11  * The interface to factories used for retrieving OFMessage instances. All
12  * methods are expected to be thread-safe.
13  * @author David Erickson (daviderickson@cs.stanford.edu)
14  */
15 public interface OFMessageFactory {
16     /**
17      * Retrieves an OFMessage instance corresponding to the specified OFType
18      * @param t the type of the OFMessage to be retrieved
19      * @return an OFMessage instance
20      */
21     public OFMessage getMessage(OFType t);
22
23     /**
24      * Attempts to parse and return all OFMessages contained in the given
25      * ByteBuffer, beginning at the ByteBuffer's position, and ending at the
26      * ByteBuffer's limit.
27      * @param data the ByteBuffer to parse for an OpenFlow message
28      * @return a list of OFMessage instances
29      */
30     public List<OFMessage> parseMessages(ByteBuffer data);
31
32     /**
33      * Attempts to parse and return all OFMessages contained in the given
34      * ByteBuffer, beginning at the ByteBuffer's position, and ending at the
35      * ByteBuffer's limit.
36      * @param data the ByteBuffer to parse for an OpenFlow message
37      * @param limit the maximum number of messages to return, 0 means no limit
38      * @return a list of OFMessage instances
39      */
40     public List<OFMessage> parseMessages(ByteBuffer data, int limit);
41
42     /**
43      * Retrieves an OFActionFactory
44      * @return an OFActionFactory
45      */
46     public OFActionFactory getActionFactory();
47 }