Interface CallChain.Stabilizer<RequestT,ResponseT,ClientT,ModelT,CallbackT extends StdCallbackContext>
- Type Parameters:
RequestT- , the web service request that was madeResponseT- the response or the fault (Exception) that needs to handledClientT- , the client that was used to invokeModelT- , the resource model object that we are currently working againstCallbackT- , the callback context that contains results
- All Superinterfaces:
CallChain.Completed<RequestT,,ResponseT, ClientT, ModelT, CallbackT> CallChain.Exceptional<RequestT,ResponseT, ClientT, ModelT, CallbackT>
- Enclosing interface:
- CallChain
public static interface CallChain.Stabilizer<RequestT,ResponseT,ClientT,ModelT,CallbackT extends StdCallbackContext>
extends CallChain.Exceptional<RequestT,ResponseT,ClientT,ModelT,CallbackT>
This provides an optional stabilization function to be incorporate before we
are done with the actual web service request. This is useful to ensure that
the web request created a resource that takes time to be live or available
before additional properties can be set on it. E.g. when one creates a
Kinesis stream is takes some time before the stream is active to do other
operations on it like set the retention period.
private Boolean isStreamActive(
CreateStreamRequest req,
CreateStreamResponse res,
ProxyClient<KinesisClient> client,
ResourceModel model,
CallbackContext cxt) {
DescribeStreamRequest r =
DescribeStreamRequest.builder().streamName(req.streamName()).build();
DescribeStreamResponse dr = client.injectCredentialsAndInvokeV2(
r, client.client()::describeStream);
StreamDescription description = dr.streamDescription();
model.setArn(description.streamARN()); return
(description.streamStatus() == StreamStatus.ACTIVE); } -
Method Summary
Methods inherited from interface software.amazon.cloudformation.proxy.CallChain.Completed
done, done, progress, progress, successMethods inherited from interface software.amazon.cloudformation.proxy.CallChain.Exceptional
exceptFilter, exceptHandler, handleError, retryErrorFilter
-
Method Details
-
stabilize
CallChain.Exceptional<RequestT,ResponseT, stabilizeClientT, ModelT, CallbackT> (CallChain.Callback<RequestT, ResponseT, ClientT, ModelT, CallbackT, Boolean> callback) - Parameters:
callback- , the stabilize predicate that is called several times to determine success.- Returns:
- true if the condition of stabilization has been meet else false.
-