blob: 97bd14e5382726e0bfa6b36cf3a1abd35340c9f2 [file] [log] [blame]
Sho SHIMIZUb0a47d42015-02-19 13:26:30 -08001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Sho SHIMIZUb0a47d42015-02-19 13:26:30 -08003 *
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.intent.impl;
17
Sho SHIMIZUb0a47d42015-02-19 13:26:30 -080018import org.onosproject.net.intent.Intent;
19import org.onosproject.net.intent.IntentData;
20
21import java.util.List;
Brian O'Connorf0c5a052015-04-27 00:34:53 -070022import java.util.Optional;
Sho SHIMIZUb0a47d42015-02-19 13:26:30 -080023
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 */
30public 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'Connorf0c5a052015-04-27 00:34:53 -070042 * @param toUninstall Intent data describing flows to uninstall.
43 * @param toInstall Intent data describing flows to install.
Sho SHIMIZUb0a47d42015-02-19 13:26:30 -080044 */
Brian O'Connorf0c5a052015-04-27 00:34:53 -070045 void apply(Optional<IntentData> toUninstall, Optional<IntentData> toInstall);
Sho SHIMIZUb0a47d42015-02-19 13:26:30 -080046}