1 package org.openflow.codec.protocol.factory;
5 import org.openflow.codec.io.IDataBuffer;
6 import org.openflow.codec.protocol.instruction.OFPInstruction;
7 import org.openflow.codec.protocol.instruction.OFPInstructionType;
10 * The interface to factories used for retrieving OFPInstruction instances. All
11 * methods are expected to be thread-safe.
15 public interface OFPInstructionFactory {
17 * Retrieves an OFPInstruction instance corresponding to the specified
21 * the type of the OFPInstruction to be retrieved
22 * @return an OFPInstruction instance
24 public OFPInstruction getInstruction(OFPInstructionType t);
27 * Attempts to parse and return all OFInstructions contained in the given
28 * DataBuffer, beginning at the DataBuffer's position, and ending at
32 * the DataBuffer to parse for OpenFlow Instructions
34 * the number of Bytes to examine for OpenFlow Instructions
35 * @return a list of OFPInstruction instances
37 public List<OFPInstruction> parseInstructions(IDataBuffer data, int length);
40 * Attempts to parse and return number of specified OFInstructions contained
41 * in the given DataBuffer, beginning at the DataBuffer's position, and
42 * ending at position+length.
45 * the DataBuffer to parse for OpenFlow Instructions
47 * the number of Bytes to examine for OpenFlow Instructions
49 * the maximum number of messages to return, 0 means no limit
50 * @return a list of OFPInstruction instances
52 public List<OFPInstruction> parseInstructions(IDataBuffer data, int length, int limit);