Package org.eclipse.jetty.fcgi.parser
Class ResponseContentParser.ResponseParser
- java.lang.Object
-
- org.eclipse.jetty.fcgi.parser.ResponseContentParser.ResponseParser
-
- All Implemented Interfaces:
HttpParser.HttpHandler,HttpParser.ResponseHandler
- Enclosing class:
- ResponseContentParser
private static class ResponseContentParser.ResponseParser extends java.lang.Object implements HttpParser.ResponseHandler
-
-
Field Summary
Fields Modifier and Type Field Description private HttpFieldsfieldsprivate ResponseContentParser.FCGIHttpParserhttpParserprivate ClientParser.Listenerlistenerprivate intrequestprivate booleanseenResponseCodeprivate booleanstalledprivate ResponseContentParser.Statestate
-
Constructor Summary
Constructors Modifier Constructor Description privateResponseParser(ClientParser.Listener listener, int request)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbadMessage(BadMessageException failure)Called to signal that a bad HTTP message has been received.booleancontent(java.nio.ByteBuffer buffer)booleancontentComplete()voidearlyEOF()Called to signal that an EOF was received unexpectedly during the parsing of an HTTP messageprotected voidfail(java.lang.Throwable failure)intgetHeaderCacheSize()booleanheaderComplete()booleanmessageComplete()private voidnotifyBegin(int code, java.lang.String reason)private booleannotifyContent(java.nio.ByteBuffer buffer)private voidnotifyHeader(HttpField httpField)private booleannotifyHeaders()private voidnotifyHeaders(HttpFields fields)booleanparse(java.nio.ByteBuffer buffer)voidparsedHeader(HttpField httpField)This is the method called by parser when an HTTP Header name and value is foundbooleanstartResponse(HttpVersion version, int status, java.lang.String reason)This is the method called by parser when the HTTP request line is parsed-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.http.HttpParser.HttpHandler
badMessage, parsedTrailer
-
-
-
-
Field Detail
-
fields
private final HttpFields fields
-
listener
private ClientParser.Listener listener
-
request
private final int request
-
httpParser
private final ResponseContentParser.FCGIHttpParser httpParser
-
state
private ResponseContentParser.State state
-
seenResponseCode
private boolean seenResponseCode
-
stalled
private boolean stalled
-
-
Constructor Detail
-
ResponseParser
private ResponseParser(ClientParser.Listener listener, int request)
-
-
Method Detail
-
parse
public boolean parse(java.nio.ByteBuffer buffer)
-
getHeaderCacheSize
public int getHeaderCacheSize()
- Specified by:
getHeaderCacheSizein interfaceHttpParser.HttpHandler- Returns:
- the size in bytes of the per parser header cache
-
startResponse
public boolean startResponse(HttpVersion version, int status, java.lang.String reason)
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- Returns:
- true if handling parsing should return
-
parsedHeader
public void parsedHeader(HttpField httpField)
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:
httpField- The field parsed
-
notifyBegin
private void notifyBegin(int code, java.lang.String reason)
-
notifyHeader
private void notifyHeader(HttpField httpField)
-
notifyHeaders
private void notifyHeaders(HttpFields fields)
-
notifyHeaders
private boolean notifyHeaders()
-
headerComplete
public boolean headerComplete()
- Specified by:
headerCompletein interfaceHttpParser.HttpHandler
-
content
public boolean content(java.nio.ByteBuffer buffer)
- Specified by:
contentin interfaceHttpParser.HttpHandler
-
notifyContent
private boolean notifyContent(java.nio.ByteBuffer buffer)
-
contentComplete
public boolean contentComplete()
- Specified by:
contentCompletein interfaceHttpParser.HttpHandler
-
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
public void badMessage(BadMessageException failure)
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
-
fail
protected void fail(java.lang.Throwable failure)
-
-