org.rhq.enterprise.server.configuration
Interface ConfigurationManagerLocal

All Known Implementing Classes:
ConfigurationManagerBean

public interface ConfigurationManagerLocal

The configuration manager which allows you to request resource configuration changes, view current resource configuration and previous update history and view/edit plugin configuration.

Author:
John Mazzitelli, Ian Springer

Method Summary
 void checkForCompletedGroupResourceConfigurationUpdate(int resourceConfigUpdateId)
           
 void checkForTimedOutConfigurationUpdateRequests()
          The purpose of this method is really to clean up requests when we detect they probably will never move out of the in-progress status.
 void completePluginConfigurationUpdate(Integer updateId)
           
 void completePluginConfigurationUpdate(org.rhq.core.domain.configuration.PluginConfigurationUpdate update)
          Updates the plugin configuration used to connect and communicate with the resource using the information in the passed PluginConfigurationUpdate object.
 void completeResourceConfigurationUpdate(ConfigurationUpdateResponse response)
          A callback method that is called when an agent has completed updating a resource's configuration.
 int createGroupConfigurationUpdate(org.rhq.core.domain.configuration.group.AbstractGroupConfigurationUpdate update)
           
 void deleteConfigurations(List<Integer> configurationIds)
           
 int deleteGroupPluginConfigurationUpdates(org.rhq.core.domain.auth.Subject subject, Integer resourceGroupId, Integer[] groupPluginConfigurationUpdateIds)
           
 int deleteGroupResourceConfigurationUpdates(org.rhq.core.domain.auth.Subject subject, Integer resourceGroupId, Integer[] groupResourceConfigurationUpdateIds)
           
 void deleteProperties(int[] propertyIds)
           
 ConfigurationUpdateResponse executePluginConfigurationUpdate(org.rhq.core.domain.configuration.PluginConfigurationUpdate update)
           
 void executeResourceConfigurationUpdate(int updateId)
           
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.configuration.group.GroupPluginConfigurationUpdate> findGroupPluginConfigurationUpdates(int groupId, org.rhq.core.domain.util.PageControl pc)
           
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.configuration.group.GroupPluginConfigurationUpdate> findGroupPluginConfigurationUpdatesByCriteria(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.criteria.GroupPluginConfigurationUpdateCriteria criteria)
           
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.configuration.group.GroupResourceConfigurationUpdate> findGroupResourceConfigurationUpdates(org.rhq.core.domain.auth.Subject subject, int groupId, org.rhq.core.domain.util.PageControl pc)
           
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.configuration.group.GroupResourceConfigurationUpdate> findGroupResourceConfigurationUpdatesByCriteria(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.criteria.GroupResourceConfigurationUpdateCriteria criteria)
           
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.configuration.composite.ConfigurationUpdateComposite> findPluginConfigurationUpdateCompositesByParentId(int configurationUpdateId, org.rhq.core.domain.util.PageControl pageControl)
           
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.configuration.PluginConfigurationUpdate> findPluginConfigurationUpdates(org.rhq.core.domain.auth.Subject subject, int resourceId, Long beginDate, Long endDate, org.rhq.core.domain.util.PageControl pc)
           
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.configuration.PluginConfigurationUpdate> findPluginConfigurationUpdatesByCriteria(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.criteria.PluginConfigurationUpdateCriteria criteria)
           
 org.rhq.core.domain.util.PageList<Integer> findPluginConfigurationUpdatesByParentId(int configurationUpdateId, org.rhq.core.domain.util.PageControl pageControl)
           
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.configuration.composite.ConfigurationUpdateComposite> findResourceConfigurationUpdateCompositesByParentId(org.rhq.core.domain.auth.Subject subject, int configurationUpdateId, org.rhq.core.domain.util.PageControl pageControl)
           
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.configuration.ResourceConfigurationUpdate> findResourceConfigurationUpdates(org.rhq.core.domain.auth.Subject subject, Integer resourceId, Long beginDate, Long endDate, boolean suppressOldest, org.rhq.core.domain.util.PageControl pc)
          Returns the list of all Resource configuration updates for the given Resource, in reverse of the order in which they were created (i.e.
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.configuration.ResourceConfigurationUpdate> findResourceConfigurationUpdatesByCriteria(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.criteria.ResourceConfigurationUpdateCriteria criteria)
           
 org.rhq.core.domain.util.PageList<Integer> findResourceConfigurationUpdatesByParentId(int groupConfigurationUpdateId, org.rhq.core.domain.util.PageControl pageControl)
           
 org.rhq.core.domain.configuration.Configuration getConfiguration(org.rhq.core.domain.auth.Subject subject, int configurationId)
           
 org.rhq.core.domain.configuration.Configuration getConfigurationById(int id)
          This is a generic method that any caller can use to obtain any configuration given a configuration ID.
 org.rhq.core.domain.configuration.Configuration getConfigurationFromDefaultTemplate(org.rhq.core.domain.configuration.definition.ConfigurationDefinition definition)
          This is a convenience method that is equivalent to the following: definition.getDefaultTemplate().getConfiguration() If the definition is already a managed bean, then there is no real reason to call this since EJB3 will traverse the object relationships just fine.
 org.rhq.core.domain.configuration.group.GroupPluginConfigurationUpdate getGroupPluginConfigurationById(int configurationUpdateId)
           
 org.rhq.core.domain.configuration.group.GroupPluginConfigurationUpdate getGroupPluginConfigurationUpdate(org.rhq.core.domain.auth.Subject subject, int configurationUpdateId)
           
 org.rhq.core.domain.configuration.group.GroupResourceConfigurationUpdate getGroupResourceConfigurationById(int configurationUpdateId)
           
 org.rhq.core.domain.configuration.group.GroupResourceConfigurationUpdate getGroupResourceConfigurationUpdate(org.rhq.core.domain.auth.Subject subject, int configurationUpdateId)
           
 org.rhq.core.domain.configuration.PluginConfigurationUpdate getLatestPluginConfigurationUpdate(org.rhq.core.domain.auth.Subject subject, int resourceId)
          Get the latest plugin configuration for the Resource with the given id.
 org.rhq.core.domain.configuration.ResourceConfigurationUpdate getLatestResourceConfigurationUpdate(org.rhq.core.domain.auth.Subject subject, int resourceId)
          Get the latest resource configuration for the Resource with the given id, or null if the resource's configuration is not yet initialized and for some reason we can't get its current live configuration (e.g.
 org.rhq.core.domain.configuration.ResourceConfigurationUpdate getLatestResourceConfigurationUpdate(org.rhq.core.domain.auth.Subject subject, int resourceId, boolean fromStructured)
           
 org.rhq.core.domain.configuration.Configuration getLiveResourceConfiguration(org.rhq.core.domain.auth.Subject subject, int resourceId, boolean pingAgentFirst)
          Get the currently live resource configuration for the Resource with the given id.
 org.rhq.core.domain.configuration.Configuration getLiveResourceConfiguration(org.rhq.core.domain.auth.Subject subject, int resourceId, boolean pingAgentFirst, boolean fromStructured)
           
 org.rhq.core.domain.configuration.definition.ConfigurationDefinition getOptionsForConfigurationDefinition(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.configuration.definition.ConfigurationDefinition def)
           
 org.rhq.core.domain.configuration.definition.ConfigurationDefinition getPackageTypeConfigurationDefinition(org.rhq.core.domain.auth.Subject subject, int packageTypeId)
           
 org.rhq.core.domain.configuration.Configuration getPluginConfiguration(int resourceId)
          This does not perform permission checks and should be used internally only.
 org.rhq.core.domain.configuration.Configuration getPluginConfiguration(org.rhq.core.domain.auth.Subject subject, int resourceId)
          Get the current plugin configuration for the Resource with the given id, or null if the resource's plugin configuration is not yet initialized.
 org.rhq.core.domain.configuration.definition.ConfigurationDefinition getPluginConfigurationDefinitionForResourceType(org.rhq.core.domain.auth.Subject subject, int resourceTypeId)
          Return the plugin configuration definition for the ResourceType with the specified id.
 Map<Integer,org.rhq.core.domain.configuration.Configuration> getPluginConfigurationMapForGroupUpdate(org.rhq.core.domain.auth.Subject subject, Integer groupPluginConfigurationUpdateId)
           
 Map<Integer,org.rhq.core.domain.configuration.Configuration> getPluginConfigurationsForCompatibleGroup(org.rhq.core.domain.auth.Subject subject, int groupId)
           
 org.rhq.core.domain.configuration.PluginConfigurationUpdate getPluginConfigurationUpdate(org.rhq.core.domain.auth.Subject subject, int configurationUpdateId)
          Returns a single plugin configuration update.
 long getPluginConfigurationUpdateCountByParentId(int configurationUpdateId)
           
 org.rhq.core.domain.configuration.Configuration getResourceConfiguration(int resourceId)
          This does not perform permission checks and should be used internally only.
 org.rhq.core.domain.configuration.Configuration getResourceConfiguration(org.rhq.core.domain.auth.Subject subject, int resourceId)
           
 org.rhq.core.domain.configuration.definition.ConfigurationDefinition getResourceConfigurationDefinitionForResourceType(org.rhq.core.domain.auth.Subject subject, int resourceTypeId)
          Return the resource configuration definition for the ResourceType with the specified id.
 org.rhq.core.domain.configuration.definition.ConfigurationDefinition getResourceConfigurationDefinitionWithTemplatesForResourceType(org.rhq.core.domain.auth.Subject subject, int resourceTypeId)
          Return the resource configuration definition for the ResourceType with the specified id.
 Map<Integer,org.rhq.core.domain.configuration.Configuration> getResourceConfigurationMapForGroupUpdate(org.rhq.core.domain.auth.Subject subject, Integer groupResourceConfigurationUpdateId)
           
 Map<Integer,org.rhq.core.domain.configuration.Configuration> getResourceConfigurationsForCompatibleGroup(org.rhq.core.domain.auth.Subject subject, int groupId)
          Returns the current Resource configurations for the members in the specified compatible group.
 org.rhq.core.domain.configuration.ResourceConfigurationUpdate getResourceConfigurationUpdate(org.rhq.core.domain.auth.Subject subject, int configurationUpdateId)
          Returns a single resource configuration update
 long getResourceConfigurationUpdateCountByParentId(int groupConfigurationUpdateId)
           
 boolean isGroupPluginConfigurationUpdateInProgress(org.rhq.core.domain.auth.Subject subject, int groupId)
           
 boolean isGroupResourceConfigurationUpdateInProgress(org.rhq.core.domain.auth.Subject subject, int groupId)
           
 boolean isResourceConfigurationUpdateInProgress(org.rhq.core.domain.auth.Subject subject, int resourceId)
           
 org.rhq.core.domain.configuration.Configuration mergeConfiguration(org.rhq.core.domain.configuration.Configuration config)
           
 org.rhq.core.domain.configuration.AbstractResourceConfigurationUpdate mergeConfigurationUpdate(org.rhq.core.domain.configuration.AbstractResourceConfigurationUpdate configurationUpdate)
          Merge the specified configuration update into the DB.
 org.rhq.core.domain.configuration.ResourceConfigurationUpdate persistNewResourceConfigurationUpdateHistory(org.rhq.core.domain.auth.Subject subject, int resourceId, org.rhq.core.domain.configuration.Configuration newConfiguration, org.rhq.core.domain.configuration.ConfigurationUpdateStatus newStatus, String newSubject, boolean isPartofGroupUpdate)
          For internal use only - do not call this method.
 void purgePluginConfigurationUpdate(org.rhq.core.domain.auth.Subject subject, int configurationUpdateId, boolean purgeInProgress)
          This deletes the update information belonging to the AbstractResourceConfigurationUpdate object with the given ID.
 void purgePluginConfigurationUpdates(org.rhq.core.domain.auth.Subject subject, int[] configurationUpdateIds, boolean purgeInProgress)
          This deletes one or more plugin configuration updates from the resource's plugin config history.
 void purgeResourceConfigurationUpdate(org.rhq.core.domain.auth.Subject subject, int configurationUpdateId, boolean purgeInProgress)
          This deletes the update information belonging to the AbstractResourceConfigurationUpdate object with the given ID.
 void purgeResourceConfigurationUpdates(org.rhq.core.domain.auth.Subject subject, int[] configurationUpdateIds, boolean purgeInProgress)
          This deletes one or more configuration updates from the resource's configuration history.
 void rollbackPluginConfiguration(org.rhq.core.domain.auth.Subject subject, int resourceId, int configHistoryId)
          This method is called when a user has requested to change the plugin configuration for an existing resource to one of its previous values.
 void rollbackResourceConfiguration(org.rhq.core.domain.auth.Subject subject, int resourceId, int configHistoryId)
          This method is called when a user has requested to change the resource configuration for an existing resource to one of its previous values.
 int scheduleGroupPluginConfigurationUpdate(org.rhq.core.domain.auth.Subject subject, int compatibleGroupId, Map<Integer,org.rhq.core.domain.configuration.Configuration> pluginConfigurationUpdate)
           
 int scheduleGroupResourceConfigurationUpdate(org.rhq.core.domain.auth.Subject subject, int compatibleGroupId, Map<Integer,org.rhq.core.domain.configuration.Configuration> newResourceConfigurationMap)
           
 void setResourceConfiguration(int resourceId, org.rhq.core.domain.configuration.Configuration configuration)
          This method is called when the plugin container reports a new Resource configuration after an external change was detected.
 org.rhq.core.domain.configuration.Configuration translateResourceConfiguration(org.rhq.core.domain.auth.Subject subject, int resourceId, org.rhq.core.domain.configuration.Configuration configuration, boolean fromStructured)
           
 void updateGroupConfigurationUpdate(org.rhq.core.domain.configuration.group.AbstractGroupConfigurationUpdate groupUpdate)
           
 org.rhq.core.domain.configuration.ConfigurationUpdateStatus updateGroupPluginConfigurationUpdateStatus(int groupPluginConfigurationUpdateId, String errorMessages)
           
 org.rhq.core.domain.configuration.ConfigurationUpdateStatus updateGroupResourceConfigurationUpdateStatus(int groupResourceConfigurationUpdateId, String errorMessages)
           
 org.rhq.core.domain.configuration.PluginConfigurationUpdate updatePluginConfiguration(org.rhq.core.domain.auth.Subject subject, int resourceId, org.rhq.core.domain.configuration.Configuration newConfiguration)
          Updates the plugin configuration used to connect and communicate with the resource.
 org.rhq.core.domain.configuration.ResourceConfigurationUpdate updateResourceConfiguration(org.rhq.core.domain.auth.Subject subject, int resourceId, org.rhq.core.domain.configuration.Configuration newConfiguration)
          This method is called when a user has requested to change the resource configuration for an existing resource.
 org.rhq.core.domain.configuration.ResourceConfigurationUpdate updateStructuredOrRawConfiguration(org.rhq.core.domain.auth.Subject subject, int resourceId, org.rhq.core.domain.configuration.Configuration newConfiguration, boolean fromStructured)
           
 

Method Detail

completePluginConfigurationUpdate

void completePluginConfigurationUpdate(org.rhq.core.domain.configuration.PluginConfigurationUpdate update)
Updates the plugin configuration used to connect and communicate with the resource using the information in the passed PluginConfigurationUpdate object. This update object will be changed to reflect the result of the plugin configuration update attempt. This is an internal method called by updatePluginConfiguration(Subject, int, Configuration) and GroupPluginConfigurationUpdateJob . It is not intended to be used for general, public consumption.

Parameters:
update - a previously server-side persisted update, which has not yet made it to the agent

completePluginConfigurationUpdate

void completePluginConfigurationUpdate(Integer updateId)

getPluginConfiguration

org.rhq.core.domain.configuration.Configuration getPluginConfiguration(int resourceId)
This does not perform permission checks and should be used internally only. In general, use getPluginConfiguration(Subject, int).


getResourceConfiguration

org.rhq.core.domain.configuration.Configuration getResourceConfiguration(int resourceId)
This does not perform permission checks and should be used internally only. In general, use #getCurrentResourceConfiguration.

Throws:
FetchException - TODO

getLiveResourceConfiguration

org.rhq.core.domain.configuration.Configuration getLiveResourceConfiguration(org.rhq.core.domain.auth.Subject subject,
                                                                             int resourceId,
                                                                             boolean pingAgentFirst)
                                                                             throws Exception
Get the currently live resource configuration for the Resource with the given id. This actually asks for the up-to-date configuration directly from the agent. An exception will be thrown if communications with the agent cannot be made.

Parameters:
subject - the user who wants to see the information
resourceId - a Resource id
pingAgentFirst - true if the underlying Agent should be pinged successfully before attempting to retrieve the configuration, or false otherwise
Returns:
the live configuration
Throws:
Exception - if failed to get the configuration from the agent

getLiveResourceConfiguration

org.rhq.core.domain.configuration.Configuration getLiveResourceConfiguration(org.rhq.core.domain.auth.Subject subject,
                                                                             int resourceId,
                                                                             boolean pingAgentFirst,
                                                                             boolean fromStructured)
                                                                             throws Exception
Throws:
Exception

findPluginConfigurationUpdates

org.rhq.core.domain.util.PageList<org.rhq.core.domain.configuration.PluginConfigurationUpdate> findPluginConfigurationUpdates(org.rhq.core.domain.auth.Subject subject,
                                                                                                                              int resourceId,
                                                                                                                              Long beginDate,
                                                                                                                              Long endDate,
                                                                                                                              org.rhq.core.domain.util.PageControl pc)

findResourceConfigurationUpdates

org.rhq.core.domain.util.PageList<org.rhq.core.domain.configuration.ResourceConfigurationUpdate> findResourceConfigurationUpdates(org.rhq.core.domain.auth.Subject subject,
                                                                                                                                  Integer resourceId,
                                                                                                                                  Long beginDate,
                                                                                                                                  Long endDate,
                                                                                                                                  boolean suppressOldest,
                                                                                                                                  org.rhq.core.domain.util.PageControl pc)
Returns the list of all Resource configuration updates for the given Resource, in reverse of the order in which they were created (i.e. most recent update will be the first item in the list). This will show you an audit trail of the update history for the Resource (who updated it, when and what did they change). You can pick one configuration version to later rollback to that version via updateResourceConfiguration(Subject, int, Configuration).

Parameters:
subject - the user who wants to see the information
resourceId - the resource whose update requests are to be returned, if null will not filter by resourceId
beginDate - filter used to show only results occurring after this epoch millis parameter, nullable
endDate - filter used to show only results occurring before this epoch millis parameter, nullable
suppressOldest - if true, will not include the oldest element in the history (usually the initial update)
pc - the pagination controls
Returns:
the Resource's complete list of updates (will be empty (not null) if none)

getPluginConfigurationUpdate

org.rhq.core.domain.configuration.PluginConfigurationUpdate getPluginConfigurationUpdate(org.rhq.core.domain.auth.Subject subject,
                                                                                         int configurationUpdateId)
Returns a single plugin configuration update.

Parameters:
subject - the user who wants to see the information
configurationUpdateId - the ID of the configuration update entity to return
Returns:
the plugin configuration update

getResourceConfigurationUpdate

org.rhq.core.domain.configuration.ResourceConfigurationUpdate getResourceConfigurationUpdate(org.rhq.core.domain.auth.Subject subject,
                                                                                             int configurationUpdateId)
Returns a single resource configuration update

Parameters:
subject - the user who wants to see the information
configurationUpdateId - the ID of the configuration update entity to return
Returns:
the resource configuration update

rollbackResourceConfiguration

void rollbackResourceConfiguration(org.rhq.core.domain.auth.Subject subject,
                                   int resourceId,
                                   int configHistoryId)
                                   throws ConfigurationUpdateException
This method is called when a user has requested to change the resource configuration for an existing resource to one of its previous values. If the user does not have the proper permissions to change the resource's configuration, an exception is thrown.

This will not wait for the agent to finish the configuration update. This will return after the request is sent. Once the agent finishes with the request, it will send the completed request information to completeResourceConfigurationUpdate(org.rhq.core.clientapi.server.configuration.ConfigurationUpdateResponse).

Parameters:
subject - the user who is requesting the update
resourceId - identifies the resource to be updated
configHistoryId - the id of the resource's previous configuration to rollback to
Throws:
ConfigurationUpdateException - if the configHistoryId does not exist

rollbackPluginConfiguration

void rollbackPluginConfiguration(org.rhq.core.domain.auth.Subject subject,
                                 int resourceId,
                                 int configHistoryId)
                                 throws ConfigurationUpdateException
This method is called when a user has requested to change the plugin configuration for an existing resource to one of its previous values. If the user does not have the proper permissions to change the resource's plugin configuration, an exception is thrown.

This will not wait for the agent to finish the configuration update. This will return after the request is sent. Once the agent finishes with the request, it will send the completed request information to completePluginConfigurationUpdate(org.rhq.core.domain.configuration.PluginConfigurationUpdate).

Parameters:
subject - the user who is requesting the update
resourceId - identifies the resource to be updated
configHistoryId - the id of the resource's previous configuration to rollback to
Throws:
ConfigurationUpdateException - if the configHistoryId does not exist

persistNewResourceConfigurationUpdateHistory

@Nullable
org.rhq.core.domain.configuration.ResourceConfigurationUpdate persistNewResourceConfigurationUpdateHistory(org.rhq.core.domain.auth.Subject subject,
                                                                                                                    int resourceId,
                                                                                                                    org.rhq.core.domain.configuration.Configuration newConfiguration,
                                                                                                                    org.rhq.core.domain.configuration.ConfigurationUpdateStatus newStatus,
                                                                                                                    String newSubject,
                                                                                                                    boolean isPartofGroupUpdate)
                                                                                                           throws ResourceNotFoundException,
                                                                                                                  ConfigurationUpdateStillInProgressException
For internal use only - do not call this method. This is for updateResourceConfiguration(Subject, int, Configuration) to call with REQUIRES_NEW transaction scope so it can force the new request to be committed to the DB. Also used by getLatestResourceConfigurationUpdate(Subject, int) and scheduleGroupResourceConfigurationUpdate(org.rhq.core.domain.auth.Subject, int, java.util.Map).

Parameters:
subject -
resourceId -
newConfiguration -
newStatus -
newSubject - user to associate with this update change (may be null)
isPartofGroupUpdate -
Returns:
the persisted Resource Configuration update, or null if the specified Configuration is identical to the currently persisted Configuration
Throws:
ResourceNotFoundException
ConfigurationUpdateStillInProgressException

completeResourceConfigurationUpdate

void completeResourceConfigurationUpdate(ConfigurationUpdateResponse response)
A callback method that is called when an agent has completed updating a resource's configuration.

Parameters:
response - information that contains the status of the update (i.e. was it successfully updated or did it fail?) as well as the configuration if it failed (with the properties containing error messages to describe what failed). If the update was a success, the completed request's configuration will be null to indicate that the configuration that was sent to the agent was used as-is.

checkForCompletedGroupResourceConfigurationUpdate

void checkForCompletedGroupResourceConfigurationUpdate(int resourceConfigUpdateId)

executePluginConfigurationUpdate

ConfigurationUpdateResponse executePluginConfigurationUpdate(org.rhq.core.domain.configuration.PluginConfigurationUpdate update)

purgePluginConfigurationUpdate

void purgePluginConfigurationUpdate(org.rhq.core.domain.auth.Subject subject,
                                    int configurationUpdateId,
                                    boolean purgeInProgress)
This deletes the update information belonging to the AbstractResourceConfigurationUpdate object with the given ID. Once this returns, the complete audit trail for that update will be gone and you will not be able to rollback to that configuration.

Under normal circumstances, you will not want to purge an update that is currently in progress. However, there may be conditions in which an update request "gets stuck" in the in-progress state, even though you know the agent will never report the completed request (typically caused by an unusual crash of the agent). In this case, you should pass true in for the purgeInProgress parameter to tell this method to delete the request even if it says it is in-progress.

Parameters:
subject - the user who is requesting the purge
configurationUpdateId - identifies the update record to be deleted
purgeInProgress - if true, delete it even if its in progress

purgePluginConfigurationUpdates

void purgePluginConfigurationUpdates(org.rhq.core.domain.auth.Subject subject,
                                     int[] configurationUpdateIds,
                                     boolean purgeInProgress)
This deletes one or more plugin configuration updates from the resource's plugin config history.

Parameters:
subject - the user who is requesting the purge
configurationUpdateIds - identifies the update records to be deleted
purgeInProgress - if true, delete those even if in progress

purgeResourceConfigurationUpdate

void purgeResourceConfigurationUpdate(org.rhq.core.domain.auth.Subject subject,
                                      int configurationUpdateId,
                                      boolean purgeInProgress)
This deletes the update information belonging to the AbstractResourceConfigurationUpdate object with the given ID. Once this returns, the complete audit trail for that update will be gone and you will not be able to rollback to that configuration.

Under normal circumstances, you will not want to purge an update that is currently in progress. However, there may be conditions in which an update request "gets stuck" in the in-progress state, even though you know the agent will never report the completed request (typically caused by an unusual crash of the agent). In this case, you should pass true in for the purgeInProgress parameter to tell this method to delete the request even if it says it is in-progress.

Parameters:
subject - the user who is requesting the purge
configurationUpdateId - identifies the update record to be deleted
purgeInProgress - if true, delete it even if its in progress

purgeResourceConfigurationUpdates

void purgeResourceConfigurationUpdates(org.rhq.core.domain.auth.Subject subject,
                                       int[] configurationUpdateIds,
                                       boolean purgeInProgress)
This deletes one or more configuration updates from the resource's configuration history.

Parameters:
subject - the user who is requesting the purge
configurationUpdateIds - identifies the update records to be deleted
purgeInProgress - if true, delete those even if in progress

getResourceConfigurationDefinitionForResourceType

@Nullable
org.rhq.core.domain.configuration.definition.ConfigurationDefinition getResourceConfigurationDefinitionForResourceType(org.rhq.core.domain.auth.Subject subject,
                                                                                                                                int resourceTypeId)
Return the resource configuration definition for the ResourceType with the specified id.

Parameters:
subject - the user who is requesting the resource configuration definition
resourceTypeId - identifies the resource type whose resource configuration definition is being requested
Returns:
the resource configuration definition for the ResourceType with the specified id, or null if the ResourceType does not define a resource configuration

getResourceConfigurationDefinitionWithTemplatesForResourceType

@Nullable
org.rhq.core.domain.configuration.definition.ConfigurationDefinition getResourceConfigurationDefinitionWithTemplatesForResourceType(org.rhq.core.domain.auth.Subject subject,
                                                                                                                                             int resourceTypeId)
Return the resource configuration definition for the ResourceType with the specified id. The templates will be loaded in the definition returned from this call.

Parameters:
subject - the user who is requesting the resource configuration definition
resourceTypeId - identifies the resource type whose resource configuration definition is being requested
Returns:
the resource configuration definition for the ResourceType with the specified id, or null if the ResourceType does not define a resource configuration

getPluginConfigurationDefinitionForResourceType

@Nullable
org.rhq.core.domain.configuration.definition.ConfigurationDefinition getPluginConfigurationDefinitionForResourceType(org.rhq.core.domain.auth.Subject subject,
                                                                                                                              int resourceTypeId)
Return the plugin configuration definition for the ResourceType with the specified id.

Parameters:
subject - the user who is requesting the plugin configuration definition
resourceTypeId - identifies the resource type whose plugin configuration definition is being requested
Returns:
the plugin configuration definition for the ResourceType with the specified id, or null if the ResourceType does not define a plugin configuration

mergeConfigurationUpdate

org.rhq.core.domain.configuration.AbstractResourceConfigurationUpdate mergeConfigurationUpdate(org.rhq.core.domain.configuration.AbstractResourceConfigurationUpdate configurationUpdate)
Merge the specified configuration update into the DB.

Parameters:
configurationUpdate - a configuration update
Returns:
an attached copy of the configuration update

getConfigurationById

org.rhq.core.domain.configuration.Configuration getConfigurationById(int id)
This is a generic method that any caller can use to obtain any configuration given a configuration ID. This can be used to obtain any configuration, which includes such things as an operation's parameters or an operations results.

Parameters:
id - identifies the configuration to return
Returns:
the configuration with the given ID, or null if there is no configuration with that ID

getConfigurationFromDefaultTemplate

org.rhq.core.domain.configuration.Configuration getConfigurationFromDefaultTemplate(org.rhq.core.domain.configuration.definition.ConfigurationDefinition definition)
This is a convenience method that is equivalent to the following: definition.getDefaultTemplate().getConfiguration() If the definition is already a managed bean, then there is no real reason to call this since EJB3 will traverse the object relationships just fine. However, if the definition is detached from the managed context, and because of the lazy-loading semantics of the entities involved in the call chain above, then you can use this method since it will re-attach it and get the configuration from the default template as shown above.

Parameters:
definition - a configuration definition
Returns:
the Configuration from the default ConfigurationTemplate of the passed definition

getGroupPluginConfigurationById

org.rhq.core.domain.configuration.group.GroupPluginConfigurationUpdate getGroupPluginConfigurationById(int configurationUpdateId)

findPluginConfigurationUpdateCompositesByParentId

org.rhq.core.domain.util.PageList<org.rhq.core.domain.configuration.composite.ConfigurationUpdateComposite> findPluginConfigurationUpdateCompositesByParentId(int configurationUpdateId,
                                                                                                                                                              org.rhq.core.domain.util.PageControl pageControl)

findResourceConfigurationUpdateCompositesByParentId

org.rhq.core.domain.util.PageList<org.rhq.core.domain.configuration.composite.ConfigurationUpdateComposite> findResourceConfigurationUpdateCompositesByParentId(org.rhq.core.domain.auth.Subject subject,
                                                                                                                                                                int configurationUpdateId,
                                                                                                                                                                org.rhq.core.domain.util.PageControl pageControl)

findPluginConfigurationUpdatesByParentId

org.rhq.core.domain.util.PageList<Integer> findPluginConfigurationUpdatesByParentId(int configurationUpdateId,
                                                                                    org.rhq.core.domain.util.PageControl pageControl)

getPluginConfigurationUpdateCountByParentId

long getPluginConfigurationUpdateCountByParentId(int configurationUpdateId)

createGroupConfigurationUpdate

int createGroupConfigurationUpdate(org.rhq.core.domain.configuration.group.AbstractGroupConfigurationUpdate update)
                                   throws org.quartz.SchedulerException
Throws:
org.quartz.SchedulerException

scheduleGroupPluginConfigurationUpdate

int scheduleGroupPluginConfigurationUpdate(org.rhq.core.domain.auth.Subject subject,
                                           int compatibleGroupId,
                                           Map<Integer,org.rhq.core.domain.configuration.Configuration> pluginConfigurationUpdate)
                                           throws org.quartz.SchedulerException
Throws:
org.quartz.SchedulerException

findGroupPluginConfigurationUpdates

org.rhq.core.domain.util.PageList<org.rhq.core.domain.configuration.group.GroupPluginConfigurationUpdate> findGroupPluginConfigurationUpdates(int groupId,
                                                                                                                                              org.rhq.core.domain.util.PageControl pc)

findGroupResourceConfigurationUpdates

org.rhq.core.domain.util.PageList<org.rhq.core.domain.configuration.group.GroupResourceConfigurationUpdate> findGroupResourceConfigurationUpdates(org.rhq.core.domain.auth.Subject subject,
                                                                                                                                                  int groupId,
                                                                                                                                                  org.rhq.core.domain.util.PageControl pc)

updateGroupResourceConfigurationUpdateStatus

org.rhq.core.domain.configuration.ConfigurationUpdateStatus updateGroupResourceConfigurationUpdateStatus(int groupResourceConfigurationUpdateId,
                                                                                                         String errorMessages)

updateGroupPluginConfigurationUpdateStatus

org.rhq.core.domain.configuration.ConfigurationUpdateStatus updateGroupPluginConfigurationUpdateStatus(int groupPluginConfigurationUpdateId,
                                                                                                       String errorMessages)

deleteGroupPluginConfigurationUpdates

int deleteGroupPluginConfigurationUpdates(org.rhq.core.domain.auth.Subject subject,
                                          Integer resourceGroupId,
                                          Integer[] groupPluginConfigurationUpdateIds)

deleteGroupResourceConfigurationUpdates

int deleteGroupResourceConfigurationUpdates(org.rhq.core.domain.auth.Subject subject,
                                            Integer resourceGroupId,
                                            Integer[] groupResourceConfigurationUpdateIds)

updateGroupConfigurationUpdate

void updateGroupConfigurationUpdate(org.rhq.core.domain.configuration.group.AbstractGroupConfigurationUpdate groupUpdate)

deleteConfigurations

void deleteConfigurations(List<Integer> configurationIds)

deleteProperties

void deleteProperties(int[] propertyIds)

findResourceConfigurationUpdatesByParentId

org.rhq.core.domain.util.PageList<Integer> findResourceConfigurationUpdatesByParentId(int groupConfigurationUpdateId,
                                                                                      org.rhq.core.domain.util.PageControl pageControl)

getResourceConfigurationUpdateCountByParentId

long getResourceConfigurationUpdateCountByParentId(int groupConfigurationUpdateId)

executeResourceConfigurationUpdate

void executeResourceConfigurationUpdate(int updateId)

getGroupResourceConfigurationById

org.rhq.core.domain.configuration.group.GroupResourceConfigurationUpdate getGroupResourceConfigurationById(int configurationUpdateId)

getResourceConfigurationMapForGroupUpdate

Map<Integer,org.rhq.core.domain.configuration.Configuration> getResourceConfigurationMapForGroupUpdate(org.rhq.core.domain.auth.Subject subject,
                                                                                                       Integer groupResourceConfigurationUpdateId)

getResourceConfigurationsForCompatibleGroup

Map<Integer,org.rhq.core.domain.configuration.Configuration> getResourceConfigurationsForCompatibleGroup(org.rhq.core.domain.auth.Subject subject,
                                                                                                         int groupId)
                                                                                                         throws ConfigurationUpdateStillInProgressException,
                                                                                                                Exception
Returns the current Resource configurations for the members in the specified compatible group.

Parameters:
subject - the current subject
groupId - the id of the compatible group
Returns:
Throws:
ConfigurationUpdateInProgressException - if config updates, for the group or any member, are in progress,
Exception - if 1) one or more of the group's members are DOWN, or 2) we fail to retrieve one or more member live configs from the corresponding Agents
ConfigurationUpdateStillInProgressException

getPluginConfigurationsForCompatibleGroup

Map<Integer,org.rhq.core.domain.configuration.Configuration> getPluginConfigurationsForCompatibleGroup(org.rhq.core.domain.auth.Subject subject,
                                                                                                       int groupId)
                                                                                                       throws ConfigurationUpdateStillInProgressException,
                                                                                                              Exception
Throws:
ConfigurationUpdateStillInProgressException
Exception

getPluginConfigurationMapForGroupUpdate

Map<Integer,org.rhq.core.domain.configuration.Configuration> getPluginConfigurationMapForGroupUpdate(org.rhq.core.domain.auth.Subject subject,
                                                                                                     Integer groupPluginConfigurationUpdateId)

checkForTimedOutConfigurationUpdateRequests

void checkForTimedOutConfigurationUpdateRequests()
The purpose of this method is really to clean up requests when we detect they probably will never move out of the in-progress status. This will occur if the Agent dies before it has a chance to report success/failure. In that case, we'll never get an Agent completion message and the update request will remain in progress status forever. This method just tries to detect this scenario - if it finds an update request that has been in progress for a very long time, we assume we'll never hear from the Agent and time out that request (that is, set its status to FAILURE and set an error string that says the request timed out).


getConfiguration

org.rhq.core.domain.configuration.Configuration getConfiguration(org.rhq.core.domain.auth.Subject subject,
                                                                 int configurationId)

getGroupPluginConfigurationUpdate

org.rhq.core.domain.configuration.group.GroupPluginConfigurationUpdate getGroupPluginConfigurationUpdate(org.rhq.core.domain.auth.Subject subject,
                                                                                                         int configurationUpdateId)

getGroupResourceConfigurationUpdate

org.rhq.core.domain.configuration.group.GroupResourceConfigurationUpdate getGroupResourceConfigurationUpdate(org.rhq.core.domain.auth.Subject subject,
                                                                                                             int configurationUpdateId)

getPluginConfiguration

@Nullable
org.rhq.core.domain.configuration.Configuration getPluginConfiguration(org.rhq.core.domain.auth.Subject subject,
                                                                                int resourceId)
Get the current plugin configuration for the Resource with the given id, or null if the resource's plugin configuration is not yet initialized.

Parameters:
subject - the user who wants to see the information
resourceId - a Resource id
Returns:
the current plugin configuration for the Resource with the given id, or null if the resource's configuration is not yet initialized
Throws:
FetchException - TODO

getLatestPluginConfigurationUpdate

org.rhq.core.domain.configuration.PluginConfigurationUpdate getLatestPluginConfigurationUpdate(org.rhq.core.domain.auth.Subject subject,
                                                                                               int resourceId)
Get the latest plugin configuration for the Resource with the given id. Returns the configuration as it is known on the server-side in the database.

Parameters:
subject - the user who wants to see the information
resourceId - a Resource id
Returns:
the current plugin configuration (along with additional information about the configuration) for the Resource with the given id
Throws:
FetchException - TODO

getLatestResourceConfigurationUpdate

@Nullable
org.rhq.core.domain.configuration.ResourceConfigurationUpdate getLatestResourceConfigurationUpdate(org.rhq.core.domain.auth.Subject subject,
                                                                                                            int resourceId)
Get the latest resource configuration for the Resource with the given id, or null if the resource's configuration is not yet initialized and for some reason we can't get its current live configuration (e.g. in the case the agent or resource is down). Returns the configuration as it is known on the server-side in the database. The database will be sync'ed with the live values, if the currently live configuration is actually different than the latest configuration update found in history.

Parameters:
subject - the user who wants to see the information
resourceId - a Resource id
Returns:
the current configuration (along with additional information about the configuration) for the Resource with the given id, or null if the resource's configuration is not yet initialized and its live configuration could not be determined
Throws:
FetchException - TODO

getLatestResourceConfigurationUpdate

org.rhq.core.domain.configuration.ResourceConfigurationUpdate getLatestResourceConfigurationUpdate(org.rhq.core.domain.auth.Subject subject,
                                                                                                   int resourceId,
                                                                                                   boolean fromStructured)

isResourceConfigurationUpdateInProgress

boolean isResourceConfigurationUpdateInProgress(org.rhq.core.domain.auth.Subject subject,
                                                int resourceId)

isGroupResourceConfigurationUpdateInProgress

boolean isGroupResourceConfigurationUpdateInProgress(org.rhq.core.domain.auth.Subject subject,
                                                     int groupId)

isGroupPluginConfigurationUpdateInProgress

boolean isGroupPluginConfigurationUpdateInProgress(org.rhq.core.domain.auth.Subject subject,
                                                   int groupId)

scheduleGroupResourceConfigurationUpdate

int scheduleGroupResourceConfigurationUpdate(org.rhq.core.domain.auth.Subject subject,
                                             int compatibleGroupId,
                                             Map<Integer,org.rhq.core.domain.configuration.Configuration> newResourceConfigurationMap)

updatePluginConfiguration

org.rhq.core.domain.configuration.PluginConfigurationUpdate updatePluginConfiguration(org.rhq.core.domain.auth.Subject subject,
                                                                                      int resourceId,
                                                                                      org.rhq.core.domain.configuration.Configuration newConfiguration)
                                                                                      throws ResourceNotFoundException
Updates the plugin configuration used to connect and communicate with the resource. The given newConfiguration is usually a modified version of a configuration returned by getPluginConfiguration(Subject, int).

Parameters:
subject - the user who wants to see the information
resourceId - a Resource id
newConfiguration - the new plugin configuration
Returns:
the plugin configuration update item corresponding to this request
Throws:
ResourceNotFoundException

updateResourceConfiguration

@Nullable
org.rhq.core.domain.configuration.ResourceConfigurationUpdate updateResourceConfiguration(org.rhq.core.domain.auth.Subject subject,
                                                                                                   int resourceId,
                                                                                                   org.rhq.core.domain.configuration.Configuration newConfiguration)
                                                                                          throws ResourceNotFoundException,
                                                                                                 ConfigurationUpdateStillInProgressException
This method is called when a user has requested to change the resource configuration for an existing resource. If the user does not have the proper permissions to change the resource's configuration, an exception is thrown.

This will not wait for the agent to finish the configuration update. This will return after the request is sent. Once the agent finishes with the request, it will send the completed request information to completeResourceConfigurationUpdate(org.rhq.core.clientapi.server.configuration.ConfigurationUpdateResponse).

Parameters:
subject - the user who is requesting the update
resourceId - identifies the resource to be updated
newConfiguration - the resource's desired new configuration
Returns:
the resource configuration update item corresponding to this request. null if newConfiguration is equal to the existing configuration.
Throws:
ResourceNotFoundException
ConfigurationUpdateStillInProgressException

updateStructuredOrRawConfiguration

org.rhq.core.domain.configuration.ResourceConfigurationUpdate updateStructuredOrRawConfiguration(org.rhq.core.domain.auth.Subject subject,
                                                                                                 int resourceId,
                                                                                                 org.rhq.core.domain.configuration.Configuration newConfiguration,
                                                                                                 boolean fromStructured)
                                                                                                 throws ResourceNotFoundException,
                                                                                                        ConfigurationUpdateStillInProgressException
Throws:
ResourceNotFoundException
ConfigurationUpdateStillInProgressException

getResourceConfiguration

org.rhq.core.domain.configuration.Configuration getResourceConfiguration(org.rhq.core.domain.auth.Subject subject,
                                                                         int resourceId)

setResourceConfiguration

void setResourceConfiguration(int resourceId,
                              org.rhq.core.domain.configuration.Configuration configuration)
This method is called when the plugin container reports a new Resource configuration after an external change was detected.

Parameters:
resourceId - the Resource's id
configuration - the updated configuration

getPackageTypeConfigurationDefinition

org.rhq.core.domain.configuration.definition.ConfigurationDefinition getPackageTypeConfigurationDefinition(org.rhq.core.domain.auth.Subject subject,
                                                                                                           int packageTypeId)
See Also:
ConfigurationManagerRemote.getPackageTypeConfigurationDefinition(Subject,int)

translateResourceConfiguration

org.rhq.core.domain.configuration.Configuration translateResourceConfiguration(org.rhq.core.domain.auth.Subject subject,
                                                                               int resourceId,
                                                                               org.rhq.core.domain.configuration.Configuration configuration,
                                                                               boolean fromStructured)
                                                                               throws ResourceNotFoundException,
                                                                                      TranslationNotSupportedException
Throws:
ResourceNotFoundException
TranslationNotSupportedException

mergeConfiguration

org.rhq.core.domain.configuration.Configuration mergeConfiguration(org.rhq.core.domain.configuration.Configuration config)

findResourceConfigurationUpdatesByCriteria

org.rhq.core.domain.util.PageList<org.rhq.core.domain.configuration.ResourceConfigurationUpdate> findResourceConfigurationUpdatesByCriteria(org.rhq.core.domain.auth.Subject subject,
                                                                                                                                            org.rhq.core.domain.criteria.ResourceConfigurationUpdateCriteria criteria)

findPluginConfigurationUpdatesByCriteria

org.rhq.core.domain.util.PageList<org.rhq.core.domain.configuration.PluginConfigurationUpdate> findPluginConfigurationUpdatesByCriteria(org.rhq.core.domain.auth.Subject subject,
                                                                                                                                        org.rhq.core.domain.criteria.PluginConfigurationUpdateCriteria criteria)

findGroupResourceConfigurationUpdatesByCriteria

org.rhq.core.domain.util.PageList<org.rhq.core.domain.configuration.group.GroupResourceConfigurationUpdate> findGroupResourceConfigurationUpdatesByCriteria(org.rhq.core.domain.auth.Subject subject,
                                                                                                                                                            org.rhq.core.domain.criteria.GroupResourceConfigurationUpdateCriteria criteria)

findGroupPluginConfigurationUpdatesByCriteria

org.rhq.core.domain.util.PageList<org.rhq.core.domain.configuration.group.GroupPluginConfigurationUpdate> findGroupPluginConfigurationUpdatesByCriteria(org.rhq.core.domain.auth.Subject subject,
                                                                                                                                                        org.rhq.core.domain.criteria.GroupPluginConfigurationUpdateCriteria criteria)

getOptionsForConfigurationDefinition

org.rhq.core.domain.configuration.definition.ConfigurationDefinition getOptionsForConfigurationDefinition(org.rhq.core.domain.auth.Subject subject,
                                                                                                          org.rhq.core.domain.configuration.definition.ConfigurationDefinition def)


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