blob: a7719f93172dce885d8749b4b887dfde710d93e6 [file] [log] [blame]
Yoonseon Han096cea02017-05-15 15:10:41 -07001/*
2 * Copyright 2017-present Open Networking Foundation
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
17package org.onosproject.incubator.net.virtual.impl.intent;
18
19import org.onosproject.incubator.net.virtual.NetworkId;
20import org.onosproject.net.intent.Intent;
21import org.onosproject.net.intent.IntentData;
22
23import java.util.List;
24import java.util.Optional;
25
26/**
27 * A collection of methods to process an intent for virtual networks.
28 *
29 * This interface is public, but intended to be used only by IntentManager and
30 * IntentProcessPhase subclasses stored under phase package.
31 */
32public interface VirtualIntentProcessor {
33 /**
34 * Compiles an intent recursively.
35 *
36 * @param networkId virtual network identifier
37 * @param intent intent
38 * @param previousInstallables previous intent installables
39 * @return result of compilation
40 */
41 List<Intent> compile(NetworkId networkId, Intent intent, List<Intent> previousInstallables);
42
43 /**
44 * Applies intents.
45 *
46 * @param networkId virtual network identifier
47 * @param toUninstall Intent data describing flows to uninstall.
48 * @param toInstall Intent data describing flows to install.
49 */
50 void apply(NetworkId networkId, Optional<IntentData> toUninstall,
51 Optional<IntentData> toInstall);
52}