Package net.shibboleth.shared.httpclient

# Class RequestConnectionClose

java.lang.Object
net.shibboleth.shared.httpclient.RequestConnectionClose

All Implemented Interfaces:
  `org.apache.hc.core5.http.HttpRequestInterceptor`

public class RequestConnectionClose extends Object implements org.apache.hc.core5.http.HttpRequestInterceptor
Adds a `Connection: close` to all HTTP/1.1 requests.

This interceptor essentially disables connection keep-alive support and, by virtue of the server closing the connection, prevents a `HttpClientConnectionManager` from holding open and reusing connections. If you'd like to allow the `HttpClientConnectionManager` to hold open connections for a while and potentially reuse them, consider using `HttpClientBuilder.setEvictIdleConnections(boolean)` and `HttpClientBuilder.setConnectionMaxIdleTime(java.time.Duration)` to limit the amount of time the connections are held open.

## Field Summary

Fields
Modifier and Type
Field
Description
`(package private) static final org.slf4j.Logger`
`LOG`
Logger.

## Constructor Summary

Constructors
Constructor
Description
`RequestConnectionClose()`

## Method Summary

Modifier and Type
Method
Description
`void`
`process(org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.EntityDetails entity, org.apache.hc.core5.http.protocol.HttpContext context)`

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

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

## Field Details

### LOG

@Nonnull static final org.slf4j.Logger LOG
Logger.

## Constructor Details

### RequestConnectionClose

public RequestConnectionClose()

## Method Details

### process

public void process(org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.EntityDetails entity, org.apache.hc.core5.http.protocol.HttpContext context) throws org.apache.hc.core5.http.HttpException, IOException

Specified by:
  `process` in interface `org.apache.hc.core5.http.HttpRequestInterceptor`
Throws:
  `org.apache.hc.core5.http.HttpException`
  `IOException`