Package org.eclipse.jetty.http2.parser
Class BodyParser
- java.lang.Object
-
- org.eclipse.jetty.http2.parser.BodyParser
-
- Direct Known Subclasses:
ContinuationBodyParser,DataBodyParser,GoAwayBodyParser,HeadersBodyParser,PingBodyParser,PriorityBodyParser,PushPromiseBodyParser,ResetBodyParser,SettingsBodyParser,UnknownBodyParser,WindowUpdateBodyParser
public abstract class BodyParser extends java.lang.ObjectThe base parser for the frame body of HTTP/2 frames.
Subclasses implement
parse(ByteBuffer)to parse the frame specific body.- See Also:
Parser
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBodyParser(HeaderParser headerParser, Parser.Listener listener)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected booleanconnectionFailure(java.nio.ByteBuffer buffer, int error, java.lang.String reason)protected voidemptyBody(java.nio.ByteBuffer buffer)protected intgetBodyLength()protected intgetFrameType()protected intgetStreamId()protected booleanhasFlag(int bit)protected booleanisEndStream()protected booleanisPadding()protected voidnotifyData(DataFrame frame)protected voidnotifyGoAway(GoAwayFrame frame)protected voidnotifyHeaders(HeadersFrame frame)protected voidnotifyPing(PingFrame frame)protected voidnotifyPriority(PriorityFrame frame)protected voidnotifyPushPromise(PushPromiseFrame frame)protected voidnotifyReset(ResetFrame frame)protected voidnotifySettings(SettingsFrame frame)protected voidnotifyWindowUpdate(WindowUpdateFrame frame)abstract booleanparse(java.nio.ByteBuffer buffer)Parses the body bytes in the givenbuffer; only the body bytes are consumed, therefore when this method returns, the buffer may contain unconsumed bytes.protected booleanrateControlOnEvent(java.lang.Object o)protected booleanstreamFailure(int streamId, int error, java.lang.String reason)
-
-
-
Field Detail
-
LOG
protected static final Logger LOG
-
-
Constructor Detail
-
BodyParser
protected BodyParser(HeaderParser headerParser, Parser.Listener listener)
-
-
Method Detail
-
parse
public abstract boolean parse(java.nio.ByteBuffer buffer)
Parses the body bytes in the given
buffer; only the body bytes are consumed, therefore when this method returns, the buffer may contain unconsumed bytes.- Parameters:
buffer- the buffer to parse- Returns:
- true if the whole body bytes were parsed, false if not enough body bytes were present in the buffer
-
emptyBody
protected void emptyBody(java.nio.ByteBuffer buffer)
-
hasFlag
protected boolean hasFlag(int bit)
-
isPadding
protected boolean isPadding()
-
isEndStream
protected boolean isEndStream()
-
getStreamId
protected int getStreamId()
-
getBodyLength
protected int getBodyLength()
-
getFrameType
protected int getFrameType()
-
notifyData
protected void notifyData(DataFrame frame)
-
notifyHeaders
protected void notifyHeaders(HeadersFrame frame)
-
notifyPriority
protected void notifyPriority(PriorityFrame frame)
-
notifyReset
protected void notifyReset(ResetFrame frame)
-
notifySettings
protected void notifySettings(SettingsFrame frame)
-
notifyPushPromise
protected void notifyPushPromise(PushPromiseFrame frame)
-
notifyPing
protected void notifyPing(PingFrame frame)
-
notifyGoAway
protected void notifyGoAway(GoAwayFrame frame)
-
notifyWindowUpdate
protected void notifyWindowUpdate(WindowUpdateFrame frame)
-
connectionFailure
protected boolean connectionFailure(java.nio.ByteBuffer buffer, int error, java.lang.String reason)
-
streamFailure
protected boolean streamFailure(int streamId, int error, java.lang.String reason)
-
rateControlOnEvent
protected boolean rateControlOnEvent(java.lang.Object o)
-
-