Checkstyle enforcer
[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      * @return the list of openflow statistics
36      */
37     List<OFStatistics> getOFFlowStatistics(Long switchId, OFMatch ofMatch);
38
39     /**
40      * Return the description statistics for the specified switch.
41      *
42      * @param switchId the openflow datapath id
43      * @return the list of openflow statistics
44      */
45     List<OFStatistics> getOFDescStatistics(Long switchId);
46
47     /**
48      * Returns the statistics for all the ports on the specified switch
49      *
50      * @param switchId the openflow datapath id
51      * @return the list of openflow statistics
52      */
53     List<OFStatistics> getOFPortStatistics(Long switchId);
54
55     /**
56      * Returns the statistics for the specified switch port
57      *
58      * @param switchId the openflow datapath id
59      * @param portId the openflow switch port id
60      * @return the list of openflow statistics
61      */
62     List<OFStatistics> getOFPortStatistics(Long switchId, short portId);
63
64     /**
65      * Returns the number of flows installed on the switch
66      *
67      * @param switchId the openflow datapath id
68      * @return the number of flows installed on the switch
69      */
70     int getFlowsNumber(long switchId);
71
72     /**
73      * Send a statistics request message to the specified switch and returns
74      * the switch response. It blocks the caller until the response has arrived
75      * from the switch or the request has timed out
76      *
77      * @param switchId the openflow datapath id of the target switch
78      * @param statType the openflow statistics type
79      * @param target the target object. For flow statistics it is the OFMatch.
80      *                                  For port statistics, it is the port id. If null the query
81      *                                  will be performed for all the targets for the specified
82      *                                  statistics type.
83      *
84      * @param timeout the timeout in milliseconds the system will wait for a response
85      *                  from the switch, before declaring failure
86      * @return the list of openflow statistics
87      */
88     List<OFStatistics> queryStatistics(Long switchId,
89             OFStatisticsType statType, Object target);
90
91     /**
92      * Returns the averaged transmit rate for the passed switch port
93      *
94      * @param switchId the openflow datapath id of the target switch
95      * @param portId the openflow switch port id
96      * @return the median transmit rate in bits per second
97      */
98     long getTransmitRate(Long switchId, Short port);
99
100     /**
101      * Returns the statistics for the specified switch table
102      *
103      * @param switchId the openflow datapath id
104      * @param tableId the openflow switch table id
105      * @return the list of openflow statistics
106      */
107     List<OFStatistics> getOFTableStatistics(Long switchId, Byte tableId);
108
109     /**
110      * Returns all the table statistics for the node specified
111      *
112      * @param switchId the openflow datapath id
113      * @return the list of openflow statistics
114      */
115     List<OFStatistics> getOFTableStatistics(Long switchId);
116
117 }