org.glassfish.grizzly.http
Class HttpTrailer

java.lang.Object
  extended by org.glassfish.grizzly.http.HttpPacket
      extended by org.glassfish.grizzly.http.HttpContent
          extended by org.glassfish.grizzly.http.HttpTrailer
All Implemented Interfaces:
Appendable<HttpContent>, Cacheable, MimeHeadersPacket

public class HttpTrailer
extends HttpContent
implements MimeHeadersPacket

HttpContent message, which represents HTTP trailer message. Applicable only for chunked HTTP messages.

Author:
Alexey Stashok

Nested Class Summary
static class HttpTrailer.Builder
          HttpTrailer message builder.
 
Field Summary
 
Fields inherited from class org.glassfish.grizzly.http.HttpContent
content, httpHeader, isLast
 
Constructor Summary
protected HttpTrailer(HttpHeader httpHeader)
           
 
Method Summary
 void addHeader(String name, String value)
          Add the HTTP mime header.
static HttpTrailer.Builder builder(HttpHeader httpHeader)
          Returns HttpTrailer builder.
 boolean containsHeader(String name)
          Returns true, if the mime header with the specific name is present among the HttpHeader mime headers, or false otherwise.
static HttpTrailer create()
           
static HttpTrailer create(HttpHeader httpHeader)
           
 String getHeader(String name)
          Get the value, of the specific HTTP mime header.
 MimeHeaders getHeaders()
          Get all MimeHeaders, associated with the HttpHeader.
 boolean isLast()
          Always true true for the trailer message.
static boolean isTrailer(HttpContent httpContent)
          Returns true if passed HttpContent is a HttpTrailder.
 void recycle()
          
protected  void reset()
          Reset the internal state.
 void setHeader(String name, String value)
          Set the value, of the specific HTTP mime header.
protected  void setHeaders(MimeHeaders mimeHeaders)
          Set the mime headers.
 
Methods inherited from class org.glassfish.grizzly.http.HttpContent
append, getContent, getHttpHeader, isContent, isHeader, setContent, setLast
 
Methods inherited from class org.glassfish.grizzly.http.HttpPacket
isHttp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpTrailer

protected HttpTrailer(HttpHeader httpHeader)
Method Detail

isTrailer

public static boolean isTrailer(HttpContent httpContent)
Returns true if passed HttpContent is a HttpTrailder.

Parameters:
httpContent -
Returns:
true if passed HttpContent is a HttpTrailder.

create

public static HttpTrailer create()

create

public static HttpTrailer create(HttpHeader httpHeader)

builder

public static HttpTrailer.Builder builder(HttpHeader httpHeader)
Returns HttpTrailer builder.

Returns:
HttpTrailer.Builder.

isLast

public final boolean isLast()
Always true true for the trailer message.

Overrides:
isLast in class HttpContent
Returns:
Always true true for the trailer message.

getHeaders

public MimeHeaders getHeaders()
Get all MimeHeaders, associated with the HttpHeader.

Specified by:
getHeaders in interface MimeHeadersPacket
Returns:
all MimeHeaders, associated with the HttpHeader.

getHeader

public String getHeader(String name)
Get the value, of the specific HTTP mime header.

Specified by:
getHeader in interface MimeHeadersPacket
Parameters:
name - the mime header name.
Returns:
the value, of the specific HTTP mime header.

setHeader

public void setHeader(String name,
                      String value)
Set the value, of the specific HTTP mime header.

Specified by:
setHeader in interface MimeHeadersPacket
Parameters:
name - the mime header name.
value - the mime header value.

addHeader

public void addHeader(String name,
                      String value)
Add the HTTP mime header.

Specified by:
addHeader in interface MimeHeadersPacket
Parameters:
name - the mime header name.
value - the mime header value.

containsHeader

public boolean containsHeader(String name)
Returns true, if the mime header with the specific name is present among the HttpHeader mime headers, or false otherwise.

Specified by:
containsHeader in interface MimeHeadersPacket
Parameters:
name - the mime header name.
Returns:
true, if the mime header with the specific name is present among the HttpHeader mime headers, or false otherwise.

setHeaders

protected void setHeaders(MimeHeaders mimeHeaders)
Set the mime headers.

Parameters:
mimeHeaders - MimeHeaders.

reset

protected void reset()
Reset the internal state.

Overrides:
reset in class HttpContent

recycle

public void recycle()

Specified by:
recycle in interface Cacheable
Overrides:
recycle in class HttpContent


Copyright © 2011 Oracle Corpration. All Rights Reserved.