Andrea Campanella | e370878 | 2017-10-16 16:00:21 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017-present Open Networking Foundation |
| 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 | */ |
| 16 | |
| 17 | package org.onosproject.net.meter; |
| 18 | |
| 19 | import com.google.common.annotations.Beta; |
| 20 | import org.onosproject.net.driver.HandlerBehaviour; |
| 21 | |
| 22 | import java.util.Collection; |
| 23 | import java.util.concurrent.CompletableFuture; |
| 24 | |
| 25 | /** |
| 26 | * Meter programmable device behaviour. |
| 27 | */ |
| 28 | @Beta |
| 29 | public interface MeterProgrammable extends HandlerBehaviour { |
| 30 | |
| 31 | /** |
| 32 | * Performs a meter operation on this device. |
| 33 | * |
| 34 | * @param meterOp operation to be performed |
| 35 | * @return Completable future with result of the operation |
| 36 | */ |
| 37 | CompletableFuture<Boolean> performMeterOperation(MeterOperation meterOp); |
| 38 | |
| 39 | /** |
| 40 | * Queries the meters from the device. |
| 41 | * |
| 42 | * @return completable future with the collection of meters |
| 43 | */ |
| 44 | CompletableFuture<Collection<Meter>> getMeters(); |
Wailok Shum | be900bd | 2021-08-05 00:55:47 +0800 | [diff] [blame] | 45 | |
| 46 | /** |
| 47 | * Queries the meter features from the device. |
| 48 | * |
| 49 | * @return completable future with the collection of meter features |
| 50 | */ |
| 51 | CompletableFuture<Collection<MeterFeatures>> getMeterFeatures(); |
Frank Wang | d7e3b4b | 2017-09-24 13:37:54 +0900 | [diff] [blame] | 52 | } |