Package io.servicetalk.http.api
Interface MultiAddressHttpClientFilterFactory<U>
-
- Type Parameters:
U
- the type of address before resolution (unresolved address).
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface MultiAddressHttpClientFilterFactory<U>
A factory forStreamingHttpClientFilter
to filter clients for different unresolved addresses.- See Also:
StreamingHttpClientFilterFactory
-
-
Method Summary
-
-
-
Method Detail
-
create
StreamingHttpClientFilter create(U address, FilterableStreamingHttpClient client)
Create aStreamingHttpClientFilter
for the passedaddress
using the providedFilterableStreamingHttpClient
.- Parameters:
address
- theUnresolvedAddress
for theFilterableStreamingHttpClient
client
- theFilterableStreamingHttpClient
to filter- Returns:
- the filtered
FilterableStreamingHttpClient
-
append
default MultiAddressHttpClientFilterFactory<U> append(MultiAddressHttpClientFilterFactory<U> before)
Returns a composed function that first applies thebefore
function to its input, and then applies this function to the result.The order of execution of these filters are in order of append. If 3 filters are added as follows:
filter1.append(filter2).append(filter3)
Making a request to a client wrapped by this filter chain the order of invocation of these filters will be:filter1 => filter2 => filter3 => client
- Parameters:
before
- the function to apply before this function is applied- Returns:
- a composed function that first applies the
before
function and then applies this function
-
asClientFilter
default StreamingHttpClientFilterFactory asClientFilter(U address)
Returns aStreamingHttpClientFilterFactory
that adapts from aMultiAddressHttpClientFilterFactory
.- Parameters:
address
- will be passed in allStreamingHttpClientFilterFactory
applications- Returns:
- a
StreamingHttpClientFilterFactory
function with a providedGroupKey
-
from
static <U> MultiAddressHttpClientFilterFactory<U> from(java.util.function.BiFunction<U,FilterableStreamingHttpClient,StreamingHttpClientFilter> function)
Returns a function that adapts from theUnaryOperator
<FilterableStreamingHttpClient
> function type to theMultiAddressHttpClientFilterFactory
.- Type Parameters:
U
- the type of address before resolution (unresolved address)- Parameters:
function
- the function that is applied to the inputGroupKey
andFilterableStreamingHttpClient
- Returns:
- the resulting
MultiAddressHttpClientFilterFactory
-
from
static <U> MultiAddressHttpClientFilterFactory<U> from(java.util.function.Function<FilterableStreamingHttpClient,StreamingHttpClientFilter> function)
Returns a function that adapts from aFunction
<FilterableStreamingHttpClient
,StreamingHttpClientFilter
> to theStreamingHttpClientFilterFactory
.- Type Parameters:
U
- the type of address before resolution (unresolved address)- Parameters:
function
- the function that is applied to the originalFilterableStreamingHttpClient
- Returns:
- A
StreamingHttpClientFilterFactory
that uses the passed filterFunction
.
-
-