blob: b8702dd0ff8f6ba0462c32b75fa0d0085ed21065 [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 */
16package org.onosproject.incubator.net.meter;
17
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 */
33 void addMeter(Meter meter);
34
35 /**
36 * Updates a meter by adding statistic information to the meter.
37 *
38 * @param meter an updated meter
39 */
40 void updateMeter(Meter meter);
41
42 /**
43 * Remove a meter from the system and the dataplane.
44 *
45 * @param meter a meter to remove
46 */
47 void removeMeter(Meter meter);
48
49 /**
50 * Remove a meter from the system and the dataplane by meter id.
51 *
52 * @param id a meter id
53 */
54 void removeMeter(MeterId id);
55
56 /**
57 * Fetch the meter by the meter id.
58 *
59 * @param id a meter id
60 * @return a meter
61 */
62 Meter getMeter(MeterId id);
63
64 /**
65 * Allocate a meter id which must be used to create the meter.
66 *
67 * @return a meter id
68 */
69 MeterId allocateMeterId();
70}