Package io.micronaut.http.filter
Interface GenericHttpFilter
public sealed interface GenericHttpFilter
Base interface for different filter types. Note that while the base interface is exposed, so you
can pass around instances of these filters, the different implementations are internal only.
- Since:
- 4.0.0
- Author:
- Jonas Konrad
-
Method Summary
Modifier and TypeMethodDescriptionstatic GenericHttpFilter
createLegacyFilter
(HttpFilter bean, FilterOrder order) Create a legacy filter.static boolean
isEnabled
(GenericHttpFilter filter) Check if the filter is enabled.default boolean
Deprecated, for removal: This API element is subject to removal in a future version.Not needed anymoredefault boolean
Deprecated, for removal: This API element is subject to removal in a future version.Not needed anymorestatic GenericHttpFilter
Create a terminal filter.static GenericHttpFilter
terminalReactiveFilter
(Publisher<? extends HttpResponse<?>> responsePublisher) Create a terminal reactive filter.
-
Method Details
-
isSuspended
Deprecated, for removal: This API element is subject to removal in a future version.Not needed anymoreWhen the filter is using the continuation it needs to be suspended and wait for the response.- Returns:
- true if suspended
-
isFiltersException
Deprecated, for removal: This API element is subject to removal in a future version.Not needed anymore- Returns:
- true if the filter can receive the processing exception.
-
createLegacyFilter
Create a legacy filter.- Parameters:
bean
- TheHttpFilter
bean.order
- The order- Returns:
- new filter
- Since:
- 4.2.0
-
terminalFilter
@Internal static GenericHttpFilter terminalFilter(Function<HttpRequest<?>, ExecutionFlow<MutableHttpResponse<?>>> fn) Create a terminal filter.- Parameters:
fn
- The function that supplierMutableHttpResponse
fromHttpRequest
.- Returns:
- new terminal filter
- Since:
- 4.2.0
-
terminalReactiveFilter
@Internal static GenericHttpFilter terminalReactiveFilter(Publisher<? extends HttpResponse<?>> responsePublisher) Create a terminal reactive filter.- Parameters:
responsePublisher
- The response publisher- Returns:
- new terminal filter
- Since:
- 4.2.0
-
isEnabled
Check if the filter is enabled.- Parameters:
filter
- The filter- Returns:
- true if enabled
- Since:
- 4.2.0
-