Package org.eclipse.jetty.client
Class HttpExchange
- java.lang.Object
-
- org.eclipse.jetty.client.HttpExchange
-
- All Implemented Interfaces:
CyclicTimeouts.Expirable
public class HttpExchange extends java.lang.Object implements CyclicTimeouts.Expirable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classHttpExchange.State
-
Field Summary
Fields Modifier and Type Field Description private HttpChannel_channelprivate HttpDestinationdestinationprivate java.util.List<Response.ResponseListener>listenersprivate static LoggerLOGprivate HttpRequestrequestprivate java.lang.ThrowablerequestFailureprivate HttpExchange.StaterequestStateprivate HttpResponseresponseprivate java.lang.ThrowableresponseFailureprivate HttpExchange.StateresponseState
-
Constructor Summary
Constructors Constructor Description HttpExchange(HttpDestination destination, HttpRequest request, java.util.List<Response.ResponseListener> listeners)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanabort(java.lang.Throwable failure)(package private) booleanassociate(HttpChannel channel)Associates the givenchannelto this exchange.private booleancompleteRequest(java.lang.Throwable failure)private booleancompleteResponse(java.lang.Throwable failure)(package private) voiddisassociate(HttpChannel channel)HttpConversationgetConversation()longgetExpireNanoTime()Returns the expiration time in nanoseconds.private HttpChannelgetHttpChannel()HttpRequestgetRequest()java.lang.ThrowablegetRequestFailure()HttpResponsegetResponse()java.lang.ThrowablegetResponseFailure()java.util.List<Response.ResponseListener>getResponseListeners()private voidnotifyFailureComplete(java.lang.Throwable failure)voidproceed(java.lang.Throwable failure)booleanrequestComplete(java.lang.Throwable failure)voidresetResponse()booleanresponseComplete(java.lang.Throwable failure)ResultterminateRequest()ResultterminateResponse()java.lang.StringtoString()
-
-
-
Field Detail
-
LOG
private static final Logger LOG
-
destination
private final HttpDestination destination
-
request
private final HttpRequest request
-
listeners
private final java.util.List<Response.ResponseListener> listeners
-
response
private final HttpResponse response
-
requestState
private HttpExchange.State requestState
-
responseState
private HttpExchange.State responseState
-
_channel
private HttpChannel _channel
-
requestFailure
private java.lang.Throwable requestFailure
-
responseFailure
private java.lang.Throwable responseFailure
-
-
Constructor Detail
-
HttpExchange
public HttpExchange(HttpDestination destination, HttpRequest request, java.util.List<Response.ResponseListener> listeners)
-
-
Method Detail
-
getConversation
public HttpConversation getConversation()
-
getRequest
public HttpRequest getRequest()
-
getRequestFailure
public java.lang.Throwable getRequestFailure()
-
getResponseListeners
public java.util.List<Response.ResponseListener> getResponseListeners()
-
getResponse
public HttpResponse getResponse()
-
getResponseFailure
public java.lang.Throwable getResponseFailure()
-
getExpireNanoTime
public long getExpireNanoTime()
Description copied from interface:CyclicTimeouts.ExpirableReturns the expiration time in nanoseconds.
The value to return must be calculated taking into account
System.nanoTime(), for example:expireNanoTime = System.nanoTime() + timeoutNanosReturning
Long.MAX_VALUEindicates that this entity does not expire.- Specified by:
getExpireNanoTimein interfaceCyclicTimeouts.Expirable- Returns:
- the expiration time in nanoseconds, or
Long.MAX_VALUEif this entity does not expire
-
associate
boolean associate(HttpChannel channel)
Associates the given
channelto this exchange.Works in strict collaboration with
HttpChannel.associate(HttpExchange).- Parameters:
channel- the channel to associate to this exchange- Returns:
- true if the channel could be associated, false otherwise
-
disassociate
void disassociate(HttpChannel channel)
-
getHttpChannel
private HttpChannel getHttpChannel()
-
requestComplete
public boolean requestComplete(java.lang.Throwable failure)
-
completeRequest
private boolean completeRequest(java.lang.Throwable failure)
-
responseComplete
public boolean responseComplete(java.lang.Throwable failure)
-
completeResponse
private boolean completeResponse(java.lang.Throwable failure)
-
terminateRequest
public Result terminateRequest()
-
terminateResponse
public Result terminateResponse()
-
abort
public boolean abort(java.lang.Throwable failure)
-
notifyFailureComplete
private void notifyFailureComplete(java.lang.Throwable failure)
-
resetResponse
public void resetResponse()
-
proceed
public void proceed(java.lang.Throwable failure)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-