blob: eaa2a504fda13f4f4b5f07ce0474a1ab6b7bd611 [file] [log] [blame]
alshabib1d2bc402015-07-31 17:04:11 -07001/*
2 * Copyright 2015 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 */
alshabib10c810b2015-08-18 16:59:04 -070016package org.onosproject.net.meter;
alshabib1d2bc402015-07-31 17:04:11 -070017
18import org.onosproject.event.ListenerService;
19
20/**
21 * Service for add/updating and removing meters. Meters are
22 * are assigned to flow to rate limit them and provide a certain
23 * quality of service.
24 */
25public interface MeterService
26 extends ListenerService<MeterEvent, MeterListener> {
27
28 /**
29 * Adds a meter to the system and performs it installation.
30 *
31 * @param meter a meter.
32 */
alshabibeadfc8e2015-08-18 15:40:46 -070033 void addMeter(MeterOperation meter);
alshabib1d2bc402015-07-31 17:04:11 -070034
35 /**
36 * Updates a meter by adding statistic information to the meter.
37 *
38 * @param meter an updated meter
39 */
alshabibeadfc8e2015-08-18 15:40:46 -070040 void updateMeter(MeterOperation meter);
alshabib1d2bc402015-07-31 17:04:11 -070041
42 /**
43 * Remove a meter from the system and the dataplane.
44 *
45 * @param meter a meter to remove
46 */
alshabibeadfc8e2015-08-18 15:40:46 -070047 void removeMeter(MeterOperation meter);
alshabib1d2bc402015-07-31 17:04:11 -070048
49 /**
50 * Fetch the meter by the meter id.
51 *
52 * @param id a meter id
53 * @return a meter
54 */
55 Meter getMeter(MeterId id);
56
57 /**
58 * Allocate a meter id which must be used to create the meter.
59 *
60 * @return a meter id
61 */
62 MeterId allocateMeterId();
63}