Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2014-present 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 | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.net.intent; |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 17 | |
Brian O'Connor | 9476fa1 | 2015-06-25 15:17:17 -0400 | [diff] [blame] | 18 | import com.google.common.annotations.Beta; |
| 19 | |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 20 | import 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'Connor | 9476fa1 | 2015-06-25 15:17:17 -0400 | [diff] [blame] | 26 | @Beta |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 27 | public interface IntentExtensionService { |
| 28 | /** |
| 29 | * Registers the specified compiler for the given intent class. |
| 30 | * |
tom | a1d16b6 | 2014-10-02 23:45:11 -0700 | [diff] [blame] | 31 | * @param cls intent class |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 32 | * @param compiler intent compiler |
tom | a1d16b6 | 2014-10-02 23:45:11 -0700 | [diff] [blame] | 33 | * @param <T> the type of intent |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 34 | */ |
| 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(); |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 51 | } |