Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.configuration.xml
Class XMLConfigurationStore

java.lang.Object
  extended by net.java.sip.communicator.impl.configuration.xml.XMLConfigurationStore
All Implemented Interfaces:
ConfigurationStore

public class XMLConfigurationStore
extends Object
implements ConfigurationStore

Implements a ConfigurationStore which serializes property name-value associations in XML format.

Author:
Emil Ivov, Damian Minkov, Lubomir Marinov

Constructor Summary
XMLConfigurationStore()
           
 
Method Summary
 Object getProperty(String propertyName)
          Implements ConfigurationStore.getProperty(String).
 String[] getPropertyNames()
          Implements {ConfigurationStore#getPropertyNames()}.
 boolean isSystemProperty(String propertyName)
          Implements {ConfigurationStore#isSystemProperty(String)}.
 void reloadConfiguration(File file)
          Implements ConfigurationStore.reloadConfiguration(File).
 void removeProperty(String propertyName)
          Implements ConfigurationStore.removeProperty(String).
 void setNonSystemProperty(String propertyName, Object property)
          Implements ConfigurationStore.setNonSystemProperty(String, Object).
 void setSystemProperty(String propertyName)
          Implements ConfigurationStore.setSystemProperty(String).
 void storeConfiguration(OutputStream out)
          Implements ConfigurationStore.storeConfiguration(OutputStream).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLConfigurationStore

public XMLConfigurationStore()
Method Detail

getProperty

public Object getProperty(String propertyName)
Implements ConfigurationStore.getProperty(String). Gets the value in this ConfigurationStore of a property with a specific name.

Specified by:
getProperty in interface ConfigurationStore
Parameters:
propertyName - 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()
Implements {ConfigurationStore#getPropertyNames()}. Gets the names of the properties which have values associated in this ConfigurationStore.

Specified by:
getPropertyNames in interface ConfigurationStore
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 propertyName)
Implements {ConfigurationStore#isSystemProperty(String)}. Determines whether a specific name stands for a system property.

Specified by:
isSystemProperty in interface ConfigurationStore
Parameters:
propertyName - 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)

reloadConfiguration

public void reloadConfiguration(File file)
                         throws IOException,
                                XMLException
Implements ConfigurationStore.reloadConfiguration(File). Removes all property name-value associations currently present in this ConfigurationStore and deserializes new property name-value associations from a specific File which presumably is in the format represented by this instance.

Specified by:
reloadConfiguration in interface ConfigurationStore
Parameters:
file - the File to be read and to deserialize new property name-value associations from into this instance
Throws:
IOException - if there is an input error while reading from the specified file
XMLException - if parsing the contents of the specified file fails
See Also:
ConfigurationStore.reloadConfiguration(File)

removeProperty

public void removeProperty(String propertyName)
Implements ConfigurationStore.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:
removeProperty in interface ConfigurationStore
Parameters:
propertyName - 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 propertyName,
                                 Object property)
Implements ConfigurationStore.setNonSystemProperty(String, Object). Sets the value of a non-system property with a specific name to a specific value in this ConfigurationStore.

Specified by:
setNonSystemProperty in interface ConfigurationStore
Parameters:
propertyName - the name of the non-system property to be set to the specified value in this ConfigurationStore
property - 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 propertyName)
Implements ConfigurationStore.setSystemProperty(String). Sets a property with a specific name to be considered a system property by the ConfigurationStore.

Specified by:
setSystemProperty in interface ConfigurationStore
Parameters:
propertyName - the name of the property to be set as a system property in this ConfigurationStore
See Also:
ConfigurationStore.setSystemProperty(String)

storeConfiguration

public void storeConfiguration(OutputStream out)
Implements ConfigurationStore.storeConfiguration(OutputStream). Stores/serializes the property name-value associations currently present in this ConfigurationStore into a specific OutputStream in the format represented by this instance.

Specified by:
storeConfiguration in interface ConfigurationStore
Parameters:
out - the OutputStream to receive the serialized form of the property name-value associations currently present in this ConfigurationStore
See Also:
ConfigurationStore.storeConfiguration(OutputStream)

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.