Module org.glassfish.grizzly.http
Package org.glassfish.grizzly.http
Class HttpHeader.Builder<T extends HttpHeader.Builder>
java.lang.Object
org.glassfish.grizzly.http.HttpHeader.Builder<T>
- Direct Known Subclasses:
HttpRequestPacket.Builder,HttpResponsePacket.Builder
- Enclosing class:
- HttpHeader
HttpHeader message builder.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()final Tchunked(boolean chunked) Set true, if thisHttpPacketcontent will be transferred in chunking mode, or false if case of fixed-length message.final TcontentLength(long contentLength) Set the content-length of thisHttpPacket.final TcontentType(String contentType) Set the content-type of thisHttpPacket.protected abstract HttpHeadercreate()final TAdd the HTTP mime header.final TAdd the HTTP mime header.final TmaxNumHeaders(int maxHeaders) Sets the maximum number of headers allowed.final TSet the HTTP message protocol version.final TSet the HTTP message protocol version.final TremoveHeader(String name) Remove the specified name from this builder.final TremoveHeader(Header header) Remove the specified header from this builder.voidreset()final TSet the HTTP upgrade type.
-
Field Details
-
protocol
-
protocolString
-
chunked
-
contentLength
-
contentType
-
upgrade
-
mimeHeaders
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
protocol
Set the HTTP message protocol version.- Parameters:
protocol-Protocol
-
protocol
Set the HTTP message protocol version.- Parameters:
protocolString- protocol version in format "HTTP/1.x".
-
chunked
Set true, if thisHttpPacketcontent will be transferred in chunking mode, or false if case of fixed-length message.- Parameters:
chunked- true, if thisHttpPacketcontent will be transferred in chunking mode, or false if case of fixed-length message.
-
contentLength
Set the content-length of thisHttpPacket. Applicable only in case of fixed-length HTTP message.- Parameters:
contentLength- the content-length of thisHttpPacket. Applicable only in case of fixed-length HTTP message.
-
contentType
Set the content-type of thisHttpPacket.- Parameters:
contentType- the content-type of thisHttpPacket.
-
upgrade
Set the HTTP upgrade type.- Parameters:
upgrade- the type of upgrade.
-
header
Add the HTTP mime header.- Parameters:
name- the mime header name.value- the mime header value.
-
removeHeader
Remove the specified name from this builder. This method is only useful if using the same builder to create multiple objects.- Parameters:
name- the mime header name.- Returns:
- this
-
header
Add the HTTP mime header.- Parameters:
header- the mimeHeader.value- the mime header value.
-
removeHeader
Remove the specified header from this builder. This method is only useful if using the same builder to create multiple objects.- Parameters:
header- the mimeHeader.- Returns:
- this
-
maxNumHeaders
Sets the maximum number of headers allowed. -
build
-
reset
public void reset() -
create
-