Merge "BUG-2329 Add test for anyxmls inside rpc resonse for netcfon-connector"
[controller.git] / opendaylight / protocol_plugins / openflow / src / main / java / org / opendaylight / controller / protocol_plugin / openflow / IOFStatisticsManager.java
1
2 /*
3  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
4  *
5  * This program and the accompanying materials are made available under the
6  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7  * and is available at http://www.eclipse.org/legal/epl-v10.html
8  */
9
10 package org.opendaylight.controller.protocol_plugin.openflow;
11
12 import java.util.List;
13
14 import org.openflow.protocol.OFMatch;
15 import org.openflow.protocol.statistics.OFStatistics;
16 import org.openflow.protocol.statistics.OFStatisticsType;
17
18 /**
19  * Interface to expose the openflow statistics collected on the switches
20  */
21 public interface IOFStatisticsManager {
22     /**
23      * Return all the statistics for all the flows present on the specified switch
24      *
25      * @param switchId the openflow datapath id
26      * @return the list of openflow statistics
27      */
28     List<OFStatistics> getOFFlowStatistics(Long switchId);
29
30     /**
31      * Return all the statistics for all the flows present on the specified switch
32      *
33      * @param switchId the openflow datapath id
34      * @param ofMatch the openflow match to query. If null, the query is intended for all the flows
35      * @param priority Priority of the wanted flow
36      * @return the list of openflow statistics
37      */
38     List<OFStatistics> getOFFlowStatistics(Long switchId, OFMatch ofMatch, short priority);
39
40     /**
41      * Return the description statistics for the specified switch.
42      *
43      * @param switchId the openflow datapath id
44      * @return the list of openflow statistics
45      */
46     List<OFStatistics> getOFDescStatistics(Long switchId);
47
48     /**
49      * Returns the statistics for all the ports on the specified switch
50      *
51      * @param switchId the openflow datapath id
52      * @return the list of openflow statistics
53      */
54     List<OFStatistics> getOFPortStatistics(Long switchId);
55
56     /**
57      * Returns the statistics for the specified switch port
58      *
59      * @param switchId the openflow datapath id
60      * @param portId the openflow switch port id
61      * @return the list of openflow statistics
62      */
63     List<OFStatistics> getOFPortStatistics(Long switchId, short portId);
64
65     /**
66      * Returns the number of flows installed on the switch
67      *
68      * @param switchId the openflow datapath id
69      * @return the number of flows installed on the switch
70      */
71     int getFlowsNumber(long switchId);
72
73     /**
74      * Send a statistics request message to the specified switch and returns
75      * the switch response. It blocks the caller until the response has arrived
76      * from the switch or the request has timed out
77      *
78      * @param switchId the openflow datapath id of the target switch
79      * @param statType the openflow statistics type
80      * @param target the target object. For flow statistics it is the OFMatch.
81      *                                  For port statistics, it is the port id. If null the query
82      *                                  will be performed for all the targets for the specified
83      *                                  statistics type.
84      *
85      * @param timeout the timeout in milliseconds the system will wait for a response
86      *                  from the switch, before declaring failure
87      * @return the list of openflow statistics
88      */
89     List<OFStatistics> queryStatistics(Long switchId,
90             OFStatisticsType statType, Object target);
91
92     /**
93      * Returns the averaged transmit rate for the passed switch port
94      *
95      * @param switchId the openflow datapath id of the target switch
96      * @param portId the openflow switch port id
97      * @return the median transmit rate in bits per second
98      */
99     long getTransmitRate(Long switchId, Short port);
100
101     /**
102      * Returns the statistics for the specified switch table
103      *
104      * @param switchId the openflow datapath id
105      * @param tableId the openflow switch table id
106      * @return the list of openflow statistics
107      */
108     List<OFStatistics> getOFTableStatistics(Long switchId, Byte tableId);
109
110     /**
111      * Returns all the table statistics for the node specified
112      *
113      * @param switchId the openflow datapath id
114      * @return the list of openflow statistics
115      */
116     List<OFStatistics> getOFTableStatistics(Long switchId);
117
118 }