blob: b26008007e58efacfb7254330961eb5349b56340 [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
Brian O'Connorabafb502014-12-02 22:26:20 -080018import org.onosproject.net.flow.FlowRuleBatchOperation;
Brian O'Connorcb900f42014-10-07 21:55:33 -070019
Brian O'Connorfa81eae2014-10-30 13:20:05 -070020import java.util.List;
21
Brian O'Connorb876bf12014-10-02 14:59:37 -070022/**
23 * Abstraction of entity capable of installing intents to the environment.
24 */
Brian O'Connor7775bda2015-02-06 15:01:18 -080025//TODO consider refactoring this API
Thomas Vachuskac96058a2014-10-20 23:00:16 -070026public interface IntentInstaller<T extends Intent> {
Brian O'Connorb876bf12014-10-02 14:59:37 -070027 /**
28 * Installs the specified intent to the environment.
29 *
Brian O'Connorfa81eae2014-10-30 13:20:05 -070030 * @param intent intent to be installed
31 * @return flow rule operations to complete install
Brian O'Connorb876bf12014-10-02 14:59:37 -070032 * @throws IntentException if issues are encountered while installing the intent
33 */
Brian O'Connorf2dbde52014-10-10 16:20:24 -070034 List<FlowRuleBatchOperation> install(T intent);
Brian O'Connorb876bf12014-10-02 14:59:37 -070035
36 /**
37 * Uninstalls the specified intent from the environment.
38 *
Brian O'Connorfa81eae2014-10-30 13:20:05 -070039 * @param intent intent to be uninstalled
40 * @return flow rule operations to complete uninstall
Brian O'Connorb876bf12014-10-02 14:59:37 -070041 * @throws IntentException if issues are encountered while uninstalling the intent
42 */
Brian O'Connorf2dbde52014-10-10 16:20:24 -070043 List<FlowRuleBatchOperation> uninstall(T intent);
Brian O'Connorfa81eae2014-10-30 13:20:05 -070044
45 /**
46 * Replaces the specified intent with a new one in the environment.
47 *
48 * @param oldIntent intent to be removed
49 * @param newIntent intent to be installed
50 * @return flow rule operations to complete the replace
51 * @throws IntentException if issues are encountered while uninstalling the intent
52 */
Brian O'Connor0e271dc2015-02-04 18:20:25 -080053 @Deprecated
Brian O'Connorfa81eae2014-10-30 13:20:05 -070054 List<FlowRuleBatchOperation> replace(T oldIntent, T newIntent);
55
Brian O'Connorb876bf12014-10-02 14:59:37 -070056}