Package org.apache.felix.http.base.internal.registry

# Class FilterRegistry

java.lang.Object
org.apache.felix.http.base.internal.registry.FilterRegistry

public final class FilterRegistry extends Object
The filter registry keeps track of all filter mappings for a single servlet context.

## Constructor Summary

Constructors
Constructor
Description
`FilterRegistry()`

## Method Summary

Modifier and Type
Method
Description
`void`
`addFilter(@NotNull FilterHandler handler)`
Add a filter.
`void`
`cleanup()`
`@NotNull FilterHandler[]`
`getFilterHandlers(@Nullable ServletHandler handler, @NotNull jakarta.servlet.DispatcherType dispatcherType, @NotNull String requestURI)`
Get all filters handling the request.
`void`
`getRuntimeInfo(org.osgi.service.servlet.runtime.dto.ServletContextDTO servletContextDTO, Collection<org.osgi.service.servlet.runtime.dto.FailedFilterDTO> failedFilterDTOs)`
Get the runtime information about filters
`void`
`removeFilter(@NotNull FilterInfo filterInfo, boolean destroy)`
Remove a filter

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### FilterRegistry

public FilterRegistry()

## Method Details

### addFilter

public void addFilter(@NotNull @NotNull FilterHandler handler)
Add a filter.

Parameters:
  `handler` - The handler for the filter

### removeFilter

public void removeFilter(@NotNull @NotNull FilterInfo filterInfo, boolean destroy)
Remove a filter

Parameters:
  `filterInfo` - The filter info
  `destroy` - boolean flag indicating whether to call destroy on the filter.

### cleanup

public void cleanup()

### getFilterHandlers

@NotNull public @NotNull FilterHandler[] getFilterHandlers(@Nullable @Nullable ServletHandler handler, @NotNull @NotNull jakarta.servlet.DispatcherType dispatcherType, @NotNull @NotNull String requestURI)
Get all filters handling the request. Filters are applied to the url and/or the servlet

Parameters:
  `handler` - Optional servlet handler
  `dispatcherType` - The dispatcher type
  `requestURI` - The request uri
Returns:
  The array of filter handlers, might be empty.

### getRuntimeInfo

public void getRuntimeInfo(org.osgi.service.servlet.runtime.dto.ServletContextDTO servletContextDTO, Collection<org.osgi.service.servlet.runtime.dto.FailedFilterDTO> failedFilterDTOs)
Get the runtime information about filters

Parameters:
  `servletContextDTO` - The servlet context DTO
  `failedFilterDTOs` - The collection holding the failed filters.