Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Licensed to the Apache Software Foundation (ASF) under one |
| 3 | * or more contributor license agreements. See the NOTICE file |
| 4 | * distributed with this work for additional information |
| 5 | * regarding copyright ownership. The ASF licenses this file |
| 6 | * to you under the Apache License, Version 2.0 (the |
| 7 | * "License"); you may not use this file except in compliance |
| 8 | * with the License. You may obtain a copy of the License at |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, |
| 13 | * software distributed under the License is distributed on an |
| 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | * KIND, either express or implied. See the License for the |
| 16 | * specific language governing permissions and limitations |
| 17 | * under the License. |
| 18 | */ |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 19 | package org.onlab.onos.net.intent; |
| 20 | |
| 21 | import java.util.Map; |
| 22 | |
| 23 | /** |
| 24 | * Service for extending the capability of intent framework by |
| 25 | * adding additional compilers or/and installers. |
| 26 | */ |
| 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(); |
| 51 | |
| 52 | /** |
| 53 | * Registers the specified installer for the given installable intent class. |
| 54 | * |
tom | a1d16b6 | 2014-10-02 23:45:11 -0700 | [diff] [blame] | 55 | * @param cls installable intent class |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 56 | * @param installer intent installer |
tom | a1d16b6 | 2014-10-02 23:45:11 -0700 | [diff] [blame] | 57 | * @param <T> the type of installable intent |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 58 | */ |
Thomas Vachuska | c96058a | 2014-10-20 23:00:16 -0700 | [diff] [blame] | 59 | <T extends Intent> void registerInstaller(Class<T> cls, IntentInstaller<T> installer); |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 60 | |
| 61 | /** |
| 62 | * Unregisters the installer for the given installable intent class. |
| 63 | * |
| 64 | * @param cls installable intent class |
| 65 | * @param <T> the type of installable intent |
| 66 | */ |
Thomas Vachuska | c96058a | 2014-10-20 23:00:16 -0700 | [diff] [blame] | 67 | <T extends Intent> void unregisterInstaller(Class<T> cls); |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 68 | |
| 69 | /** |
| 70 | * Returns immutable set of bindings of currently registered intent installers. |
| 71 | * |
| 72 | * @return the set of installer bindings |
| 73 | */ |
Thomas Vachuska | c96058a | 2014-10-20 23:00:16 -0700 | [diff] [blame] | 74 | Map<Class<? extends Intent>, IntentInstaller<? extends Intent>> getInstallers(); |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 75 | } |