2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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
9 package org.opendaylight.controller.md.statistics.manager;
11 import java.util.List;
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;
33 * org.opendaylight.controller.md.statistics.manager
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.
42 * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
44 * Created: Aug 27, 2014
46 public interface StatisticsManager extends AutoCloseable, TransactionChainListener {
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.
54 public interface StatDataStoreOperation {
57 * Apply all read / write (put|merge) operation
59 * @param {@link ReadWriteTransaction} tx
61 void applyOperation(ReadWriteTransaction tx);
66 * Method starts whole StatisticManager functionality
68 * @param {@link NotificationProviderService} notifService
69 * @param {@link RpcConsumerRegistry} rpcRegistry
70 * @param minReqNetMonitInt
72 void start(final NotificationProviderService notifService,
73 final RpcConsumerRegistry rpcRegistry, final long minReqNetMonitInt);
76 * Method provides read/write DataStore functionality cross applyOperation
77 * defined in {@link StatDataStoreOperation}
79 * @param inventoryOper - operation for DataStore
81 void enqueue(final StatDataStoreOperation inventoryOper);
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
90 boolean isProvidedFlowNodeActive(InstanceIdentifier<Node> nodeIdent);
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.
99 void collectNextStatistics(InstanceIdentifier<Node> nodeIdent);
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.
108 * @param nrOfSwitchTables
110 void connectedNodeRegistration(InstanceIdentifier<Node> nodeIdent,
111 List<StatCapabTypes> statTypes, Short nrOfSwitchTables);
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.
120 void disconnectedNodeUnregistration(InstanceIdentifier<Node> nodeIdent);
123 * Method wraps {@link StatPermCollector}.registerAdditionalNodeFeature to provide
124 * possibility to register additional Node Feature {@link StatCapabTypes} for
125 * statistics collecting.
130 void registerAdditionalNodeFeature(InstanceIdentifier<Node> nodeIdent, StatCapabTypes statCapab);
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)
138 * @return {@link StatRpcMsgManager}
140 StatRpcMsgManager getRpcMsgManager();
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}
147 StatNodeRegistration getNodeRegistrator();
150 * Define Method : Flow Config/DS data change listener -> impl. target ->
151 * -> make pair between Config/DS FlowId and Device Flow response Hash
154 StatListeningCommiter<Flow, OpendaylightFlowStatisticsListener> getFlowListenComit();
157 * Define Method : Meter Config/DS data change listener and Operation/DS notify commit
161 StatListeningCommiter<Meter, OpendaylightMeterStatisticsListener> getMeterListenCommit();
164 * Define Method : Group Config/DS data change listener and Operation/DS notify commit
168 StatListeningCommiter<Group, OpendaylightGroupStatisticsListener> getGroupListenCommit();
171 * Define Method : Queue Config/DS change listener and Operation/DS notify commit functionality
174 StatListeningCommiter<Queue, OpendaylightQueueStatisticsListener> getQueueNotifyCommit();
177 * Define Method : Table Operation/DS notify commit functionality
180 StatNotifyCommiter<OpendaylightFlowTableStatisticsListener> getTableNotifCommit();
183 * Define Method : Port Operation/DS notify commit functionality
186 StatNotifyCommiter<OpendaylightPortStatisticsListener> getPortNotifyCommit();