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 synchronousRequestPipeline
factory 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 aSupplier
build
(HttpClientDependencies dependencies) Construct theRequestPipeline
with the currently configured stages.static <InputT,
OutputT>
RequestPipelineBuilder<InputT, OutputT> first
(Function<HttpClientDependencies, RequestPipeline<InputT, OutputT>> pipelineFactory) Factory method to create aRequestPipelineBuilder
with an initial pipeline stage.static <InputT,
OutputT>
RequestPipelineBuilder<InputT, OutputT> first
(Supplier<RequestPipeline<InputT, OutputT>> pipelineFactory) Factory method to create aRequestPipelineBuilder
with an initial pipeline stage.<NewOutputT>
RequestPipelineBuilder<InputT, NewOutputT> then
(Function<HttpClientDependencies, RequestPipeline<OutputT, NewOutputT>> pipelineFactory) Factory method to chain the currentRequestPipelineBuilder
with another pipeline stage.<NewOutputT>
RequestPipelineBuilder<InputT, NewOutputT> then
(Supplier<RequestPipeline<OutputT, NewOutputT>> pipelineFactory) Factory method to chain the currentRequestPipelineBuilder
with another pipeline stage.<NewInputT,
NewOutputT>
RequestPipelineBuilder<NewInputT, NewOutputT> wrappedWith
(BiFunction<HttpClientDependencies, RequestPipeline<InputT, OutputT>, RequestPipeline<NewInputT, NewOutputT>> wrappedFactory) Factory method to wrap the currentRequestPipelineBuilder
with another pipeline stage.<NewInputT,
NewOutputT>
RequestPipelineBuilder<NewInputT, NewOutputT> wrappedWith
(Function<RequestPipeline<InputT, OutputT>, RequestPipeline<NewInputT, NewOutputT>> wrappedFactory) Factory method to wrap the currentRequestPipelineBuilder
with another pipeline stage.
-
Method Details
-
first
public static <InputT,OutputT> RequestPipelineBuilder<InputT,OutputT> first(Function<HttpClientDependencies, RequestPipeline<InputT, OutputT>> pipelineFactory) Factory method to create aRequestPipelineBuilder
with an initial pipeline stage. Stages in this pipeline will only be able to accept anHttpClientDependencies
orHttpClientDependencies
.- Type Parameters:
InputT
- Input type of pipelineOutputT
- Output type of pipeline.- Parameters:
pipelineFactory
- Factory that can produce aRequestPipeline
. Should take anHttpClientDependencies
object 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 aRequestPipelineBuilder
with an initial pipeline stage. Stages in this pipeline will only be able to accept anHttpClientDependencies
orHttpClientDependencies
.- 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 needHttpClientDependencies
and 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 currentRequestPipelineBuilder
with 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 anHttpClientDependencies
object 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 synchronousRequestPipeline
factory 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 originalRequestPipeline
OutputT
- the return type of the originalRequestPipeline
- Parameters:
pipelineFactory
- the delegate pipeline factory to wrap- Returns:
- the wrapped
RequestPipeline
factory
-
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 currentRequestPipelineBuilder
with 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 needHttpClientDependencies
and 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 currentRequestPipelineBuilder
with another pipeline stage. The argument to wrap is a factory that takes anHttpClientDependencies
object and a innerRequestPipeline
(the current one being built) as arguments and produces a newRequestPipeline
for 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
-BiFunction
factory that can produce aRequestPipeline
. The arguments to the factory will beHttpClientDependencies
and 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 currentRequestPipelineBuilder
with another pipeline stage. The argument is a factory that takes an innerRequestPipeline
(the current one being built) as an argument and produces a newRequestPipeline
for 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
-Function
factory 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 theRequestPipeline
with the currently configured stages.- Parameters:
dependencies
-HttpClientDependencies
to supply to factory methods that are interested in it.- Returns:
- Constructed
RequestPipeline
. - See Also:
-