Thomas Vachuska | f0e1fae | 2015-04-24 00:51:51 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
Thomas Vachuska | f0e1fae | 2015-04-24 00:51:51 -0700 | [diff] [blame] | 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 | */ |
Ray Milkey | a412236 | 2015-08-18 15:19:08 -0700 | [diff] [blame] | 16 | package org.onosproject.net.config; |
Thomas Vachuska | f0e1fae | 2015-04-24 00:51:51 -0700 | [diff] [blame] | 17 | |
Thomas Vachuska | e2b7e7e | 2015-05-20 11:11:31 -0700 | [diff] [blame] | 18 | import com.google.common.annotations.Beta; |
| 19 | |
Thomas Vachuska | f0e1fae | 2015-04-24 00:51:51 -0700 | [diff] [blame] | 20 | import java.util.Set; |
| 21 | |
| 22 | /** |
Thomas Vachuska | 96d55b1 | 2015-05-11 08:52:03 -0700 | [diff] [blame] | 23 | * 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 Vachuska | f0e1fae | 2015-04-24 00:51:51 -0700 | [diff] [blame] | 28 | */ |
Thomas Vachuska | e2b7e7e | 2015-05-20 11:11:31 -0700 | [diff] [blame] | 29 | @Beta |
samanwita pal | 9bb9168 | 2015-07-27 16:47:56 -0700 | [diff] [blame] | 30 | public interface NetworkConfigRegistry extends NetworkConfigService { |
Thomas Vachuska | f0e1fae | 2015-04-24 00:51:51 -0700 | [diff] [blame] | 31 | |
| 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 Vachuska | 96d55b1 | 2015-05-11 08:52:03 -0700 | [diff] [blame] | 47 | * 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 Vachuska | f0e1fae | 2015-04-24 00:51:51 -0700 | [diff] [blame] | 55 | * class of subject. |
| 56 | * |
| 57 | * @param subjectClass subject class |
Thomas Vachuska | 96d55b1 | 2015-05-11 08:52:03 -0700 | [diff] [blame] | 58 | * @param <S> type of subject |
| 59 | * @param <C> type of configuration |
Thomas Vachuska | 266b443 | 2015-04-30 18:13:25 -0700 | [diff] [blame] | 60 | * @return set of config factories |
Thomas Vachuska | f0e1fae | 2015-04-24 00:51:51 -0700 | [diff] [blame] | 61 | */ |
Thomas Vachuska | 96d55b1 | 2015-05-11 08:52:03 -0700 | [diff] [blame] | 62 | <S, C extends Config<S>> Set<ConfigFactory<S, C>> getConfigFactories(Class<S> subjectClass); |
Thomas Vachuska | f0e1fae | 2015-04-24 00:51:51 -0700 | [diff] [blame] | 63 | |
| 64 | /** |
Thomas Vachuska | 96d55b1 | 2015-05-11 08:52:03 -0700 | [diff] [blame] | 65 | * Returns the configuration factory that produces the specified class of |
| 66 | * configurations. |
Thomas Vachuska | f0e1fae | 2015-04-24 00:51:51 -0700 | [diff] [blame] | 67 | * |
| 68 | * @param configClass configuration class |
Thomas Vachuska | 96d55b1 | 2015-05-11 08:52:03 -0700 | [diff] [blame] | 69 | * @param <S> type of subject |
| 70 | * @param <C> type of configuration |
Thomas Vachuska | 266b443 | 2015-04-30 18:13:25 -0700 | [diff] [blame] | 71 | * @return config factory |
Thomas Vachuska | f0e1fae | 2015-04-24 00:51:51 -0700 | [diff] [blame] | 72 | */ |
Thomas Vachuska | 96d55b1 | 2015-05-11 08:52:03 -0700 | [diff] [blame] | 73 | <S, C extends Config<S>> ConfigFactory<S, C> getConfigFactory(Class<C> configClass); |
Thomas Vachuska | f0e1fae | 2015-04-24 00:51:51 -0700 | [diff] [blame] | 74 | |
| 75 | } |