Class PreferenceAppliedResponseFilter

java.lang.Object
org.gcube.informationsystem.resourceregistry.rest.providers.PreferenceAppliedResponseFilter
All Implemented Interfaces:
jakarta.ws.rs.container.ContainerResponseFilter

@Provider public class PreferenceAppliedResponseFilter extends Object implements jakarta.ws.rs.container.ContainerResponseFilter
Global JAX-RS response filter that automatically extracts the accumulated OperationReturn preference from the current JAX-RS ContainerRequestContext properties and emits it as the Preference-Applied response header.

This filter uses a request property, automatically discarded and garbage-collected by the container at the end of the request cycle, making the process thread-safe and memory-leak free. Mirrors ResultScopeResponseFilter's mechanism exactly.

Author:
Luca Frosini (ISTI - CNR)
  • Constructor Details

    • PreferenceAppliedResponseFilter

      public PreferenceAppliedResponseFilter()
  • Method Details

    • filter

      public void filter(jakarta.ws.rs.container.ContainerRequestContext requestContext, jakarta.ws.rs.container.ContainerResponseContext responseContext) throws IOException
      Specified by:
      filter in interface jakarta.ws.rs.container.ContainerResponseFilter
      Throws:
      IOException