X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fstatistics-manager%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fstatistics%2Fmanager%2FStatisticsManager.java;fp=opendaylight%2Fmd-sal%2Fstatistics-manager%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fstatistics%2Fmanager%2FStatisticsManager.java;h=b53c54e360e662c7a7b6b935dbfb76d2b6c98788;hb=b495d88f63ba0b5b3959d7742ae683c869cf3ccc;hp=0000000000000000000000000000000000000000;hpb=b3e553ce5b3d3e972cbe19465ab7af2fcb39934c;p=controller.git
diff --git a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatisticsManager.java b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatisticsManager.java
new file mode 100644
index 0000000000..b53c54e360
--- /dev/null
+++ b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatisticsManager.java
@@ -0,0 +1,179 @@
+/**
+ * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.controller.md.statistics.manager;
+
+import java.util.List;
+
+import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
+import org.opendaylight.controller.md.statistics.manager.StatPermCollector.StatCapabTypes;
+import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.controller.sal.binding.api.RpcConsumerRegistry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.OpendaylightFlowStatisticsListener;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.OpendaylightFlowTableStatisticsListener;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.queues.Queue;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.OpendaylightGroupStatisticsListener;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.OpendaylightMeterStatisticsListener;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.OpendaylightPortStatisticsListener;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.OpendaylightQueueStatisticsListener;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+
+/**
+ * statistics-manager
+ * org.opendaylight.controller.md.statistics.manager
+ *
+ * StatisticsManager
+ * It represent a central point for whole module. Implementation
+ * StatisticsManager registers all Operation/DS {@link StatNotifyCommiter} and
+ * Config/DS {@StatListeningCommiter}, as well as {@link StatPermCollector}
+ * for statistic collecting and {@link StatRpcMsgManager} as Device RPCs provider.
+ * In next, StatisticsManager provides all DS contact Transaction services.
+ *
+ * @author Vaclav Demcak
+ *
+ * Created: Aug 27, 2014
+ */
+public interface StatisticsManager extends AutoCloseable, TransactionChainListener {
+
+ /**
+ * StatDataStoreOperation
+ * Interface represent functionality to submit changes to DataStore.
+ * Internal {@link TransactionChainListener} joining all DS commits
+ * to Set of chained changes for prevent often DataStore touches.
+ */
+ public interface StatDataStoreOperation {
+
+ /**
+ * Apply all read / write (put|merge) operation
+ * for DataStore
+ * @param {@link ReadWriteTransaction} tx
+ */
+ void applyOperation(ReadWriteTransaction tx);
+
+ }
+
+ /**
+ * Method starts whole StatisticManager functionality
+ *
+ * @param {@link NotificationProviderService} notifService
+ * @param {@link RpcConsumerRegistry} rpcRegistry
+ * @param minReqNetMonitInt
+ */
+ void start(final NotificationProviderService notifService,
+ final RpcConsumerRegistry rpcRegistry, final long minReqNetMonitInt);
+
+ /**
+ * Method provides read/write DataStore functionality cross applyOperation
+ * defined in {@link StatDataStoreOperation}
+ *
+ * @param inventoryOper - operation for DataStore
+ */
+ void enqueue(final StatDataStoreOperation inventoryOper);
+
+ /**
+ * Method wraps {@link StatisticCollector}.isProvidedFlowNodeActive method
+ * to provide parallel statCollection process for Set of Nodes. So it has to
+ * identify correct Node Set by NodeIdentifier
+ *
+ * @param nodeIdent
+ */
+ boolean isProvidedFlowNodeActive(InstanceIdentifier nodeIdent);
+
+ /**
+ * Method wraps {@link StatPermCollector}.collectNextStatistics to provide
+ * parallel statCollection process for Set of Nodes. So it has to
+ * identify correct Node Set by NodeIdentifier.
+ *
+ * @param nodeIdent
+ */
+ void collectNextStatistics(InstanceIdentifier nodeIdent);
+
+ /**
+ * Method wraps {@link StatPermCollector}.connectedNodeRegistration to provide
+ * parallel statCollection process for Set of Nodes. So it has to
+ * connect node to new or not full Node statCollector Set.
+ *
+ * @param nodeIdent
+ * @param statTypes
+ * @param nrOfSwitchTables
+ */
+ void connectedNodeRegistration(InstanceIdentifier nodeIdent,
+ List statTypes, Short nrOfSwitchTables);
+
+ /**
+ * Method wraps {@link StatPermCollector}.disconnectedNodeUnregistration to provide
+ * parallel statCollection process for Set of Nodes. So it has to identify
+ * correct collector for disconnect node.
+ *
+ * @param nodeIdent
+ */
+ void disconnectedNodeUnregistration(InstanceIdentifier nodeIdent);
+
+ /**
+ * Method provides access to Device RPC methods by wrapped
+ * internal method. In next {@link StatRpcMsgManager} is registered all
+ * Multipart device msg response and joining all to be able run all
+ * collected statistics in one time (easy identification Data for delete)
+ *
+ * @return {@link StatRpcMsgManager}
+ */
+ StatRpcMsgManager getRpcMsgManager();
+
+ /**
+ * Define Method : {@link org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode}
+ * Operational/DS data change listener -> impl. target -> register FlowCapableNode to Statistic Collecting process
+ * @return {@link StatNodeRegistration}
+ */
+ StatNodeRegistration getNodeRegistrator();
+
+ /**
+ * Define Method : Flow Config/DS data change listener -> impl. target ->
+ * -> make pair between Config/DS FlowId and Device Flow response Hash
+ * @return
+ */
+ StatListeningCommiter getFlowListenComit();
+
+ /**
+ * Define Method : Meter Config/DS data change listener and Operation/DS notify commit
+ * functionality
+ * @return
+ */
+ StatListeningCommiter getMeterListenCommit();
+
+ /**
+ * Define Method : Group Config/DS data change listener and Operation/DS notify commit
+ * functionality
+ * @return
+ */
+ StatListeningCommiter getGroupListenCommit();
+
+ /**
+ * Define Method : Queue Config/DS change listener and Operation/DS notify commit functionality
+ * @return
+ */
+ StatListeningCommiter getQueueNotifyCommit();
+
+ /**
+ * Define Method : Table Operation/DS notify commit functionality
+ * @return
+ */
+ StatNotifyCommiter getTableNotifCommit();
+
+ /**
+ * Define Method : Port Operation/DS notify commit functionality
+ * @return
+ */
+ StatNotifyCommiter getPortNotifyCommit();
+
+}
+