blob: 6b06c8c83f2647c2f5b8004336208906600530af [file] [log] [blame]
Thomas Vachuskaf0e1fae2015-04-24 00:51:51 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Thomas Vachuskaf0e1fae2015-04-24 00:51:51 -07003 *
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 */
Ray Milkeya4122362015-08-18 15:19:08 -070016package org.onosproject.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/**
Thomas Vachuska96d55b12015-05-11 08:52:03 -070023 * Service for tracking network configuration factories. It is the basis for
24 * extensibility to allow various core subsystems or apps to register their
25 * own configuration factories that permit use to inject additional meta
26 * information about how various parts of the network should be viewed and
27 * treated.
Thomas Vachuskaf0e1fae2015-04-24 00:51:51 -070028 */
Thomas Vachuskae2b7e7e2015-05-20 11:11:31 -070029@Beta
samanwita pal9bb91682015-07-27 16:47:56 -070030public interface NetworkConfigRegistry extends NetworkConfigService {
Thomas Vachuskaf0e1fae2015-04-24 00:51:51 -070031
32 /**
33 * Registers the specified configuration factory.
34 *
35 * @param configFactory configuration factory
36 */
37 void registerConfigFactory(ConfigFactory configFactory);
38
39 /**
40 * Unregisters the specified configuration factory.
41 *
42 * @param configFactory configuration factory
43 */
44 void unregisterConfigFactory(ConfigFactory configFactory);
45
46 /**
Thomas Vachuska96d55b12015-05-11 08:52:03 -070047 * Returns set of all registered configuration factories.
48 *
49 * @return set of config factories
50 */
51 Set<ConfigFactory> getConfigFactories();
52
53 /**
54 * Returns set of all configuration factories registered for the specified
Thomas Vachuskaf0e1fae2015-04-24 00:51:51 -070055 * class of subject.
56 *
57 * @param subjectClass subject class
Thomas Vachuska96d55b12015-05-11 08:52:03 -070058 * @param <S> type of subject
59 * @param <C> type of configuration
Thomas Vachuska266b4432015-04-30 18:13:25 -070060 * @return set of config factories
Thomas Vachuskaf0e1fae2015-04-24 00:51:51 -070061 */
Thomas Vachuska96d55b12015-05-11 08:52:03 -070062 <S, C extends Config<S>> Set<ConfigFactory<S, C>> getConfigFactories(Class<S> subjectClass);
Thomas Vachuskaf0e1fae2015-04-24 00:51:51 -070063
64 /**
Thomas Vachuska96d55b12015-05-11 08:52:03 -070065 * Returns the configuration factory that produces the specified class of
66 * configurations.
Thomas Vachuskaf0e1fae2015-04-24 00:51:51 -070067 *
68 * @param configClass configuration class
Thomas Vachuska96d55b12015-05-11 08:52:03 -070069 * @param <S> type of subject
70 * @param <C> type of configuration
Thomas Vachuska266b4432015-04-30 18:13:25 -070071 * @return config factory
Thomas Vachuskaf0e1fae2015-04-24 00:51:51 -070072 */
Thomas Vachuska96d55b12015-05-11 08:52:03 -070073 <S, C extends Config<S>> ConfigFactory<S, C> getConfigFactory(Class<C> configClass);
Thomas Vachuskaf0e1fae2015-04-24 00:51:51 -070074
75}