Class HttpReceiverOverHTTP
java.lang.Object
org.eclipse.jetty.client.transport.HttpReceiver
org.eclipse.jetty.client.transport.internal.HttpReceiverOverHTTP
- All Implemented Interfaces:
HttpParser.HttpHandler
,HttpParser.ResponseHandler
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
badMessage
(HttpException failure) Called to signal that a bad HTTP message has been received.boolean
content
(ByteBuffer buffer) boolean
protected void
dispose()
Disposes the state of this HttpReceiver.void
earlyEOF()
Called to signal that an EOF was received unexpectedly during the parsing of an HTTP messagevoid
failAndClose
(Throwable failure) Fails the receiver and closes the underlying stream.protected void
protected ByteBuffer
boolean
protected boolean
boolean
protected void
Prepare for the next step after an interim response was read.protected ByteBuffer
void
parsedHeader
(HttpField field) This is the method called by parser when an HTTP Header name and value is foundvoid
parsedTrailer
(HttpField trailer) This is the method called by parser when an HTTP Trailer name and value is foundread
(boolean fillInterestIfNeeded) Reads a chunk of data.protected void
reset()
Resets the state of this HttpReceiver.void
startResponse
(HttpVersion version, int status, String reason) This is the method called by parser when the HTTP request line is parsedtoString()
Methods inherited from class org.eclipse.jetty.client.transport.HttpReceiver
abort, getHttpDestination, getHttpExchange, hasContent, isFailed, responseBegin, responseContentAvailable, responseFailure, responseHeader, responseHeaders, responseSuccess, storeCookie
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.http.HttpParser.HttpHandler
messageBegin, onViolation
-
Constructor Details
-
HttpReceiverOverHTTP
-
-
Method Details
-
onInterim
protected void onInterim()Description copied from class:HttpReceiver
Prepare for the next step after an interim response was read.- Specified by:
onInterim
in classHttpReceiver
-
reset
protected void reset()Description copied from class:HttpReceiver
Resets the state of this HttpReceiver.Subclasses should override (but remember to call
super
) to reset their own state.Either this method or
HttpReceiver.dispose()
is called.- Overrides:
reset
in classHttpReceiver
-
dispose
protected void dispose()Description copied from class:HttpReceiver
Disposes the state of this HttpReceiver.Subclasses should override (but remember to call
super
) to dispose their own state.Either this method or
HttpReceiver.reset()
is called.- Overrides:
dispose
in classHttpReceiver
-
read
Description copied from class:HttpReceiver
Reads a chunk of data.If no data was read,
null
is returned and iffillInterestIfNeeded
istrue
then fill interest is registered.The returned chunk of data may be the last one or an error exactly like
Content.Source.read()
specifies.- Specified by:
read
in classHttpReceiver
- Parameters:
fillInterestIfNeeded
- true to register for fill interest when no data was read.- Returns:
- the chunk of data that was read, or
null
if nothing was read.
-
failAndClose
Description copied from class:HttpReceiver
Fails the receiver and closes the underlying stream.- Specified by:
failAndClose
in classHttpReceiver
- Parameters:
failure
- the failure.
-
getHttpChannel
- Overrides:
getHttpChannel
in classHttpReceiver
-
getResponseBuffer
-
onUpgradeFrom
-
fillInterested
protected void fillInterested() -
isShutdown
protected boolean isShutdown() -
startResponse
Description copied from interface:HttpParser.ResponseHandler
This is the method called by parser when the HTTP request line is parsed- Specified by:
startResponse
in interfaceHttpParser.ResponseHandler
- Parameters:
version
- the http version in usestatus
- the response statusreason
- the response reason phrase
-
parsedHeader
Description copied from interface:HttpParser.HttpHandler
This is the method called by parser when an HTTP Header name and value is found- Specified by:
parsedHeader
in interfaceHttpParser.HttpHandler
- Parameters:
field
- The field parsed
-
headerComplete
public boolean headerComplete()- Specified by:
headerComplete
in interfaceHttpParser.HttpHandler
-
content
- Specified by:
content
in interfaceHttpParser.HttpHandler
-
contentComplete
public boolean contentComplete()- Specified by:
contentComplete
in interfaceHttpParser.HttpHandler
-
parsedTrailer
Description copied from interface:HttpParser.HttpHandler
This is the method called by parser when an HTTP Trailer name and value is found- Specified by:
parsedTrailer
in interfaceHttpParser.HttpHandler
- Parameters:
trailer
- The field parsed
-
messageComplete
public boolean messageComplete()- Specified by:
messageComplete
in interfaceHttpParser.HttpHandler
-
earlyEOF
public void earlyEOF()Description copied from interface:HttpParser.HttpHandler
Called to signal that an EOF was received unexpectedly during the parsing of an HTTP message- Specified by:
earlyEOF
in interfaceHttpParser.HttpHandler
-
badMessage
Description copied from interface:HttpParser.HttpHandler
Called to signal that a bad HTTP message has been received.- Specified by:
badMessage
in interfaceHttpParser.HttpHandler
- Parameters:
failure
- the failure with the bad message information
-
toString
- Overrides:
toString
in classHttpReceiver
-