Package org.eclipse.jetty.client
Class HttpConnection
- java.lang.Object
-
- org.eclipse.jetty.client.HttpConnection
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,Connection
,Attachable
- Direct Known Subclasses:
HttpConnectionOverHTTP.Delegate
public abstract class HttpConnection extends java.lang.Object implements Connection, Attachable
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object
attachment
private HttpDestination
destination
private int
idleTimeoutGuard
private long
idleTimeoutStamp
private static Logger
LOG
-
Constructor Summary
Constructors Modifier Constructor Description protected
HttpConnection(HttpDestination destination)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private void
applyProxyAuthentication(Request request, ProxyConfiguration.Proxy proxy)
private void
applyRequestAuthentication(Request request)
private java.lang.StringBuilder
convertCookies(java.util.List<java.net.HttpCookie> cookies, java.lang.StringBuilder builder)
java.lang.Object
getAttachment()
HttpClient
getHttpClient()
HttpDestination
getHttpDestination()
protected void
normalizeRequest(Request request)
boolean
onIdleTimeout(long idleTimeout)
void
send(Request request, Response.CompleteListener listener)
Sends a request with an associated response listener.protected SendFailure
send(HttpChannel channel, HttpExchange exchange)
protected abstract SendFailure
send(HttpExchange exchange)
void
setAttachment(java.lang.Object obj)
Attaches the given object to this stream for later retrieval.java.lang.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.client.api.Connection
close, isClosed
-
-
-
-
Field Detail
-
LOG
private static final Logger LOG
-
destination
private final HttpDestination destination
-
attachment
private java.lang.Object attachment
-
idleTimeoutGuard
private int idleTimeoutGuard
-
idleTimeoutStamp
private long idleTimeoutStamp
-
-
Constructor Detail
-
HttpConnection
protected HttpConnection(HttpDestination destination)
-
-
Method Detail
-
getHttpClient
public HttpClient getHttpClient()
-
getHttpDestination
public HttpDestination getHttpDestination()
-
send
public void send(Request request, Response.CompleteListener listener)
Description copied from interface:Connection
Sends a request with an associated response listener.Request.send(Response.CompleteListener)
will eventually call this method to send the request. It is exposed to allow applications to send requests via unpooled connections.- Specified by:
send
in interfaceConnection
- Parameters:
request
- the request to sendlistener
- the response listener
-
send
protected abstract SendFailure send(HttpExchange exchange)
-
normalizeRequest
protected void normalizeRequest(Request request)
-
convertCookies
private java.lang.StringBuilder convertCookies(java.util.List<java.net.HttpCookie> cookies, java.lang.StringBuilder builder)
-
applyRequestAuthentication
private void applyRequestAuthentication(Request request)
-
applyProxyAuthentication
private void applyProxyAuthentication(Request request, ProxyConfiguration.Proxy proxy)
-
send
protected SendFailure send(HttpChannel channel, HttpExchange exchange)
-
onIdleTimeout
public boolean onIdleTimeout(long idleTimeout)
-
setAttachment
public void setAttachment(java.lang.Object obj)
Description copied from interface:Attachable
Attaches the given object to this stream for later retrieval.- Specified by:
setAttachment
in interfaceAttachable
- Parameters:
obj
- the object to attach to this instance
-
getAttachment
public java.lang.Object getAttachment()
- Specified by:
getAttachment
in interfaceAttachable
- Returns:
- the object attached to this instance
- See Also:
Attachable.setAttachment(Object)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-