Package africa.absa.inception.config
Interface IConfigService
- All Known Implementing Classes:
ConfigService
public interface IConfigService
The IConfigService interface defines the functionality provided by a Config Service
implementation, which manages the config information for an application or service.
- Author:
- Marcus Portmann
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteConfig(String key) Delete the config with the specified key.byte[]Retrieve the binary config.byte[]Retrieve the binary config.booleangetBoolean(String key) Retrieve the Boolean config.booleangetBoolean(String key, boolean defaultValue) Retrieve the Boolean config.Retrieve the config.Retrieve all the configs.Retrieve all the config summaries.Retrieve the Double config.doubleRetrieve the Double config.getFilteredConfigs(String filter) Retrieve the filtered configs.getFilteredConfigSummaries(String filter) Retrieve the filtered config summaries.getInteger(String key) Retrieve the Integer config.intgetInteger(String key, int defaultValue) Retrieve the Integer config.Retrieve the Long config.longRetrieve the Long config.Retrieve the value for the String config.Retrieve the value for the String config.booleanCheck if a config with the specified key exists.voidSet the config.voidSet the config key to the specified value.
-
Method Details
-
deleteConfig
void deleteConfig(String key) throws InvalidArgumentException, ConfigNotFoundException, ServiceUnavailableException Delete the config with the specified key.- Parameters:
key- the key for the config- Throws:
InvalidArgumentException- if an argument is invalidConfigNotFoundException- if the config could not be foundServiceUnavailableException- if the config could not be deleted
-
getBinary
byte[] getBinary(String key) throws InvalidArgumentException, ConfigNotFoundException, ServiceUnavailableException Retrieve the binary config.- Parameters:
key- the key for the config- Returns:
- the binary config
- Throws:
InvalidArgumentException- if an argument is invalidConfigNotFoundException- if the config could not be foundServiceUnavailableException- if the binary config value could not be retrieved
-
getBinary
byte[] getBinary(String key, byte[] defaultValue) throws InvalidArgumentException, ServiceUnavailableException Retrieve the binary config.- Parameters:
key- the key for the configdefaultValue- the default value to return if the config does not exist- Returns:
- the binary config or the default value if the config does not exist
- Throws:
InvalidArgumentException- if an argument is invalidServiceUnavailableException- if the binary config value could not be retrieved
-
getBoolean
boolean getBoolean(String key) throws InvalidArgumentException, ConfigNotFoundException, ServiceUnavailableException Retrieve the Boolean config.- Parameters:
key- the key for the config- Returns:
- the Boolean config
- Throws:
InvalidArgumentException- if an argument is invalidConfigNotFoundException- if the config could not be foundServiceUnavailableException- if the boolean config value could not be retrieved
-
getBoolean
boolean getBoolean(String key, boolean defaultValue) throws InvalidArgumentException, ServiceUnavailableException Retrieve the Boolean config.- Parameters:
key- the key for the configdefaultValue- the default value to return if the config does not exist- Returns:
- the Boolean config or the default value if the config value does not exist
- Throws:
InvalidArgumentException- if an argument is invalidServiceUnavailableException- if the boolean config value could not be retrieved
-
getConfig
Config getConfig(String key) throws InvalidArgumentException, ConfigNotFoundException, ServiceUnavailableException Retrieve the config.- Parameters:
key- the key for the config- Returns:
- the config
- Throws:
InvalidArgumentException- if an argument is invalidConfigNotFoundException- if the config could not be foundServiceUnavailableException- if the config could not be retrieved
-
getConfigSummaries
Retrieve all the config summaries.- Returns:
- the config summaries
- Throws:
ServiceUnavailableException- if the config summaries could not be retrieved
-
getConfigs
Retrieve all the configs.- Returns:
- the configs
- Throws:
ServiceUnavailableException- if the configs could not be retrieved
-
getDouble
Double getDouble(String key) throws InvalidArgumentException, ConfigNotFoundException, ServiceUnavailableException Retrieve the Double config.- Parameters:
key- the key for the config- Returns:
- the Double config
- Throws:
InvalidArgumentException- if an argument is invalidConfigNotFoundException- if the config could not be foundServiceUnavailableException- if the double config value could not be retrieved
-
getDouble
double getDouble(String key, double defaultValue) throws InvalidArgumentException, ServiceUnavailableException Retrieve the Double config.- Parameters:
key- the key for the configdefaultValue- the default value to return if the config does not exist- Returns:
- the Double config or the default value if the config entry does not exist
- Throws:
InvalidArgumentException- if an argument is invalidServiceUnavailableException- if the double config value could not be retrieved
-
getFilteredConfigSummaries
Retrieve the filtered config summaries.- Parameters:
filter- the filter to apply to the keys for the config summaries- Returns:
- the config summaries
- Throws:
ServiceUnavailableException- if the filtered config summaries could not be retrieved
-
getFilteredConfigs
Retrieve the filtered configs.- Parameters:
filter- the filter to apply to the keys for the config- Returns:
- the configs
- Throws:
ServiceUnavailableException- if the filtered configs could not be retrieved
-
getInteger
Integer getInteger(String key) throws InvalidArgumentException, ConfigNotFoundException, ServiceUnavailableException Retrieve the Integer config.- Parameters:
key- the key for the config- Returns:
- the Integer config
- Throws:
InvalidArgumentException- if an argument is invalidConfigNotFoundException- if the config could not be foundServiceUnavailableException- if the integer config value could not be retrieved
-
getInteger
int getInteger(String key, int defaultValue) throws InvalidArgumentException, ServiceUnavailableException Retrieve the Integer config.- Parameters:
key- the key for the configdefaultValue- the default value to return if the config does not exist- Returns:
- the Integer config or the default value if the config entry does not exist
- Throws:
InvalidArgumentException- if an argument is invalidServiceUnavailableException- if the integer config value could not be retrieved
-
getLong
Long getLong(String key) throws InvalidArgumentException, ConfigNotFoundException, ServiceUnavailableException Retrieve the Long config.- Parameters:
key- the key for the config- Returns:
- the Long config
- Throws:
InvalidArgumentException- if an argument is invalidConfigNotFoundException- if the config could not be foundServiceUnavailableException- if the long config value could not be retrieved
-
getLong
long getLong(String key, long defaultValue) throws InvalidArgumentException, ServiceUnavailableException Retrieve the Long config.- Parameters:
key- the key for the configdefaultValue- the default value to return if the config does not exist- Returns:
- the Long config or the default value if the config entry does not exist
- Throws:
InvalidArgumentException- if an argument is invalidServiceUnavailableException- if the long config value could not be retrieved
-
getString
String getString(String key) throws InvalidArgumentException, ConfigNotFoundException, ServiceUnavailableException Retrieve the value for the String config.- Parameters:
key- the key for the config- Returns:
- the value for the String config
- Throws:
InvalidArgumentException- if an argument is invalidConfigNotFoundException- if the config could not be foundServiceUnavailableException- if the string config value could not be retrieved
-
getString
String getString(String key, String defaultValue) throws InvalidArgumentException, ServiceUnavailableException Retrieve the value for the String config.- Parameters:
key- the key for the configdefaultValue- the default value to return if the config does not exist- Returns:
- the value for the String config or the default value if the config does not exist
- Throws:
InvalidArgumentException- if an argument is invalidServiceUnavailableException- if the string config value could not be retrieved
-
keyExists
Check if a config with the specified key exists.- Parameters:
key- the key for the config- Returns:
- true if the config with the specified key exists or false otherwise
- Throws:
InvalidArgumentException- if an argument is invalidServiceUnavailableException- if the check for the existing key failed
-
setConfig
Set the config.- Parameters:
config- the config- Throws:
InvalidArgumentException- if an argument is invalidServiceUnavailableException- if the config could not be set
-
setConfig
void setConfig(String key, Object value, String description) throws InvalidArgumentException, ServiceUnavailableException Set the config key to the specified value.- Parameters:
key- the key for the configvalue- the value for the configdescription- the description for the config- Throws:
InvalidArgumentException- if an argument is invalidServiceUnavailableException- if the config could not be set
-