in aws-servicecatalog-serviceactionassociation/src/main/java/software/amazon/servicecatalog/serviceactionassociation/stabilizer/Stabilization.java [48:72]
public static ProgressEvent<ResourceModel, CallbackContext> handleDeleteStabilizeRequest(final ActionAssociationController actionController, final ResourceHandlerRequest<ResourceModel> request,
final CallbackContext callbackContext,
final Logger logger) {
final ResourceModel model = request.getDesiredResourceState();
if (callbackContext.getStabilizationRetriesRemaining() == 0) {
logger.log("Delete retries remaining zero");
throw new CfnNotStabilizedException(ResourceModel.TYPE_NAME, callbackContext.getServiceActionId());
}
try {
final boolean isMatch = actionController.isServiceActionAssociatedToPA(callbackContext.getProductId(), callbackContext.getProvisioningArtifactId(), callbackContext.getServiceActionId());
logger.log(String.format(DELETE_RETRIES, callbackContext.getStabilizationRetriesRemaining()));
if(isMatch){
return ProgressEvent.defaultInProgressHandler(
callbackContext.toBuilder()
.stabilizationRetriesRemaining(callbackContext.getStabilizationRetriesRemaining() - 1)
.build(),
POLL_RETRY_DELAY_SECONDS,
model);
} else {
return ProgressEvent.defaultSuccessHandler(null);
}
} catch (ResourceNotFoundException ex) {
throw new CfnNotFoundException(ResourceModel.TYPE_NAME, callbackContext.getServiceActionId(), ex);
}
}