org.rhq.enterprise.server.configuration.util
Class ConfigurationMaskingUtility

java.lang.Object
  extended by org.rhq.enterprise.server.configuration.util.ConfigurationMaskingUtility

public class ConfigurationMaskingUtility
extends Object

A class that provides static methods for masking and unmasking password properties within Configurations, The reason for masking a property's value is so that the current values of such properties cannot be viewed by a user by viewing the HTML source of a Configuration GUI page, e.g.: <input type="password" value="********" .../> would be rendered, rather than: <input type="password" value="ACTUAL_PASSWORD" .../>

Author:
Ian Springer

Constructor Summary
ConfigurationMaskingUtility()
           
 
Method Summary
static void maskConfiguration(org.rhq.core.domain.configuration.Configuration configuration, org.rhq.core.domain.configuration.definition.ConfigurationDefinition configurationDefinition)
          Mask the values of all simple properties of type PASSWORD in the configuration.
static void unmaskConfiguration(org.rhq.core.domain.configuration.Configuration configuration, org.rhq.core.domain.configuration.Configuration unmaskedConfiguration)
          Unmask the values of all masked simple properties of type PASSWORD in the configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationMaskingUtility

public ConfigurationMaskingUtility()
Method Detail

maskConfiguration

public static void maskConfiguration(@NotNull
                                     org.rhq.core.domain.configuration.Configuration configuration,
                                     @NotNull
                                     org.rhq.core.domain.configuration.definition.ConfigurationDefinition configurationDefinition)
Mask the values of all simple properties of type PASSWORD in the configuration. The properties are masked by calling PropertySimple.mask(). The configuration does not need to be normalized; that is, properties defined by the configuration definition do not need to exist in the configuration.

Parameters:
configuration - the configuration to be masked
configurationDefinition - the configuration definition corresponding to the specified configuration; this is used to determine which properties to mask - all simple properties of type PASSWORD at any level within the configuration are masked

unmaskConfiguration

public static void unmaskConfiguration(@NotNull
                                       org.rhq.core.domain.configuration.Configuration configuration,
                                       @NotNull
                                       org.rhq.core.domain.configuration.Configuration unmaskedConfiguration)
Unmask the values of all masked simple properties of type PASSWORD in the configuration. The configuration does not need to be normalized; that is, properties defined by the configuration definition do not need to exist in the configuration.

Parameters:
configuration - the configuration to be unmasked
unmaskedConfiguration - the unmasked configuration that should be used as the reference to unmask the configuration


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