Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #207 from josejulio/BZ-1309481
Browse files Browse the repository at this point in the history
Bug 1309481 - Remote API is missing ability to retrieve and revert hi…
  • Loading branch information
burmanm committed Feb 23, 2016
2 parents 9fa7c48 + 94e3588 commit 83535ef
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 44 deletions.
Expand Up @@ -31,6 +31,30 @@
<method>void purgeResourceConfigurationUpdates(*)</method>
<justification>Exposed to remote API https://bugzilla.redhat.com/show_bug.cgi?id=1155693</justification>
</difference>
<difference>
<className>org/rhq/enterprise/server/configuration/ConfigurationManagerRemote</className>
<differenceType>7012</differenceType> <!-- method added -->
<method>org.rhq.core.domain.util.PageList findPluginConfigurationUpdatesByCriteria(org.rhq.core.domain.auth.Subject, org.rhq.core.domain.criteria.PluginConfigurationUpdateCriteria)</method>
<justification>Exposed to remote API https://bugzilla.redhat.com/show_bug.cgi?id=1309481</justification>
</difference>
<difference>
<className>org/rhq/enterprise/server/configuration/ConfigurationManagerRemote</className>
<differenceType>7012</differenceType> <!-- method added -->
<method>org.rhq.core.domain.util.PageList findResourceConfigurationUpdatesByCriteria(org.rhq.core.domain.auth.Subject, org.rhq.core.domain.criteria.ResourceConfigurationUpdateCriteria)</method>
<justification>Exposed to remote API https://bugzilla.redhat.com/show_bug.cgi?id=1309481</justification>
</difference>
<difference>
<className>org/rhq/enterprise/server/configuration/ConfigurationManagerRemote</className>
<differenceType>7012</differenceType> <!-- method added -->
<method>void rollbackPluginConfiguration(org.rhq.core.domain.auth.Subject, int, int)</method>
<justification>Exposed to remote API https://bugzilla.redhat.com/show_bug.cgi?id=1309481</justification>
</difference>
<difference>
<className>org/rhq/enterprise/server/configuration/ConfigurationManagerRemote</className>
<differenceType>7012</differenceType> <!-- method added -->
<method>void rollbackResourceConfiguration(org.rhq.core.domain.auth.Subject, int, int)</method>
<justification>Exposed to remote API https://bugzilla.redhat.com/show_bug.cgi?id=1309481</justification>
</difference>
<difference>
<className>org/rhq/enterprise/server/bundle/BundleManagerRemote</className>
<differenceType>7012</differenceType> <!-- method added -->
Expand Down
Expand Up @@ -40,8 +40,6 @@
import org.rhq.core.domain.configuration.group.AbstractGroupConfigurationUpdate;
import org.rhq.core.domain.configuration.group.GroupPluginConfigurationUpdate;
import org.rhq.core.domain.configuration.group.GroupResourceConfigurationUpdate;
import org.rhq.core.domain.criteria.PluginConfigurationUpdateCriteria;
import org.rhq.core.domain.criteria.ResourceConfigurationUpdateCriteria;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.server.configuration.job.GroupPluginConfigurationUpdateJob;
Expand Down Expand Up @@ -126,42 +124,6 @@ PageList<ResourceConfigurationUpdate> findResourceConfigurationUpdates(Subject s
*/
ResourceConfigurationUpdate getResourceConfigurationUpdate(Subject subject, int configurationUpdateId);

/**
* 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.
*
* <p>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
* {@link #completeResourceConfigurationUpdate}.</p>
*
* @param subject the user who is requesting the update
* @param resourceId identifies the resource to be updated
* @param configHistoryId the id of the resource's previous configuration to rollback to
*
* @throws ConfigurationUpdateException if the configHistoryId does not exist
*/
void rollbackResourceConfiguration(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.
*
* <p>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
* {@link #completePluginConfigurationUpdate}.</p>
*
* @param subject the user who is requesting the update
* @param resourceId identifies the resource to be updated
* @param configHistoryId the id of the resource's previous configuration to rollback to
*
* @throws ConfigurationUpdateException if the configHistoryId does not exist
*/
void rollbackPluginConfiguration(Subject subject, int resourceId, int configHistoryId)
throws ConfigurationUpdateException;

/**
* For internal use only - do not call this method. This is for
* {@link #updateResourceConfiguration(Subject, int, Configuration)} to call with REQUIRES_NEW transaction scope so
Expand Down Expand Up @@ -373,12 +335,6 @@ ResourceConfigurationUpdate updateStructuredOrRawConfiguration(Subject subject,

Configuration mergeConfiguration(Configuration config);

PageList<ResourceConfigurationUpdate> findResourceConfigurationUpdatesByCriteria(Subject subject,
ResourceConfigurationUpdateCriteria criteria);

PageList<PluginConfigurationUpdate> findPluginConfigurationUpdatesByCriteria(Subject subject,
PluginConfigurationUpdateCriteria criteria);



ConfigurationDefinition getOptionsForConfigurationDefinition(Subject subject, int resourceId,
Expand Down
Expand Up @@ -33,6 +33,8 @@
import org.rhq.core.domain.configuration.group.GroupResourceConfigurationUpdate;
import org.rhq.core.domain.criteria.GroupPluginConfigurationUpdateCriteria;
import org.rhq.core.domain.criteria.GroupResourceConfigurationUpdateCriteria;
import org.rhq.core.domain.criteria.PluginConfigurationUpdateCriteria;
import org.rhq.core.domain.criteria.ResourceConfigurationUpdateCriteria;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.server.authz.PermissionException;
import org.rhq.enterprise.server.resource.ResourceNotFoundException;
Expand Down Expand Up @@ -342,4 +344,47 @@ Configuration translateResourceConfiguration(Subject subject, int resourceId, Co
* @since 4.14
*/
void purgePluginConfigurationUpdates(Subject subject, int[] configurationUpdateIds, boolean purgeInProgress);

/**
* 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.
*
* <p>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
* {@link #completeResourceConfigurationUpdate}.</p>
*
* @param subject the user who is requesting the update
* @param resourceId identifies the resource to be updated
* @param configHistoryId the id of the resource's previous configuration to rollback to
*
* @throws ConfigurationUpdateException if the configHistoryId does not exist
*/
void rollbackResourceConfiguration(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.
*
* <p>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
* {@link #completePluginConfigurationUpdate}.</p>
*
* @param subject the user who is requesting the update
* @param resourceId identifies the resource to be updated
* @param configHistoryId the id of the resource's previous configuration to rollback to
*
* @throws ConfigurationUpdateException if the configHistoryId does not exist
*/
void rollbackPluginConfiguration(Subject subject, int resourceId, int configHistoryId)
throws ConfigurationUpdateException;

PageList<ResourceConfigurationUpdate> findResourceConfigurationUpdatesByCriteria(Subject subject,
ResourceConfigurationUpdateCriteria criteria);

PageList<PluginConfigurationUpdate> findPluginConfigurationUpdatesByCriteria(Subject subject,
PluginConfigurationUpdateCriteria criteria);

}

0 comments on commit 83535ef

Please sign in to comment.