Sho SHIMIZU | b0a47d4 | 2015-02-19 13:26:30 -0800 | [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.intent.impl; |
| 17 | |
Sho SHIMIZU | b0a47d4 | 2015-02-19 13:26:30 -0800 | [diff] [blame] | 18 | import org.onosproject.net.intent.Intent; |
| 19 | import org.onosproject.net.intent.IntentData; |
| 20 | |
| 21 | import java.util.List; |
Brian O'Connor | f0c5a05 | 2015-04-27 00:34:53 -0700 | [diff] [blame] | 22 | import java.util.Optional; |
Sho SHIMIZU | b0a47d4 | 2015-02-19 13:26:30 -0800 | [diff] [blame] | 23 | |
| 24 | /** |
| 25 | * A collection of methods to process an intent. |
| 26 | * |
| 27 | * This interface is public, but intended to be used only by IntentManager and |
| 28 | * IntentProcessPhase subclasses stored under phase package. |
| 29 | */ |
| 30 | public interface IntentProcessor { |
| 31 | |
| 32 | /** |
| 33 | * Compiles an intent recursively. |
| 34 | * |
| 35 | * @param intent intent |
| 36 | * @param previousInstallables previous intent installables |
| 37 | * @return result of compilation |
| 38 | */ |
| 39 | List<Intent> compile(Intent intent, List<Intent> previousInstallables); |
| 40 | |
| 41 | /** |
Brian O'Connor | f0c5a05 | 2015-04-27 00:34:53 -0700 | [diff] [blame] | 42 | * @param toUninstall Intent data describing flows to uninstall. |
| 43 | * @param toInstall Intent data describing flows to install. |
Sho SHIMIZU | b0a47d4 | 2015-02-19 13:26:30 -0800 | [diff] [blame] | 44 | */ |
Brian O'Connor | f0c5a05 | 2015-04-27 00:34:53 -0700 | [diff] [blame] | 45 | void apply(Optional<IntentData> toUninstall, Optional<IntentData> toInstall); |
Sho SHIMIZU | b0a47d4 | 2015-02-19 13:26:30 -0800 | [diff] [blame] | 46 | } |