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 TypeMethodDescriptionvoidBinds this connection to the givenSocket.voidclose()Closes this connection gracefully.voidCloses this process or endpoint and releases any system resources associated with it.getId()protected voidonRequestSubmitted(ClassicHttpRequest request) protected voidonResponseReceived(ClassicHttpResponse response) Methods inherited from class org.apache.hc.core5.http.impl.io.DefaultBHttpClientConnection
isConsistent, receiveResponseEntity, receiveResponseHeader, sendRequestEntity, sendRequestHeader, terminateRequestMethods 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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.hc.core5.http.io.BHttpConnection
flush, isDataAvailable, isStaleMethods inherited from interface org.apache.hc.core5.http.HttpConnection
getEndpointDetails, getLocalAddress, getProtocolVersion, getRemoteAddress, getSSLSession, isOpenMethods 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:
getIdin interfaceIdentifiable
-
close
Description copied from interface:HttpConnectionCloses 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. Useshutdowninstead.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceHttpConnection- Overrides:
closein classBHttpConnectionBase- Throws:
IOException
-
close
Description copied from interface:ModalCloseableCloses 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:
closein interfaceModalCloseable- Overrides:
closein classBHttpConnectionBase- Parameters:
closeMode- How to close the receiver.
-
bind
Description copied from class:BHttpConnectionBaseBinds 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:
bindin classDefaultBHttpClientConnection- Parameters:
socket- the socket.- Throws:
IOException- in case of an I/O error.
-
onResponseReceived
- Overrides:
onResponseReceivedin classDefaultBHttpClientConnection
-
onRequestSubmitted
- Overrides:
onRequestSubmittedin classDefaultBHttpClientConnection
-