Top Description Fields Constructors Methods
org.glassfish.grizzly.http2.frames

public final Class CompressedHeadersBuilder

extends Object
Class Inheritance
Imports
java.io.IOException, java.util.HashMap, .Locale, .Map, org.glassfish.grizzly.Buffer, org.glassfish.grizzly.http.HttpPacket, .Method, .Protocol, org.glassfish.grizzly.http.util.Header, .HttpStatus, org.glassfish.grizzly.http2.HeadersEncoder

The builder for compressed headers used by HeadersFrame.
Author
Alexey Stashok
See Also
HeadersFrame

Field Summary

Modifier and TypeField and Description
private final Map<String, String>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Buffer
build(final HeadersEncoder encoder)

public CompressedHeadersBuilder
contentLength(long
the content-length of this HttpPacket. Applicable only in case of fixed-length HTTP message.
contentLength
)

Set the content-length of this header.

public CompressedHeadersBuilder
contentType(String
the content-type of this HttpPacket.
contentType
)

Set the content-type of this header.

public CompressedHeadersBuilder
header(String
the mime header name.
name
,
String
the mime header value.
value
)

Add the HTTP mime header.

public CompressedHeadersBuilder
header(Header
the mime Header.
header
,
String
the mime header value.
value
)

Add the HTTP mime header.

public CompressedHeadersBuilder
host(String
the host/port.
host
)

Set the the host/port (See RFC1738 [RFC1738]) portion of the URL for this request header (e.g. "www.google.com:1234").

public CompressedHeadersBuilder
method(final Method
the method of this header.
method
)

Set the the HTTP method for this request.

public CompressedHeadersBuilder
method(String
the method of this header.
method
)

Set the the HTTP method for this request.

public static CompressedHeadersBuilder
newInstance()

Returns the CompressedHeadersBuilder instance.

public CompressedHeadersBuilder
path(String
the path of this header.
path
)

Set the url-path for required url with "/" prefixed.

public CompressedHeadersBuilder
scheme(String
the scheme of this header.
scheme
)

Set the scheme portion of the URL for this request header (e.g. "https").

public CompressedHeadersBuilder
status(int
the status of this header.
status
)

Set the HTTP response status code (e.g. 200 or 404).

public CompressedHeadersBuilder
status(HttpStatus
the status of this header.
status
)

Set the HTTP response status code (e.g. "200" or "200 OK")

public CompressedHeadersBuilder
status(final String
the status of this header.
status
)

Set the HTTP response status code (e.g. "200" or "200 OK")

public CompressedHeadersBuilder
version(Protocol
the HTTP version of this header.
version
)

Set the the HTTP version of this request (e.g. "HTTP/1.1").

public CompressedHeadersBuilder
version(String
the HTTP version of this header.
version
)

Set the the HTTP version of this request (e.g. "HTTP/1.1").

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

headersback to summary
private final Map<String, String> headers

Constructor Detail

CompressedHeadersBuilderback to summary
private CompressedHeadersBuilder()

Method Detail

buildback to summary
public Buffer build(final HeadersEncoder encoder) throws IOException
contentLengthback to summary
public CompressedHeadersBuilder contentLength(long contentLength)

Set the content-length of this header. Applicable only in case of fixed-length HTTP message.

Parameters
contentLength:long

the content-length of this HttpPacket. Applicable only in case of fixed-length HTTP message.

contentTypeback to summary
public CompressedHeadersBuilder contentType(String contentType)

Set the content-type of this header.

Parameters
contentType:String

the content-type of this HttpPacket.

headerback to summary
public CompressedHeadersBuilder header(String name, String value)

Add the HTTP mime header.

Parameters
name:String

the mime header name.

value:String

the mime header value.

headerback to summary
public CompressedHeadersBuilder header(Header header, String value)

Add the HTTP mime header.

Parameters
header:Header

the mime Header.

value:String

the mime header value.

hostback to summary
public CompressedHeadersBuilder host(String host)

Set the the host/port (See RFC1738 [RFC1738]) portion of the URL for this request header (e.g. "www.google.com:1234"). This header is the same as the HTTP 'Host' header.

Parameters
host:String

the host/port.

methodback to summary
public CompressedHeadersBuilder method(final Method method)

Set the the HTTP method for this request. (e.g. "GET", "POST", "HEAD", etc).

Parameters
method:Method

the method of this header.

methodback to summary
public CompressedHeadersBuilder method(String method)

Set the the HTTP method for this request. (e.g. "GET", "POST", "HEAD", etc).

Parameters
method:String

the method of this header.

newInstanceback to summary
public static CompressedHeadersBuilder newInstance()

Returns the CompressedHeadersBuilder instance.

pathback to summary
public CompressedHeadersBuilder path(String path)

Set the url-path for required url with "/" prefixed. (See RFC1738 [RFC1738]). For example, for "http://www.google.com/search?q=dogs" the path would be "/search?q=dogs".

Parameters
path:String

the path of this header.

schemeback to summary
public CompressedHeadersBuilder scheme(String scheme)

Set the scheme portion of the URL for this request header (e.g. "https").

Parameters
scheme:String

the scheme of this header.

statusback to summary
public CompressedHeadersBuilder status(int status)

Set the HTTP response status code (e.g. 200 or 404).

Parameters
status:int

the status of this header.

statusback to summary
public CompressedHeadersBuilder status(HttpStatus status)

Set the HTTP response status code (e.g. "200" or "200 OK")

Parameters
status:HttpStatus

the status of this header.

statusback to summary
public CompressedHeadersBuilder status(final String status)

Set the HTTP response status code (e.g. "200" or "200 OK")

Parameters
status:String

the status of this header.

versionback to summary
public CompressedHeadersBuilder version(Protocol version)

Set the the HTTP version of this request (e.g. "HTTP/1.1").

Parameters
version:Protocol

the HTTP version of this header.

versionback to summary
public CompressedHeadersBuilder version(String version)

Set the the HTTP version of this request (e.g. "HTTP/1.1").

Parameters
version:String

the HTTP version of this header.