blob: 8deb3728b254d71dd55f3b007d802a715bceda0c [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 */
41 <T extends InstallableIntent> void registerInstaller(Class<T> cls, IntentInstaller<T> installer);
42
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 */
49 <T extends InstallableIntent> void unregisterInstaller(Class<T> cls);
50
51 /**
52 * Returns immutable set of bindings of currently registered intent installers.
53 *
54 * @return the set of installer bindings
55 */
56 Map<Class<? extends InstallableIntent>, IntentInstaller<? extends InstallableIntent>> getInstallers();
57}