Top Description Fields Constructors Methods
org.eclipse.microprofile.rest.client.ext

public Class DefaultClientHeadersFactoryImpl

extends Object
implements ClientHeadersFactory
Class Inheritance
All Implemented Interfaces
org.eclipse.microprofile.rest.client.ext.ClientHeadersFactory
Imports
java.util.Arrays, .Optional, java.util.logging.Level, .Logger, org.eclipse.microprofile.config.Config, .ConfigProvider, jakarta.ws.rs.core.MultivaluedHashMap, .MultivaluedMap

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

Modifier and TypeField and Description
private static final String
private static final Logger
public static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static Optional<Config>
private static Optional<String>
public MultivaluedMap<String, String>
update(MultivaluedMap<String, String>
- 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.
incomingHeaders
,
MultivaluedMap<String, String>
- the read-only map of header parameters specified on the client interface.
clientOutgoingHeaders
)

Implements org.eclipse.microprofile.rest.client.ext.ClientHeadersFactory.update.

Updates the HTTP headers to send to the remote service.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CLASS_NAMEback to summary
private static final String CLASS_NAME
LOGback to summary
private static final Logger LOG
PROPAGATE_PROPERTYback to summary
public static final String PROPAGATE_PROPERTY

Constructor Detail

DefaultClientHeadersFactoryImplback to summary
public DefaultClientHeadersFactoryImpl()

Method Detail

configback to summary
private static Optional<Config> config()
getHeadersPropertyback to summary
private static Optional<String> getHeadersProperty()
updateback to summary
public MultivaluedMap<String, String> update(MultivaluedMap<String, String> incomingHeaders, MultivaluedMap<String, String> clientOutgoingHeaders)

Implements org.eclipse.microprofile.rest.client.ext.ClientHeadersFactory.update.

Doc from org.eclipse.microprofile.rest.client.ext.ClientHeadersFactory.update.

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:MultivaluedMap<String, String>

- 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:MultivaluedMap<String, String>

- the read-only map of header parameters specified on the client interface.

Returns:MultivaluedMap<String, String>

a map of HTTP headers to merge with the clientOutgoingHeaders to be sent to the remote service.

Annotations
@Override