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

    • HTTP_STATUS_NETWORK_AUTHN_REQUIRED

      public static final int HTTP_STATUS_NETWORK_AUTHN_REQUIRED
      See Also:
    • HTTP_STATUS_GONE

      public static final int HTTP_STATUS_GONE
      See Also:
  • Constructor Details

  • Method Details

    • 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: 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(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, Function<RequestT,ResultT> requestFunction)
    • injectCredentialsAndInvoke

      public <RequestT extends com.amazonaws.AmazonWebServiceRequest> void injectCredentialsAndInvoke(RequestT request, Consumer<RequestT> 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)
    • 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, 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, Function<RequestT,software.amazon.awssdk.core.ResponseBytes<ResultT>> 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