Interface CallChain
- All Known Implementing Classes:
AmazonWebServicesClientProxy
public interface CallChain
This can be used by Read, Create, Update and Delete handlers when invoking
AWS services. Each CallChain when invoking a service call explicitly provide
a call graph name. This name is used as a key prefix to memoize request,
responses and results in each call sequences. This
CallChain provides
a fluent API * design that ensure that right sequence of steps is followed
for making a service call.
Any service call should use AmazonWebServicesClientProxy. Here is the
minimum sequence for the calls.
- See Also:
AmazonWebServicesClientProxy
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceCallChain.Callback<RequestT,ResponseT,ClientT,ModelT,CallbackT extends StdCallbackContext,ReturnT>All service calls made will use the same call back interface for handling both exceptions as well as actual response received from the call.static interfaceCallChain.Caller<RequestT,ClientT,ModelT,CallbackT extends StdCallbackContext>This Encapsulates the actual Call to the service that is being made via caller.static interfaceCallChain.Completed<RequestT,ResponseT,ClientT,ModelT,CallbackT extends StdCallbackContext>One the call sequence has completed successfully, this is called to provide the progress event.static interfaceCallChain.Exceptional<RequestT,ResponseT,ClientT,ModelT,CallbackT extends StdCallbackContext>This provide the handler with the option to provide an explicit exception handler that would have service exceptions that was received.static interfaceCallChain.ExceptionPropagate<RequestT,E extends java.lang.Exception,ClientT,ModelT,CallbackT extends StdCallbackContext,ReturnT>When implementing this interface, developers can either propagate the exception as is.static interfaceCallChain.Initiator<ClientT,ModelT,CallbackT extends StdCallbackContext>Provides an API initiator interface that works for all API calls that need conversion, retry-backoff strategy, common exception handling and more against desired state of the resource and callback context.static interfaceCallChain.RequestMaker<ClientT,ModelT,CallbackT extends StdCallbackContext>This performs the translate step between the ModelT properties and what is needed for making the service call.static interfaceCallChain.Stabilizer<RequestT,ResponseT,ClientT,ModelT,CallbackT extends StdCallbackContext>This provides an optional stabilization function to be incorporate before we are done with the actual web service request. -
Method Summary
Modifier and Type Method Description <ClientT, ModelT, CallbackT extends StdCallbackContext>
CallChain.RequestMaker<ClientT,ModelT,CallbackT>initiate(java.lang.String callGraph, ProxyClient<ClientT> client, ModelT model, CallbackT cxt)Each service call must be first initiated.<ClientT, ModelT, CallbackT extends StdCallbackContext>
CallChain.Initiator<ClientT,ModelT,CallbackT>newInitiator(ProxyClient<ClientT> client, ModelT model, CallbackT context)factory method can created anCallChain.Initiator
-
Method Details
-
newInitiator
<ClientT, ModelT, CallbackT extends StdCallbackContext> CallChain.Initiator<ClientT,ModelT,CallbackT> newInitiator(ProxyClient<ClientT> client, ModelT model, CallbackT context)factory method can created anCallChain.Initiator- Type Parameters:
ClientT- Actual client e.g. KinesisClient.ModelT- The type (POJO) of Resource model.CallbackT- , callback context the extendsStdCallbackContext- Parameters:
client- AWS Service Client. Recommend using Sync client as the framework handles interleaving as needed.model- the resource desired state model, usuallycontext- callback context that tracks all outbound API calls- Returns:
- an instance of the
CallChain.Initiator
-
initiate
<ClientT, ModelT, CallbackT extends StdCallbackContext> CallChain.RequestMaker<ClientT,ModelT,CallbackT> initiate(java.lang.String callGraph, ProxyClient<ClientT> client, ModelT model, CallbackT cxt)Each service call must be first initiated. Every call is provided a separate name called call graph. This is eseential from both a tracing perspective as well asStdCallbackContextautomated replay capabilities.- Type Parameters:
ClientT- Actual client e.g. KinesisClient.ModelT- The type (POJO) of Resource model.CallbackT- , callback context the extendsStdCallbackContext- Parameters:
callGraph- , the name of the service operation this call graph is about.client- , actual client needed to make the call wrapped insideProxyClientto support injection of scoped credentialsmodel- , the actual resource model that defines the shape for setting up this resource type.cxt- , Callback context used for supporting replay and dedupe capabilities.- Returns:
- Provides the next logical set in the fluent API.
-