Package org.bytemechanics.config.manager
Interface ConfigManager
- All Known Implementing Classes:
ConfigManagerImpl
public interface ConfigManager
Config Manager service, there are several things to take in account:
Overwrited lists can have unexpected behaviours please convert it to maps if you want to override any attribute, otherwise you need to take in account:
If you are overriding with yaml files include all its elements changing only what you want to change
If you change the size of a list from properties origin the helper field length should no be correct
- Author:
- afarre
-
Method Summary
Modifier and Type Method Description voidload()Reads all configured locations and populate into System propertiesjava.util.stream.Stream<Config>read(java.net.URI _location)Reads the uri location if possible returning a configuration streamjava.util.stream.Stream<Config>stream()Reads all configured locations and return as streamvoidwrite(java.net.URI _location, java.util.stream.Stream<Config> _config)Utility method to update configuration locations when possible
-
Method Details
-
read
Reads the uri location if possible returning a configuration stream- Parameters:
_location- location where read the configuration- Returns:
- Stream of configurations or an empty stream
- Throws:
UnreadableConfigLocation- if the location can not be readedUnsupportedConfigLocationFormat- if the format of the location is not supportedUnsupportedConfigLocationScheme- if the scheme of the location is not supported (location type)
-
write
Utility method to update configuration locations when possible- Parameters:
_location- location to update/create configuration_config- stream of config files to write- Throws:
UnwritableConfigLocation- when for any reason the configuration can not be writenUnsupportedConfigLocationFormat- if the format of the location is not supportedUnsupportedConfigLocationScheme- if the scheme of the location is not supported (location type)java.lang.UnsupportedOperationException- if write operation is not supported by the location format and/or scheme
-
stream
java.util.stream.Stream<Config> stream()Reads all configured locations and return as stream- Returns:
- Stream of configurations or an empty stream
- Throws:
UnreadableConfigLocation- if the location can not be readedUnsupportedConfigLocationFormat- if the format of the location is not supportedUnsupportedConfigLocationScheme- if the scheme of the location is not supported (location type)
-
load
void load()Reads all configured locations and populate into System properties- Throws:
UnreadableConfigLocation- if the location can not be readedUnsupportedConfigLocationFormat- if the format of the location is not supportedUnsupportedConfigLocationScheme- if the scheme of the location is not supported (location type)
-