blob: b112b9a96f16ee5f8a422b6c5baec8492f015ad2 [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
18/**
alshabibeadfc8e2015-08-18 15:40:46 -070019 * A context permitting the application to be notified when the
20 * meter installation has been successful.
alshabib1d2bc402015-07-31 17:04:11 -070021 */
22public interface MeterContext {
23
24 /**
25 * Invoked on successful installation of the meter.
26 *
alshabibeadfc8e2015-08-18 15:40:46 -070027 * @param op a meter
alshabib1d2bc402015-07-31 17:04:11 -070028 */
alshabibeadfc8e2015-08-18 15:40:46 -070029 default void onSuccess(Meter op) {}
alshabib1d2bc402015-07-31 17:04:11 -070030
31 /**
32 * Invoked when error is encountered while installing a meter.
33 *
alshabibeadfc8e2015-08-18 15:40:46 -070034 * @param op a meter
alshabib1d2bc402015-07-31 17:04:11 -070035 * @param reason the reason why it failed
36 */
alshabibeadfc8e2015-08-18 15:40:46 -070037 default void onError(Meter op, MeterFailReason reason) {}
alshabib1d2bc402015-07-31 17:04:11 -070038}