Interface HttpMessageParser<Output extends ParserOutput>
- All Known Implementing Classes:
HttpResponseParser
public interface HttpMessageParser<Output extends ParserOutput>
INTERNAL API
Common logic for http request and response message parsing
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic final classstatic class -
Method Summary
Modifier and TypeMethodDescription<A extends ParserOutput>
ParserOutput.StreamedEntityCreator<A,RequestEntity> chunkedEntity(scala.Option<Content$minusType> cth) scala.Function0<scala.Option<ParserOutput.ErrorOutput>>scala.Function0<scala.Option<ParserOutput.ErrorOutput>>Completion handling for a message start that was truncated by the connection closing, reporting what the parser had already read of that message.contentType(scala.Option<Content$minusType> cth) The protocol of the message that is currently being parsed<A extends ParserOutput>
ParserOutput.StreamedEntityCreator<A,UniversalEntity> defaultEntity(scala.Option<Content$minusType> cth, long contentLength) done()Use {@link continue} orterminate()to suspend or terminate processing.doPull()voidemptyEntity(scala.Option<Content$minusType> cth) failEntityStream(String summary) failEntityStream(String summary, String detail) failEntityStream(ErrorInfo info) failMessageStart(String summary) failMessageStart(String summary, String detail) failMessageStart(StatusCode status) failMessageStart(StatusCode status, String summary, String detail) failMessageStart(StatusCode status, ErrorInfo info) What is known about the message that is currently being parsed, at the point where parsing failed.scala.collection.mutable.ListBuffer<HttpHeader>booleanscala.runtime.Nothing$onBadProtocol(org.apache.pekko.util.ByteString input) invoked if the specified protocol is unknownparseBytes(org.apache.pekko.util.ByteString input) parseChunk(org.apache.pekko.util.ByteString input, int offset, boolean isLastMessage, long totalBytesRead, int chunkCount) parseEntity(scala.collection.immutable.List<HttpHeader> headers, HttpProtocol protocol, org.apache.pekko.util.ByteString input, int bodyStart, scala.Option<Content$minusLength> clh, scala.Option<Content$minusType> cth, boolean isChunked, boolean expect100continue, boolean hostHeaderPresent, boolean closeAfterResponseCompletion, SSLSession sslSession) parseFixedLengthBody(long remainingBodyBytes, boolean isLastMessage, org.apache.pekko.util.ByteString input, int bodyStart) parseHeaderLines(org.apache.pekko.util.ByteString input, int lineStart, scala.collection.mutable.ListBuffer<HttpHeader> headers, int headerCount, scala.Option<Connection> ch, scala.Option<Content$minusLength> clh, scala.Option<Content$minusType> cth, boolean isChunked, boolean e100c, boolean hh) parseHeaderLinesAux(scala.collection.mutable.ListBuffer<HttpHeader> headers, int headerCount, scala.Option<Connection> ch, scala.Option<Content$minusLength> clh, scala.Option<Content$minusType> cth, boolean isChunked, boolean e100c, boolean hh, org.apache.pekko.util.ByteString input, int lineStart) parseMessage(org.apache.pekko.util.ByteString input, int offset) intparseProtocol(org.apache.pekko.util.ByteString input, int cursor) parseSessionBytes(org.apache.pekko.stream.TLSProtocol.SessionBytes input) voidsetCompletionHandling(scala.Function0<scala.Option<ParserOutput.ErrorOutput>> completionHandling) settings()booleanstartNewMessage(org.apache.pekko.util.ByteString input, int offset) strictEntity(scala.Option<Content$minusType> cth, org.apache.pekko.util.ByteString input, int bodyStart, int contentLength) boolean
-
Method Details
-
completionHandling
scala.Function0<scala.Option<ParserOutput.ErrorOutput>> completionHandling() -
terminated
boolean terminated() -
settings
ParserSettings settings() -
headerParser
HttpHeaderParser headerParser() -
isResponseParser
boolean isResponseParser() -
onBadProtocol
scala.runtime.Nothing$ onBadProtocol(org.apache.pekko.util.ByteString input) invoked if the specified protocol is unknown -
illegalRequestContext
IllegalRequestContext illegalRequestContext()What is known about the message that is currently being parsed, at the point where parsing failed. Only the request parser has anything to report here.- Returns:
- (undocumented)
-
currentProtocol
HttpProtocol currentProtocol()The protocol of the message that is currently being parsed -
completionIsMessageStartError
scala.Function0<scala.Option<ParserOutput.ErrorOutput>> completionIsMessageStartError()Completion handling for a message start that was truncated by the connection closing, reporting what the parser had already read of that message.- Returns:
- (undocumented)
-
parseMessage
-
parseEntity
HttpMessageParser.StateResult parseEntity(scala.collection.immutable.List<HttpHeader> headers, HttpProtocol protocol, org.apache.pekko.util.ByteString input, int bodyStart, scala.Option<Content$minusLength> clh, scala.Option<Content$minusType> cth, boolean isChunked, boolean expect100continue, boolean hostHeaderPresent, boolean closeAfterResponseCompletion, SSLSession sslSession) -
initialHeaderBuffer
scala.collection.mutable.ListBuffer<HttpHeader> initialHeaderBuffer() -
parseSessionBytes
-
parseBytes
-
doPull
Output doPull() -
shouldComplete
boolean shouldComplete() -
startNewMessage
-
parseProtocol
int parseProtocol(org.apache.pekko.util.ByteString input, int cursor) -
parseHeaderLines
HttpMessageParser.StateResult parseHeaderLines(org.apache.pekko.util.ByteString input, int lineStart, scala.collection.mutable.ListBuffer<HttpHeader> headers, int headerCount, scala.Option<Connection> ch, scala.Option<Content$minusLength> clh, scala.Option<Content$minusType> cth, boolean isChunked, boolean e100c, boolean hh) -
parseHeaderLinesAux
HttpMessageParser.StateResult parseHeaderLinesAux(scala.collection.mutable.ListBuffer<HttpHeader> headers, int headerCount, scala.Option<Connection> ch, scala.Option<Content$minusLength> clh, scala.Option<Content$minusType> cth, boolean isChunked, boolean e100c, boolean hh, org.apache.pekko.util.ByteString input, int lineStart) -
parseFixedLengthBody
HttpMessageParser.StateResult parseFixedLengthBody(long remainingBodyBytes, boolean isLastMessage, org.apache.pekko.util.ByteString input, int bodyStart) -
parseChunk
HttpMessageParser.StateResult parseChunk(org.apache.pekko.util.ByteString input, int offset, boolean isLastMessage, long totalBytesRead, int chunkCount) -
emit
-
failMessageStart
-
failMessageStart
-
failMessageStart
-
failMessageStart
-
failMessageStart
-
failEntityStream
-
failEntityStream
-
failEntityStream
-
terminate
HttpMessageParser.StateResult terminate() -
done
Use {@link continue} orterminate()to suspend or terminate processing. Do not call this directly.- Returns:
- (undocumented)
-
contentType
-
emptyEntity
ParserOutput.StrictEntityCreator<Output,UniversalEntity> emptyEntity(scala.Option<Content$minusType> cth) -
strictEntity
ParserOutput.StrictEntityCreator<Output,UniversalEntity> strictEntity(scala.Option<Content$minusType> cth, org.apache.pekko.util.ByteString input, int bodyStart, int contentLength) -
defaultEntity
<A extends ParserOutput> ParserOutput.StreamedEntityCreator<A,UniversalEntity> defaultEntity(scala.Option<Content$minusType> cth, long contentLength) -
chunkedEntity
<A extends ParserOutput> ParserOutput.StreamedEntityCreator<A,RequestEntity> chunkedEntity(scala.Option<Content$minusType> cth) -
setCompletionHandling
void setCompletionHandling(scala.Function0<scala.Option<ParserOutput.ErrorOutput>> completionHandling)
-