Class PreferenceAppliedHeaderEmitter

java.lang.Object
org.gcube.informationsystem.resourceregistry.http.headers.preference.PreferenceAppliedHeaderEmitter

public final class PreferenceAppliedHeaderEmitter extends Object
Emits the Preference-Applied header for the honored OperationReturn preference of an Operation Envelope response.

Unlike X-Warning (open-ended cardinality) and X-Result-Scope (a bounded set of tokens), exactly one OperationReturn ever applies per request, so there is nothing to combine - this mirrors ResultScopeHeaderEmitter's shape without the multi-value handling.

Author:
Luca Frosini (ISTI - CNR)
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addPreferenceAppliedHeader(jakarta.ws.rs.core.MultivaluedMap<String,Object> headers, org.gcube.informationsystem.resourceregistry.api.rest.OperationReturn operationReturn)
    Emits the Preference-Applied header into the given JAX-RS multivalued map, if present.
    static void
    addPreferenceAppliedHeader(jakarta.ws.rs.core.Response.ResponseBuilder rb, org.gcube.informationsystem.resourceregistry.api.rest.OperationReturn operationReturn)
    Emits the Preference-Applied header into the given response builder, if present.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • addPreferenceAppliedHeader

      public static void addPreferenceAppliedHeader(jakarta.ws.rs.core.Response.ResponseBuilder rb, org.gcube.informationsystem.resourceregistry.api.rest.OperationReturn operationReturn)
      Emits the Preference-Applied header into the given response builder, if present.
      Parameters:
      rb - the response builder to add the header to
      operationReturn - the honored operation-return preference, or null
    • addPreferenceAppliedHeader

      public static void addPreferenceAppliedHeader(jakarta.ws.rs.core.MultivaluedMap<String,Object> headers, org.gcube.informationsystem.resourceregistry.api.rest.OperationReturn operationReturn)
      Emits the Preference-Applied header into the given JAX-RS multivalued map, if present.
      Parameters:
      headers - the multivalued headers map to add the header to
      operationReturn - the honored operation-return preference, or null