* @return an instance of ProvisioningActionResultInfo which contain the result of the review
* @throws AxisFault if an exception occurs while reviewing the specified provisionging action
*/
public ProvisioningActionResultInfo reviewProvisioningAction(ProvisioningActionInfo provActionInfo)
throws AxisFault {
ProfileModificationAction profModificationAction =
ProfileModificationActionFactory.getProfileModificationAction(provActionInfo.getActionType());
if (profModificationAction == null) {
handleException("Error occured while reviewing provisioning action",
"failed.review.prov.action");
}
if (log.isDebugEnabled()) {
log.debug("Reviewing the provisioning action: " + profModificationAction.getActionType());
}
ProvisioningActionResultInfo provisioningActionResultInfo = null;
try {
//Derive IInstallableUnits from the features to be installed. These are available in added repositories
IInstallableUnit[] repositoryIUs = ProvWSUtils.deriveRepositoryIUsFromFeatures(
provActionInfo.getFeaturesToInstall());
profModificationAction.setIusToInstall(repositoryIUs);
//Derive IInstallableUnits from the features to be uninstalled.
//These features are alread installed, hence available in the profile
IInstallableUnit[] profileIUs = ProvWSUtils.deriveProfileIUsFromFeatures(
provActionInfo.getFeaturesToUninstall());
profModificationAction.setIusToUninstall(profileIUs);
//This is required for revert operations.
profModificationAction.setTimestamp(provActionInfo.getTimestamp());
//Review the profile modifiation operation
ResolutionResult resolutionResult = profModificationAction.reviewProfileChangeAction(
ProvisioningUtils.getProfile());
//Wrap ResolutionResult so that it can be send through the wire.
provisioningActionResultInfo = ProvWSUtils.wrapResolutionResult(resolutionResult);
int severity = resolutionResult.getSummaryStatus().getSeverity();
if (severity == IStatus.ERROR) {
provisioningActionResultInfo.setProceedWithInstallation(false);
if (log.isDebugEnabled()) {
log.debug("Failed to proceed with the provisioning action due an error," +
resolutionResult.getSummaryReport());
}
} else {
provisioningActionResultInfo.setProceedWithInstallation(true);
ProvWSUtils.saveResolutionResult(profModificationAction.getActionType(), resolutionResult,
MessageContext.getCurrentMessageContext());
if (log.isDebugEnabled()) {
log.debug("Successfully reviewed the provisioning action");
}
}