Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 1 | /* |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 2 | * Copyright 2014 Open Networking Laboratory |
Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 3 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 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 |
Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 7 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 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. |
Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 15 | */ |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.net.intent; |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 17 | |
Brian O'Connor | fa81eae | 2014-10-30 13:20:05 -0700 | [diff] [blame] | 18 | import java.util.List; |
Ray Milkey | 71ade56 | 2015-02-18 15:08:07 -0800 | [diff] [blame] | 19 | import java.util.Set; |
| 20 | |
| 21 | import org.onosproject.net.flow.FlowRuleOperation; |
Brian O'Connor | fa81eae | 2014-10-30 13:20:05 -0700 | [diff] [blame] | 22 | |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 23 | /** |
| 24 | * Abstraction of entity capable of installing intents to the environment. |
| 25 | */ |
Brian O'Connor | 7775bda | 2015-02-06 15:01:18 -0800 | [diff] [blame] | 26 | //TODO consider refactoring this API |
Thomas Vachuska | c96058a | 2014-10-20 23:00:16 -0700 | [diff] [blame] | 27 | public interface IntentInstaller<T extends Intent> { |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 28 | /** |
| 29 | * Installs the specified intent to the environment. |
| 30 | * |
Brian O'Connor | fa81eae | 2014-10-30 13:20:05 -0700 | [diff] [blame] | 31 | * @param intent intent to be installed |
| 32 | * @return flow rule operations to complete install |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 33 | * @throws IntentException if issues are encountered while installing the intent |
| 34 | */ |
Ray Milkey | 71ade56 | 2015-02-18 15:08:07 -0800 | [diff] [blame] | 35 | List<Set<FlowRuleOperation>> install(T intent); |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 36 | |
| 37 | /** |
| 38 | * Uninstalls the specified intent from the environment. |
| 39 | * |
Brian O'Connor | fa81eae | 2014-10-30 13:20:05 -0700 | [diff] [blame] | 40 | * @param intent intent to be uninstalled |
| 41 | * @return flow rule operations to complete uninstall |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 42 | * @throws IntentException if issues are encountered while uninstalling the intent |
| 43 | */ |
Ray Milkey | 71ade56 | 2015-02-18 15:08:07 -0800 | [diff] [blame] | 44 | List<Set<FlowRuleOperation>> uninstall(T intent); |
Brian O'Connor | fa81eae | 2014-10-30 13:20:05 -0700 | [diff] [blame] | 45 | |
| 46 | /** |
| 47 | * Replaces the specified intent with a new one in the environment. |
| 48 | * |
| 49 | * @param oldIntent intent to be removed |
| 50 | * @param newIntent intent to be installed |
| 51 | * @return flow rule operations to complete the replace |
| 52 | * @throws IntentException if issues are encountered while uninstalling the intent |
| 53 | */ |
Ray Milkey | 71ade56 | 2015-02-18 15:08:07 -0800 | [diff] [blame] | 54 | List<Set<FlowRuleOperation>> replace(T oldIntent, T newIntent); |
Brian O'Connor | fa81eae | 2014-10-30 13:20:05 -0700 | [diff] [blame] | 55 | |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 56 | } |