in aws-memorydb-acl/src/main/java/software/amazon/memorydb/acl/BaseHandlerStd.java [53:85]
protected abstract ProgressEvent<ResourceModel, CallbackContext> handleRequest(
final AmazonWebServicesClientProxy proxy,
final ResourceHandlerRequest<ResourceModel> request,
final CallbackContext callbackContext,
final ProxyClient<MemoryDbClient> proxyClient,
final Logger logger);
protected boolean isAclStabilized(
final ProxyClient<MemoryDbClient> proxyClient,
final ResourceModel model,
Logger logger) {
logger.log("isACLStabilized");
try {
final Optional<ACL> acl =
proxyClient.injectCredentialsAndInvokeV2(
Translator.translateToReadRequest(model), proxyClient.client()::describeACLs
).acLs().stream().findFirst();
if (!acl.isPresent()) {
throw AclNotFoundException.builder().build();
}
logger.log("Stable status: " + acl.get().name() + " " + acl.get().status());
return "ACTIVE".equalsIgnoreCase(acl.get().status());
} catch (AclNotFoundException e) {
throw new CfnNotFoundException(ResourceModel.TYPE_NAME, e.getMessage());
} catch (Exception e) {
logger.log(
e.toString() + " " + e.getMessage() + " " + e.getCause() + "\n" + Throwables.getStackTraceAsString(e));
throw new CfnNotStabilizedException(MESSAGE_FORMAT_FAILED_TO_STABILIZE, model.getACLName(), e);
}
}