Package org.jitsi.impl.configuration
Class HashtableConfigurationStore<T extends Hashtable>
- java.lang.Object
-
- org.jitsi.impl.configuration.HashtableConfigurationStore<T>
-
- Type Parameters:
T- the hashtable extension that descendants are going to use.
- All Implemented Interfaces:
ConfigurationStore
- Direct Known Subclasses:
DatabaseConfigurationStore,PropertyConfigurationStore
public abstract class HashtableConfigurationStore<T extends Hashtable> extends Object implements ConfigurationStore
A simple in-memoryConfigurationStoreimplementation that only uses a hashtable.- Author:
- Lyubomir Marinov
-
-
Field Summary
Fields Modifier and Type Field Description protected TpropertiesThe Hashtable instance which stores the property name-value associations of this ConfigurationStore instance and which is effectively adapted by this instance to ConfigurationStore.
-
Constructor Summary
Constructors Modifier Constructor Description protectedHashtableConfigurationStore(T properties)Creates an instance of this class using properties as the set of properties where it will be storing an retrieving properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetProperty(String name)ImplementsConfigurationStore.getProperty(String).String[]getPropertyNames()ImplementsConfigurationStore.getPropertyNames().booleanisSystemProperty(String name)ImplementsConfigurationStore.isSystemProperty(String).voidremoveProperty(String name)ImplementsConfigurationStore.removeProperty(String).voidsetNonSystemProperty(String name, Object value)voidsetSystemProperty(String name)ImplementsConfigurationStore.setSystemProperty(String).-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jitsi.impl.configuration.ConfigurationStore
reloadConfiguration, storeConfiguration
-
-
-
-
Constructor Detail
-
HashtableConfigurationStore
protected HashtableConfigurationStore(T properties)
Creates an instance of this class using properties as the set of properties where it will be storing an retrieving properties.- Parameters:
properties- the map that this store will use for storing and retrieving properties.
-
-
Method Detail
-
getProperty
public Object getProperty(String name)
ImplementsConfigurationStore.getProperty(String). If this ConfigurationStore contains a value associated with the specified property name, returns it. Otherwise, searches for a system property with the specified name and returns its value.- Specified by:
getPropertyin interfaceConfigurationStore- Parameters:
name- the name of the property to get the value of- Returns:
- the value in this ConfigurationStore of the property with the specified name; null if the property with the specified name does not have an association with a value in this ConfigurationStore
- See Also:
ConfigurationStore.getProperty(String)
-
getPropertyNames
public String[] getPropertyNames()
ImplementsConfigurationStore.getPropertyNames(). Gets the names of the properties which have values associated in this ConfigurationStore.- Specified by:
getPropertyNamesin interfaceConfigurationStore- Returns:
- an array of Strings which specify the names of the properties that have values associated in this ConfigurationStore; an empty array if this instance contains no property values
- See Also:
ConfigurationStore.getPropertyNames()
-
isSystemProperty
public boolean isSystemProperty(String name)
ImplementsConfigurationStore.isSystemProperty(String). Considers a property to be system if the system properties contain a value associated with its name.- Specified by:
isSystemPropertyin interfaceConfigurationStore- Parameters:
name- the name of a property which is to be determined whether it is a system property- Returns:
- true if the specified name stands for a system property; false, otherwise
- See Also:
ConfigurationStore.isSystemProperty(String)
-
removeProperty
public void removeProperty(String name)
ImplementsConfigurationStore.removeProperty(String). Removes the value association in this ConfigurationStore of the property with a specific name. If the property with the specified name is not associated with a value in this ConfigurationStore, does nothing.- Specified by:
removePropertyin interfaceConfigurationStore- Parameters:
name- the name of the property which is to have its value association in this ConfigurationStore removed- See Also:
ConfigurationStore.removeProperty(String)
-
setNonSystemProperty
public void setNonSystemProperty(String name, Object value)
- Specified by:
setNonSystemPropertyin interfaceConfigurationStore- Parameters:
name- the name of the non-system property to be set to the specified value in this ConfigurationStorevalue- the value to be assigned to the non-system property with the specified name in this ConfigurationStore- See Also:
ConfigurationStore.setNonSystemProperty(String, Object)
-
setSystemProperty
public void setSystemProperty(String name)
ImplementsConfigurationStore.setSystemProperty(String). Since system properties are managed through the System class, setting a property as system in this ConfigurationStore effectively removes any existing value associated with the specified property name from this instance.- Specified by:
setSystemPropertyin interfaceConfigurationStore- Parameters:
name- the name of the property to be set as a system property in this ConfigurationStore- See Also:
ConfigurationStore.setSystemProperty(String)
-
-