org.rhq.core.pluginapi.configuration
Interface ConfigurationFacet


public interface ConfigurationFacet

Components that implement this facet expose the ability to configure resources.


Method Summary
 Configuration loadResourceConfiguration()
          Returns the current values for the specified resource.
 void updateResourceConfiguration(ConfigurationUpdateReport report)
          Configures the specified resource with the values found in the Configuration object within the given report.
 

Method Detail

loadResourceConfiguration

Configuration loadResourceConfiguration()
                                        throws Exception
Returns the current values for the specified resource. Note that the returns configuration is the configuration settings for the managed resource itself, not to be confused with the plugin configuration which is used by the plugin code to connect to the managed resource.

Returns:
the current configuration of the managed resource
Throws:
Exception - if failed to obtain the current configuration from the resource

updateResourceConfiguration

void updateResourceConfiguration(ConfigurationUpdateReport report)
Configures the specified resource with the values found in the Configuration object within the given report. This configuration contains the entire configuration for the resource and not simply a series of changes to the existing values. The method implementation must not change the property values; the Configuration must either be used as-is or a failure must be indicated with error messages attached to the invalid property values indicating why they were invalid.

Implementations must set the report's final status (for example, ConfigurationUpdateStatus.SUCCESS or ConfigurationUpdateStatus.FAILURE). If the method leaves the status to as null or ConfigurationUpdateStatus.INPROGRESS, the caller should assume the method somehow aborted the update and will consider it a failure. If an error occurred, the implementation should set the request's error message to a non-null value that will describe an overall error message and it should set the configuration with all the properties in them but that contain property error messages that indicate which properties failed to get updated and why. This allows you to indicate all the errors that occurred, in case more than one property was invalid or could not be updated.

Note that this method should not throw any exceptions; instead, all error conditions should be indicated in the report.

Parameters:
report -


Copyright © 2008-2009 RHQ Project Advisory Board (Red Hat, Inc.). All Rights Reserved.