Class 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 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.
    • Constructor Detail

      • ConfigurationServiceImpl

        public ConfigurationServiceImpl()
    • Method Detail

      • setProperty

        public void setProperty​(String propertyName,
                                Object property)
                         throws org.jitsi.service.configuration.ConfigPropertyVetoException
        Specified by:
        setProperty in interface org.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:
        setProperty in interface org.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:
        setProperties in interface org.jitsi.service.configuration.ConfigurationService
        Throws:
        org.jitsi.service.configuration.ConfigPropertyVetoException
      • removeProperty

        public void removeProperty​(String propertyName)
        Specified by:
        removeProperty in interface org.jitsi.service.configuration.ConfigurationService
      • getProperty

        public Object getProperty​(String propertyName)
        Specified by:
        getProperty in interface org.jitsi.service.configuration.ConfigurationService
      • getAllPropertyNames

        public List<String> getAllPropertyNames()
        Specified by:
        getAllPropertyNames in interface org.jitsi.service.configuration.ConfigurationService
      • getPropertyNamesByPrefix

        public List<String> getPropertyNamesByPrefix​(String prefix,
                                                     boolean exactPrefixMatch)
        Specified by:
        getPropertyNamesByPrefix in interface org.jitsi.service.configuration.ConfigurationService
      • getPropertyNamesBySuffix

        public List<String> getPropertyNamesBySuffix​(String suffix)
        Specified by:
        getPropertyNamesBySuffix in interface org.jitsi.service.configuration.ConfigurationService
      • addPropertyChangeListener

        public void addPropertyChangeListener​(PropertyChangeListener listener)
        Specified by:
        addPropertyChangeListener in interface org.jitsi.service.configuration.ConfigurationService
      • removePropertyChangeListener

        public void removePropertyChangeListener​(PropertyChangeListener listener)
        Specified by:
        removePropertyChangeListener in interface org.jitsi.service.configuration.ConfigurationService
      • addPropertyChangeListener

        public void addPropertyChangeListener​(String propertyName,
                                              PropertyChangeListener listener)
        Specified by:
        addPropertyChangeListener in interface org.jitsi.service.configuration.ConfigurationService
      • removePropertyChangeListener

        public void removePropertyChangeListener​(String propertyName,
                                                 PropertyChangeListener listener)
        Specified by:
        removePropertyChangeListener in interface org.jitsi.service.configuration.ConfigurationService
      • addVetoableChangeListener

        public void addVetoableChangeListener​(org.jitsi.service.configuration.ConfigVetoableChangeListener listener)
        Specified by:
        addVetoableChangeListener in interface org.jitsi.service.configuration.ConfigurationService
      • removeVetoableChangeListener

        public void removeVetoableChangeListener​(org.jitsi.service.configuration.ConfigVetoableChangeListener listener)
        Specified by:
        removeVetoableChangeListener in interface org.jitsi.service.configuration.ConfigurationService
      • addVetoableChangeListener

        public void addVetoableChangeListener​(String propertyName,
                                              org.jitsi.service.configuration.ConfigVetoableChangeListener listener)
        Specified by:
        addVetoableChangeListener in interface org.jitsi.service.configuration.ConfigurationService
      • removeVetoableChangeListener

        public void removeVetoableChangeListener​(String propertyName,
                                                 org.jitsi.service.configuration.ConfigVetoableChangeListener listener)
        Specified by:
        removeVetoableChangeListener in interface org.jitsi.service.configuration.ConfigurationService
      • reloadConfiguration

        public void reloadConfiguration()
                                 throws IOException
        Specified by:
        reloadConfiguration in interface org.jitsi.service.configuration.ConfigurationService
        Throws:
        IOException
      • storeConfiguration

        public void storeConfiguration()
                                throws IOException
        Specified by:
        storeConfiguration in interface org.jitsi.service.configuration.ConfigurationService
        Throws:
        IOException
      • getConfigurationFilename

        public String getConfigurationFilename()
        Specified by:
        getConfigurationFilename in interface org.jitsi.service.configuration.ConfigurationService
      • getScHomeDirLocation

        public String getScHomeDirLocation()
        Specified by:
        getScHomeDirLocation in interface org.jitsi.service.configuration.ConfigurationService
      • getScHomeDirName

        public String getScHomeDirName()
        Specified by:
        getScHomeDirName in interface org.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:
        getString in interface org.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:
        getString in interface org.jitsi.service.configuration.ConfigurationService
      • getBoolean

        public boolean getBoolean​(String propertyName,
                                  boolean defaultValue)
        Specified by:
        getBoolean in interface org.jitsi.service.configuration.ConfigurationService
      • getInt

        public int getInt​(String propertyName,
                          int defaultValue)
        Specified by:
        getInt in interface org.jitsi.service.configuration.ConfigurationService
      • getDouble

        public double getDouble​(String propertyName,
                                double defaultValue)
        Specified by:
        getDouble in interface org.jitsi.service.configuration.ConfigurationService
      • getLong

        public long getLong​(String propertyName,
                            long defaultValue)
        Specified by:
        getLong in interface org.jitsi.service.configuration.ConfigurationService
      • purgeStoredConfiguration

        public void purgeStoredConfiguration()
        Deletes the configuration file currently used by this implementation.
        Specified by:
        purgeStoredConfiguration in interface org.jitsi.service.configuration.ConfigurationService
      • logConfigurationProperties

        public void logConfigurationProperties​(String excludePattern)
        Specified by:
        logConfigurationProperties in interface org.jitsi.service.configuration.ConfigurationService