alshabib | bc37196 | 2015-07-09 22:26:21 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
alshabib | bc37196 | 2015-07-09 22:26:21 -0700 | [diff] [blame] | 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 | */ |
alshabib | 10c810b | 2015-08-18 16:59:04 -0700 | [diff] [blame] | 16 | package org.onosproject.net.meter; |
alshabib | bc37196 | 2015-07-09 22:26:21 -0700 | [diff] [blame] | 17 | |
| 18 | import org.onosproject.net.DeviceId; |
| 19 | import org.onosproject.net.provider.ProviderService; |
| 20 | |
| 21 | import java.util.Collection; |
| 22 | |
| 23 | /** |
| 24 | * Service through which meter providers can inject information |
| 25 | * into the core. |
| 26 | */ |
| 27 | public interface MeterProviderService extends ProviderService<MeterProvider> { |
| 28 | |
| 29 | /** |
| 30 | * Notifies the core that a meter operaton failed for a |
| 31 | * specific reason. |
alshabib | c791179 | 2015-07-30 17:55:30 -0700 | [diff] [blame] | 32 | * @param operation the failed operation |
| 33 | * @param reason the failure reason |
alshabib | bc37196 | 2015-07-09 22:26:21 -0700 | [diff] [blame] | 34 | */ |
alshabib | c791179 | 2015-07-30 17:55:30 -0700 | [diff] [blame] | 35 | void meterOperationFailed(MeterOperation operation, |
alshabib | bc37196 | 2015-07-09 22:26:21 -0700 | [diff] [blame] | 36 | MeterFailReason reason); |
| 37 | |
| 38 | /** |
| 39 | * Pushes the collection of meters observed on the data plane as |
| 40 | * well as their associated statistics. |
| 41 | * |
| 42 | * @param deviceId a device id |
| 43 | * @param meterEntries a collection of meter entries |
| 44 | */ |
| 45 | void pushMeterMetrics(DeviceId deviceId, |
| 46 | Collection<Meter> meterEntries); |
| 47 | |
Jordi Ortiz | aa8de49 | 2016-12-01 00:21:36 +0100 | [diff] [blame] | 48 | /** |
| 49 | * Pushes the meter features collected from the device. |
| 50 | * |
| 51 | * @param deviceId the device Id |
| 52 | * @param meterfeatures the meter features |
| 53 | */ |
| 54 | void pushMeterFeatures(DeviceId deviceId, |
| 55 | MeterFeatures meterfeatures); |
| 56 | |
Wailok Shum | be89723 | 2021-07-26 16:51:01 +0800 | [diff] [blame] | 57 | /** |
| 58 | * Pushes the collection of meter features collected from the device. |
| 59 | * |
| 60 | * @param deviceId the device Id |
| 61 | * @param meterfeatures the meter features |
| 62 | */ |
| 63 | void pushMeterFeatures(DeviceId deviceId, |
| 64 | Collection<MeterFeatures> meterfeatures); |
Jordi Ortiz | aa8de49 | 2016-12-01 00:21:36 +0100 | [diff] [blame] | 65 | |
| 66 | /** |
| 67 | * Delete meter features collected from the device. |
| 68 | * |
| 69 | * @param deviceId the device id |
| 70 | */ |
| 71 | void deleteMeterFeatures(DeviceId deviceId); |
alshabib | bc37196 | 2015-07-09 22:26:21 -0700 | [diff] [blame] | 72 | |
| 73 | } |