Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.intent; |
| 2 | |
| 3 | import java.util.Map; |
| 4 | |
| 5 | /** |
| 6 | * Service for extending the capability of intent framework by |
| 7 | * adding additional compilers or/and installers. |
| 8 | */ |
| 9 | public interface IntentExtensionService { |
| 10 | /** |
| 11 | * Registers the specified compiler for the given intent class. |
| 12 | * |
tom | a1d16b6 | 2014-10-02 23:45:11 -0700 | [diff] [blame] | 13 | * @param cls intent class |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 14 | * @param compiler intent compiler |
tom | a1d16b6 | 2014-10-02 23:45:11 -0700 | [diff] [blame] | 15 | * @param <T> the type of intent |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 16 | */ |
| 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 | * |
tom | a1d16b6 | 2014-10-02 23:45:11 -0700 | [diff] [blame] | 37 | * @param cls installable intent class |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 38 | * @param installer intent installer |
tom | a1d16b6 | 2014-10-02 23:45:11 -0700 | [diff] [blame] | 39 | * @param <T> the type of installable intent |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 40 | */ |
Thomas Vachuska | c96058a | 2014-10-20 23:00:16 -0700 | [diff] [blame] | 41 | <T extends Intent> void registerInstaller(Class<T> cls, IntentInstaller<T> installer); |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 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 | */ |
Thomas Vachuska | c96058a | 2014-10-20 23:00:16 -0700 | [diff] [blame] | 49 | <T extends Intent> void unregisterInstaller(Class<T> cls); |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 50 | |
| 51 | /** |
| 52 | * Returns immutable set of bindings of currently registered intent installers. |
| 53 | * |
| 54 | * @return the set of installer bindings |
| 55 | */ |
Thomas Vachuska | c96058a | 2014-10-20 23:00:16 -0700 | [diff] [blame] | 56 | Map<Class<? extends Intent>, IntentInstaller<? extends Intent>> getInstallers(); |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 57 | } |