blob: f36b356a92b1d92a83c995aed72af9c96cd128ab [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();
Yi Tsengc927a062017-05-02 15:02:37 -070051
52 /**
53 * Registers the specific installer for the given intent class.
54 *
55 * @param cls intent class
56 * @param installer intent installer
57 * @param <T> the type of intent
58 */
59 <T extends Intent> void registerInstaller(Class<T> cls, IntentInstaller<T> installer);
60
61 /**
62 * Unregisters the installer for the specific intent class.
63 *
64 * @param cls intent class
65 * @param <T> the type of intent
66 */
67 <T extends Intent> void unregisterInstaller(Class<T> cls);
68
69 /**
70 * Returns immutable set of binding of currently registered intent installers.
71 *
72 * @return the set of installer bindings
73 */
74 Map<Class<? extends Intent>, IntentInstaller<? extends Intent>> getInstallers();
75
76 /**
77 * Returns the installer for specific installable intent.
78 *
79 * @param cls the type of intent
80 * @param <T> the type of intent
81 * @return the installer for specific installable intent
82 */
83 <T extends Intent> IntentInstaller<T> getInstaller(Class<T> cls);
Brian O'Connorb876bf12014-10-02 14:59:37 -070084}