Added method for getting non-cached flow statistics
[controller.git] / opendaylight / statisticsmanager / api / src / main / java / org / opendaylight / controller / statisticsmanager / IStatisticsManager.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.statisticsmanager;
11
12 import java.util.List;
13 import java.util.Map;
14
15 import org.opendaylight.controller.forwardingrulesmanager.FlowEntry;
16 import org.opendaylight.controller.sal.core.Node;
17 import org.opendaylight.controller.sal.core.NodeConnector;
18 import org.opendaylight.controller.sal.core.NodeTable;
19 import org.opendaylight.controller.sal.reader.FlowOnNode;
20 import org.opendaylight.controller.sal.reader.NodeConnectorStatistics;
21 import org.opendaylight.controller.sal.reader.NodeDescription;
22 import org.opendaylight.controller.sal.reader.NodeTableStatistics;
23
24 /**
25  * Interface which defines the available methods for retrieving
26  * the network nodes statistics.
27  */
28 public interface IStatisticsManager {
29     /**
30      * Return all the statistics for all the flows present on the specified node
31      * in the current container context. If the context is the default
32      * container, the returned statistics are for all the flows installed on the
33      * node, regardless of the container they belong to
34      *
35      * @param node
36      *            The network node
37      * @return List of flows installed on the network node. Null if specified
38      *         node is null. Empty list if node/stat is not present.
39      */
40     List<FlowOnNode> getFlows(Node node);
41
42     /**
43      * Same as the getFlows method.
44      * The only difference is that this method does not return cached flows.
45      * It will always make a request to the node to get all the flows for that node.
46      * If the request times out or gets an error, we revert to getting the cached flows.
47      * @see IStatisticsManager#getFlows
48      * @param node
49      * @return List of flows installed on the network node.
50      */
51     List<FlowOnNode> getFlowsNoCache(Node node);
52
53     /**
54      * Returns the statistics for the flows specified in the list
55      *
56      * @param flows
57      * @return A map of flows per node installed on that node, empty map if
58      *         flows is null/empty.
59      */
60     Map<Node, List<FlowOnNode>> getFlowStatisticsForFlowList(List<FlowEntry> flows);
61
62     /**
63      * Returns the number of flows installed on the switch in the current
64      * container context If the context is the default container, the returned
65      * value is the number of all the flows installed on the switch regardless
66      * of the container they belong to
67      *
68      * @param node
69      * @return number of flows on specified node or (-1) if node was not found
70      */
71     int getFlowsNumber(Node node);
72
73     /**
74      * Returns the node description for the specified node retrieved by the
75      * protocol plugin component and cached by statistics manager.
76      * Null if node not found.
77      *
78      * @param node
79      * @return node description
80      */
81     NodeDescription getNodeDescription(Node node);
82
83     /**
84      * Returns the statistics for the specified node connector as it was
85      * retrieved by the protocol plugin component and cached by statistics
86      * manager.
87      *
88      * @param node
89      * @return Node connector statistics or null if requested stats was not
90      *         found.
91      */
92     NodeConnectorStatistics getNodeConnectorStatistics(NodeConnector nodeConnector);
93
94     /**
95      * Returns the statistics for all the node connector present on the
96      * specified network node
97      *
98      * @param node
99      * @return List of node connector statistics. Null if node is null. Empty
100      *         list if node/stats is not present.
101      */
102     List<NodeConnectorStatistics> getNodeConnectorStatistics(Node node);
103
104     /**
105      * Returns the statistics for the specified table of the node
106      *
107      * @param nodeTable
108      * @return Table statistics. Null if node table is null or stats not found.
109      */
110     NodeTableStatistics getNodeTableStatistics(NodeTable nodeTable);
111
112     /**
113      * Returns the statistics for all the tables of the node
114      *
115      * @param nodeTable
116      * @return List of table stats. Null if node is null. Empty list if
117      *         node/stats not found.
118      */
119     List <NodeTableStatistics> getNodeTableStatistics(Node node);
120 }