blob: c3cd06265bf9a7d0b832afabc5ff18ce0412eacb [file] [log] [blame]
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -08001/**
2* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior
3* University
4*
5* Licensed under the Apache License, Version 2.0 (the "License"); you may
6* not use this file except in compliance with the License. You may obtain
7* a copy of the License at
8*
9* http://www.apache.org/licenses/LICENSE-2.0
10*
11* Unless required by applicable law or agreed to in writing, software
12* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14* License for the specific language governing permissions and limitations
15* under the License.
16**/
17
18package org.openflow.protocol.factory;
19
20import java.util.List;
21
22import org.jboss.netty.buffer.ChannelBuffer;
23import org.openflow.protocol.action.OFAction;
24import org.openflow.protocol.action.OFActionType;
25
26
27/**
28 * The interface to factories used for retrieving OFAction instances. All
29 * methods are expected to be thread-safe.
30 * @author David Erickson (daviderickson@cs.stanford.edu)
31 */
32public interface OFActionFactory {
33 /**
34 * Retrieves an OFAction instance corresponding to the specified
35 * OFActionType
36 * @param t the type of the OFAction to be retrieved
37 * @return an OFAction instance
38 */
39 public OFAction getAction(OFActionType t);
40
41 /**
42 * Attempts to parse and return all OFActions contained in the given
43 * ByteBuffer, beginning at the ByteBuffer's position, and ending at
44 * position+length.
45 * @param data the ChannelBuffer to parse for OpenFlow actions
46 * @param length the number of Bytes to examine for OpenFlow actions
47 * @return a list of OFAction instances
48 */
49 public List<OFAction> parseActions(ChannelBuffer data, int length);
50
51 /**
52 * Attempts to parse and return all OFActions contained in the given
53 * ByteBuffer, beginning at the ByteBuffer's position, and ending at
54 * position+length.
55 * @param data the ChannelBuffer to parse for OpenFlow actions
56 * @param length the number of Bytes to examine for OpenFlow actions
57 * @param limit the maximum number of messages to return, 0 means no limit
58 * @return a list of OFAction instances
59 */
60 public List<OFAction> parseActions(ChannelBuffer data, int length, int limit);
61}