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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbadMessage(HttpException failure) Called to signal that a bad HTTP message has been received.booleancontent(ByteBuffer buffer) booleanprotected voiddispose()Disposes the state of this HttpReceiver.voidearlyEOF()Called to signal that an EOF was received unexpectedly during the parsing of an HTTP messagevoidfailAndClose(Throwable failure) Fails the receiver and closes the underlying stream.protected voidprotected ByteBufferbooleanprotected booleanbooleanprotected voidPrepare for the next step after an interim response was read.protected ByteBuffervoidparsedHeader(HttpField field) This is the method called by parser when an HTTP Header name and value is foundvoidparsedTrailer(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 voidreset()Resets the state of this HttpReceiver.voidstartResponse(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, storeCookieMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.http.HttpParser.HttpHandler
messageBegin, onViolation
-
Constructor Details
-
HttpReceiverOverHTTP
-
-
Method Details
-
onInterim
protected void onInterim()Description copied from class:HttpReceiverPrepare for the next step after an interim response was read.- Specified by:
onInterimin classHttpReceiver
-
reset
protected void reset()Description copied from class:HttpReceiverResets 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:
resetin classHttpReceiver
-
dispose
protected void dispose()Description copied from class:HttpReceiverDisposes 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:
disposein classHttpReceiver
-
read
Description copied from class:HttpReceiverReads a chunk of data.If no data was read,
nullis returned and iffillInterestIfNeededistruethen 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:
readin classHttpReceiver- Parameters:
fillInterestIfNeeded- true to register for fill interest when no data was read.- Returns:
- the chunk of data that was read, or
nullif nothing was read.
-
failAndClose
Description copied from class:HttpReceiverFails the receiver and closes the underlying stream.- Specified by:
failAndClosein classHttpReceiver- Parameters:
failure- the failure.
-
getHttpChannel
- Overrides:
getHttpChannelin classHttpReceiver
-
getResponseBuffer
-
onUpgradeFrom
-
fillInterested
protected void fillInterested() -
isShutdown
protected boolean isShutdown() -
startResponse
Description copied from interface:HttpParser.ResponseHandlerThis is the method called by parser when the HTTP request line is parsed- Specified by:
startResponsein interfaceHttpParser.ResponseHandler- Parameters:
version- the http version in usestatus- the response statusreason- the response reason phrase
-
parsedHeader
Description copied from interface:HttpParser.HttpHandlerThis is the method called by parser when an HTTP Header name and value is found- Specified by:
parsedHeaderin interfaceHttpParser.HttpHandler- Parameters:
field- The field parsed
-
headerComplete
public boolean headerComplete()- Specified by:
headerCompletein interfaceHttpParser.HttpHandler
-
content
- Specified by:
contentin interfaceHttpParser.HttpHandler
-
contentComplete
public boolean contentComplete()- Specified by:
contentCompletein interfaceHttpParser.HttpHandler
-
parsedTrailer
Description copied from interface:HttpParser.HttpHandlerThis is the method called by parser when an HTTP Trailer name and value is found- Specified by:
parsedTrailerin interfaceHttpParser.HttpHandler- Parameters:
trailer- The field parsed
-
messageComplete
public boolean messageComplete()- Specified by:
messageCompletein interfaceHttpParser.HttpHandler
-
earlyEOF
public void earlyEOF()Description copied from interface:HttpParser.HttpHandlerCalled to signal that an EOF was received unexpectedly during the parsing of an HTTP message- Specified by:
earlyEOFin interfaceHttpParser.HttpHandler
-
badMessage
Description copied from interface:HttpParser.HttpHandlerCalled to signal that a bad HTTP message has been received.- Specified by:
badMessagein interfaceHttpParser.HttpHandler- Parameters:
failure- the failure with the bad message information
-
toString
- Overrides:
toStringin classHttpReceiver
-