1 package org.openflow.protocol.factory;
3 import java.nio.ByteBuffer;
6 import org.openflow.protocol.OFMessage;
7 import org.openflow.protocol.OFType;
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)
15 public interface OFMessageFactory {
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
21 public OFMessage getMessage(OFType t);
24 * Attempts to parse and return all OFMessages contained in the given
25 * ByteBuffer, beginning at the ByteBuffer's position, and ending at the
27 * @param data the ByteBuffer to parse for an OpenFlow message
28 * @return a list of OFMessage instances
30 public List<OFMessage> parseMessages(ByteBuffer data);
33 * Attempts to parse and return all OFMessages contained in the given
34 * ByteBuffer, beginning at the ByteBuffer's position, and ending at the
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
40 public List<OFMessage> parseMessages(ByteBuffer data, int limit);
43 * Retrieves an OFActionFactory
44 * @return an OFActionFactory
46 public OFActionFactory getActionFactory();