java.lang.Object
org.gcube.informationsystem.resourceregistry.http.headers.warning.WarningHeaderEmitter

public final class WarningHeaderEmitter extends Object
Emits X-Warning headers with anti-DoS capping and summary semantics.
Author:
Luca Frosini (ISTI - CNR)
  • Method Details

    • addWarningHeaders

      public static void addWarningHeaders(jakarta.ws.rs.core.Response.ResponseBuilder rb, List<ServiceWarning> warnings)
      Emits warnings as X-Warning headers. If warnings exceed the allowed cap, emits the first detail headers and one summary header.
      Parameters:
      rb - the response builder to add headers to
      warnings - the list of service warnings to emit
    • addWarningHeaders

      public static void addWarningHeaders(jakarta.ws.rs.core.MultivaluedMap<String,Object> headers, List<ServiceWarning> warnings)
      Emits warnings as X-Warning headers into the given JAX-RS multivalued map. If warnings exceed the allowed cap, emits the first detail headers and one summary header.
      Parameters:
      headers - the multivalued headers map to add warnings to
      warnings - the list of service warnings to emit