Class AmazonWebServicesClientProxy
- java.lang.Object
-
- software.amazon.cloudformation.proxy.AmazonWebServicesClientProxy
-
- All Implemented Interfaces:
CallChain
public class AmazonWebServicesClientProxy extends Object implements CallChain
This implements the proxying mechanism to inject appropriate scoped credentials into a service call when making Amazon Webservice calls.- See Also:
CallChain,ProxyClient
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface software.amazon.cloudformation.proxy.CallChain
CallChain.Callback<RequestT,ResponseT,ClientT,ModelT,CallbackT extends StdCallbackContext,ReturnT>, CallChain.Caller<RequestT,ClientT,ModelT,CallbackT extends StdCallbackContext>, CallChain.Completed<RequestT,ResponseT,ClientT,ModelT,CallbackT extends StdCallbackContext>, CallChain.Exceptional<RequestT,ResponseT,ClientT,ModelT,CallbackT extends StdCallbackContext>, CallChain.ExceptionPropagate<RequestT,E extends Exception,ClientT,ModelT,CallbackT extends StdCallbackContext,ReturnT>, CallChain.Initiator<ClientT,ModelT,CallbackT extends StdCallbackContext>, CallChain.RequestMaker<ClientT,ModelT,CallbackT extends StdCallbackContext>, CallChain.Stabilizer<RequestT,ResponseT,ClientT,ModelT,CallbackT extends StdCallbackContext>
-
-
Field Summary
Fields Modifier and Type Field Description static intHTTP_STATUS_GONEstatic intHTTP_STATUS_NETWORK_AUTHN_REQUIRED
-
Constructor Summary
Constructors Constructor Description AmazonWebServicesClientProxy(boolean inHandshakeMode, LoggerProxy loggerProxy, Credentials credentials, Supplier<Long> remainingTimeToExecute, DelayFactory override)AmazonWebServicesClientProxy(LoggerProxy loggerProxy, Credentials credentials, Supplier<Long> remainingTimeToExecute)AmazonWebServicesClientProxy(LoggerProxy loggerProxy, Credentials credentials, Supplier<Long> remainingTimeToExecute, DelayFactory override)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <RequestT,ClientT,ModelT,CallbackT extends StdCallbackContext>
ProgressEvent<ModelT,CallbackT>defaultHandler(RequestT request, Exception e, ClientT client, ModelT model, CallbackT context)longgetRemainingTimeInMillis()<ClientT,ModelT,CallbackT extends StdCallbackContext>
CallChain.RequestMaker<ClientT,ModelT,CallbackT>initiate(String callGraph, ProxyClient<ClientT> client, ModelT model, CallbackT cxt)Each service call must be first initiated.<RequestT extends com.amazonaws.AmazonWebServiceRequest,ResultT extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata>>
ResultTinjectCredentialsAndInvoke(RequestT request, Function<RequestT,ResultT> requestFunction)<RequestT extends software.amazon.awssdk.awscore.AwsRequest,ResultT extends software.amazon.awssdk.awscore.AwsResponse,IterableT extends software.amazon.awssdk.core.pagination.sync.SdkIterable<ResultT>>
IterableTinjectCredentialsAndInvokeIterableV2(RequestT request, Function<RequestT,IterableT> requestFunction)<RequestT extends software.amazon.awssdk.awscore.AwsRequest,ResultT extends software.amazon.awssdk.awscore.AwsResponse>
ResultTinjectCredentialsAndInvokeV2(RequestT request, Function<RequestT,ResultT> requestFunction)<RequestT extends software.amazon.awssdk.awscore.AwsRequest,ResultT extends software.amazon.awssdk.awscore.AwsResponse>
CompletableFuture<ResultT>injectCredentialsAndInvokeV2Async(RequestT request, Function<RequestT,CompletableFuture<ResultT>> requestFunction)<ClientT,ModelT,CallbackT extends StdCallbackContext>
CallChain.Initiator<ClientT,ModelT,CallbackT>newInitiator(Supplier<ClientT> client, ModelT model, CallbackT context)<ClientT,ModelT,CallbackT extends StdCallbackContext>
CallChain.Initiator<ClientT,ModelT,CallbackT>newInitiator(ProxyClient<ClientT> client, ModelT model, CallbackT context)factory method can created anCallChain.Initiator<ClientT> ProxyClient<ClientT>newProxy(Supplier<ClientT> client)
-
-
-
Field Detail
-
HTTP_STATUS_NETWORK_AUTHN_REQUIRED
public static final int HTTP_STATUS_NETWORK_AUTHN_REQUIRED
- See Also:
- Constant Field Values
-
HTTP_STATUS_GONE
public static final int HTTP_STATUS_GONE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AmazonWebServicesClientProxy
public AmazonWebServicesClientProxy(LoggerProxy loggerProxy, Credentials credentials, Supplier<Long> remainingTimeToExecute)
-
AmazonWebServicesClientProxy
public AmazonWebServicesClientProxy(LoggerProxy loggerProxy, Credentials credentials, Supplier<Long> remainingTimeToExecute, DelayFactory override)
-
AmazonWebServicesClientProxy
public AmazonWebServicesClientProxy(boolean inHandshakeMode, LoggerProxy loggerProxy, Credentials credentials, Supplier<Long> remainingTimeToExecute, DelayFactory override)
-
-
Method Detail
-
newProxy
public <ClientT> ProxyClient<ClientT> newProxy(@Nonnull Supplier<ClientT> client)
-
newInitiator
public <ClientT,ModelT,CallbackT extends StdCallbackContext> CallChain.Initiator<ClientT,ModelT,CallbackT> newInitiator(@Nonnull Supplier<ClientT> client, ModelT model, CallbackT context)
-
newInitiator
public <ClientT,ModelT,CallbackT extends StdCallbackContext> CallChain.Initiator<ClientT,ModelT,CallbackT> newInitiator(ProxyClient<ClientT> client, ModelT model, CallbackT context)
Description copied from interface:CallChainfactory method can created anCallChain.Initiator- Specified by:
newInitiatorin interfaceCallChain- 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
public <ClientT,ModelT,CallbackT extends StdCallbackContext> CallChain.RequestMaker<ClientT,ModelT,CallbackT> initiate(String callGraph, ProxyClient<ClientT> client, ModelT model, CallbackT cxt)
Description copied from interface:CallChainEach 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.- Specified by:
initiatein interfaceCallChain- 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.
-
getRemainingTimeInMillis
public final long getRemainingTimeInMillis()
-
injectCredentialsAndInvoke
public <RequestT extends com.amazonaws.AmazonWebServiceRequest,ResultT extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata>> ResultT injectCredentialsAndInvoke(RequestT request, Function<RequestT,ResultT> requestFunction)
-
injectCredentialsAndInvokeV2
public <RequestT extends software.amazon.awssdk.awscore.AwsRequest,ResultT extends software.amazon.awssdk.awscore.AwsResponse> ResultT injectCredentialsAndInvokeV2(RequestT request, Function<RequestT,ResultT> requestFunction)
-
injectCredentialsAndInvokeV2Async
public <RequestT extends software.amazon.awssdk.awscore.AwsRequest,ResultT extends software.amazon.awssdk.awscore.AwsResponse> CompletableFuture<ResultT> injectCredentialsAndInvokeV2Async(RequestT request, Function<RequestT,CompletableFuture<ResultT>> requestFunction)
-
injectCredentialsAndInvokeIterableV2
public <RequestT extends software.amazon.awssdk.awscore.AwsRequest,ResultT extends software.amazon.awssdk.awscore.AwsResponse,IterableT extends software.amazon.awssdk.core.pagination.sync.SdkIterable<ResultT>> IterableT injectCredentialsAndInvokeIterableV2(RequestT request, Function<RequestT,IterableT> requestFunction)
-
defaultHandler
public <RequestT,ClientT,ModelT,CallbackT extends StdCallbackContext> ProgressEvent<ModelT,CallbackT> defaultHandler(RequestT request, Exception e, ClientT client, ModelT model, CallbackT context) throws Exception
- Throws:
Exception
-
-