Merge "Netconf-cli compilable and included in project"
[controller.git] / opendaylight / md-sal / statistics-manager / src / main / java / org / opendaylight / controller / md / statistics / manager / StatisticsManager.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.controller.md.sal.binding.api.ReadWriteTransaction;
14 import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
15 import org.opendaylight.controller.md.statistics.manager.StatPermCollector.StatCapabTypes;
16 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
17 import org.opendaylight.controller.sal.binding.api.RpcConsumerRegistry;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.OpendaylightFlowStatisticsListener;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.OpendaylightFlowTableStatisticsListener;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.queues.Queue;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.OpendaylightGroupStatisticsListener;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
25 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
26 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.OpendaylightMeterStatisticsListener;
27 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.OpendaylightPortStatisticsListener;
28 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.OpendaylightQueueStatisticsListener;
29 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
30
31 /**
32  * statistics-manager
33  * org.opendaylight.controller.md.statistics.manager
34  *
35  * StatisticsManager
36  * It represent a central point for whole module. Implementation
37  * StatisticsManager registers all Operation/DS {@link StatNotifyCommiter} and
38  * Config/DS {@StatListeningCommiter}, as well as {@link StatPermCollector}
39  * for statistic collecting and {@link StatRpcMsgManager} as Device RPCs provider.
40  * In next, StatisticsManager provides all DS contact Transaction services.
41  *
42  * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
43  *
44  * Created: Aug 27, 2014
45  */
46 public interface StatisticsManager extends AutoCloseable, TransactionChainListener {
47
48     /**
49      * StatDataStoreOperation
50      * Interface represent functionality to submit changes to DataStore.
51      * Internal {@link TransactionChainListener} joining all DS commits
52      * to Set of chained changes for prevent often DataStore touches.
53      */
54     public interface StatDataStoreOperation {
55
56         /**
57          * Apply all read / write (put|merge) operation
58          * for DataStore
59          * @param {@link ReadWriteTransaction} tx
60          */
61         void applyOperation(ReadWriteTransaction tx);
62
63     }
64
65     /**
66      * Method starts whole StatisticManager functionality
67      *
68      * @param {@link NotificationProviderService} notifService
69      * @param {@link RpcConsumerRegistry} rpcRegistry
70      * @param minReqNetMonitInt
71      */
72     void start(final NotificationProviderService notifService,
73             final RpcConsumerRegistry rpcRegistry, final long minReqNetMonitInt);
74
75     /**
76      * Method provides read/write DataStore functionality cross applyOperation
77      * defined in {@link StatDataStoreOperation}
78      *
79      * @param inventoryOper - operation for DataStore
80      */
81     void enqueue(final StatDataStoreOperation inventoryOper);
82
83     /**
84      * Method wraps {@link StatisticCollector}.isProvidedFlowNodeActive method
85      * to provide parallel statCollection process for Set of Nodes. So it has to
86      * identify correct Node Set by NodeIdentifier
87      *
88      * @param nodeIdent
89      */
90      boolean isProvidedFlowNodeActive(InstanceIdentifier<Node> nodeIdent);
91
92      /**
93       * Method wraps {@link StatPermCollector}.collectNextStatistics to provide
94       * parallel statCollection process for Set of Nodes. So it has to
95       * identify correct Node Set by NodeIdentifier.
96       *
97       * @param nodeIdent
98       */
99      void collectNextStatistics(InstanceIdentifier<Node> nodeIdent);
100
101      /**
102       * Method wraps {@link StatPermCollector}.connectedNodeRegistration to provide
103       * parallel statCollection process for Set of Nodes. So it has to
104       * connect node to new or not full Node statCollector Set.
105       *
106       * @param nodeIdent
107       * @param statTypes
108       * @param nrOfSwitchTables
109       */
110      void connectedNodeRegistration(InstanceIdentifier<Node> nodeIdent,
111              List<StatCapabTypes> statTypes, Short nrOfSwitchTables);
112
113      /**
114       * Method wraps {@link StatPermCollector}.disconnectedNodeUnregistration to provide
115       * parallel statCollection process for Set of Nodes. So it has to identify
116       * correct collector for disconnect node.
117       *
118       * @param nodeIdent
119       */
120      void disconnectedNodeUnregistration(InstanceIdentifier<Node> nodeIdent);
121
122      /**
123       * Method wraps {@link StatPermCollector}.registerAdditionalNodeFeature to provide
124       * possibility to register additional Node Feature {@link StatCapabTypes} for
125       * statistics collecting.
126       *
127       * @param nodeIdent
128       * @param statCapab
129       */
130      void registerAdditionalNodeFeature(InstanceIdentifier<Node> nodeIdent, StatCapabTypes statCapab);
131
132     /**
133      * Method provides access to Device RPC methods by wrapped
134      * internal method. In next {@link StatRpcMsgManager} is registered all
135      * Multipart device msg response and joining all to be able run all
136      * collected statistics in one time (easy identification Data for delete)
137      *
138      * @return {@link StatRpcMsgManager}
139      */
140     StatRpcMsgManager getRpcMsgManager();
141
142     /**
143      * Define Method : {@link org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode}
144      * Operational/DS data change listener -> impl. target -> register FlowCapableNode to Statistic Collecting process
145      * @return {@link StatNodeRegistration}
146      */
147     StatNodeRegistration getNodeRegistrator();
148
149     /**
150      * Define Method : Flow Config/DS data change listener -> impl. target ->
151      * -> make pair between Config/DS FlowId and Device Flow response Hash
152      * @return
153      */
154     StatListeningCommiter<Flow, OpendaylightFlowStatisticsListener> getFlowListenComit();
155
156     /**
157      * Define Method : Meter Config/DS data change listener and Operation/DS notify commit
158      * functionality
159      * @return
160      */
161     StatListeningCommiter<Meter, OpendaylightMeterStatisticsListener> getMeterListenCommit();
162
163     /**
164      * Define Method : Group Config/DS data change listener and Operation/DS notify commit
165      * functionality
166      * @return
167      */
168     StatListeningCommiter<Group, OpendaylightGroupStatisticsListener> getGroupListenCommit();
169
170     /**
171      * Define Method : Queue Config/DS change listener and Operation/DS notify commit functionality
172      * @return
173      */
174     StatListeningCommiter<Queue, OpendaylightQueueStatisticsListener> getQueueNotifyCommit();
175
176     /**
177      * Define Method : Table Operation/DS notify commit functionality
178      * @return
179      */
180     StatNotifyCommiter<OpendaylightFlowTableStatisticsListener> getTableNotifCommit();
181
182     /**
183      * Define Method : Port Operation/DS notify commit functionality
184      * @return
185      */
186     StatNotifyCommiter<OpendaylightPortStatisticsListener> getPortNotifyCommit();
187
188 }
189