blob: b4d40c9e0c2e5a2e5b0f82898ae48f96b1c9720c [file] [log] [blame]
Thomas Vachuska83e090e2014-10-22 14:25:35 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2014-present 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'Connor9476fa12015-06-25 15:17:17 -040018import com.google.common.annotations.Beta;
19
Brian O'Connorb876bf12014-10-02 14:59:37 -070020import java.util.Map;
21
22/**
23 * Service for extending the capability of intent framework by
24 * adding additional compilers or/and installers.
25 */
Brian O'Connor9476fa12015-06-25 15:17:17 -040026@Beta
Brian O'Connorb876bf12014-10-02 14:59:37 -070027public interface IntentExtensionService {
28 /**
29 * Registers the specified compiler for the given intent class.
30 *
toma1d16b62014-10-02 23:45:11 -070031 * @param cls intent class
Brian O'Connorb876bf12014-10-02 14:59:37 -070032 * @param compiler intent compiler
toma1d16b62014-10-02 23:45:11 -070033 * @param <T> the type of intent
Brian O'Connorb876bf12014-10-02 14:59:37 -070034 */
35 <T extends Intent> void registerCompiler(Class<T> cls, IntentCompiler<T> compiler);
36
37 /**
38 * Unregisters the compiler for the specified intent class.
39 *
40 * @param cls intent class
41 * @param <T> the type of intent
42 */
43 <T extends Intent> void unregisterCompiler(Class<T> cls);
44
45 /**
46 * Returns immutable set of bindings of currently registered intent compilers.
47 *
48 * @return the set of compiler bindings
49 */
50 Map<Class<? extends Intent>, IntentCompiler<? extends Intent>> getCompilers();
Brian O'Connorb876bf12014-10-02 14:59:37 -070051}