blob: 2b578ff6d18bf1326403bd58fcbd36d134196ae5 [file] [log] [blame]
Thomas Vachuska83e090e2014-10-22 14:25:35 -07001/*
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07002 * Copyright 2014 Open Networking Laboratory
Thomas Vachuska83e090e2014-10-22 14:25:35 -07003 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07004 * 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 Vachuska83e090e2014-10-22 14:25:35 -07007 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07008 * 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 Vachuska83e090e2014-10-22 14:25:35 -070015 */
Brian O'Connorb876bf12014-10-02 14:59:37 -070016package org.onlab.onos.net.intent;
17
18import java.util.Map;
19
20/**
21 * Service for extending the capability of intent framework by
22 * adding additional compilers or/and installers.
23 */
24public interface IntentExtensionService {
25 /**
26 * Registers the specified compiler for the given intent class.
27 *
toma1d16b62014-10-02 23:45:11 -070028 * @param cls intent class
Brian O'Connorb876bf12014-10-02 14:59:37 -070029 * @param compiler intent compiler
toma1d16b62014-10-02 23:45:11 -070030 * @param <T> the type of intent
Brian O'Connorb876bf12014-10-02 14:59:37 -070031 */
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 *
toma1d16b62014-10-02 23:45:11 -070052 * @param cls installable intent class
Brian O'Connorb876bf12014-10-02 14:59:37 -070053 * @param installer intent installer
toma1d16b62014-10-02 23:45:11 -070054 * @param <T> the type of installable intent
Brian O'Connorb876bf12014-10-02 14:59:37 -070055 */
Thomas Vachuskac96058a2014-10-20 23:00:16 -070056 <T extends Intent> void registerInstaller(Class<T> cls, IntentInstaller<T> installer);
Brian O'Connorb876bf12014-10-02 14:59:37 -070057
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 Vachuskac96058a2014-10-20 23:00:16 -070064 <T extends Intent> void unregisterInstaller(Class<T> cls);
Brian O'Connorb876bf12014-10-02 14:59:37 -070065
66 /**
67 * Returns immutable set of bindings of currently registered intent installers.
68 *
69 * @return the set of installer bindings
70 */
Thomas Vachuskac96058a2014-10-20 23:00:16 -070071 Map<Class<? extends Intent>, IntentInstaller<? extends Intent>> getInstallers();
Brian O'Connorb876bf12014-10-02 14:59:37 -070072}