Top Fields Constructors Methods
io.undertow.client.http

pack-priv abstract Class HttpResponseParser

extends Object
Class Inheritance
Annotations
@HttpResponseParserConfig
protocols:HTTP/0.9, HTTP/1.0, HTTP/1.1
headers:Accept-Ranges, Age, Cache-Control, Connection, Content-Disposition, Content-Encoding, Content-Language, Content-Length, Content-Location, Content-MD5, Content-Range, Content-Type, Date, Expires, ETag, Last-Modified, Location, Pragma, Proxy-Authenticate, Refresh, Retry-After, Server, Set-Cookie, Set-Cookie2, Strict-Transport-Security, Trailer, Transfer-Encoding, Vary, Via, Warning, WWW-Authenticate
Imports
io.undertow.annotationprocessor.HttpResponseParserConfig, io.undertow.util.BadRequestException, .Headers, .HttpString, .Methods, .Protocols, java.lang.reflect.Field, java.nio.ByteBuffer, java.util.HashMap, .Map

Author
Emanuel Muckenhuber

Field Summary

Modifier and TypeField and Description
private static final int
private static final int
public static final HttpResponseParser
private static final int
private static final int
NORMAL

The parse states for parsing heading values

private static final int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
handle(final ByteBuffer buffer, final ResponseParseState currentState, final HttpResponseBuilder builder)

protected void
pack-priv abstract void
pack-priv final void

Returns:

The number of bytes remaining
handleHeaderValue
(ByteBuffer
The buffer
buffer
,
ResponseParseState
The current state
state
,
HttpResponseBuilder
The exchange builder
builder
)

Parses a header value.

pack-priv abstract void
pack-priv final void

Returns:

The number of bytes remaining
handleReasonPhrase
(ByteBuffer
The buffer
buffer
,
ResponseParseState
The current state
state
,
HttpResponseBuilder
The exchange builder
builder
)

Parses the reason phrase.

pack-priv final void

Returns:

The number of bytes remaining
handleStatusCode
(ByteBuffer
The buffer
buffer
,
ResponseParseState
The current state
state
,
HttpResponseBuilder
The exchange builder
builder
)

Parses the status code.

protected static Map<String, HttpString>
httpStrings()

This is a bit of hack to enable the parser to get access to the HttpString's that are sorted in the static fields of the relevant classes.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

AWAIT_DATA_ENDback to summary
private static final int AWAIT_DATA_END
BEGIN_LINE_ENDback to summary
private static final int BEGIN_LINE_END
INSTANCEback to summary
public static final HttpResponseParser INSTANCE
LINE_ENDback to summary
private static final int LINE_END
NORMALback to summary
private static final int NORMAL

The parse states for parsing heading values

WHITESPACEback to summary
private static final int WHITESPACE

Constructor Detail

HttpResponseParserback to summary
pack-priv HttpResponseParser()

Method Detail

handleback to summary
public void handle(final ByteBuffer buffer, final ResponseParseState currentState, final HttpResponseBuilder builder) throws BadRequestException
handleAfterReasonPhraseback to summary
protected void handleAfterReasonPhrase(ByteBuffer buffer, ResponseParseState state, HttpResponseBuilder builder)
handleHeaderback to summary
pack-priv abstract void handleHeader(ByteBuffer buffer, ResponseParseState currentState, HttpResponseBuilder builder) throws BadRequestException
handleHeaderValueback to summary
pack-priv final void handleHeaderValue(ByteBuffer buffer, ResponseParseState state, HttpResponseBuilder builder)

Parses a header value. This is called from the generated bytecode.

Parameters
buffer:ByteBuffer

The buffer

state:ResponseParseState

The current state

builder:HttpResponseBuilder

The exchange builder

Returns:void

The number of bytes remaining

Annotations
@SuppressWarnings:unused
handleHttpVersionback to summary
pack-priv abstract void handleHttpVersion(ByteBuffer buffer, ResponseParseState currentState, HttpResponseBuilder builder) throws BadRequestException
handleReasonPhraseback to summary
pack-priv final void handleReasonPhrase(ByteBuffer buffer, ResponseParseState state, HttpResponseBuilder builder)

Parses the reason phrase. This is called from the generated bytecode.

Parameters
buffer:ByteBuffer

The buffer

state:ResponseParseState

The current state

builder:HttpResponseBuilder

The exchange builder

Returns:void

The number of bytes remaining

Annotations
@SuppressWarnings:unused
handleStatusCodeback to summary
pack-priv final void handleStatusCode(ByteBuffer buffer, ResponseParseState state, HttpResponseBuilder builder)

Parses the status code. This is called from the generated bytecode.

Parameters
buffer:ByteBuffer

The buffer

state:ResponseParseState

The current state

builder:HttpResponseBuilder

The exchange builder

Returns:void

The number of bytes remaining

Annotations
@SuppressWarnings:unused
httpStringsback to summary
protected static Map<String, HttpString> httpStrings()

This is a bit of hack to enable the parser to get access to the HttpString's that are sorted in the static fields of the relevant classes. This means that in most cases a HttpString comparison will take the fast path == route, as they will be the same object