blob: 1ac30e89bf3f80c218e178c315ea15b3e08252dc [file] [log] [blame]
alshabib2a441c62015-04-13 18:39:38 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
alshabib2a441c62015-04-13 18:39:38 -07003 *
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.net.flowobjective;
17
Thomas Vachuskaa9d491e2015-05-20 11:17:21 -070018import com.google.common.annotations.Beta;
19
alshabib2a441c62015-04-13 18:39:38 -070020/**
21 * The context of a objective that will become the subject of
22 * the notification.
Thomas Vachuska27bee092015-06-23 19:03:10 -070023 * <p>
alshabib2a441c62015-04-13 18:39:38 -070024 * Implementations of this class must be serializable.
Thomas Vachuska27bee092015-06-23 19:03:10 -070025 * </p>
alshabib2a441c62015-04-13 18:39:38 -070026 */
Thomas Vachuskaa9d491e2015-05-20 11:17:21 -070027@Beta
alshabib2a441c62015-04-13 18:39:38 -070028public interface ObjectiveContext {
29
Thomas Vachuska27bee092015-06-23 19:03:10 -070030 /**
31 * Invoked on successful execution of the flow objective.
32 *
33 * @param objective objective to execute
34 */
35 default void onSuccess(Objective objective) {
36 }
alshabib2a441c62015-04-13 18:39:38 -070037
Thomas Vachuska27bee092015-06-23 19:03:10 -070038 /**
39 * Invoked when error is encountered while executing the flow objective.
40 *
41 * @param objective objective to execute
Madan Jampani0dbac7a2015-06-25 10:37:45 -070042 * @param error error encountered
Thomas Vachuska27bee092015-06-23 19:03:10 -070043 */
44 default void onError(Objective objective, ObjectiveError error) {
45 }
alshabib2a441c62015-04-13 18:39:38 -070046
47}