Interface ClientHeadersFactory

  • All Known Implementing Classes:
    DefaultClientHeadersFactoryImpl


    public interface ClientHeadersFactory
    This interface is intended for generating or propagating HTTP headers. It is invoked by the MP Rest Client implementation before invoking any entity providers on the outbound processing chain. It contains a single method, update which takes parameters of headers passed in from the incoming JAX-RS request (if applicable, if not, this will be an empty map) and a read-only map of headers specified by ClientHeaderParam or HeaderParam annotations on the client interface. This method should return a MultivaluedMap of headers to be merged with the outgoing headers. This will determine the final set of HTTP headers that will be sent to the outbound entity provider processing chain - thus any filters, MessageBodyWriters, interceptors, etc. could further refine the set of headers actually sent on the client request.
    Since:
    1.2
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> update​(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> incomingHeaders, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> clientOutgoingHeaders)
      Updates the HTTP headers to send to the remote service.
    • Method Detail

      • update

        javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> update​(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> incomingHeaders,
                                                                                  javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> clientOutgoingHeaders)
        Updates the HTTP headers to send to the remote service. Note that providers on the outbound processing chain could further update the headers.
        Parameters:
        incomingHeaders - - the map of headers from the inbound JAX-RS request. This will be an empty map if the associated client interface is not part of a JAX-RS request.
        clientOutgoingHeaders - - the read-only map of header parameters specified on the client interface.
        Returns:
        a map of HTTP headers to merge with the clientOutgoingHeaders to be sent to the remote service.