Netconf-cli compilable and included in project
[controller.git] / opendaylight / md-sal / statistics-manager / src / main / java / org / opendaylight / controller / md / statistics / manager / StatPermCollector.java
1 /**
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.controller.md.statistics.manager;
10
11 import java.util.List;
12
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
14 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
15
16 /**
17  * statistics-manager
18  * org.opendaylight.controller.md.statistics.manager
19  *
20  * StatPermCollector
21  * Class implement {@link Runnable} and inside is running statistic collecting
22  * process DataObject statistics by DataObject statistics for every {@link org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode}.
23  * Every statistics wait to finish previous statistics. Only if all statistics finish,
24  * next {@link org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode}
25  * Statistics should be collecting. We are able to set minimal time for start next round cross all Network,
26  * but all depends on network possibility.
27  *
28  * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
29  *
30  * Created: Aug 28, 2014
31  */
32 public interface StatPermCollector extends Runnable, AutoCloseable {
33
34     /**
35      * StatCapType
36      * Enum class refers ofp_statistics capabilities fields from OF Switch
37      * capabilities specification which have to come as a post HandShake
38      * information from OF Switch and Inventory Manager adds all to the
39      * Operational/DS.
40      * If the capabilities are not add (for any reason) NodeRegistrator
41      * adds all StatCapTypes for the {@link Node}.
42      */
43     public enum StatCapabTypes {
44         /**
45          * OFPC_FLOW_STATS
46          */
47         FLOW_STATS,
48         /**
49          * OFPC_TABLE_STATS
50          */
51         TABLE_STATS,
52         /**
53          * OFPC_PORT_STATS
54          */
55         PORT_STATS,
56         /**
57          * OFPC_GROUP_STATS
58          */
59         GROUP_STATS,
60         /**
61          * OFPC_QUEUE_STATS
62          */
63         QUEUE_STATS,
64         /**
65          * Meter statistics has no support from OF Switch capabilities
66          * so we have to try get statistics for it and wait for response
67          * Error or response package with results.
68          */
69         METER_STATS
70     }
71
72     /**
73      * Add new connected node for permanent statistics collecting process
74      *
75      * @param flowNode
76      * @param statTypes
77      * @param nrOfSwitchTables
78      * @return true/false if the {@link Node} added successful
79      */
80     boolean connectedNodeRegistration(InstanceIdentifier<Node> nodeIdent,
81             List<StatCapabTypes> statTypes, Short nrOfSwitchTables);
82
83     /**
84      * All disconnected Nodes need be removed from stat list Nodes
85      * @param flowNode
86      * @return true/false if the {@link Node} removed successful
87      */
88     boolean disconnectedNodeUnregistration(InstanceIdentifier<Node> nodeIdent);
89
90     /**
91      * Method return true only and only if {@link StatPermCollector} contain
92      * valid node registration in its internal {@link Node} map.
93      * Otherwise return false.
94      *
95      * @param InstanceIdentifier<FlowCapableNode> flowNode
96      * @return
97      */
98     boolean isProvidedFlowNodeActive(InstanceIdentifier<Node> nodeIdent);
99
100     /**
101      * Object notification for continue statistics collecting process.
102      * It is call from collecting allStatistics methods as a future result for
103      * Operational/DS statistic store call (does not matter in the outcome).
104      */
105     void collectNextStatistics();
106
107     /**
108      * Method returns true if collector has registered some active nodes
109      * otherwise return false.
110      *
111      * @return
112      */
113     boolean hasActiveNodes();
114 }
115