public class ConfigValidatorImpl extends Object implements ConfigValidator
ConfigValidatorImpl| Modifier and Type | Field and Description |
|---|---|
static String |
PROP_VALIDATOR_ACTIVATOR
Boolean property to activate the fact that invalid config a blokking issues is. |
| Constructor and Description |
|---|
ConfigValidatorImpl(List<String> expectedProps) |
ConfigValidatorImpl(List<String> expectedProps,
Configuration config) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsKey(String key)
Property contains key.
|
Boolean |
getBooleanProperty(String key,
Boolean defaultValue)
Gets the boolean property.
|
Configuration |
getConfig() |
Configuration |
getCurrentConfig() |
Duration |
getDurationProperty(String key,
Long defaultValue,
TimeUnit defaultTimeUnit) |
Integer |
getIntegerProperty(String key,
Integer defaultValue)
Gets the integer property.
|
Long |
getLongProperty(String key,
Long defaultValue)
Gets the long property.
|
List<String> |
getMatchingProperties(String rootKey)
Gets the properties that match a root key.
|
String |
getProperty(String key)
Gets the property by Key from the DEFAULT_CONFIG.
|
String |
getProperty(String key,
String defaultValue)
Gets the property by Key.
|
List<Object> |
getUnfoundPropertiesAfterValidation()
will do the validation of the current config ( if not done yet ) and return the properties that were not found.
|
URL |
getURLProperty(String property)
Gets the uRL property.
|
boolean |
hasDurationProperty(String key) |
boolean |
hasMatchingProperty(String rootKey) |
boolean |
hasProperty(String key)
Checks for property.
|
void |
invalidate()
Method to invalidate all the cached configuration.
|
void |
invalidateCache()
This method will invalidate the current config.
|
boolean |
isReloading() |
boolean |
isValid() |
void |
reload()
Method to reload the configuration modules.
|
void |
setProperty(String key,
String value)
Method to override a property at runtime.
|
public static final String PROP_VALIDATOR_ACTIVATOR
Boolean property to activate the fact that invalid config a blokking issues is. If this property is TRUE then a
ConfigurationException will be throw when the config is invalid.
Default value is TRUE.
public ConfigValidatorImpl(List<String> expectedProps, Configuration config)
public final Configuration getConfig() throws TechnicalConnectorException
getConfig in interface ConfigValidatorTechnicalConnectorExceptionpublic List<Object> getUnfoundPropertiesAfterValidation() throws TechnicalConnectorException
ConfigValidatorgetUnfoundPropertiesAfterValidation in interface ConfigValidatorTechnicalConnectorException - if exception occurs while initializeing config.public final boolean isValid()
throws TechnicalConnectorException
isValid in interface ConfigValidatorTechnicalConnectorExceptionpublic final void invalidateCache()
ConfigValidatorinvalidateCache in interface ConfigValidatorpublic final String getProperty(String key, String defaultValue)
ConfigurationgetProperty in interface Configurationkey - the keydefaultValue - the default valuepublic final Long getLongProperty(String key, Long defaultValue)
ConfigurationgetLongProperty in interface Configurationkey - the keydefaultValue - the default valuepublic final Integer getIntegerProperty(String key, Integer defaultValue)
ConfigurationgetIntegerProperty in interface Configurationkey - the keydefaultValue - the default valuepublic final Boolean getBooleanProperty(String key, Boolean defaultValue)
ConfigurationgetBooleanProperty in interface Configurationkey - the keydefaultValue - the default valuepublic Duration getDurationProperty(String key, Long defaultValue, TimeUnit defaultTimeUnit)
getDurationProperty in interface Configurationpublic boolean hasDurationProperty(String key)
hasDurationProperty in interface Configurationpublic final String getProperty(String key)
ConfigurationgetProperty in interface Configurationkey - the keypublic final boolean containsKey(String key)
ConfigurationcontainsKey in interface Configurationkey - the keypublic final URL getURLProperty(String property)
ConfigurationgetURLProperty in interface Configurationproperty - the stringpublic final void setProperty(String key, String value)
ConfigurationsetProperty in interface Configurationkey - the keyvalue - the valuepublic final boolean hasProperty(String key)
ConfigurationhasProperty in interface Configurationkey - the keypublic boolean hasMatchingProperty(String rootKey)
hasMatchingProperty in interface Configurationpublic final List<String> getMatchingProperties(String rootKey)
ConfigurationgetMatchingProperties in interface ConfigurationrootKey - the root keypublic final Configuration getCurrentConfig()
getCurrentConfig in interface Configurationpublic void invalidate()
throws TechnicalConnectorException
Configurationinvalidate in interface ConfigurationTechnicalConnectorExceptionpublic void reload()
throws TechnicalConnectorException
ConfigurationThis method must be called when you change properties at runtime that are used by configuration modules.
reload in interface ConfigurationTechnicalConnectorExceptionpublic boolean isReloading()
isReloading in interface Configuration
Connector Packaging generic 4.2.0 API
Copyright © {inceptionYear}-2022 eHealth. All Rights Reserved.