Initial opendaylight infrastructure commit!!
[controller.git] / third-party / openflowj / src / main / java / org / openflow / protocol / factory / OFActionFactory.java
1 package org.openflow.protocol.factory;
2
3 import java.nio.ByteBuffer;
4 import java.util.List;
5
6 import org.openflow.protocol.action.OFAction;
7 import org.openflow.protocol.action.OFActionType;
8
9
10 /**
11  * The interface to factories used for retrieving OFAction instances. All
12  * methods are expected to be thread-safe.
13  * @author David Erickson (daviderickson@cs.stanford.edu)
14  */
15 public interface OFActionFactory {
16     /**
17      * Retrieves an OFAction instance corresponding to the specified
18      * OFActionType
19      * @param t the type of the OFAction to be retrieved
20      * @return an OFAction instance
21      */
22     public OFAction getAction(OFActionType t);
23
24     /**
25      * Attempts to parse and return all OFActions contained in the given
26      * ByteBuffer, beginning at the ByteBuffer's position, and ending at
27      * position+length.
28      * @param data the ByteBuffer to parse for OpenFlow actions
29      * @param length the number of Bytes to examine for OpenFlow actions
30      * @return a list of OFAction instances
31      */
32     public List<OFAction> parseActions(ByteBuffer data, int length);
33
34     /**
35      * Attempts to parse and return all OFActions contained in the given
36      * ByteBuffer, beginning at the ByteBuffer's position, and ending at
37      * position+length.
38      * @param data the ByteBuffer to parse for OpenFlow actions
39      * @param length the number of Bytes to examine for OpenFlow actions
40      * @param limit the maximum number of messages to return, 0 means no limit
41      * @return a list of OFAction instances
42      */
43     public List<OFAction> parseActions(ByteBuffer data, int length, int limit);
44 }