in aws-rds-dbproxy/src/main/java/software/amazon/rds/dbproxy/DeleteHandler.java [43:82]
private ProgressEvent<ResourceModel, CallbackContext> deleteProxyAndUpdateProgress(ResourceModel model,
CallbackContext callbackContext) {
if (callbackContext.getStabilizationRetriesRemaining() == 0) {
throw new RuntimeException(TIMED_OUT_MESSAGE);
}
if (callbackContext.getProxy() == null) {
try {
return ProgressEvent.<ResourceModel, CallbackContext>builder()
.resourceModel(model)
.status(OperationStatus.IN_PROGRESS)
.callbackContext(CallbackContext.builder()
.proxy(deleteProxy(model.getDBProxyName()))
.stabilizationRetriesRemaining(Constants.NUMBER_OF_STATE_POLL_RETRIES)
.build())
.build();
} catch (DBProxyNotFoundException e) {
return ProgressEvent.defaultFailureHandler(e, HandlerErrorCode.NotFound);
}
} else if (callbackContext.isDeleted()) {
return ProgressEvent.<ResourceModel, CallbackContext>builder()
.status(OperationStatus.SUCCESS)
.build();
} else {
try {
Thread.sleep(Constants.POLL_RETRY_DELAY_IN_MS);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
return ProgressEvent.<ResourceModel, CallbackContext>builder()
.resourceModel(model)
.status(OperationStatus.IN_PROGRESS)
.callbackContext(CallbackContext.builder()
.proxy(callbackContext.getProxy())
.deleted(!doesProxyExist(model.getDBProxyName()))
.stabilizationRetriesRemaining(callbackContext.getStabilizationRetriesRemaining() - 1)
.build())
.build();
}
}