blob: c613a8dbcfe84943fff3658c466bdf28998c8187 [file] [log] [blame]
Sho SHIMIZUb0a47d42015-02-19 13:26:30 -08001/*
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 */
16package org.onosproject.net.intent.impl;
17
18import org.onosproject.net.flow.FlowRuleOperations;
19import org.onosproject.net.intent.Intent;
20import org.onosproject.net.intent.IntentData;
21
22import java.util.List;
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 */
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 /**
42 * Generate a {@link FlowRuleOperations} instance from the specified intent data.
43 *
44 * @param current intent data stored in the store
45 * @param pending intent data being processed
46 * @return flow rule operations
47 */
48 FlowRuleOperations coordinate(IntentData current, IntentData pending);
49
50 /**
51 * Generate a {@link FlowRuleOperations} instance from the specified intent data.
52 *
53 * @param current intent data stored in the store
54 * @param pending intent data being processed
55 * @return flow rule operations
56 */
57 FlowRuleOperations uninstallCoordinate(IntentData current, IntentData pending);
58
59 /**
60 * Applies a batch operation of FlowRules.
61 *
62 * @param flowRules batch operation to apply
63 */
64 // TODO: consider a better name
65 // This methods gives strangeness a bit because
66 // it doesn't receive/return intent related information
67 void applyFlowRules(FlowRuleOperations flowRules);
68}