org.jboss.netty.handler.codec.http
Class DefaultHttpChunkTrailer

java.lang.Object
  extended by org.jboss.netty.handler.codec.http.DefaultHttpChunkTrailer
All Implemented Interfaces:
HttpChunk, HttpChunkTrailer

public class DefaultHttpChunkTrailer
extends Object
implements HttpChunkTrailer

The default HttpChunkTrailer implementation.

Version:
$Rev: 2080 $, $Date: 2010-01-26 18:04:19 +0900 (Tue, 26 Jan 2010) $
Author:
The Netty Project, Trustin Lee

Field Summary
 
Fields inherited from interface org.jboss.netty.handler.codec.http.HttpChunk
LAST_CHUNK
 
Constructor Summary
DefaultHttpChunkTrailer()
           
 
Method Summary
 void addHeader(String name, Object value)
          Adds a new trailing header with the specified name and value.
 void clearHeaders()
          Removes all trailing headers from this trailer.
 boolean containsHeader(String name)
          Returns true if and only if there is a trailing header with the specified header name.
 ChannelBuffer getContent()
          Returns the content of this chunk.
 String getHeader(String name)
          Returns the trailing header value with the specified header name.
 Set<String> getHeaderNames()
          Returns the Set of all trailing header names that this trailer contains.
 List<Map.Entry<String,String>> getHeaders()
          Returns the all header names and values that this trailer contains.
 List<String> getHeaders(String name)
          Returns the trailing header values with the specified header name.
 boolean isLast()
          Always returns true.
 void removeHeader(String name)
          Removes the trailing header with the specified name.
 void setContent(ChannelBuffer content)
          Sets the content of this chunk.
 void setHeader(String name, Iterable<?> values)
          Sets a new trailing header with the specified name and values.
 void setHeader(String name, Object value)
          Sets a new trailing header with the specified name and value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultHttpChunkTrailer

public DefaultHttpChunkTrailer()
Method Detail

isLast

public boolean isLast()
Description copied from interface: HttpChunkTrailer
Always returns true.

Specified by:
isLast in interface HttpChunk
Specified by:
isLast in interface HttpChunkTrailer

addHeader

public void addHeader(String name,
                      Object value)
Description copied from interface: HttpChunkTrailer
Adds a new trailing header with the specified name and value.

Specified by:
addHeader in interface HttpChunkTrailer

setHeader

public void setHeader(String name,
                      Object value)
Description copied from interface: HttpChunkTrailer
Sets a new trailing header with the specified name and value. If there is an existing trailing header with the same name, the existing one is removed.

Specified by:
setHeader in interface HttpChunkTrailer

setHeader

public void setHeader(String name,
                      Iterable<?> values)
Description copied from interface: HttpChunkTrailer
Sets a new trailing header with the specified name and values. If there is an existing trailing header with the same name, the existing one is removed.

Specified by:
setHeader in interface HttpChunkTrailer

removeHeader

public void removeHeader(String name)
Description copied from interface: HttpChunkTrailer
Removes the trailing header with the specified name.

Specified by:
removeHeader in interface HttpChunkTrailer

clearHeaders

public void clearHeaders()
Description copied from interface: HttpChunkTrailer
Removes all trailing headers from this trailer.

Specified by:
clearHeaders in interface HttpChunkTrailer

getHeader

public String getHeader(String name)
Description copied from interface: HttpChunkTrailer
Returns the trailing header value with the specified header name. If there are more than one trailing header value for the specified header name, the first value is returned.

Specified by:
getHeader in interface HttpChunkTrailer
Returns:
the header value or null if there is no such header

getHeaders

public List<String> getHeaders(String name)
Description copied from interface: HttpChunkTrailer
Returns the trailing header values with the specified header name.

Specified by:
getHeaders in interface HttpChunkTrailer
Returns:
the List of header values. An empty list if there is no such header.

getHeaders

public List<Map.Entry<String,String>> getHeaders()
Description copied from interface: HttpChunkTrailer
Returns the all header names and values that this trailer contains.

Specified by:
getHeaders in interface HttpChunkTrailer
Returns:
the List of the header name-value pairs. An empty list if there is no header in this trailer.

containsHeader

public boolean containsHeader(String name)
Description copied from interface: HttpChunkTrailer
Returns true if and only if there is a trailing header with the specified header name.

Specified by:
containsHeader in interface HttpChunkTrailer

getHeaderNames

public Set<String> getHeaderNames()
Description copied from interface: HttpChunkTrailer
Returns the Set of all trailing header names that this trailer contains.

Specified by:
getHeaderNames in interface HttpChunkTrailer

getContent

public ChannelBuffer getContent()
Description copied from interface: HttpChunk
Returns the content of this chunk. If this is the 'end of content' marker, ChannelBuffers.EMPTY_BUFFER will be returned.

Specified by:
getContent in interface HttpChunk

setContent

public void setContent(ChannelBuffer content)
Description copied from interface: HttpChunk
Sets the content of this chunk. If an empty buffer is specified, this chunk becomes the 'end of content' marker.

Specified by:
setContent in interface HttpChunk


Copyright © 2008-2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.