Class ResultScopeResponseFilter
java.lang.Object
org.gcube.informationsystem.resourceregistry.rest.providers.ResultScopeResponseFilter
- All Implemented Interfaces:
jakarta.ws.rs.container.ContainerResponseFilter
@Provider
public class ResultScopeResponseFilter
extends Object
implements jakarta.ws.rs.container.ContainerResponseFilter
Global JAX-RS response filter that automatically extracts accumulated
ResultScope
tokens from the current JAX-RS ContainerRequestContext properties and emits them
as a single combined X-Result-Scope response header.
If ResultScope.PREVIOUS_PATH is present, it also emits the
X-Resolved-Context-Path header carrying the resolved Context's current path.
This filter uses request properties, which are automatically discarded and garbage-collected
by the container at the end of the request cycle, making the process completely thread-safe
and memory-leak free. Mirrors WarningResponseFilter's mechanism exactly.
- Author:
- Luca Frosini (ISTI - CNR)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfilter(jakarta.ws.rs.container.ContainerRequestContext requestContext, jakarta.ws.rs.container.ContainerResponseContext responseContext)
-
Constructor Details
-
ResultScopeResponseFilter
public ResultScopeResponseFilter()
-
-
Method Details
-
filter
public void filter(jakarta.ws.rs.container.ContainerRequestContext requestContext, jakarta.ws.rs.container.ContainerResponseContext responseContext) throws IOException - Specified by:
filterin interfacejakarta.ws.rs.container.ContainerResponseFilter- Throws:
IOException
-