Package io.micronaut.http.client.filter
Class DefaultHttpClientFilterResolver
java.lang.Object
io.micronaut.http.filter.BaseFilterProcessor<ClientFilter>
io.micronaut.http.client.filter.DefaultHttpClientFilterResolver
- All Implemented Interfaces:
AnnotationProcessor<ClientFilter,
,ExecutableMethod<?, ?>> ExecutableMethodProcessor<ClientFilter>
,HttpClientFilterResolver<ClientFilterResolutionContext>
,HttpFilterResolver<ClientFilterResolutionContext>
@Internal
@Singleton
public class DefaultHttpClientFilterResolver
extends BaseFilterProcessor<ClientFilter>
implements HttpClientFilterResolver<ClientFilterResolutionContext>
Resolves filters for http clients.
- Since:
- 1.3.0
- Author:
- James Kleeh, graemerocher
-
Nested Class Summary
Nested classes/interfaces inherited from class io.micronaut.http.filter.BaseFilterProcessor
BaseFilterProcessor.FilterMetadata, BaseFilterProcessor.RequiresRequestBodyBinder<T>
Nested classes/interfaces inherited from interface io.micronaut.http.filter.HttpFilterResolver
HttpFilterResolver.FilterEntry
-
Constructor Summary
ConstructorDescriptionDefaultHttpClientFilterResolver
(BeanContext beanContext, AnnotationMetadataResolver annotationMetadataResolver, List<HttpClientFilter> legacyClientFilters) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addFilter
(Supplier<GenericHttpFilter> factory, AnnotationMetadata methodAnnotations, BaseFilterProcessor.FilterMetadata metadata) Add a filter.Resolves the initial list of filters.resolveFilters
(HttpRequest<?> request, List<HttpFilterResolver.FilterEntry> filterEntries) Returns which filters should apply for the given request.Methods inherited from class io.micronaut.http.filter.BaseFilterProcessor
prependContextPath, process
-
Constructor Details
-
DefaultHttpClientFilterResolver
public DefaultHttpClientFilterResolver(BeanContext beanContext, AnnotationMetadataResolver annotationMetadataResolver, List<HttpClientFilter> legacyClientFilters) Default constructor.- Parameters:
beanContext
- The bean contextannotationMetadataResolver
- The annotation metadata resolverlegacyClientFilters
- All client filters
-
-
Method Details
-
resolveFilterEntries
public List<HttpFilterResolver.FilterEntry> resolveFilterEntries(ClientFilterResolutionContext context) Description copied from interface:HttpFilterResolver
Resolves the initial list of filters.- Specified by:
resolveFilterEntries
in interfaceHttpFilterResolver<ClientFilterResolutionContext>
- Parameters:
context
- The context- Returns:
- The filters
-
resolveFilters
public List<GenericHttpFilter> resolveFilters(HttpRequest<?> request, List<HttpFilterResolver.FilterEntry> filterEntries) Description copied from interface:HttpFilterResolver
Returns which filters should apply for the given request.- Specified by:
resolveFilters
in interfaceHttpFilterResolver<ClientFilterResolutionContext>
- Parameters:
request
- The requestfilterEntries
- the filter entries- Returns:
- The list of filters
-
addFilter
protected void addFilter(Supplier<GenericHttpFilter> factory, AnnotationMetadata methodAnnotations, BaseFilterProcessor.FilterMetadata metadata) Description copied from class:BaseFilterProcessor
Add a filter. Called duringBaseFilterProcessor.process(BeanDefinition, ExecutableMethod)
.- Specified by:
addFilter
in classBaseFilterProcessor<ClientFilter>
- Parameters:
factory
- Factory that will create the filter instancemethodAnnotations
- Annotations on the filter methodmetadata
- Filter metadata from class and method annotations
-