org.rhq.core.domain.configuration
Class ObfuscatedPropertySimple

java.lang.Object
  extended by org.rhq.core.domain.configuration.Property
      extended by org.rhq.core.domain.configuration.PropertySimple
          extended by org.rhq.core.domain.configuration.ObfuscatedPropertySimple
All Implemented Interfaces:
Serializable, Comparable<Property>, DeepCopyable<Property>

public class ObfuscatedPropertySimple
extends PropertySimple

This is a specialization of PropertySimple that provides password obfuscation methods.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.rhq.core.domain.configuration.PropertySimple
MAX_VALUE_LENGTH
 
Fields inherited from class org.rhq.core.domain.configuration.Property
QUERY_DELETE_BY_PROPERTY_IDS
 
Constructor Summary
  ObfuscatedPropertySimple()
           
  ObfuscatedPropertySimple(PropertySimple unobfuscated)
          A conversion constructor - makes the provided unobfuscated simple property an obfuscated one.
protected ObfuscatedPropertySimple(PropertySimple original, boolean keepId)
           
  ObfuscatedPropertySimple(String name, Object value)
           
 
Method Summary
 PropertySimple deepCopy(boolean keepId)
           
protected  void deobfuscate()
          We deobfuscate right after the entity has been loaded from the database or right after we persist or update the value.
protected  void obfuscate()
          Obfuscate the value right before it gets pushed down to the database.
 
Methods inherited from class org.rhq.core.domain.configuration.PropertySimple
appendToStringInternals, equals, getBooleanValue, getDoubleValue, getFloatValue, getIntegerValue, getLongValue, getOverride, getStringValue, hashCode, isMasked, mask, setBooleanValue, setDoubleValue, setFloatValue, setIntegerValue, setLongValue, setOverride, setStringValue, setValue
 
Methods inherited from class org.rhq.core.domain.configuration.Property
compareTo, getConfiguration, getErrorMessage, getId, getName, getParentList, getParentMap, setConfiguration, setErrorMessage, setId, setName, setParentList, setParentMap, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObfuscatedPropertySimple

public ObfuscatedPropertySimple()

ObfuscatedPropertySimple

public ObfuscatedPropertySimple(PropertySimple unobfuscated)
A conversion constructor - makes the provided unobfuscated simple property an obfuscated one.

Parameters:
unobfuscated -

ObfuscatedPropertySimple

protected ObfuscatedPropertySimple(PropertySimple original,
                                   boolean keepId)
Parameters:
original -
keepId -

ObfuscatedPropertySimple

public ObfuscatedPropertySimple(String name,
                                Object value)
Parameters:
name -
value -
Method Detail

deepCopy

public PropertySimple deepCopy(boolean keepId)
Specified by:
deepCopy in interface DeepCopyable<Property>
Overrides:
deepCopy in class PropertySimple

deobfuscate

protected void deobfuscate()
We deobfuscate right after the entity has been loaded from the database or right after we persist or update the value. Because we change the value before persist or update, we have to swap the value back as soon as those DB changes are done, so that we only use the raw value in memory.


obfuscate

protected void obfuscate()
Obfuscate the value right before it gets pushed down to the database.



Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.