protected ProgressEvent handleRequest()

in aws-logs-destination/src/main/java/software/amazon/logs/destination/UpdateHandler.java [19:41]


    protected ProgressEvent<ResourceModel, CallbackContext> handleRequest(final AmazonWebServicesClientProxy proxy,
            final ResourceHandlerRequest<ResourceModel> request,
            final CallbackContext callbackContext,
            final ProxyClient<CloudWatchLogsClient> proxyClient,
            final Logger logger) {
        final ResourceModel model = request.getDesiredResourceState();

        return ProgressEvent.progress(model, callbackContext)
                .then(progress -> preCreateCheck(proxy, callbackContext, proxyClient, model).done((response) -> {
                    if (isDestinationListNullOrEmpty(response)) {
                        return ProgressEvent.defaultFailureHandler(new CfnNotFoundException(ResourceModel.TYPE_NAME,
                                model.getPrimaryIdentifier()
                                        .toString()), HandlerErrorCode.NotFound);
                    }
                    return ProgressEvent.progress(model, callbackContext);
                }))
                .then(progress -> putDestination(proxy, callbackContext, proxyClient, model, DESTINATION_UPDATE_GRAPH,
                        logger, Action.UPDATE))
                .then(progress -> putDestinationPolicy(proxy, callbackContext, proxyClient, model,
                        DESTINATION_POLICY_UPDATE_GRAPH, logger, Action.UPDATE))
                .then(progress -> new ReadHandler().handleRequest(proxy, request, callbackContext, proxyClient,
                        logger));
    }