alshabib | 2a441c6 | 2015-04-13 18:39:38 -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 | */ |
| 16 | package org.onosproject.net.flowobjective; |
| 17 | |
Thomas Vachuska | a9d491e | 2015-05-20 11:17:21 -0700 | [diff] [blame] | 18 | import com.google.common.annotations.Beta; |
| 19 | |
alshabib | 2a441c6 | 2015-04-13 18:39:38 -0700 | [diff] [blame] | 20 | /** |
| 21 | * The context of a objective that will become the subject of |
| 22 | * the notification. |
Thomas Vachuska | 27bee09 | 2015-06-23 19:03:10 -0700 | [diff] [blame] | 23 | * <p> |
alshabib | 2a441c6 | 2015-04-13 18:39:38 -0700 | [diff] [blame] | 24 | * Implementations of this class must be serializable. |
Thomas Vachuska | 27bee09 | 2015-06-23 19:03:10 -0700 | [diff] [blame] | 25 | * </p> |
alshabib | 2a441c6 | 2015-04-13 18:39:38 -0700 | [diff] [blame] | 26 | */ |
Thomas Vachuska | a9d491e | 2015-05-20 11:17:21 -0700 | [diff] [blame] | 27 | @Beta |
alshabib | 2a441c6 | 2015-04-13 18:39:38 -0700 | [diff] [blame] | 28 | public interface ObjectiveContext { |
| 29 | |
Thomas Vachuska | 27bee09 | 2015-06-23 19:03:10 -0700 | [diff] [blame] | 30 | /** |
| 31 | * Invoked on successful execution of the flow objective. |
| 32 | * |
| 33 | * @param objective objective to execute |
| 34 | */ |
| 35 | default void onSuccess(Objective objective) { |
| 36 | } |
alshabib | 2a441c6 | 2015-04-13 18:39:38 -0700 | [diff] [blame] | 37 | |
Thomas Vachuska | 27bee09 | 2015-06-23 19:03:10 -0700 | [diff] [blame] | 38 | /** |
| 39 | * Invoked when error is encountered while executing the flow objective. |
| 40 | * |
| 41 | * @param objective objective to execute |
| 42 | */ |
| 43 | default void onError(Objective objective, ObjectiveError error) { |
| 44 | } |
alshabib | 2a441c6 | 2015-04-13 18:39:38 -0700 | [diff] [blame] | 45 | |
| 46 | } |