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
-
Method Summary
Modifier and TypeMethodDescriptionstatic GenericHttpFiltercreateLegacyFilter(HttpFilter bean, FilterOrder order) Create a legacy filter.static booleanisEnabled(GenericHttpFilter filter) Check if the filter is enabled.default booleanDeprecated, for removal: This API element is subject to removal in a future version.Not needed anymoredefault booleanDeprecated, for removal: This API element is subject to removal in a future version.Not needed anymorestatic GenericHttpFilterterminalFilter(Function<HttpRequest<?>, io.micronaut.core.execution.ExecutionFlow<MutableHttpResponse<?>>> fn) Create a terminal filter.static GenericHttpFilterterminalReactiveFilter(org.reactivestreams.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- TheHttpFilterbean.order- The order- Returns:
- new filter
- Since:
- 4.2.0
-
terminalFilter
@Internal static GenericHttpFilter terminalFilter(Function<HttpRequest<?>, io.micronaut.core.execution.ExecutionFlow<MutableHttpResponse<?>>> fn) Create a terminal filter.- Parameters:
fn- The function that supplierMutableHttpResponsefromHttpRequest.- Returns:
- new terminal filter
- Since:
- 4.2.0
-
terminalReactiveFilter
@Internal static GenericHttpFilter terminalReactiveFilter(org.reactivestreams.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
-