Class AmazonWebServicesClientProxy

java.lang.Object
software.amazon.cloudformation.proxy.AmazonWebServicesClientProxy
All Implemented Interfaces:
CallChain

public class AmazonWebServicesClientProxy
extends java.lang.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
  • Field Details

    • 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 Details

    • AmazonWebServicesClientProxy

      public AmazonWebServicesClientProxy​(LoggerProxy loggerProxy, Credentials credentials, java.util.function.Supplier<java.lang.Long> remainingTimeToExecute)
    • AmazonWebServicesClientProxy

      public AmazonWebServicesClientProxy​(LoggerProxy loggerProxy, Credentials credentials, java.util.function.Supplier<java.lang.Long> remainingTimeToExecute, DelayFactory override)
    • AmazonWebServicesClientProxy

      public AmazonWebServicesClientProxy​(LoggerProxy loggerProxy, Credentials credentials, DelayFactory override, WaitStrategy waitStrategy)
  • Method Details

    • newProxy

      public <ClientT> ProxyClient<ClientT> newProxy​(@Nonnull java.util.function.Supplier<ClientT> client)
    • newInitiator

      public <ClientT,​ ModelT,​ CallbackT extends StdCallbackContext> CallChain.Initiator<ClientT,​ModelT,​CallbackT> newInitiator​(@Nonnull java.util.function.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: CallChain
      factory method can created an CallChain.Initiator
      Specified by:
      newInitiator in interface CallChain
      Type Parameters:
      ClientT - Actual client e.g. KinesisClient.
      ModelT - The type (POJO) of Resource model.
      CallbackT - , callback context the extends StdCallbackContext
      Parameters:
      client - AWS Service Client. Recommend using Sync client as the framework handles interleaving as needed.
      model - the resource desired state model, usually
      context - 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​(java.lang.String callGraph, ProxyClient<ClientT> client, ModelT model, CallbackT cxt)
      Description copied from interface: CallChain
      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 as StdCallbackContext automated replay capabilities.
      Specified by:
      initiate in interface CallChain
      Type Parameters:
      ClientT - Actual client e.g. KinesisClient.
      ModelT - The type (POJO) of Resource model.
      CallbackT - , callback context the extends StdCallbackContext
      Parameters:
      callGraph - , the name of the service operation this call graph is about.
      client - , actual client needed to make the call wrapped inside ProxyClient to support injection of scoped credentials
      model - , 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.
    • injectCredentialsAndInvoke

      public <RequestT extends com.amazonaws.AmazonWebServiceRequest,​ ResultT extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata>> ResultT injectCredentialsAndInvoke​(RequestT request, java.util.function.Function<RequestT,​ResultT> requestFunction)
    • injectCredentialsAndInvokeV2

      public <RequestT extends software.amazon.awssdk.awscore.AwsRequest,​ ResultT extends software.amazon.awssdk.awscore.AwsResponse> ResultT injectCredentialsAndInvokeV2​(RequestT request, java.util.function.Function<RequestT,​ResultT> requestFunction)
    • injectCredentialsAndInvokeV2Async

      public <RequestT extends software.amazon.awssdk.awscore.AwsRequest,​ ResultT extends software.amazon.awssdk.awscore.AwsResponse> java.util.concurrent.CompletableFuture<ResultT> injectCredentialsAndInvokeV2Async​(RequestT request, java.util.function.Function<RequestT,​java.util.concurrent.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, java.util.function.Function<RequestT,​IterableT> requestFunction)
    • injectCredentialsAndInvokeV2InputStream

      public <RequestT extends software.amazon.awssdk.awscore.AwsRequest,​ ResultT extends software.amazon.awssdk.awscore.AwsResponse> software.amazon.awssdk.core.ResponseInputStream<ResultT> injectCredentialsAndInvokeV2InputStream​(RequestT request, java.util.function.Function<RequestT,​software.amazon.awssdk.core.ResponseInputStream<ResultT>> requestFunction)
    • injectCredentialsAndInvokeV2Bytes

      public <RequestT extends software.amazon.awssdk.awscore.AwsRequest,​ ResultT extends software.amazon.awssdk.awscore.AwsResponse> software.amazon.awssdk.core.ResponseBytes<ResultT> injectCredentialsAndInvokeV2Bytes​(RequestT request, java.util.function.Function<RequestT,​software.amazon.awssdk.core.ResponseBytes<ResultT>> requestFunction)
    • defaultHandler

      public <RequestT,​ ClientT,​ ModelT,​ CallbackT extends StdCallbackContext> ProgressEvent<ModelT,​CallbackT> defaultHandler​(RequestT request, java.lang.Exception e, ClientT client, ModelT model, CallbackT context) throws java.lang.Exception
      Throws:
      java.lang.Exception