Class RequestPipelineBuilder<InputT,OutputT>
java.lang.Object
software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder<InputT,OutputT>
- Type Parameters:
InputT- Currently configured input type to theRequestPipeline.OutputT- Currently configured output type to theRequestPipeline.
Builder for a
RequestPipeline.-
Method Summary
Modifier and TypeMethodDescriptionstatic <InputT,OutputT>
Function<HttpClientDependencies, RequestPipeline<CompletableFuture<InputT>, CompletableFuture<OutputT>>> async(Function<HttpClientDependencies, RequestPipeline<InputT, OutputT>> pipelineFactory) Convert a synchronousRequestPipelinefactory into a factory that produces a version of the RequestPipeline that accepts a CompletableFuture and returns a CompletableFuture.static <InputT,OutputT>
Function<HttpClientDependencies, RequestPipeline<CompletableFuture<InputT>, CompletableFuture<OutputT>>> async(Supplier<RequestPipeline<InputT, OutputT>> pipelineFactory) A version ofasync(Function)that takes aSupplierbuild(HttpClientDependencies dependencies) Construct theRequestPipelinewith the currently configured stages.static <InputT,OutputT>
RequestPipelineBuilder<InputT, OutputT> first(Function<HttpClientDependencies, RequestPipeline<InputT, OutputT>> pipelineFactory) Factory method to create aRequestPipelineBuilderwith an initial pipeline stage.static <InputT,OutputT>
RequestPipelineBuilder<InputT, OutputT> first(Supplier<RequestPipeline<InputT, OutputT>> pipelineFactory) Factory method to create aRequestPipelineBuilderwith an initial pipeline stage.<NewOutputT>
RequestPipelineBuilder<InputT, NewOutputT> then(Function<HttpClientDependencies, RequestPipeline<OutputT, NewOutputT>> pipelineFactory) Factory method to chain the currentRequestPipelineBuilderwith another pipeline stage.<NewOutputT>
RequestPipelineBuilder<InputT, NewOutputT> then(Supplier<RequestPipeline<OutputT, NewOutputT>> pipelineFactory) Factory method to chain the currentRequestPipelineBuilderwith another pipeline stage.<NewInputT,NewOutputT>
RequestPipelineBuilder<NewInputT, NewOutputT> wrappedWith(BiFunction<HttpClientDependencies, RequestPipeline<InputT, OutputT>, RequestPipeline<NewInputT, NewOutputT>> wrappedFactory) Factory method to wrap the currentRequestPipelineBuilderwith another pipeline stage.<NewInputT,NewOutputT>
RequestPipelineBuilder<NewInputT, NewOutputT> wrappedWith(Function<RequestPipeline<InputT, OutputT>, RequestPipeline<NewInputT, NewOutputT>> wrappedFactory) Factory method to wrap the currentRequestPipelineBuilderwith another pipeline stage.
-
Method Details
-
first
public static <InputT,OutputT> RequestPipelineBuilder<InputT,OutputT> first(Function<HttpClientDependencies, RequestPipeline<InputT, OutputT>> pipelineFactory) Factory method to create aRequestPipelineBuilderwith an initial pipeline stage. Stages in this pipeline will only be able to accept anHttpClientDependenciesorHttpClientDependencies.- Type Parameters:
InputT- Input type of pipelineOutputT- Output type of pipeline.- Parameters:
pipelineFactory- Factory that can produce aRequestPipeline. Should take anHttpClientDependenciesobject as the first parameter to the factory method.- Returns:
- RequestPipelineBuilder composed of that initial stage.
- See Also:
-
first
public static <InputT,OutputT> RequestPipelineBuilder<InputT,OutputT> first(Supplier<RequestPipeline<InputT, OutputT>> pipelineFactory) Factory method to create aRequestPipelineBuilderwith an initial pipeline stage. Stages in this pipeline will only be able to accept anHttpClientDependenciesorHttpClientDependencies.- Type Parameters:
InputT- Input type of pipelineOutputT- Output type of pipeline.- Parameters:
pipelineFactory- Factory that can produce aRequestPipeline. Use this overload when the factory does not needHttpClientDependenciesand should instead take no arguments.- Returns:
- RequestPipelineBuilder composed of that initial stage.
- See Also:
-
then
public <NewOutputT> RequestPipelineBuilder<InputT,NewOutputT> then(Function<HttpClientDependencies, RequestPipeline<OutputT, NewOutputT>> pipelineFactory) Factory method to chain the currentRequestPipelineBuilderwith another pipeline stage. The new stage's input type must match the current stage's output type. The new stage may define a new output type (if it's transforming the type) or may define the same output type as the current stage.- Type Parameters:
NewOutputT- New output type of pipeline- Parameters:
pipelineFactory- Factory that can produce aRequestPipeline. Should take anHttpClientDependenciesobject as the first parameter to the factory method.- Returns:
- A new RequestPipelineBuilder composed of the previous stages and the new stage.
- See Also:
-
async
public static <InputT,OutputT> Function<HttpClientDependencies,RequestPipeline<CompletableFuture<InputT>, asyncCompletableFuture<OutputT>>> (Function<HttpClientDependencies, RequestPipeline<InputT, OutputT>> pipelineFactory) Convert a synchronousRequestPipelinefactory into a factory that produces a version of the RequestPipeline that accepts a CompletableFuture and returns a CompletableFuture.- Type Parameters:
InputT- the input type of the originalRequestPipelineOutputT- the return type of the originalRequestPipeline- Parameters:
pipelineFactory- the delegate pipeline factory to wrap- Returns:
- the wrapped
RequestPipelinefactory
-
async
public static <InputT,OutputT> Function<HttpClientDependencies,RequestPipeline<CompletableFuture<InputT>, asyncCompletableFuture<OutputT>>> (Supplier<RequestPipeline<InputT, OutputT>> pipelineFactory) A version ofasync(Function)that takes aSupplier- See Also:
-
then
public <NewOutputT> RequestPipelineBuilder<InputT,NewOutputT> then(Supplier<RequestPipeline<OutputT, NewOutputT>> pipelineFactory) Factory method to chain the currentRequestPipelineBuilderwith another pipeline stage. The new stage's input type must match the current stage's output type. The new stage may define a new output type (if it's transforming the type) or may define the same output type as the current stage.- Type Parameters:
NewOutputT- New output type of pipeline- Parameters:
pipelineFactory- Factory that can produce aRequestPipeline. Use this overload when the factory does not needHttpClientDependenciesand should instead take no arguments.- Returns:
- A new RequestPipelineBuilder composed of the previous stages and the new stage.
- See Also:
-
wrappedWith
public <NewInputT,NewOutputT> RequestPipelineBuilder<NewInputT,NewOutputT> wrappedWith(BiFunction<HttpClientDependencies, RequestPipeline<InputT, OutputT>, RequestPipeline<NewInputT, NewOutputT>> wrappedFactory) Factory method to wrap the currentRequestPipelineBuilderwith another pipeline stage. The argument to wrap is a factory that takes anHttpClientDependenciesobject and a innerRequestPipeline(the current one being built) as arguments and produces a newRequestPipelinefor the wrapper. The wrapper may have entirely different input and output types, typically it will have the same however.- Type Parameters:
NewOutputT- New output type of pipeline- Parameters:
wrappedFactory-BiFunctionfactory that can produce aRequestPipeline. The arguments to the factory will beHttpClientDependenciesand an innerRequestPipeline.- Returns:
- A new RequestPipelineBuilder that wraps around the pipeline currently being constructed.
- See Also:
-
wrappedWith
public <NewInputT,NewOutputT> RequestPipelineBuilder<NewInputT,NewOutputT> wrappedWith(Function<RequestPipeline<InputT, OutputT>, RequestPipeline<NewInputT, NewOutputT>> wrappedFactory) Factory method to wrap the currentRequestPipelineBuilderwith another pipeline stage. The argument is a factory that takes an innerRequestPipeline(the current one being built) as an argument and produces a newRequestPipelinefor the wrapper. The wrapper may have entirely different input and output types, typically it will have the same however.- Type Parameters:
NewOutputT- New output type of pipeline- Parameters:
wrappedFactory-Functionfactory that can produce aRequestPipeline. The argument to the factory will be an innerRequestPipeline.- Returns:
- A new RequestPipelineBuilder that wraps around the pipeline currently being constructed.
- See Also:
-
build
Construct theRequestPipelinewith the currently configured stages.- Parameters:
dependencies-HttpClientDependenciesto supply to factory methods that are interested in it.- Returns:
- Constructed
RequestPipeline. - See Also:
-