X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=third-party%2Fopenflowj%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenflow%2Fprotocol%2Ffactory%2FOFActionFactory.java;fp=third-party%2Fopenflowj%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenflow%2Fprotocol%2Ffactory%2FOFActionFactory.java;h=5d0949b8813a1daf5fbe7d6e3167bf1492bbf55d;hp=0000000000000000000000000000000000000000;hb=42210c03b0a4c54706320ba9f55794c0abd4d201;hpb=7576b38152b393793b1c9ec3df0ff86685f95236 diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/factory/OFActionFactory.java b/third-party/openflowj/src/main/java/org/openflow/protocol/factory/OFActionFactory.java new file mode 100644 index 0000000000..5d0949b881 --- /dev/null +++ b/third-party/openflowj/src/main/java/org/openflow/protocol/factory/OFActionFactory.java @@ -0,0 +1,44 @@ +package org.openflow.protocol.factory; + +import java.nio.ByteBuffer; +import java.util.List; + +import org.openflow.protocol.action.OFAction; +import org.openflow.protocol.action.OFActionType; + + +/** + * The interface to factories used for retrieving OFAction instances. All + * methods are expected to be thread-safe. + * @author David Erickson (daviderickson@cs.stanford.edu) + */ +public interface OFActionFactory { + /** + * Retrieves an OFAction instance corresponding to the specified + * OFActionType + * @param t the type of the OFAction to be retrieved + * @return an OFAction instance + */ + public OFAction getAction(OFActionType t); + + /** + * Attempts to parse and return all OFActions contained in the given + * ByteBuffer, beginning at the ByteBuffer's position, and ending at + * position+length. + * @param data the ByteBuffer to parse for OpenFlow actions + * @param length the number of Bytes to examine for OpenFlow actions + * @return a list of OFAction instances + */ + public List parseActions(ByteBuffer data, int length); + + /** + * Attempts to parse and return all OFActions contained in the given + * ByteBuffer, beginning at the ByteBuffer's position, and ending at + * position+length. + * @param data the ByteBuffer to parse for OpenFlow actions + * @param length the number of Bytes to examine for OpenFlow actions + * @param limit the maximum number of messages to return, 0 means no limit + * @return a list of OFAction instances + */ + public List parseActions(ByteBuffer data, int length, int limit); +}