blob: 96fcc1136910e451b9f1e854bcd237db2b9689aa [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
2 * Copyright 2014 Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
alshabiba43aa252014-10-21 21:36:41 -070016package org.onlab.onos.net.statistic;
17
18import org.onlab.onos.net.ConnectPoint;
19import org.onlab.onos.net.flow.FlowEntry;
20import org.onlab.onos.net.flow.FlowRule;
21
22import java.util.Set;
23
24/**
25 * Store to house the computed statistics.
26 */
27public interface StatisticStore {
28
29 /**
30 * Lay the foundation for receiving flow stats for this rule.
31 * @param rule a {@link org.onlab.onos.net.flow.FlowRule}
32 */
33 void prepareForStatistics(FlowRule rule);
34
35 /**
36 * Remove entries associated with this rule.
Yuta HIGUCHI5c947272014-11-03 21:39:21 -080037 * @param rule {@link org.onlab.onos.net.flow.FlowRule}
alshabiba43aa252014-10-21 21:36:41 -070038 */
39 void removeFromStatistics(FlowRule rule);
40
41 /**
42 * Adds a stats observation for a flow rule.
43 * @param rule a {@link org.onlab.onos.net.flow.FlowEntry}
44 */
45 void addOrUpdateStatistic(FlowEntry rule);
46
47 /**
48 * Fetches the current observed stats values.
49 * @param connectPoint the port to fetch information for
50 * @return set of current flow rules
51 */
52 Set<FlowEntry> getCurrentStatistic(ConnectPoint connectPoint);
53
54 /**
55 * Fetches the current observed stats values.
56 * @param connectPoint the port to fetch information for
57 * @return set of current values
58 */
59 Set<FlowEntry> getPreviousStatistic(ConnectPoint connectPoint);
60}