blob: 50e803c74487a276c24ed6745c6ecc8187e8918d [file] [log] [blame]
Brian O'Connorb876bf12014-10-02 14:59:37 -07001package org.onlab.onos.net.intent;
2
3import java.util.Map;
4
5/**
6 * Service for extending the capability of intent framework by
7 * adding additional compilers or/and installers.
8 */
9public interface IntentExtensionService {
10 /**
11 * Registers the specified compiler for the given intent class.
12 *
toma1d16b62014-10-02 23:45:11 -070013 * @param cls intent class
Brian O'Connorb876bf12014-10-02 14:59:37 -070014 * @param compiler intent compiler
toma1d16b62014-10-02 23:45:11 -070015 * @param <T> the type of intent
Brian O'Connorb876bf12014-10-02 14:59:37 -070016 */
17 <T extends Intent> void registerCompiler(Class<T> cls, IntentCompiler<T> compiler);
18
19 /**
20 * Unregisters the compiler for the specified intent class.
21 *
22 * @param cls intent class
23 * @param <T> the type of intent
24 */
25 <T extends Intent> void unregisterCompiler(Class<T> cls);
26
27 /**
28 * Returns immutable set of bindings of currently registered intent compilers.
29 *
30 * @return the set of compiler bindings
31 */
32 Map<Class<? extends Intent>, IntentCompiler<? extends Intent>> getCompilers();
33
34 /**
35 * Registers the specified installer for the given installable intent class.
36 *
toma1d16b62014-10-02 23:45:11 -070037 * @param cls installable intent class
Brian O'Connorb876bf12014-10-02 14:59:37 -070038 * @param installer intent installer
toma1d16b62014-10-02 23:45:11 -070039 * @param <T> the type of installable intent
Brian O'Connorb876bf12014-10-02 14:59:37 -070040 */
Thomas Vachuskac96058a2014-10-20 23:00:16 -070041 <T extends Intent> void registerInstaller(Class<T> cls, IntentInstaller<T> installer);
Brian O'Connorb876bf12014-10-02 14:59:37 -070042
43 /**
44 * Unregisters the installer for the given installable intent class.
45 *
46 * @param cls installable intent class
47 * @param <T> the type of installable intent
48 */
Thomas Vachuskac96058a2014-10-20 23:00:16 -070049 <T extends Intent> void unregisterInstaller(Class<T> cls);
Brian O'Connorb876bf12014-10-02 14:59:37 -070050
51 /**
52 * Returns immutable set of bindings of currently registered intent installers.
53 *
54 * @return the set of installer bindings
55 */
Thomas Vachuskac96058a2014-10-20 23:00:16 -070056 Map<Class<? extends Intent>, IntentInstaller<? extends Intent>> getInstallers();
Brian O'Connorb876bf12014-10-02 14:59:37 -070057}