@NotThreadSafe public class BHttpConnectionBase extends java.lang.Object implements org.apache.http.HttpConnection, org.apache.http.HttpInetConnection
HttpConnection implementations and provides
functionality common to both client and server HTTP connections.| Modifier | Constructor and Description |
|---|---|
protected |
BHttpConnectionBase(int buffersize,
int fragmentSizeHint,
java.nio.charset.CharsetDecoder chardecoder,
java.nio.charset.CharsetEncoder charencoder,
MessageConstraints constraints,
org.apache.http.entity.ContentLengthStrategy incomingContentStrategy,
org.apache.http.entity.ContentLengthStrategy outgoingContentStrategy)
Creates new instance of BHttpConnectionBase.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
awaitInput(int timeout) |
protected void |
bind(java.net.Socket socket)
Binds this connection to the given
Socket. |
void |
close() |
protected java.io.InputStream |
createInputStream(long len,
org.apache.http.io.SessionInputBuffer inbuffer) |
protected java.io.OutputStream |
createOutputStream(long len,
org.apache.http.io.SessionOutputBuffer outbuffer) |
protected void |
doFlush() |
protected void |
ensureOpen() |
java.net.InetAddress |
getLocalAddress() |
int |
getLocalPort() |
org.apache.http.HttpConnectionMetrics |
getMetrics() |
java.net.InetAddress |
getRemoteAddress() |
int |
getRemotePort() |
protected org.apache.http.io.SessionInputBuffer |
getSessionInputBuffer() |
protected org.apache.http.io.SessionOutputBuffer |
getSessionOutputBuffer() |
protected java.net.Socket |
getSocket() |
protected java.io.InputStream |
getSocketInputStream(java.net.Socket socket) |
protected java.io.OutputStream |
getSocketOutputStream(java.net.Socket socket) |
int |
getSocketTimeout() |
protected void |
incrementRequestCount() |
protected void |
incrementResponseCount() |
boolean |
isOpen() |
boolean |
isStale() |
protected org.apache.http.HttpEntity |
prepareInput(org.apache.http.HttpMessage message) |
protected java.io.OutputStream |
prepareOutput(org.apache.http.HttpMessage message) |
void |
setSocketTimeout(int timeout) |
void |
shutdown() |
java.lang.String |
toString() |
protected BHttpConnectionBase(int buffersize,
int fragmentSizeHint,
java.nio.charset.CharsetDecoder chardecoder,
java.nio.charset.CharsetEncoder charencoder,
MessageConstraints constraints,
org.apache.http.entity.ContentLengthStrategy incomingContentStrategy,
org.apache.http.entity.ContentLengthStrategy outgoingContentStrategy)
buffersize - buffer size. Must be a positive number.fragmentSizeHint - fragment size hint.chardecoder - decoder to be used for decoding HTTP protocol elements.
If null simple type cast will be used for byte to char conversion.charencoder - encoder to be used for encoding HTTP protocol elements.
If null simple type cast will be used for char to byte conversion.constraints - Message constraints. If null
MessageConstraints.DEFAULT will be used.incomingContentStrategy - incoming content length strategy. If null
LaxContentLengthStrategyHC4.INSTANCE will be used.outgoingContentStrategy - outgoing content length strategy. If null
StrictContentLengthStrategyHC4.INSTANCE will be used.protected void ensureOpen()
throws java.io.IOException
java.io.IOExceptionprotected java.io.InputStream getSocketInputStream(java.net.Socket socket)
throws java.io.IOException
java.io.IOExceptionprotected java.io.OutputStream getSocketOutputStream(java.net.Socket socket)
throws java.io.IOException
java.io.IOExceptionprotected void bind(java.net.Socket socket)
throws java.io.IOException
Socket. 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 isOpen() will return true.socket - the socket.java.io.IOException - in case of an I/O error.protected org.apache.http.io.SessionInputBuffer getSessionInputBuffer()
protected org.apache.http.io.SessionOutputBuffer getSessionOutputBuffer()
protected void doFlush()
throws java.io.IOException
java.io.IOExceptionpublic boolean isOpen()
isOpen in interface org.apache.http.HttpConnectionprotected java.net.Socket getSocket()
protected java.io.OutputStream createOutputStream(long len,
org.apache.http.io.SessionOutputBuffer outbuffer)
protected java.io.OutputStream prepareOutput(org.apache.http.HttpMessage message)
throws org.apache.http.HttpException
org.apache.http.HttpExceptionprotected java.io.InputStream createInputStream(long len,
org.apache.http.io.SessionInputBuffer inbuffer)
protected org.apache.http.HttpEntity prepareInput(org.apache.http.HttpMessage message)
throws org.apache.http.HttpException
org.apache.http.HttpExceptionpublic java.net.InetAddress getLocalAddress()
getLocalAddress in interface org.apache.http.HttpInetConnectionpublic int getLocalPort()
getLocalPort in interface org.apache.http.HttpInetConnectionpublic java.net.InetAddress getRemoteAddress()
getRemoteAddress in interface org.apache.http.HttpInetConnectionpublic int getRemotePort()
getRemotePort in interface org.apache.http.HttpInetConnectionpublic void setSocketTimeout(int timeout)
setSocketTimeout in interface org.apache.http.HttpConnectionpublic int getSocketTimeout()
getSocketTimeout in interface org.apache.http.HttpConnectionpublic void shutdown()
throws java.io.IOException
shutdown in interface org.apache.http.HttpConnectionjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface org.apache.http.HttpConnectionjava.io.IOExceptionprotected boolean awaitInput(int timeout)
throws java.io.IOException
java.io.IOExceptionpublic boolean isStale()
isStale in interface org.apache.http.HttpConnectionprotected void incrementRequestCount()
protected void incrementResponseCount()
public org.apache.http.HttpConnectionMetrics getMetrics()
getMetrics in interface org.apache.http.HttpConnectionpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 1999-2015 The Apache Software Foundation. All rights reserved.