Class LoggingBHttpClientConnection
java.lang.Object
org.apache.hc.core5.http.impl.io.BHttpConnectionBase
org.apache.hc.core5.http.impl.io.DefaultBHttpClientConnection
org.apache.hc.core5.testing.classic.LoggingBHttpClientConnection
- All Implemented Interfaces:
Closeable
,AutoCloseable
,HttpConnection
,BHttpConnection
,HttpClientConnection
,SocketModalCloseable
,ModalCloseable
,Identifiable
public class LoggingBHttpClientConnection
extends DefaultBHttpClientConnection
implements Identifiable
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLoggingBHttpClientConnection
(Http1Config http1Config) LoggingBHttpClientConnection
(Http1Config http1Config, CharsetDecoder charDecoder, CharsetEncoder charEncoder, ContentLengthStrategy incomingContentStrategy, ContentLengthStrategy outgoingContentStrategy, HttpMessageWriterFactory<ClassicHttpRequest> requestWriterFactory, HttpMessageParserFactory<ClassicHttpResponse> responseParserFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Binds this connection to the givenSocket
.void
close()
Closes this connection gracefully.void
Closes this process or endpoint and releases any system resources associated with it.getId()
protected void
onRequestSubmitted
(ClassicHttpRequest request) protected void
onResponseReceived
(ClassicHttpResponse response) Methods inherited from class org.apache.hc.core5.http.impl.io.DefaultBHttpClientConnection
isConsistent, receiveResponseEntity, receiveResponseHeader, sendRequestEntity, sendRequestHeader, terminateRequest
Methods inherited from class org.apache.hc.core5.http.impl.io.BHttpConnectionBase
awaitInput, bind, createContentInputStream, createContentOutputStream, ensureOpen, flush, getEndpointDetails, getLocalAddress, getProtocolVersion, getRemoteAddress, getSocketHolder, getSocketTimeout, getSSLSession, incrementRequestCount, incrementResponseCount, isDataAvailable, isOpen, isStale, setSocketTimeout, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.hc.core5.http.io.BHttpConnection
flush, isDataAvailable, isStale
Methods inherited from interface org.apache.hc.core5.http.HttpConnection
getEndpointDetails, getLocalAddress, getProtocolVersion, getRemoteAddress, getSSLSession, isOpen
Methods inherited from interface org.apache.hc.core5.http.SocketModalCloseable
getSocketTimeout, setSocketTimeout
-
Field Details
-
COUNT
-
id
-
log
private final org.slf4j.Logger log -
headerLog
private final org.slf4j.Logger headerLog -
wire
-
-
Constructor Details
-
LoggingBHttpClientConnection
public LoggingBHttpClientConnection(Http1Config http1Config, CharsetDecoder charDecoder, CharsetEncoder charEncoder, ContentLengthStrategy incomingContentStrategy, ContentLengthStrategy outgoingContentStrategy, HttpMessageWriterFactory<ClassicHttpRequest> requestWriterFactory, HttpMessageParserFactory<ClassicHttpResponse> responseParserFactory) -
LoggingBHttpClientConnection
-
-
Method Details
-
getId
- Specified by:
getId
in interfaceIdentifiable
-
close
Description copied from interface:HttpConnection
Closes this connection gracefully. This method will attempt to flush the internal output buffer prior to closing the underlying socket. This method MUST NOT be called from a different thread to force shutdown of the connection. Useshutdown
instead.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceHttpConnection
- Overrides:
close
in classBHttpConnectionBase
- Throws:
IOException
-
close
Description copied from interface:ModalCloseable
Closes this process or endpoint and releases any system resources associated with it. If the endpoint or the process is already closed then invoking this method has no effect.- Specified by:
close
in interfaceModalCloseable
- Overrides:
close
in classBHttpConnectionBase
- Parameters:
closeMode
- How to close the receiver.
-
bind
Description copied from class:BHttpConnectionBase
Binds this connection to the givenSocket
. This socket will be used by the connection to send and receive data.After this method's execution the connection status will be reported as open and the
BHttpConnectionBase.isOpen()
will returntrue
.- Overrides:
bind
in classDefaultBHttpClientConnection
- Parameters:
socket
- the socket.- Throws:
IOException
- in case of an I/O error.
-
onResponseReceived
- Overrides:
onResponseReceived
in classDefaultBHttpClientConnection
-
onRequestSubmitted
- Overrides:
onRequestSubmitted
in classDefaultBHttpClientConnection
-