Class ProxyInterceptorBuilder
- java.lang.Object
-
- io.vertx.rxjava3.httpproxy.ProxyInterceptorBuilder
-
- All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate
public class ProxyInterceptorBuilder extends Object implements io.vertx.lang.rx.RxDelegate
>Builder class for a customizable interceptor capable of transforming HTTP request/response head attributes (headers, path, query params) as well as transforming the HTTP body.
Head transformation methods can be invoked multiple times. Operations on the path will be invoked in the order of configuration, that goes for operations on request headers, response headers and query parameters.Body transformation can be achieved with
transformingResponseBody(io.vertx.rxjava3.httpproxy.BodyTransformer)
andtransformingRequestBody(io.vertx.rxjava3.httpproxy.BodyTransformer)
. Body transformation buffer the body content and then applies a transforming function before sending the response.NOTE: This class has been automatically generated from the
original
non RX-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static io.vertx.lang.rx.TypeArg<ProxyInterceptorBuilder>
__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description ProxyInterceptorBuilder(ProxyInterceptorBuilder delegate)
ProxyInterceptorBuilder(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ProxyInterceptorBuilder
addingPathPrefix(String prefix)
Add a prefix to the URI.ProxyInterceptor
build()
boolean
equals(Object o)
ProxyInterceptorBuilder
filteringRequestHeaders(Set<CharSequence> forbiddenRequestHeaders)
Filter the request headers in the given set.ProxyInterceptorBuilder
filteringResponseHeaders(Set<CharSequence> forbiddenResponseHeaders)
Filter the response headers in the given set.ProxyInterceptorBuilder
getDelegate()
int
hashCode()
static ProxyInterceptorBuilder
newInstance(ProxyInterceptorBuilder arg)
ProxyInterceptorBuilder
removingPathPrefix(String prefix)
Remove a prefix to the URI.ProxyInterceptorBuilder
removingQueryParam(String name)
Remove a query parameter from the request.ProxyInterceptorBuilder
settingQueryParam(String name, String value)
Add a query parameter to the request.String
toString()
ProxyInterceptorBuilder
transformingPath(Function<String,String> mutator)
Apply a callback to change the request URI when the proxy receives it.ProxyInterceptorBuilder
transformingQueryParams(Handler<MultiMap> updater)
Apply modifications to the query parameters.ProxyInterceptorBuilder
transformingRequestBody(BodyTransformer requestTransformer)
Apply a transformation to change the request body when the proxy receives it.ProxyInterceptorBuilder
transformingRequestHeaders(Handler<MultiMap> requestHeadersUpdater)
Apply callbacks to change the request headers when the proxy receives them.ProxyInterceptorBuilder
transformingResponseBody(BodyTransformer responseTransformer)
Apply a transformation to change the response body when the proxy receives it.ProxyInterceptorBuilder
transformingResponseHeaders(Handler<MultiMap> responseHeadersUpdater)
Apply callbacks to change the response headers when the proxy receives them.
-
-
-
Field Detail
-
__TYPE_ARG
public static final io.vertx.lang.rx.TypeArg<ProxyInterceptorBuilder> __TYPE_ARG
-
-
Constructor Detail
-
ProxyInterceptorBuilder
public ProxyInterceptorBuilder(ProxyInterceptorBuilder delegate)
-
ProxyInterceptorBuilder
public ProxyInterceptorBuilder(Object delegate)
-
-
Method Detail
-
getDelegate
public ProxyInterceptorBuilder getDelegate()
- Specified by:
getDelegate
in interfaceio.vertx.lang.rx.RxDelegate
-
build
public ProxyInterceptor build()
- Returns:
- the proxy interceptor build according to builder requirements
-
transformingQueryParams
public ProxyInterceptorBuilder transformingQueryParams(Handler<MultiMap> updater)
Apply modifications to the query parameters.- Parameters:
updater
- the operation to apply to the request query parameters (can be null, but in this case nothing happens)- Returns:
- a reference to this, so the API can be used fluently
-
settingQueryParam
public ProxyInterceptorBuilder settingQueryParam(String name, String value)
Add a query parameter to the request.- Parameters:
name
- the parameter name (can be null, but in this case nothing happens)value
- the parameter value (can be null, but in this case nothing happens)- Returns:
- a reference to this, so the API can be used fluently
-
removingQueryParam
public ProxyInterceptorBuilder removingQueryParam(String name)
Remove a query parameter from the request.- Parameters:
name
- the parameter name (can be null, but in this case nothing happens)- Returns:
- a reference to this, so the API can be used fluently
-
transformingPath
public ProxyInterceptorBuilder transformingPath(Function<String,String> mutator)
Apply a callback to change the request URI when the proxy receives it.- Parameters:
mutator
- the operation that applied to the path (can be null, but in this case nothing happens)- Returns:
- a reference to this, so the API can be used fluently
-
addingPathPrefix
public ProxyInterceptorBuilder addingPathPrefix(String prefix)
Add a prefix to the URI.- Parameters:
prefix
- the prefix that need to be added (can be null, but in this case nothing happens)- Returns:
- a reference to this, so the API can be used fluently
-
removingPathPrefix
public ProxyInterceptorBuilder removingPathPrefix(String prefix)
Remove a prefix to the URI. Do nothing if it doesn't exist.- Parameters:
prefix
- the prefix that need to be removed (can be null, but in this case nothing happens)- Returns:
- a reference to this, so the API can be used fluently
-
transformingRequestHeaders
public ProxyInterceptorBuilder transformingRequestHeaders(Handler<MultiMap> requestHeadersUpdater)
Apply callbacks to change the request headers when the proxy receives them.- Parameters:
requestHeadersUpdater
- the operation to apply to the request headers (can be null, but in this case nothing happens)- Returns:
- a reference to this, so the API can be used fluently
-
transformingResponseHeaders
public ProxyInterceptorBuilder transformingResponseHeaders(Handler<MultiMap> responseHeadersUpdater)
Apply callbacks to change the response headers when the proxy receives them.- Parameters:
responseHeadersUpdater
- the operation to apply to the response headers (can be null, but in this case nothing happens)- Returns:
- a reference to this, so the API can be used fluently
-
transformingRequestBody
public ProxyInterceptorBuilder transformingRequestBody(BodyTransformer requestTransformer)
Apply a transformation to change the request body when the proxy receives it.
The interceptor fully buffers the request body and then applies the transformation.
- Parameters:
requestTransformer
- the operation to apply to the request body- Returns:
- the created interceptor
-
transformingResponseBody
public ProxyInterceptorBuilder transformingResponseBody(BodyTransformer responseTransformer)
Apply a transformation to change the response body when the proxy receives it.
The interceptor fully buffers the response body and then applies the transformation.
- Parameters:
responseTransformer
- the operation to apply to the response body- Returns:
- the created interceptor
-
filteringRequestHeaders
public ProxyInterceptorBuilder filteringRequestHeaders(Set<CharSequence> forbiddenRequestHeaders)
Filter the request headers in the given set.- Parameters:
forbiddenRequestHeaders
- a set of the headers that need to be filtered (can be null, but in this case nothing happens)- Returns:
- a reference to this, so the API can be used fluently
-
filteringResponseHeaders
public ProxyInterceptorBuilder filteringResponseHeaders(Set<CharSequence> forbiddenResponseHeaders)
Filter the response headers in the given set.- Parameters:
forbiddenResponseHeaders
- a set of the headers that need to be filtered (can be null, but in this case nothing happens)- Returns:
- a reference to this, so the API can be used fluently
-
newInstance
public static ProxyInterceptorBuilder newInstance(ProxyInterceptorBuilder arg)
-
-