|
||||||||||
| 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)
|
|
ConfigValidatorImpl(List<String> expectedProps,
Configuration config)
|
|
| 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)
public ConfigValidatorImpl(List<String> expectedProps,
Configuration config)
| Method Detail |
|---|
public final Configuration getConfig()
throws TechnicalConnectorException
getConfig in interface ConfigValidatorTechnicalConnectorException
public List<Object> getUnfoundPropertiesAfterValidation()
throws TechnicalConnectorException
ConfigValidator
getUnfoundPropertiesAfterValidation in interface ConfigValidatorTechnicalConnectorException - if exception occurs while initializeing config.
public final boolean isValid()
throws TechnicalConnectorException
isValid in interface ConfigValidatorTechnicalConnectorExceptionpublic final void invalidateCache()
ConfigValidator
invalidateCache in interface ConfigValidator
public final String getProperty(String key,
String defaultValue)
Configuration
getProperty in interface Configurationkey - the keydefaultValue - the default value
public final Long getLongProperty(String key,
Long defaultValue)
Configuration
getLongProperty in interface Configurationkey - the keydefaultValue - the default value
public final Integer getIntegerProperty(String key,
Integer defaultValue)
Configuration
getIntegerProperty in interface Configurationkey - the keydefaultValue - the default value
public final Boolean getBooleanProperty(String key,
Boolean defaultValue)
Configuration
getBooleanProperty in interface Configurationkey - the keydefaultValue - the default value
public 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)
Configuration
getProperty in interface Configurationkey - the key
public final boolean containsKey(String key)
Configuration
containsKey in interface Configurationkey - the key
public final URL getURLProperty(String property)
Configuration
getURLProperty in interface Configurationproperty - the string
public final void setProperty(String key,
String value)
Configuration
setProperty in interface Configurationkey - the keyvalue - the valuepublic final boolean hasProperty(String key)
Configuration
hasProperty in interface Configurationkey - the key
public boolean hasMatchingProperty(String rootKey)
hasMatchingProperty in interface Configurationpublic final List<String> getMatchingProperties(String rootKey)
Configuration
getMatchingProperties in interface ConfigurationrootKey - the root key
public final void setConfigLocation(String location)
throws TechnicalConnectorException
Configuration
setConfigLocation in interface ConfigurationTechnicalConnectorExceptionpublic final Configuration getCurrentConfig()
getCurrentConfig in interface Configuration
public void invalidate()
throws TechnicalConnectorException
Configuration
invalidate in interface ConfigurationTechnicalConnectorException
public 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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||