blob: 261e1bd777ab9ed410a63c02a0b5b452c374639c [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
Thomas Vachuskae2b7e7e2015-05-20 11:11:31 -070018import com.google.common.annotations.Beta;
19
Thomas Vachuskaf0e1fae2015-04-24 00:51:51 -070020import java.util.Set;
21
22/**
23 * Service for tracking network configuration factories.
24 */
Thomas Vachuskae2b7e7e2015-05-20 11:11:31 -070025@Beta
Thomas Vachuskaf0e1fae2015-04-24 00:51:51 -070026public interface NetworkConfigRegistry {
27
28 /**
29 * Registers the specified configuration factory.
30 *
31 * @param configFactory configuration factory
32 */
33 void registerConfigFactory(ConfigFactory configFactory);
34
35 /**
36 * Unregisters the specified configuration factory.
37 *
38 * @param configFactory configuration factory
39 */
40 void unregisterConfigFactory(ConfigFactory configFactory);
41
42 /**
43 * Returns set of configuration factories available for the specified
44 * class of subject.
45 *
46 * @param subjectClass subject class
Thomas Vachuska266b4432015-04-30 18:13:25 -070047 * @param <T> type of subject
48 * @return set of config factories
Thomas Vachuskaf0e1fae2015-04-24 00:51:51 -070049 */
50 <T> Set<ConfigFactory<T>> getConfigFactories(Class<T> subjectClass);
51
52 /**
53 * Returns the configuration type registered for the specified
54 * subject type and key.
55 *
56 * @param subjectClass subject class
Thomas Vachuska266b4432015-04-30 18:13:25 -070057 * @param configKey configuration key
58 * @param <T> type of subject
59 * @return config factory
Thomas Vachuskaf0e1fae2015-04-24 00:51:51 -070060 */
61 <T> ConfigFactory<T> getConfigFactory(Class<T> subjectClass, String configKey);
62
63 /**
64 * Returns the configuration type registered for the specified
65 * configuration class.
66 *
67 * @param configClass configuration class
Thomas Vachuska266b4432015-04-30 18:13:25 -070068 * @param <T> type of subject
69 * @return config factory
Thomas Vachuskaf0e1fae2015-04-24 00:51:51 -070070 */
71 <T> ConfigFactory<T> getConfigFactory(Class<Config<T>> configClass);
72
73}