|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbe.ehealth.technicalconnector.config.impl.ConfigValidatorImpl
public class ConfigValidatorImpl
Implementation of ConfigValidatorImpl
Field Summary | |
---|---|
static String |
PROP_VALIDATOR_ACTIVATOR
Boolean property to activate the fact that invalid config a blokking issues is. |
Constructor Summary | |
---|---|
ConfigValidatorImpl(List<String> expectedProps)
|
Method Summary | |
---|---|
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 |
setConfigLocation(String location)
Sets the configLocation and remove the current configuration. |
void |
setProperty(String key,
String value)
Method to override a property at runtime. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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.
Constructor Detail |
---|
public ConfigValidatorImpl(List<String> expectedProps)
Method Detail |
---|
public final Configuration getConfig() throws TechnicalConnectorException
getConfig
in interface ConfigValidator
TechnicalConnectorException
public List<Object> getUnfoundPropertiesAfterValidation() throws TechnicalConnectorException
ConfigValidator
getUnfoundPropertiesAfterValidation
in interface ConfigValidator
TechnicalConnectorException
- if exception occurs while initializeing config.public final boolean isValid() throws TechnicalConnectorException
isValid
in interface ConfigValidator
TechnicalConnectorException
public final void invalidateCache()
ConfigValidator
invalidateCache
in interface ConfigValidator
public final String getProperty(String key, String defaultValue)
Configuration
getProperty
in interface Configuration
key
- the keydefaultValue
- the default value
public final Long getLongProperty(String key, Long defaultValue)
Configuration
getLongProperty
in interface Configuration
key
- the keydefaultValue
- the default value
public final Integer getIntegerProperty(String key, Integer defaultValue)
Configuration
getIntegerProperty
in interface Configuration
key
- the keydefaultValue
- the default value
public final Boolean getBooleanProperty(String key, Boolean defaultValue)
Configuration
getBooleanProperty
in interface Configuration
key
- the keydefaultValue
- the default value
public Duration getDurationProperty(String key, Long defaultValue, TimeUnit defaultTimeUnit)
getDurationProperty
in interface Configuration
public boolean hasDurationProperty(String key)
hasDurationProperty
in interface Configuration
public final String getProperty(String key)
Configuration
getProperty
in interface Configuration
key
- the key
public final boolean containsKey(String key)
Configuration
containsKey
in interface Configuration
key
- the key
public final URL getURLProperty(String property)
Configuration
getURLProperty
in interface Configuration
property
- the string
public final void setProperty(String key, String value)
Configuration
setProperty
in interface Configuration
key
- the keyvalue
- the valuepublic final boolean hasProperty(String key)
Configuration
hasProperty
in interface Configuration
key
- the key
public boolean hasMatchingProperty(String rootKey)
hasMatchingProperty
in interface Configuration
public final List<String> getMatchingProperties(String rootKey)
Configuration
getMatchingProperties
in interface Configuration
rootKey
- the root key
public final void setConfigLocation(String location) throws TechnicalConnectorException
Configuration
setConfigLocation
in interface Configuration
TechnicalConnectorException
public final Configuration getCurrentConfig()
getCurrentConfig
in interface Configuration
public void invalidate() throws TechnicalConnectorException
Configuration
invalidate
in interface Configuration
TechnicalConnectorException
public void reload() throws TechnicalConnectorException
Configuration
This method must be called when you change properties at runtime that are used by configuration modules.
reload
in interface Configuration
TechnicalConnectorException
public boolean isReloading()
isReloading
in interface Configuration
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |