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