Class Http2Headers
java.lang.Object
io.helidon.http.http2.Http2Headers
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThere is one dynamic table for inbound headers and one for outbound headers for each connection. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HeaderNameHeader name of the authority pseudo header.static final HeaderNameHeader name of the method pseudo header.static final HeaderNameHeader name of the path pseudo header.static final HeaderNameHeader name of the scheme pseudo header.static final HeaderNameHeader name of the status pseudo header. -
Method Summary
Modifier and TypeMethodDescriptionAuthority pseudo header.Authority of the request.static Http2HeadersCreate HTTP/2 headers from HTTP headers.static Http2Headerscreate(Http2Stream stream, Http2Headers.DynamicTable table, Http2HuffmanDecoder huffman, Http2FrameData... frames) Create headers from HTTP request.static Http2Headerscreate(Http2Stream stream, Http2Headers.DynamicTable table, Http2HuffmanDecoder huffman, Http2Headers headers, Http2FrameData... frames) Create headers from HTTP request.static Http2Headerscreate(Http2Stream stream, Http2Headers.DynamicTable table, Http2HuffmanDecoder huffman, Http2Headers headers, Set<HeaderName> ignoredHeaders, Http2FrameData... frames) Create headers from HTTP request.static Http2Headerscreate(Http2Stream stream, Http2Headers.DynamicTable table, Http2HuffmanDecoder huffman, Http2Headers headers, Set<HeaderName> ignoredHeaders, LongConsumer decodedHeaderSizeConsumer, Http2FrameData... frames) Create headers from HTTP request.static Http2Headerscreate(WritableHeaders<?> writableHeaders) Create from writable HTTP headers.HTTP headers.method()Method pseudo header.HTTP method to be used.path()Path pseudo header.Path of the request.scheme()Scheme pseudo header.HTTP scheme, such ashttporhttps.status()Status pseudo header.Status pseudo header.toString()voidValidate client or server request.voidValidate server response or client response.voidValidate that request or response trailers do not contain pseudo-headers.voidwrite(Http2Headers.DynamicTable table, Http2HuffmanEncoder huffman, BufferData growingBuffer) Write headers to a buffer.
-
Field Details
-
AUTHORITY_NAME
Header name of the authority pseudo header. -
METHOD_NAME
Header name of the method pseudo header. -
PATH_NAME
Header name of the path pseudo header. -
SCHEME_NAME
Header name of the scheme pseudo header. -
STATUS_NAME
Header name of the status pseudo header.
-
-
Method Details
-
create
public static Http2Headers create(Http2Stream stream, Http2Headers.DynamicTable table, Http2HuffmanDecoder huffman, Http2Headers headers, Http2FrameData... frames) Create headers from HTTP request.- Parameters:
stream- stream that owns these headerstable- dynamic table for this connectionhuffman- huffman decoderheaders- http2 headersframes- frames of the headers- Returns:
- new headers parsed from the frames
- Throws:
Http2Exception- in case of protocol errors
-
create
public static Http2Headers create(Http2Stream stream, Http2Headers.DynamicTable table, Http2HuffmanDecoder huffman, Http2Headers headers, Set<HeaderName> ignoredHeaders, Http2FrameData... frames) Create headers from HTTP request.- Parameters:
stream- stream that owns these headerstable- dynamic table for this connectionhuffman- huffman decoderheaders- http2 headersignoredHeaders- decoded header names that must not be added to the resultframes- frames of the headers- Returns:
- new headers parsed from the frames
- Throws:
Http2Exception- in case of protocol errors
-
create
public static Http2Headers create(Http2Stream stream, Http2Headers.DynamicTable table, Http2HuffmanDecoder huffman, Http2Headers headers, Set<HeaderName> ignoredHeaders, LongConsumer decodedHeaderSizeConsumer, Http2FrameData... frames) Create headers from HTTP request.- Parameters:
stream- stream that owns these headerstable- dynamic table for this connectionhuffman- huffman decoderheaders- http2 headersignoredHeaders- decoded header names that must not be added to the resultdecodedHeaderSizeConsumer- consumer of each decoded header field size before ignored-header filteringframes- frames of the headers- Returns:
- new headers parsed from the frames
- Throws:
Http2Exception- in case of protocol errors
-
create
public static Http2Headers create(Http2Stream stream, Http2Headers.DynamicTable table, Http2HuffmanDecoder huffman, Http2FrameData... frames) Create headers from HTTP request.- Parameters:
stream- stream that owns these headerstable- dynamic table for this connectionhuffman- huffman decoderframes- frames of the headers- Returns:
- new headers parsed from the frames
- Throws:
Http2Exception- in case of protocol errors
-
create
Create HTTP/2 headers from HTTP headers.- Parameters:
headers- headers to base these headers on- Returns:
- new HTTP/2 headers
-
create
Create from writable HTTP headers.- Parameters:
writableHeaders- header to use- Returns:
- new HTTP/2 headers
-
status
-
path
-
method
-
scheme
-
authority
-
path
Path of the request.- Parameters:
path- HTTP path of the request- Returns:
- updated headers
-
method
HTTP method to be used.- Parameters:
method- HTTP method of the request- Returns:
- updated headers
-
authority
Authority of the request. This is an HTTP/2 pseudo-header. This is an equivalent ofHOSTheader in HTTP/1.- Parameters:
authority- authority of the request, such aslocalhost:8080- Returns:
- updated headers
-
scheme
HTTP scheme, such ashttporhttps.- Parameters:
scheme- scheme of the request- Returns:
- updated headeres
-
httpHeaders
-
validateResponse
Validate server response or client response.- Throws:
Http2Exception- in case the response is invalid
-
validateTrailers
Validate that request or response trailers do not contain pseudo-headers.- Throws:
Http2Exception- if the trailers contain a pseudo-header
-
validateRequest
Validate client or server request.- Throws:
Http2Exception- in case the request is invalid
-
toString
-
status
Status pseudo header.- Parameters:
status- status to use- Returns:
- updated headers
-
write
public void write(Http2Headers.DynamicTable table, Http2HuffmanEncoder huffman, BufferData growingBuffer) Write headers to a buffer.- Parameters:
table- dynamic table to usehuffman- huffman encoder to usegrowingBuffer- buffer to write to
-