org.rhq.core.clientapi.agent.configuration
Interface ConfigurationAgentService


public interface ConfigurationAgentService

Interface to the plugin container for triggering configuration operations on the plugin's resources.

Author:
Jason Dobies, John Mazzitelli

Method Summary
 ConfigurationUpdateResponse executeUpdateResourceConfigurationImmediately(ConfigurationUpdateRequest request)
          Configures a resource with the new set of configuration values found in the Configuration object within the given request.
 org.rhq.core.domain.configuration.Configuration loadResourceConfiguration(int resourceId)
          Loads the current configuration for the given resource.
 org.rhq.core.domain.configuration.Configuration merge(org.rhq.core.domain.configuration.Configuration configuration, int resourceId, boolean fromStructured)
          If the fromStructured flag is true, then the structured configuration (i.e., Configuration.properties) is merged into the latest raw configurations returned from the plugin.
 void updateResourceConfiguration(ConfigurationUpdateRequest request)
          Configures a resource with the new set of configuration values found in the Configuration object within the given request.
 org.rhq.core.domain.configuration.Configuration validate(org.rhq.core.domain.configuration.Configuration configuration, int resourceId, boolean isStructured)
          If the fromStructured flag is true, then the s Configuration.properties) is merged into the latest raw configura Configuration object returned will consist of the structured configurati configurations.
 

Method Detail

updateResourceConfiguration

void updateResourceConfiguration(ConfigurationUpdateRequest request)
Configures a resource with the new set of configuration values found in the Configuration object within the given request. This configuration contains the entire configuration for the resource and not simply a series of changes to the existing values. The plugin responsible for managing the given resource must inform that resource that its configuration has changed to the given set of new values.

Note that this method should not throw any exceptions; instead, all error conditions should be indicated in the response object when sent back to the caller.

Parameters:
request - tells you the resource to configure and the full set of configuration values for the resource

executeUpdateResourceConfigurationImmediately

ConfigurationUpdateResponse executeUpdateResourceConfigurationImmediately(ConfigurationUpdateRequest request)
                                                                          throws PluginContainerException
Configures a resource with the new set of configuration values found in the Configuration object within the given request. This configuration contains the entire configuration for the resource and not simply a series of changes to the existing values. The plugin responsible for managing the given resource must inform that resource that its configuration has changed to the given set of new values.

Note that this method should not throw any exceptions for configuration errors; instead, all error conditions should be indicated in the response object when sent back to the caller. Any Runtime or Plugin Excpetions will still be thrown

Parameters:
request - tells you the resource to configure and the full set of configuration values for the resource
Returns:
ConfigurationUpdateResponse response object with the updated values and also any specific errors on a configuration
Throws:
PluginContainerException - if update fails due to an unrecoverable error, then a PluginContainerException is thrown.

loadResourceConfiguration

org.rhq.core.domain.configuration.Configuration loadResourceConfiguration(int resourceId)
                                                                          throws PluginContainerException
Loads the current configuration for the given resource. This returns the entire set of configuration values for the resource.

Parameters:
resourceId - id of the resource to load
Returns:
current values of the entire configuration for the resource
Throws:
PluginContainerException - if a runtime or plugin error occurs a PluginContainerException is thrown

merge

org.rhq.core.domain.configuration.Configuration merge(org.rhq.core.domain.configuration.Configuration configuration,
                                                      int resourceId,
                                                      boolean fromStructured)
                                                      throws PluginContainerException
If the fromStructured flag is true, then the structured configuration (i.e., Configuration.properties) is merged into the latest raw configurations returned from the plugin. The Configuration object returned will consist of the structured configuration along with the merged raw configurations. If fromStructured is false, then the raw configurations (i.e., Configuration.rawConfigurations) is merged into the latest structured configurations returned from the plugin. The returned Configuration will then consist of the raw configuration along with the merged structured configuration.

Parameters:
configuration - The Configuration with the changes to be merged
resourceId - The id of the resource to which the configuration belongs
fromStructured - A flag that if true indicates the merge should be from structured to raw, otherwise merge from raw to structured.
Returns:
The merged configuration, where a merge consists of a refresh of the side being merged followed by the values of the side merging from being applied to the side being merged into.
Throws:
PluginContainerException - if a runtime or plugin error occurs.

validate

org.rhq.core.domain.configuration.Configuration validate(org.rhq.core.domain.configuration.Configuration configuration,
                                                         int resourceId,
                                                         boolean isStructured)
                                                         throws PluginContainerException
If the fromStructured flag is true, then the s Configuration.properties) is merged into the latest raw configura Configuration object returned will consist of the structured configurati configurations. If fromStructured is false, th Configuration.rawConfigurations) is merged into the latest struct plugin. The returned Configuration will then consist of the raw configur configuration.

Parameters:
configuration - The Configuration with the changes to be merged
resourceId - The id of the resource to which the configuration belongs
A - flag that if true indicates validate the Structured configuration otherwisre, it validates the raw
Returns:
If validate succeeds, it returns null, to avoid doing any unnecessary marshaling. If validation fails, it returns the configuration object with embedded messages
Throws:
PluginContainerException
PluginContainerException - if a runtime or plugin error occurs.


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