| 1 | # Configuration |
| 2 | |
| 3 | It is possible to configure the Eclipse Dataspace Connector. All configuration are retrieved by their key from an |
| 4 | extension, that implements the Configuration Extension interface. |
| 5 | |
| 6 | Whether this configuration may happen when the application is running or only on start-up may vary for each |
| 7 | configuration extension. |
| 8 | |
| 9 | ## Create new Setting |
| 10 | |
| 11 | Settings are identified by their key. When creation new setting please follow the best practices listed below. |
| 12 | |
| 13 | Settings 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 |
| 25 | class 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 | |
| 41 | The integration of each configuration extension may vary. Please have a look at their corresponding README.md files. |
| 42 | |
| 43 | The following extensions implement the ConfigurationExtension interface. |
| 44 | |
| 45 | - [File System Configuration](../../extensions/common/configuration/configuration-filesystem/README.md) |