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.openflowplugin.applications.statistics.manager;
11 import java.util.List;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.TransactionId;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
15 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
19 * org.opendaylight.openflowplugin.applications.statistics.manager
22 * Class implement {@link Runnable} and inside is running statistic collecting
23 * process DataObject statistics by DataObject statistics for every {@link org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode}.
24 * Every statistics wait to finish previous statistics. Only if all statistics finish,
25 * next {@link org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode}
26 * Statistics should be collecting. We are able to set minimal time for start next round cross all Network,
27 * but all depends on network possibility.
29 * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
31 * Created: Aug 28, 2014
33 public interface StatPermCollector extends Runnable, AutoCloseable {
37 * Enum class refers ofp_statistics capabilities fields from OF Switch
38 * capabilities specification which have to come as a post HandShake
39 * information from OF Switch and Inventory Manager adds all to the
41 * If the capabilities are not add (for any reason) NodeRegistrator
42 * adds all StatCapTypes for the {@link Node}.
44 public enum StatCapabTypes {
66 * Meter statistics has no support from OF Switch capabilities
67 * so we have to try get statistics for it and wait for response
68 * Error or response package with results.
72 //Custom flags for meter feature stats
75 //Custom flags for group feature stats
80 * Add new connected node for permanent statistics collecting process
84 * @param nrOfSwitchTables
85 * @return true/false if the {@link Node} added successful
87 boolean connectedNodeRegistration(InstanceIdentifier<Node> nodeIdent,
88 List<StatCapabTypes> statTypes, Short nrOfSwitchTables);
91 * All disconnected Nodes need be removed from stat list Nodes
94 * @return true/false if the {@link Node} removed successful
96 boolean disconnectedNodeUnregistration(InstanceIdentifier<Node> nodeIdent);
99 * Method add new feature {@link StatCapabTypes} to Node identified by
100 * nodeIdent -> InstanceIdentifier<Node>
103 * @return true/false if the {@link StatCapabTypes} add successful
105 boolean registerAdditionalNodeFeature(InstanceIdentifier<Node> nodeIdent, StatCapabTypes statCapab);
108 * Method remove stats {@link StatCapabTypes} from Node identified by
109 * nodeIdent -> InstanceIdentifier<Node>
112 * @return true/false if the {@link StatCapabTypes} remove successful
114 boolean unregisterNodeStats(InstanceIdentifier<Node> nodeIdent, StatCapabTypes statCapab);
117 * Method return true only and only if {@link StatPermCollector} contain
118 * valid node registration in its internal {@link Node} map.
119 * Otherwise return false.
124 boolean isProvidedFlowNodeActive(InstanceIdentifier<Node> nodeIdent);
127 * Object notification for continue statistics collecting process.
128 * It is call from collecting allStatistics methods as a future result for
129 * Operational/DS statistic store call (does not matter in the outcome).
131 void collectNextStatistics(TransactionId xid);
134 * Method returns true if collector has registered some active nodes
135 * otherwise return false.
139 boolean hasActiveNodes();