blob: fec85d5553cf78bb87f338e7331f906a57dbcda6 [file] [log] [blame]
Thomas Vachuska83e090e2014-10-22 14:25:35 -07001/*
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07002 * Copyright 2014 Open Networking Laboratory
Thomas Vachuska83e090e2014-10-22 14:25:35 -07003 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07004 * 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 Vachuska83e090e2014-10-22 14:25:35 -07007 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07008 * 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 Vachuska83e090e2014-10-22 14:25:35 -070015 */
Brian O'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.net.intent;
Brian O'Connorb876bf12014-10-02 14:59:37 -070017
Ray Milkey71ade562015-02-18 15:08:07 -080018import org.onosproject.net.flow.FlowRuleOperation;
Brian O'Connorfa81eae2014-10-30 13:20:05 -070019
Brian O'Connor64a0369d2015-02-20 22:02:59 -080020import java.util.Collection;
21import java.util.List;
22
Brian O'Connorb876bf12014-10-02 14:59:37 -070023/**
24 * Abstraction of entity capable of installing intents to the environment.
25 */
Brian O'Connor7775bda2015-02-06 15:01:18 -080026//TODO consider refactoring this API
Thomas Vachuskac96058a2014-10-20 23:00:16 -070027public interface IntentInstaller<T extends Intent> {
Brian O'Connorb876bf12014-10-02 14:59:37 -070028 /**
29 * Installs the specified intent to the environment.
30 *
Brian O'Connorfa81eae2014-10-30 13:20:05 -070031 * @param intent intent to be installed
32 * @return flow rule operations to complete install
Brian O'Connorb876bf12014-10-02 14:59:37 -070033 * @throws IntentException if issues are encountered while installing the intent
34 */
Brian O'Connor64a0369d2015-02-20 22:02:59 -080035 List<Collection<FlowRuleOperation>> install(T intent);
Brian O'Connorb876bf12014-10-02 14:59:37 -070036
37 /**
38 * Uninstalls the specified intent from the environment.
39 *
Brian O'Connorfa81eae2014-10-30 13:20:05 -070040 * @param intent intent to be uninstalled
41 * @return flow rule operations to complete uninstall
Brian O'Connorb876bf12014-10-02 14:59:37 -070042 * @throws IntentException if issues are encountered while uninstalling the intent
43 */
Brian O'Connor64a0369d2015-02-20 22:02:59 -080044 List<Collection<FlowRuleOperation>> uninstall(T intent);
Brian O'Connorfa81eae2014-10-30 13:20:05 -070045
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 */
Brian O'Connor64a0369d2015-02-20 22:02:59 -080054 List<Collection<FlowRuleOperation>> replace(T oldIntent, T newIntent);
Brian O'Connorfa81eae2014-10-30 13:20:05 -070055
Brian O'Connorb876bf12014-10-02 14:59:37 -070056}