|
25 | 25 | * a fluent API * design that ensure that right sequence of steps is followed |
26 | 26 | * for making a service call. |
27 | 27 | * |
28 | | - * {@code |
29 | | - * public class CreateHandler extends BaseHandler<CallbackContext> { |
30 | | - * |
31 | | - * @Override public ProgressEvent<ResourceModel, CallbackContext> handleRequest( |
32 | | - * final AmazonWebServicesClientProxy proxy, final |
33 | | - * ResourceHandlerRequest<ResourceModel> request, final CallbackContext |
34 | | - * callbackContext, final Logger logger) { |
35 | | - * |
36 | | - * final ProxyClient<KinesisClient> client = |
37 | | - * proxy.newProxy(KinesisClient::create); final ResourceModel model = |
38 | | - * request.getDesiredResourceState(); ProgressEvent<ResourceModel, |
39 | | - * CallbackContext> created = proxy.initiate( "kinesis:CreateStream", client, |
40 | | - * model, callbackContext) |
41 | | - * |
42 | | - * // // create request for a new stream // .request( (m) -> |
43 | | - * CreateStreamRequest.builder() .streamName(m.getName()) |
44 | | - * .shardCount(m.getShardCount()).build() ) |
45 | | - * |
46 | | - * // // Making the call via injection of credentials to make scoped credentials |
47 | | - * work // .call((r, c) -> c.injectCredentialsAndInvokeV2(r, |
48 | | - * c.client()::createStream)) |
49 | | - * |
50 | | - * // // Currently any failure to stabilize will be propagated over as failure |
51 | | - * to create. This means that // there is a likely hood that the stream could |
52 | | - * have been created but we timed out. Any attempt to re-create // this resource |
53 | | - * will fail with an already exists stream name. The stabiliserCreate provides |
54 | | - * the // ARN in the model (side effect, maybe change model later to be |
55 | | - * functional) from the describe calls. // So exceptions during stabilizes with |
56 | | - * report event with FAILED, but the model has the ARN to // indicate successful |
57 | | - * creation. So CFN can call us back with DELETE correctly. // IMP: if we do not |
58 | | - * have read permissions during create, this will fail causing the resources to |
59 | | - * // leak. // .stabilize( new Delay.Exponential(2, 2^5, TimeUnit.SECONDS), |
60 | | - * this::stabilizeCreate) .done(CallChain.Callback.progress()); |
61 | | - * |
62 | | - * } } } |
63 | 28 | * |
64 | 29 | * Any service call should use {@link AmazonWebServicesClientProxy}. Here is the |
65 | 30 | * minimum sequence for the calls. |
@@ -196,9 +161,8 @@ interface Exceptional<RequestT, ResponseT, ClientT, ModelT, CallbackT extends St |
196 | 161 | * @param handler, a lambda expression that take the web request, response, |
197 | 162 | * client, model and context and says continue or fail operation by |
198 | 163 | * providing the appropriate {@link ProgressEvent} back. |
199 | | - * @return {@link ProgressEvent#getStatus()} is |
200 | | - * {@link OperationStatus#IN_PROGRESS} we will attempt another retry. |
201 | | - * Otherwise failure is propagated. |
| 164 | + * @return If status is {@link OperationStatus#IN_PROGRESS} we will attempt |
| 165 | + * another retry. Otherwise failure is propagated. |
202 | 166 | */ |
203 | 167 | Completed<RequestT, ResponseT, ClientT, ModelT, CallbackT> exceptHandler(Callback<? super RequestT, Exception, ClientT, |
204 | 168 | ModelT, CallbackT, ProgressEvent<ModelT, CallbackT>> handler); |
|
0 commit comments