be.ehealth.technicalconnector.config.impl
Class ConfigurationImpl

java.lang.Object
  extended by be.ehealth.technicalconnector.config.impl.ConfigurationImpl
All Implemented Interfaces:
Configuration

public final class ConfigurationImpl
extends Object
implements Configuration

Implementation of Configuration


Field Summary
static String SYSPROP_MODULE_LOADING
          Property to (des)activate the module loading of the configuration factory.
 
Method Summary
 boolean containsKey(String key)
          Property contains key.
 Boolean getBooleanProperty(String key, Boolean defaultValue)
          Gets the boolean property.
 Configuration getCurrentConfig()
           
 Duration getDurationProperty(String key, Long defaultValue, TimeUnit defaultTimeUnit)
           
static Configuration getInstance()
           
 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.
 Properties getProperties()
           
 String getProperty(String key)
          Gets the property by Key from the DEFAULT_CONFIG.
 String getProperty(String key, String defaultValue)
          Gets the property by Key.
 URL getURLProperty(String key)
          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 reload()
          reloads the instance, and reloads the config modules.
static void reset()
           
 void setConfigLocation(String location)
          Deprecated. 
 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

SYSPROP_MODULE_LOADING

public static final String SYSPROP_MODULE_LOADING
Property to (des)activate the module loading of the configuration factory.

Default value: true

See Also:
Constant Field Values
Method Detail

getProperty

public String getProperty(String key,
                          String defaultValue)
Description copied from interface: Configuration
Gets the property by Key.

Specified by:
getProperty in interface Configuration
Parameters:
key - the key
defaultValue - the default value
Returns:
the property

getLongProperty

public Long getLongProperty(String key,
                            Long defaultValue)
Description copied from interface: Configuration
Gets the long property.

Specified by:
getLongProperty in interface Configuration
Parameters:
key - the key
defaultValue - the default value
Returns:
the long property

getIntegerProperty

public Integer getIntegerProperty(String key,
                                  Integer defaultValue)
Description copied from interface: Configuration
Gets the integer property.

Specified by:
getIntegerProperty in interface Configuration
Parameters:
key - the key
defaultValue - the default value
Returns:
the integer property

getBooleanProperty

public Boolean getBooleanProperty(String key,
                                  Boolean defaultValue)
Description copied from interface: Configuration
Gets the boolean property.

Specified by:
getBooleanProperty in interface Configuration
Parameters:
key - the key
defaultValue - the default value
Returns:
the boolean property

getDurationProperty

public Duration getDurationProperty(String key,
                                    Long defaultValue,
                                    TimeUnit defaultTimeUnit)
Specified by:
getDurationProperty in interface Configuration

hasDurationProperty

public boolean hasDurationProperty(String key)
Specified by:
hasDurationProperty in interface Configuration

getURLProperty

public URL getURLProperty(String key)
Description copied from interface: Configuration
Gets the uRL property.

Specified by:
getURLProperty in interface Configuration
Parameters:
key - the string
Returns:
the uRL property

getProperty

public String getProperty(String key)
Description copied from interface: Configuration
Gets the property by Key from the DEFAULT_CONFIG.

Specified by:
getProperty in interface Configuration
Parameters:
key - the key
Returns:
the property

reset

public static void reset()

reload

public void reload()
            throws TechnicalConnectorException
reloads the instance, and reloads the config modules.

Specified by:
reload in interface Configuration
Throws:
TechnicalConnectorException

containsKey

public boolean containsKey(String key)
Description copied from interface: Configuration
Property contains key.

Specified by:
containsKey in interface Configuration
Parameters:
key - the key
Returns:
true, if successful

setProperty

public void setProperty(String key,
                        String value)
Description copied from interface: Configuration
Method to override a property at runtime.

Specified by:
setProperty in interface Configuration
Parameters:
key - the key
value - the value

hasProperty

public boolean hasProperty(String key)
Description copied from interface: Configuration
Checks for property.

Specified by:
hasProperty in interface Configuration
Parameters:
key - the key
Returns:
true, if successful

hasMatchingProperty

public boolean hasMatchingProperty(String rootKey)
Specified by:
hasMatchingProperty in interface Configuration

getMatchingProperties

public List<String> getMatchingProperties(String rootKey)
Description copied from interface: Configuration
Gets the properties that match a root key.

Specified by:
getMatchingProperties in interface Configuration
Parameters:
rootKey - the root key
Returns:
the properties

setConfigLocation

@Deprecated
public void setConfigLocation(String location)
                       throws TechnicalConnectorException
Deprecated. 

Description copied from interface: Configuration
Sets the configLocation and remove the current configuration. when used with a null value , the default configuration is set.

Specified by:
setConfigLocation in interface Configuration
Throws:
TechnicalConnectorException

getCurrentConfig

public Configuration getCurrentConfig()
                               throws TechnicalConnectorException
Specified by:
getCurrentConfig in interface Configuration
Returns:
the currenct configuration;
Throws:
TechnicalConnectorException

getInstance

public static Configuration getInstance()
                                 throws TechnicalConnectorException
Throws:
TechnicalConnectorException

getProperties

public Properties getProperties()

invalidate

public void invalidate()
Description copied from interface: Configuration
Method to invalidate all the cached configuration.

Specified by:
invalidate in interface Configuration



Connector Packaging PERSDIETICIAN 3.11.1 API
Copyright © {inceptionYear}-2016 eHealth. All Rights Reserved.