Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 1 | /* |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 2 | * Copyright 2014 Open Networking Laboratory |
Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 3 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 4 | * 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 Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 7 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 8 | * 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 Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 15 | */ |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 16 | package org.onlab.onos.net.intent; |
| 17 | |
| 18 | import java.util.Map; |
| 19 | |
| 20 | /** |
| 21 | * Service for extending the capability of intent framework by |
| 22 | * adding additional compilers or/and installers. |
| 23 | */ |
| 24 | public interface IntentExtensionService { |
| 25 | /** |
| 26 | * Registers the specified compiler for the given intent class. |
| 27 | * |
tom | a1d16b6 | 2014-10-02 23:45:11 -0700 | [diff] [blame] | 28 | * @param cls intent class |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 29 | * @param compiler intent compiler |
tom | a1d16b6 | 2014-10-02 23:45:11 -0700 | [diff] [blame] | 30 | * @param <T> the type of intent |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 31 | */ |
| 32 | <T extends Intent> void registerCompiler(Class<T> cls, IntentCompiler<T> compiler); |
| 33 | |
| 34 | /** |
| 35 | * Unregisters the compiler for the specified intent class. |
| 36 | * |
| 37 | * @param cls intent class |
| 38 | * @param <T> the type of intent |
| 39 | */ |
| 40 | <T extends Intent> void unregisterCompiler(Class<T> cls); |
| 41 | |
| 42 | /** |
| 43 | * Returns immutable set of bindings of currently registered intent compilers. |
| 44 | * |
| 45 | * @return the set of compiler bindings |
| 46 | */ |
| 47 | Map<Class<? extends Intent>, IntentCompiler<? extends Intent>> getCompilers(); |
| 48 | |
| 49 | /** |
| 50 | * Registers the specified installer for the given installable intent class. |
| 51 | * |
tom | a1d16b6 | 2014-10-02 23:45:11 -0700 | [diff] [blame] | 52 | * @param cls installable intent class |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 53 | * @param installer intent installer |
tom | a1d16b6 | 2014-10-02 23:45:11 -0700 | [diff] [blame] | 54 | * @param <T> the type of installable intent |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 55 | */ |
Thomas Vachuska | c96058a | 2014-10-20 23:00:16 -0700 | [diff] [blame] | 56 | <T extends Intent> void registerInstaller(Class<T> cls, IntentInstaller<T> installer); |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 57 | |
| 58 | /** |
| 59 | * Unregisters the installer for the given installable intent class. |
| 60 | * |
| 61 | * @param cls installable intent class |
| 62 | * @param <T> the type of installable intent |
| 63 | */ |
Thomas Vachuska | c96058a | 2014-10-20 23:00:16 -0700 | [diff] [blame] | 64 | <T extends Intent> void unregisterInstaller(Class<T> cls); |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 65 | |
| 66 | /** |
| 67 | * Returns immutable set of bindings of currently registered intent installers. |
| 68 | * |
| 69 | * @return the set of installer bindings |
| 70 | */ |
Thomas Vachuska | c96058a | 2014-10-20 23:00:16 -0700 | [diff] [blame] | 71 | Map<Class<? extends Intent>, IntentInstaller<? extends Intent>> getInstallers(); |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 72 | } |