Package org.jitsi.impl.configuration
Class ConfigurationServiceImpl
- java.lang.Object
-
- org.jitsi.impl.configuration.ConfigurationServiceImpl
-
- All Implemented Interfaces:
org.jitsi.service.configuration.ConfigurationService
public class ConfigurationServiceImpl extends Object implements org.jitsi.service.configuration.ConfigurationService
A straightforward implementation of the ConfigurationService using an XML or a .properties file for storing properties. Currently only String properties are meaningfully saved (we should probably consider how and whether we should take care of the rest).- Author:
- Emil Ivov, Damian Minkov, Lyubomir Marinov, Dmitri Melnikov, Pawel Domas
-
-
Field Summary
Fields Modifier and Type Field Description static StringPASSWORD_CMD_LINE_ARGSSpecify names of command line arguments which are password, so that their values will be masked when 'sun.java.command' is printed to the logs.static StringPASSWORD_SYS_PROPSSet this filed value to a regular expression which will be used to select system properties keys whose values should be masked when printed out to the logs.
-
Constructor Summary
Constructors Constructor Description ConfigurationServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPropertyChangeListener(PropertyChangeListener listener)voidaddPropertyChangeListener(String propertyName, PropertyChangeListener listener)voidaddVetoableChangeListener(String propertyName, org.jitsi.service.configuration.ConfigVetoableChangeListener listener)voidaddVetoableChangeListener(org.jitsi.service.configuration.ConfigVetoableChangeListener listener)List<String>getAllPropertyNames()booleangetBoolean(String propertyName, boolean defaultValue)StringgetConfigurationFilename()doublegetDouble(String propertyName, double defaultValue)intgetInt(String propertyName, int defaultValue)longgetLong(String propertyName, long defaultValue)ObjectgetProperty(String propertyName)List<String>getPropertyNamesByPrefix(String prefix, boolean exactPrefixMatch)List<String>getPropertyNamesBySuffix(String suffix)StringgetScHomeDirLocation()StringgetScHomeDirName()StringgetString(String propertyName)Returns the String value of the specified property (minus all encompassing whitespaces) and null in case no property value was mapped against the specified propertyName, or in case the returned property string had zero length or contained whitespaces only.StringgetString(String propertyName, String defaultValue)voidlogConfigurationProperties(String excludePattern)voidpurgeStoredConfiguration()Deletes the configuration file currently used by this implementation.voidreloadConfiguration()voidremoveProperty(String propertyName)voidremovePropertyChangeListener(PropertyChangeListener listener)voidremovePropertyChangeListener(String propertyName, PropertyChangeListener listener)voidremoveVetoableChangeListener(String propertyName, org.jitsi.service.configuration.ConfigVetoableChangeListener listener)voidremoveVetoableChangeListener(org.jitsi.service.configuration.ConfigVetoableChangeListener listener)voidsetProperties(Map<String,Object> properties)voidsetProperty(String propertyName, Object property)voidsetProperty(String propertyName, Object property, boolean isSystem)voidstoreConfiguration()
-
-
-
Field Detail
-
PASSWORD_CMD_LINE_ARGS
public static String PASSWORD_CMD_LINE_ARGS
Specify names of command line arguments which are password, so that their values will be masked when 'sun.java.command' is printed to the logs. Separate each name with a comma.
-
PASSWORD_SYS_PROPS
public static String PASSWORD_SYS_PROPS
Set this filed value to a regular expression which will be used to select system properties keys whose values should be masked when printed out to the logs.
-
-
Method Detail
-
setProperty
public void setProperty(String propertyName, Object property) throws org.jitsi.service.configuration.ConfigPropertyVetoException
- Specified by:
setPropertyin interfaceorg.jitsi.service.configuration.ConfigurationService- Throws:
org.jitsi.service.configuration.ConfigPropertyVetoException
-
setProperty
public void setProperty(String propertyName, Object property, boolean isSystem) throws org.jitsi.service.configuration.ConfigPropertyVetoException
- Specified by:
setPropertyin interfaceorg.jitsi.service.configuration.ConfigurationService- Throws:
org.jitsi.service.configuration.ConfigPropertyVetoException
-
setProperties
public void setProperties(Map<String,Object> properties) throws org.jitsi.service.configuration.ConfigPropertyVetoException
- Specified by:
setPropertiesin interfaceorg.jitsi.service.configuration.ConfigurationService- Throws:
org.jitsi.service.configuration.ConfigPropertyVetoException
-
removeProperty
public void removeProperty(String propertyName)
- Specified by:
removePropertyin interfaceorg.jitsi.service.configuration.ConfigurationService
-
getProperty
public Object getProperty(String propertyName)
- Specified by:
getPropertyin interfaceorg.jitsi.service.configuration.ConfigurationService
-
getAllPropertyNames
public List<String> getAllPropertyNames()
- Specified by:
getAllPropertyNamesin interfaceorg.jitsi.service.configuration.ConfigurationService
-
getPropertyNamesByPrefix
public List<String> getPropertyNamesByPrefix(String prefix, boolean exactPrefixMatch)
- Specified by:
getPropertyNamesByPrefixin interfaceorg.jitsi.service.configuration.ConfigurationService
-
getPropertyNamesBySuffix
public List<String> getPropertyNamesBySuffix(String suffix)
- Specified by:
getPropertyNamesBySuffixin interfaceorg.jitsi.service.configuration.ConfigurationService
-
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
- Specified by:
addPropertyChangeListenerin interfaceorg.jitsi.service.configuration.ConfigurationService
-
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
- Specified by:
removePropertyChangeListenerin interfaceorg.jitsi.service.configuration.ConfigurationService
-
addPropertyChangeListener
public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
- Specified by:
addPropertyChangeListenerin interfaceorg.jitsi.service.configuration.ConfigurationService
-
removePropertyChangeListener
public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
- Specified by:
removePropertyChangeListenerin interfaceorg.jitsi.service.configuration.ConfigurationService
-
addVetoableChangeListener
public void addVetoableChangeListener(org.jitsi.service.configuration.ConfigVetoableChangeListener listener)
- Specified by:
addVetoableChangeListenerin interfaceorg.jitsi.service.configuration.ConfigurationService
-
removeVetoableChangeListener
public void removeVetoableChangeListener(org.jitsi.service.configuration.ConfigVetoableChangeListener listener)
- Specified by:
removeVetoableChangeListenerin interfaceorg.jitsi.service.configuration.ConfigurationService
-
addVetoableChangeListener
public void addVetoableChangeListener(String propertyName, org.jitsi.service.configuration.ConfigVetoableChangeListener listener)
- Specified by:
addVetoableChangeListenerin interfaceorg.jitsi.service.configuration.ConfigurationService
-
removeVetoableChangeListener
public void removeVetoableChangeListener(String propertyName, org.jitsi.service.configuration.ConfigVetoableChangeListener listener)
- Specified by:
removeVetoableChangeListenerin interfaceorg.jitsi.service.configuration.ConfigurationService
-
reloadConfiguration
public void reloadConfiguration() throws IOException- Specified by:
reloadConfigurationin interfaceorg.jitsi.service.configuration.ConfigurationService- Throws:
IOException
-
storeConfiguration
public void storeConfiguration() throws IOException- Specified by:
storeConfigurationin interfaceorg.jitsi.service.configuration.ConfigurationService- Throws:
IOException
-
getConfigurationFilename
public String getConfigurationFilename()
- Specified by:
getConfigurationFilenamein interfaceorg.jitsi.service.configuration.ConfigurationService
-
getScHomeDirLocation
public String getScHomeDirLocation()
- Specified by:
getScHomeDirLocationin interfaceorg.jitsi.service.configuration.ConfigurationService
-
getScHomeDirName
public String getScHomeDirName()
- Specified by:
getScHomeDirNamein interfaceorg.jitsi.service.configuration.ConfigurationService
-
getString
public String getString(String propertyName)
Returns the String value of the specified property (minus all encompassing whitespaces) and null in case no property value was mapped against the specified propertyName, or in case the returned property string had zero length or contained whitespaces only.- Specified by:
getStringin interfaceorg.jitsi.service.configuration.ConfigurationService- Parameters:
propertyName- the name of the property that is being queried.- Returns:
- the result of calling the property's toString method and null in case there was no value mapped against the specified. propertyName, or the returned string had zero length or contained whitespaces only.
-
getString
public String getString(String propertyName, String defaultValue)
- Specified by:
getStringin interfaceorg.jitsi.service.configuration.ConfigurationService
-
getBoolean
public boolean getBoolean(String propertyName, boolean defaultValue)
- Specified by:
getBooleanin interfaceorg.jitsi.service.configuration.ConfigurationService
-
getInt
public int getInt(String propertyName, int defaultValue)
- Specified by:
getIntin interfaceorg.jitsi.service.configuration.ConfigurationService
-
getDouble
public double getDouble(String propertyName, double defaultValue)
- Specified by:
getDoublein interfaceorg.jitsi.service.configuration.ConfigurationService
-
getLong
public long getLong(String propertyName, long defaultValue)
- Specified by:
getLongin interfaceorg.jitsi.service.configuration.ConfigurationService
-
purgeStoredConfiguration
public void purgeStoredConfiguration()
Deletes the configuration file currently used by this implementation.- Specified by:
purgeStoredConfigurationin interfaceorg.jitsi.service.configuration.ConfigurationService
-
logConfigurationProperties
public void logConfigurationProperties(String excludePattern)
- Specified by:
logConfigurationPropertiesin interfaceorg.jitsi.service.configuration.ConfigurationService
-
-