org.glassfish.grizzly.http
Class HttpHeader.Builder<T extends HttpHeader.Builder>

java.lang.Object
  extended by org.glassfish.grizzly.http.HttpHeader.Builder<T>
Direct Known Subclasses:
HttpRequestPacket.Builder, HttpResponsePacket.Builder
Enclosing class:
HttpHeader

public abstract static class HttpHeader.Builder<T extends HttpHeader.Builder>
extends Object

HttpHeader message builder.


Field Summary
protected  HttpHeader packet
           
 
Constructor Summary
HttpHeader.Builder()
           
 
Method Summary
 T chunked(boolean isChunked)
          Set true, if this HttpPacket content will be transferred in chunking mode, or false if case of fixed-length message.
 T contentLength(long contentLength)
          Set the content-length of this HttpPacket.
 T contentType(String contentType)
          Set the content-type of this HttpPacket.
 T header(String name, String value)
          Add the HTTP mime header.
 T protocol(Protocol protocol)
          Set the HTTP message protocol version.
 T protocol(String protocol)
          Set the HTTP message protocol version.
 T upgrade(String upgrade)
          Set the HTTP upgrade type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

packet

protected HttpHeader packet
Constructor Detail

HttpHeader.Builder

public HttpHeader.Builder()
Method Detail

protocol

public final T protocol(Protocol protocol)
Set the HTTP message protocol version.

Parameters:
protocol - Protocol

protocol

public final T protocol(String protocol)
Set the HTTP message protocol version.

Parameters:
protocol - protocol version in format "HTTP/1.x".

chunked

public final T chunked(boolean isChunked)
Set true, if this HttpPacket content will be transferred in chunking mode, or false if case of fixed-length message.

Parameters:
isChunked - true, if this HttpPacket content will be transferred in chunking mode, or false if case of fixed-length message.

contentLength

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

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

contentType

public final T contentType(String contentType)
Set the content-type of this HttpPacket.

Parameters:
contentType - the content-type of this HttpPacket.

upgrade

public final T upgrade(String upgrade)
Set the HTTP upgrade type.

Parameters:
upgrade - the type of upgrade.

header

public final T header(String name,
                      String value)
Add the HTTP mime header.

Parameters:
name - the mime header name.
value - the mime header value.


Copyright © 2011 Oracle Corpration. All Rights Reserved.