blob: 1524fd6c128392072f55409874327e9258e60429 [file] [log] [blame]
Thomas Vachuskaf0e1fae2015-04-24 00:51:51 -07001/*
2 * Copyright 2015 Open Networking Laboratory
3 *
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
7 *
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.
15 */
Thomas Vachuskad24aa7f2015-05-14 18:37:54 -070016package org.onosproject.incubator.net.config;
Thomas Vachuskaf0e1fae2015-04-24 00:51:51 -070017
18import java.util.Set;
19
20/**
21 * Service for tracking network configurations which specify how the discovered
22 * network information should be interpretted and how the network should be
23 * configured.
24 */
25public interface NetworkConfigService {
26
27 /**
28 * Returns the set of subjects for which some configuration is available.
29 *
30 * @param subjectClass subject class
Thomas Vachuska266b4432015-04-30 18:13:25 -070031 * @param <T> type of subject
Thomas Vachuskaf0e1fae2015-04-24 00:51:51 -070032 * @return set of configured subjects
33 */
34 <T> Set<T> getSubjects(Class<T> subjectClass);
35
36 /**
37 * Returns the set of subjects for which the specified configuration is
38 * available.
39 *
40 * @param subjectClass subject class
41 * @param configClass configuration class
Thomas Vachuska266b4432015-04-30 18:13:25 -070042 * @param <T> type of subject
Thomas Vachuskaf0e1fae2015-04-24 00:51:51 -070043 * @return set of configured subjects
44 */
45 <T> Set<T> getSubjects(Class<T> subjectClass, Class<Config<T>> configClass);
46
47
48 /**
49 * Returns all configurations for the specified subject.
50 *
51 * @param subject configuration subject
Thomas Vachuska266b4432015-04-30 18:13:25 -070052 * @param <T> type of subject
Thomas Vachuskaf0e1fae2015-04-24 00:51:51 -070053 * @return set of configurations
54 */
55 <T> Set<Config<T>> getConfigs(T subject);
56
57 /**
58 * Returns the configuration for the specified subject and configuration
59 * class if one is available; null otherwise.
60 *
61 * @param subject configuration subject
62 * @param configClass configuration class
Thomas Vachuska266b4432015-04-30 18:13:25 -070063 * @param <T> type of subject
Thomas Vachuskaf0e1fae2015-04-24 00:51:51 -070064 * @return configuration or null if one is not available
65 */
66 <T> Config<T> getConfig(T subject, Class<Config<T>> configClass);
67
68}