Package org.eclipse.microprofile.rest.client.ext

# Class DefaultClientHeadersFactoryImpl

java.lang.Object
org.eclipse.microprofile.rest.client.ext.DefaultClientHeadersFactoryImpl

All Implemented Interfaces:
  `ClientHeadersFactory`

public class DefaultClientHeadersFactoryImpl extends Object implements ClientHeadersFactory
This class propagates Jakarta RESTful Web Services headers whose names are specified using the MicroProfile Config property, `org.eclipse.microprofile.rest.client.propagateHeaders`.

The value of this property should be a comma-separated list of HTTP header names. If the headers specified in the property exist in the inbound Jakarta RESTful Web Services request, this class will propagate those headers to the outbound Rest Client request.

Any headers present on `clientOutgoingHeaders` will not be returned when calling the `update` method.

Since:
  1.2

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`PROPAGATE_PROPERTY`

## Constructor Summary

Constructors
Constructor
Description
`DefaultClientHeadersFactoryImpl()`

## Method Summary

Modifier and Type
Method
Description
`jakarta.ws.rs.core.MultivaluedMap<String,String>`
`update(jakarta.ws.rs.core.MultivaluedMap<String,String> incomingHeaders, jakarta.ws.rs.core.MultivaluedMap<String,String> clientOutgoingHeaders)`
Updates the HTTP headers to send to the remote service.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### PROPAGATE_PROPERTY

public static final String PROPAGATE_PROPERTY

See Also:
  - Constant Field Values

## Constructor Details

### DefaultClientHeadersFactoryImpl

public DefaultClientHeadersFactoryImpl()

## Method Details

### update

public jakarta.ws.rs.core.MultivaluedMap<String,String> update(jakarta.ws.rs.core.MultivaluedMap<String,String> incomingHeaders, jakarta.ws.rs.core.MultivaluedMap<String,String> clientOutgoingHeaders)
Description copied from interface: `ClientHeadersFactory`
Updates the HTTP headers to send to the remote service. Note that providers on the outbound processing chain could further update the headers.

Specified by:
  `update` in interface `ClientHeadersFactory`
Parameters:
  `incomingHeaders` - - the map of headers from the inbound Jakarta RESTful Web Services request. This will be an empty map if the associated client interface is not part of a Jakarta RESTful Web Services 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.