1 package org.openflow.codec.protocol.factory;
5 import org.openflow.codec.io.IDataBuffer;
6 import org.openflow.codec.protocol.OFPMessage;
7 import org.openflow.codec.protocol.OFPType;
10 * The interface to factories used for retrieving OFPMessage instances. All
11 * methods are expected to be thread-safe.
13 * @author David Erickson (daviderickson@cs.stanford.edu)
15 public interface OFPMessageFactory {
17 * Retrieves an OFPMessage instance corresponding to the specified OFPType
20 * the type of the OFPMessage to be retrieved
21 * @return an OFPMessage instance
23 public OFPMessage getMessage(OFPType t);
26 * Attempts to parse and return all OFMessages contained in the given
27 * DataBuffer, beginning at the DataBuffer's position, and ending at the
31 * the DataBuffer to parse for an OpenFlow message
32 * @return a list of OFPMessage instances
34 public List<OFPMessage> parseMessages(IDataBuffer data);
37 * Attempts to parse and return all OFMessages contained in the given
38 * DataBuffer, beginning at the DataBuffer's position, and ending at the
42 * the DataBuffer to parse for an OpenFlow message
44 * the maximum number of messages to return, 0 means no limit
45 * @return a list of OFPMessage instances
47 public List<OFPMessage> parseMessages(IDataBuffer data, int limit);
50 * Retrieves an OFPActionFactory
52 * @return an OFPActionFactory
54 public OFPActionFactory getActionFactory();