Move stats caching to FM StatisticsManager
[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      * Returns the statistics for the flows specified in the list
44      *
45      * @param flows
46      * @return A map of flows per node installed on that node, empty map if
47      *         flows is null/empty.
48      */
49     Map<Node, List<FlowOnNode>> getFlowStatisticsForFlowList(List<FlowEntry> flows);
50
51     /**
52      * Returns the number of flows installed on the switch in the current
53      * container context If the context is the default container, the returned
54      * value is the number of all the flows installed on the switch regardless
55      * of the container they belong to
56      *
57      * @param node
58      * @return number of flows on specified node or (-1) if node was not found
59      */
60     int getFlowsNumber(Node node);
61
62     /**
63      * Returns the node description for the specified node retrieved by the
64      * protocol plugin component and cached by statistics manager.
65      * Null if node not found.
66      *
67      * @param node
68      * @return node description
69      */
70     NodeDescription getNodeDescription(Node node);
71
72     /**
73      * Returns the statistics for the specified node connector as it was
74      * retrieved by the protocol plugin component and cached by statistics
75      * manager.
76      *
77      * @param node
78      * @return Node connector statistics or null if requested stats was not
79      *         found.
80      */
81     NodeConnectorStatistics getNodeConnectorStatistics(NodeConnector nodeConnector);
82
83     /**
84      * Returns the statistics for all the node connector present on the
85      * specified network node
86      *
87      * @param node
88      * @return List of node connector statistics. Null if node is null. Empty
89      *         list if node/stats is not present.
90      */
91     List<NodeConnectorStatistics> getNodeConnectorStatistics(Node node);
92
93     /**
94      * Returns the statistics for the specified table of the node
95      *
96      * @param nodeTable
97      * @return Table statistics. Null if node table is null or stats not found.
98      */
99     NodeTableStatistics getNodeTableStatistics(NodeTable nodeTable);
100
101     /**
102      * Returns the statistics for all the tables of the node
103      *
104      * @param nodeTable
105      * @return List of table stats. Null if node is null. Empty list if
106      *         node/stats not found.
107      */
108     List <NodeTableStatistics> getNodeTableStatistics(Node node);
109 }