alshabib | 1d2bc40 | 2015-07-31 17:04:11 -0700 | [diff] [blame] | 1 | /* |
| 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 | */ |
alshabib | 10c810b | 2015-08-18 16:59:04 -0700 | [diff] [blame] | 16 | package org.onosproject.net.meter; |
alshabib | 1d2bc40 | 2015-07-31 17:04:11 -0700 | [diff] [blame] | 17 | |
| 18 | /** |
alshabib | eadfc8e | 2015-08-18 15:40:46 -0700 | [diff] [blame] | 19 | * A context permitting the application to be notified when the |
| 20 | * meter installation has been successful. |
alshabib | 1d2bc40 | 2015-07-31 17:04:11 -0700 | [diff] [blame] | 21 | */ |
| 22 | public interface MeterContext { |
| 23 | |
| 24 | /** |
| 25 | * Invoked on successful installation of the meter. |
| 26 | * |
alshabib | eadfc8e | 2015-08-18 15:40:46 -0700 | [diff] [blame] | 27 | * @param op a meter |
alshabib | 1d2bc40 | 2015-07-31 17:04:11 -0700 | [diff] [blame] | 28 | */ |
alshabib | e1248b6 | 2015-08-20 17:21:55 -0700 | [diff] [blame] | 29 | default void onSuccess(MeterRequest op) {} |
alshabib | 1d2bc40 | 2015-07-31 17:04:11 -0700 | [diff] [blame] | 30 | |
| 31 | /** |
| 32 | * Invoked when error is encountered while installing a meter. |
| 33 | * |
alshabib | eadfc8e | 2015-08-18 15:40:46 -0700 | [diff] [blame] | 34 | * @param op a meter |
alshabib | 1d2bc40 | 2015-07-31 17:04:11 -0700 | [diff] [blame] | 35 | * @param reason the reason why it failed |
| 36 | */ |
alshabib | e1248b6 | 2015-08-20 17:21:55 -0700 | [diff] [blame] | 37 | default void onError(MeterRequest op, MeterFailReason reason) {} |
alshabib | 1d2bc40 | 2015-07-31 17:04:11 -0700 | [diff] [blame] | 38 | } |