Thomas Vachuska | f0e1fae | 2015-04-24 00:51:51 -0700 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 16 | package org.onosproject.exp.net.config; |
| 17 | |
| 18 | import 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 | */ |
| 25 | public interface NetworkConfigService { |
| 26 | |
| 27 | /** |
| 28 | * Returns the set of subjects for which some configuration is available. |
| 29 | * |
| 30 | * @param subjectClass subject class |
Thomas Vachuska | 266b443 | 2015-04-30 18:13:25 -0700 | [diff] [blame^] | 31 | * @param <T> type of subject |
Thomas Vachuska | f0e1fae | 2015-04-24 00:51:51 -0700 | [diff] [blame] | 32 | * @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 Vachuska | 266b443 | 2015-04-30 18:13:25 -0700 | [diff] [blame^] | 42 | * @param <T> type of subject |
Thomas Vachuska | f0e1fae | 2015-04-24 00:51:51 -0700 | [diff] [blame] | 43 | * @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 Vachuska | 266b443 | 2015-04-30 18:13:25 -0700 | [diff] [blame^] | 52 | * @param <T> type of subject |
Thomas Vachuska | f0e1fae | 2015-04-24 00:51:51 -0700 | [diff] [blame] | 53 | * @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 Vachuska | 266b443 | 2015-04-30 18:13:25 -0700 | [diff] [blame^] | 63 | * @param <T> type of subject |
Thomas Vachuska | f0e1fae | 2015-04-24 00:51:51 -0700 | [diff] [blame] | 64 | * @return configuration or null if one is not available |
| 65 | */ |
| 66 | <T> Config<T> getConfig(T subject, Class<Config<T>> configClass); |
| 67 | |
| 68 | } |