2 * Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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
18 package org.openflow.protocol.factory;
20 import java.util.List;
22 import org.jboss.netty.buffer.ChannelBuffer;
23 import org.openflow.protocol.OFType;
24 import org.openflow.protocol.statistics.OFStatistics;
25 import org.openflow.protocol.statistics.OFStatisticsType;
29 * The interface to factories used for retrieving OFStatistics instances. All
30 * methods are expected to be thread-safe.
31 * @author David Erickson (daviderickson@cs.stanford.edu)
33 public interface OFStatisticsFactory {
35 * Retrieves an OFStatistics instance corresponding to the specified
37 * @param t the type of the containing OFMessage, only accepts statistics
39 * @param st the type of the OFStatistics to be retrieved
40 * @return an OFStatistics instance
42 public OFStatistics getStatistics(OFType t, OFStatisticsType st);
45 * Attempts to parse and return all OFStatistics contained in the given
46 * ByteBuffer, beginning at the ByteBuffer's position, and ending at
48 * @param t the type of the containing OFMessage, only accepts statistics
50 * @param st the type of the OFStatistics to be retrieved
51 * @param data the ChannelBuffer to parse for OpenFlow Statistics
52 * @param length the number of Bytes to examine for OpenFlow Statistics
53 * @return a list of OFStatistics instances
55 public List<OFStatistics> parseStatistics(OFType t,
56 OFStatisticsType st, ChannelBuffer data, int length);
59 * Attempts to parse and return all OFStatistics contained in the given
60 * ByteBuffer, beginning at the ByteBuffer's position, and ending at
62 * @param t the type of the containing OFMessage, only accepts statistics
64 * @param st the type of the OFStatistics to be retrieved
65 * @param data the ChannelBuffer to parse for OpenFlow Statistics
66 * @param length the number of Bytes to examine for OpenFlow Statistics
67 * @param limit the maximum number of messages to return, 0 means no limit
68 * @return a list of OFStatistics instances
70 public List<OFStatistics> parseStatistics(OFType t,
71 OFStatisticsType st, ChannelBuffer data, int length, int limit);