Top Description Fields Constructors Methods
org.eclipse.jetty.http2.parser

public abstract Class BodyParser

extends Object
Class Inheritance
Known Direct Subclasses
org.eclipse.jetty.http2.parser.ContinuationBodyParser, org.eclipse.jetty.http2.parser.DataBodyParser, org.eclipse.jetty.http2.parser.GoAwayBodyParser, org.eclipse.jetty.http2.parser.HeadersBodyParser, org.eclipse.jetty.http2.parser.PingBodyParser, org.eclipse.jetty.http2.parser.PriorityBodyParser, org.eclipse.jetty.http2.parser.PushPromiseBodyParser, org.eclipse.jetty.http2.parser.ResetBodyParser, org.eclipse.jetty.http2.parser.SettingsBodyParser, org.eclipse.jetty.http2.parser.UnknownBodyParser, org.eclipse.jetty.http2.parser.WindowUpdateBodyParser
Imports
java.nio.ByteBuffer, org.eclipse.jetty.http2.ErrorCode, .Flags, org.eclipse.jetty.http2.frames.DataFrame, .GoAwayFrame, .HeadersFrame, .PingFrame, .PriorityFrame, .PushPromiseFrame, .ResetFrame, .SettingsFrame, .WindowUpdateFrame, org.eclipse.jetty.util.BufferUtil, org.slf4j.Logger, .LoggerFactory

The base parser for the frame body of HTTP/2 frames.

Subclasses implement parse(ByteBuffer) to parse the frame specific body.

See Also
Parser

Field Summary

Modifier and TypeField and Description
private final HeaderParser
private final Parser.Listener
private static final Logger

Constructor Summary

AccessConstructor and Description
protected
BodyParser(HeaderParser headerParser, Parser.Listener listener)

Method Summary

Modifier and TypeMethod and Description
protected boolean
connectionFailure(ByteBuffer buffer, int error, String reason)

protected void
protected int
protected int
protected int
protected boolean
hasFlag(int bit)

protected boolean
protected boolean
private void
notifyConnectionFailure(int error, String reason)

protected void
protected void
protected void
protected void
protected void
protected void
protected void
protected void
private void
notifyStreamFailure(int streamId, int error, String reason)

protected void
public abstract boolean

Returns:

true if the whole body bytes were parsed, false if not enough body bytes were present in the buffer
parse
(ByteBuffer
the buffer to parse
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.

protected boolean
protected boolean
streamFailure(int streamId, int error, String reason)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

headerParserback to summary
private final HeaderParser headerParser
listenerback to summary
private final Parser.Listener listener
LOGback to summary
private static final Logger LOG

Constructor Detail

BodyParserback to summary
protected BodyParser(HeaderParser headerParser, Parser.Listener listener)

Method Detail

connectionFailureback to summary
protected boolean connectionFailure(ByteBuffer buffer, int error, String reason)
emptyBodyback to summary
protected void emptyBody(ByteBuffer buffer)
getBodyLengthback to summary
protected int getBodyLength()
getFrameTypeback to summary
protected int getFrameType()
getStreamIdback to summary
protected int getStreamId()
hasFlagback to summary
protected boolean hasFlag(int bit)
isEndStreamback to summary
protected boolean isEndStream()
isPaddingback to summary
protected boolean isPadding()
notifyConnectionFailureback to summary
private void notifyConnectionFailure(int error, String reason)
notifyDataback to summary
protected void notifyData(DataFrame frame)
notifyGoAwayback to summary
protected void notifyGoAway(GoAwayFrame frame)
notifyHeadersback to summary
protected void notifyHeaders(HeadersFrame frame)
notifyPingback to summary
protected void notifyPing(PingFrame frame)
notifyPriorityback to summary
protected void notifyPriority(PriorityFrame frame)
notifyPushPromiseback to summary
protected void notifyPushPromise(PushPromiseFrame frame)
notifyResetback to summary
protected void notifyReset(ResetFrame frame)
notifySettingsback to summary
protected void notifySettings(SettingsFrame frame)
notifyStreamFailureback to summary
private void notifyStreamFailure(int streamId, int error, String reason)
notifyWindowUpdateback to summary
protected void notifyWindowUpdate(WindowUpdateFrame frame)
parseback to summary
public abstract boolean parse(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:ByteBuffer

the buffer to parse

Returns:boolean

true if the whole body bytes were parsed, false if not enough body bytes were present in the buffer

rateControlOnEventback to summary
protected boolean rateControlOnEvent(Object o)
streamFailureback to summary
protected boolean streamFailure(int streamId, int error, String reason)