blob: 31db2ec182ab1e10da34f0d628b94ae5495babfd [file] [log] [blame]
Thomas Vachuska83e090e2014-10-22 14:25:35 -07001/*
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'Connorb876bf12014-10-02 14:59:37 -070019package org.onlab.onos.net.intent;
20
21import java.util.Map;
22
23/**
24 * Service for extending the capability of intent framework by
25 * adding additional compilers or/and installers.
26 */
27public interface IntentExtensionService {
28 /**
29 * Registers the specified compiler for the given intent class.
30 *
toma1d16b62014-10-02 23:45:11 -070031 * @param cls intent class
Brian O'Connorb876bf12014-10-02 14:59:37 -070032 * @param compiler intent compiler
toma1d16b62014-10-02 23:45:11 -070033 * @param <T> the type of intent
Brian O'Connorb876bf12014-10-02 14:59:37 -070034 */
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 *
toma1d16b62014-10-02 23:45:11 -070055 * @param cls installable intent class
Brian O'Connorb876bf12014-10-02 14:59:37 -070056 * @param installer intent installer
toma1d16b62014-10-02 23:45:11 -070057 * @param <T> the type of installable intent
Brian O'Connorb876bf12014-10-02 14:59:37 -070058 */
Thomas Vachuskac96058a2014-10-20 23:00:16 -070059 <T extends Intent> void registerInstaller(Class<T> cls, IntentInstaller<T> installer);
Brian O'Connorb876bf12014-10-02 14:59:37 -070060
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 Vachuskac96058a2014-10-20 23:00:16 -070067 <T extends Intent> void unregisterInstaller(Class<T> cls);
Brian O'Connorb876bf12014-10-02 14:59:37 -070068
69 /**
70 * Returns immutable set of bindings of currently registered intent installers.
71 *
72 * @return the set of installer bindings
73 */
Thomas Vachuskac96058a2014-10-20 23:00:16 -070074 Map<Class<? extends Intent>, IntentInstaller<? extends Intent>> getInstallers();
Brian O'Connorb876bf12014-10-02 14:59:37 -070075}