blob: 53bc77e0d8a0cb584a84ddf99294888287f38562 [file] [log] [blame]
Thomas Vachuska6d697f12015-03-08 20:59:50 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Thomas Vachuska6d697f12015-03-08 20:59:50 -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 */
16package org.onosproject.cfg;
17
18import java.util.Set;
19
20/**
21 * Service for tracking system-wide configurations for various software components.
22 */
23public interface ComponentConfigService {
24
25 /**
26 * Returns names of all components that have registered their
27 * configuration properties.
28 *
29 * @return set of component names
30 */
31 Set<String> getComponentNames();
32
33 /**
34 * Registers configuration properties for the specified component.
35 *
36 * @param componentClass class of configurable component
37 */
38 void registerProperties(Class<?> componentClass);
39
40 /**
41 * Unregisters configuration properties for the specified component.
42 *
43 * @param componentClass class of configurable component
44 * @param clear true indicates any settings should be cleared
45 */
46 void unregisterProperties(Class<?> componentClass, boolean clear);
47
48 /**
49 * Returns configuration properties of the named components.
50 *
51 * @param componentName component name
52 * @return set of configuration properties
53 */
54 Set<ConfigProperty> getProperties(String componentName);
55
56 /**
57 * Sets the value of the specified configuration property.
58 *
59 * @param componentName component name
60 * @param name property name
61 * @param value new property value
62 */
63 void setProperty(String componentName, String name, String value);
64
65 /**
andreadd106a62015-10-02 13:39:48 -070066 * Presets the value of the specified configuration property, regardless
67 * of the component's state.
68 *
69 * @param componentName component name
70 * @param name property name
71 * @param value new property value
72 */
73 void preSetProperty(String componentName, String name, String value);
74
75 /**
Thomas Vachuska6d697f12015-03-08 20:59:50 -070076 * Clears the value of the specified configuration property thus making
77 * the property take on its default value.
78 *
79 * @param componentName component name
80 * @param name property name
81 */
82 void unsetProperty(String componentName, String name);
83
84}
andreadd106a62015-10-02 13:39:48 -070085