Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.plugin.otr
Class OtrConfigurator

java.lang.Object
  extended by net.java.sip.communicator.plugin.otr.OtrConfigurator

public class OtrConfigurator
extends Object

A class that gets/sets the OTR configuration values. Introduced to assure our configuration is properly written when XMLConfigurationStore is used. Can be seen as a proxy between the ConfigurationService and the OTR Plugin.

Author:
George Politis

Constructor Summary
OtrConfigurator()
           
 
Method Summary
 boolean getPropertyBoolean(String id, boolean defaultValue)
          Gets the value of a specific property as a boolean ( ConfigurationService.getBoolean(String, boolean) proxy).
 byte[] getPropertyBytes(String id)
          Returns the value of the property with the specified name or null if no such property exists (ConfigurationService.getProperty(String) proxy).
 int getPropertyInt(String id, int defaultValue)
          Gets the value of a specific property as a signed decimal integer.
 void removeProperty(String id)
          Removes the property with the specified name ( ConfigurationService.removeProperty(String) proxy).
 void setProperty(String id, byte[] value)
          Sets the property with the specified name to the specified value ( ConfigurationService.setProperty(String, Object) proxy).
 void setProperty(String id, Object value)
          Sets the property with the specified name to the specified value ( ConfigurationService.setProperty(String, Object) proxy).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OtrConfigurator

public OtrConfigurator()
Method Detail

getPropertyBytes

public byte[] getPropertyBytes(String id)
Returns the value of the property with the specified name or null if no such property exists (ConfigurationService.getProperty(String) proxy).

Parameters:
id - of the property that is being queried.
Returns:
the byte[] value of the property with the specified name.

getPropertyBoolean

public boolean getPropertyBoolean(String id,
                                  boolean defaultValue)
Gets the value of a specific property as a boolean ( ConfigurationService.getBoolean(String, boolean) proxy).

Parameters:
id - of the property that is being queried.
defaultValue - the value to be returned if the specified property name is not associated with a value.
Returns:
the Boolean value of the property with the specified name.

setProperty

public void setProperty(String id,
                        byte[] value)
Sets the property with the specified name to the specified value ( ConfigurationService.setProperty(String, Object) proxy). The value is Base64 encoded.

Parameters:
id - the name of the property to change.
value - the new value of the specified property.

setProperty

public void setProperty(String id,
                        Object value)
Sets the property with the specified name to the specified value ( ConfigurationService.setProperty(String, Object) proxy).

Parameters:
id - the name of the property to change.
value - the new value of the specified property.

removeProperty

public void removeProperty(String id)
Removes the property with the specified name ( ConfigurationService.removeProperty(String) proxy).

Parameters:
id - the name of the property to change.

getPropertyInt

public int getPropertyInt(String id,
                          int defaultValue)
Gets the value of a specific property as a signed decimal integer.

Parameters:
id - the name of the property to change.
defaultValue - the value to be returned if the specified property name is not associated with a value.
Returns:
the int value of the property

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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