Elffuss BraidHub

kikocis/EDC public

main · 1.5 KiBRenderedRawPermalink
1# Configuration
2
3It is possible to configure the Eclipse Dataspace Connector. All configuration are retrieved by their key from an
4extension, that implements the Configuration Extension interface.
5
6Whether this configuration may happen when the application is running or only on start-up may vary for each
7configuration extension.
8
9## Create new Setting
10
11Settings are identified by their key. When creation new setting please follow the best practices listed below.
12
13Settings are retrieved from the ServiceExtensionContext interface.
14
15**Best practices for Settings**:
16
17- setting keys start with _edc_
18- setting keys are defined in _private static final_ fields
19- setting fields are annotated with the _@Setting_ marker interface
20- settings have a valid default value
21
22**Example Setting**
23
24```java
25class ExampleSetting {
26
27 private final static String DEFAULT_TITLE = "Default Title";
28
29 @Setting(value = "The ids title", defaultValue = DEFAULT_TITLE)
30 private final static String EDC_IDS_TITLE = "edc.ids.title";
31
32 private String getTitle(ServiceExtensionContext context) {
33 return context.getSetting(EDC_IDS_TITLE, DEFAULT_TITLE);
34 }
35
36}
37```
38
39## Configuration Extension
40
41The integration of each configuration extension may vary. Please have a look at their corresponding README.md files.
42
43The following extensions implement the ConfigurationExtension interface.
44
45- [File System Configuration](../../extensions/common/configuration/configuration-filesystem/README.md)