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.md.statistics.manager.impl.StatisticsManagerConfig;
17 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
18 import org.opendaylight.controller.sal.binding.api.RpcConsumerRegistry;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.OpendaylightFlowStatisticsListener;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.OpendaylightFlowTableStatisticsListener;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.queues.Queue;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.OpendaylightGroupStatisticsListener;
25 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
26 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
27 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.OpendaylightMeterStatisticsListener;
28 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.OpendaylightPortStatisticsListener;
29 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.OpendaylightQueueStatisticsListener;
30 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
34 * org.opendaylight.controller.md.statistics.manager
37 * It represent a central point for whole module. Implementation
38 * StatisticsManager registers all Operation/DS {@link StatNotifyCommiter} and
39 * Config/DS {@StatListeningCommiter}, as well as {@link StatPermCollector}
40 * for statistic collecting and {@link StatRpcMsgManager} as Device RPCs provider.
41 * In next, StatisticsManager provides all DS contact Transaction services.
43 * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
45 * Created: Aug 27, 2014
47 public interface StatisticsManager extends AutoCloseable, TransactionChainListener {
50 * StatDataStoreOperation
51 * Interface represent functionality to submit changes to DataStore.
52 * Internal {@link TransactionChainListener} joining all DS commits
53 * to Set of chained changes for prevent often DataStore touches.
55 public interface StatDataStoreOperation {
58 * Apply all read / write (put|merge) operation
60 * @param {@link ReadWriteTransaction} tx
62 void applyOperation(ReadWriteTransaction tx);
67 * Method starts whole StatisticManager functionality
69 * @param {@link NotificationProviderService} notifService
70 * @param {@link RpcConsumerRegistry} rpcRegistry
71 * @param minReqNetMonitInt
73 void start(final NotificationProviderService notifService,
74 final RpcConsumerRegistry rpcRegistry);
77 * Method provides read/write DataStore functionality cross applyOperation
78 * defined in {@link StatDataStoreOperation}
80 * @param inventoryOper - operation for DataStore
82 void enqueue(final StatDataStoreOperation inventoryOper);
85 * Method wraps {@link StatisticCollector}.isProvidedFlowNodeActive method
86 * to provide parallel statCollection process for Set of Nodes. So it has to
87 * identify correct Node Set by NodeIdentifier
91 boolean isProvidedFlowNodeActive(InstanceIdentifier<Node> nodeIdent);
94 * Method wraps {@link StatPermCollector}.collectNextStatistics to provide
95 * parallel statCollection process for Set of Nodes. So it has to
96 * identify correct Node Set by NodeIdentifier.
100 void collectNextStatistics(InstanceIdentifier<Node> nodeIdent);
103 * Method wraps {@link StatPermCollector}.connectedNodeRegistration to provide
104 * parallel statCollection process for Set of Nodes. So it has to
105 * connect node to new or not full Node statCollector Set.
109 * @param nrOfSwitchTables
111 void connectedNodeRegistration(InstanceIdentifier<Node> nodeIdent,
112 List<StatCapabTypes> statTypes, Short nrOfSwitchTables);
115 * Method wraps {@link StatPermCollector}.disconnectedNodeUnregistration to provide
116 * parallel statCollection process for Set of Nodes. So it has to identify
117 * correct collector for disconnect node.
121 void disconnectedNodeUnregistration(InstanceIdentifier<Node> nodeIdent);
124 * Method wraps {@link StatPermCollector}.registerAdditionalNodeFeature to provide
125 * possibility to register additional Node Feature {@link StatCapabTypes} for
126 * statistics collecting.
131 void registerAdditionalNodeFeature(InstanceIdentifier<Node> nodeIdent, StatCapabTypes statCapab);
134 * Method provides access to Device RPC methods by wrapped
135 * internal method. In next {@link StatRpcMsgManager} is registered all
136 * Multipart device msg response and joining all to be able run all
137 * collected statistics in one time (easy identification Data for delete)
139 * @return {@link StatRpcMsgManager}
141 StatRpcMsgManager getRpcMsgManager();
144 * Define Method : {@link org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode}
145 * Operational/DS data change listener -> impl. target -> register FlowCapableNode to Statistic Collecting process
146 * @return {@link StatNodeRegistration}
148 StatNodeRegistration getNodeRegistrator();
151 * Define Method : Flow Config/DS data change listener -> impl. target ->
152 * -> make pair between Config/DS FlowId and Device Flow response Hash
155 StatListeningCommiter<Flow, OpendaylightFlowStatisticsListener> getFlowListenComit();
158 * Define Method : Meter Config/DS data change listener and Operation/DS notify commit
162 StatListeningCommiter<Meter, OpendaylightMeterStatisticsListener> getMeterListenCommit();
165 * Define Method : Group Config/DS data change listener and Operation/DS notify commit
169 StatListeningCommiter<Group, OpendaylightGroupStatisticsListener> getGroupListenCommit();
172 * Define Method : Queue Config/DS change listener and Operation/DS notify commit functionality
175 StatListeningCommiter<Queue, OpendaylightQueueStatisticsListener> getQueueNotifyCommit();
178 * Define Method : Table Operation/DS notify commit functionality
181 StatNotifyCommiter<OpendaylightFlowTableStatisticsListener> getTableNotifCommit();
184 * Define Method : Port Operation/DS notify commit functionality
187 StatNotifyCommiter<OpendaylightPortStatisticsListener> getPortNotifyCommit();
189 StatisticsManagerConfig getConfiguration();