|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.netty.handler.codec.http2.DefaultHttpMessage
public class DefaultHttpMessage

The default HttpMessage implementation.
| Constructor Summary | |
|---|---|
protected |
DefaultHttpMessage(HttpVersion version)
Creates a new instance. |
| Method Summary | |
|---|---|
void |
addHeader(String name,
Object value)
Adds a new header with the specified name and value. |
void |
clearHeaders()
Removes all headers from this message. |
boolean |
containsHeader(String name)
Returns true if and only if there is a header with the specified
header name. |
org.jboss.netty.buffer.ChannelBuffer |
getContent()
Returns the content of this message. |
long |
getContentLength()
Deprecated. |
long |
getContentLength(long defaultValue)
Deprecated. |
String |
getHeader(String name)
Returns the header value with the specified header name. |
Set<String> |
getHeaderNames()
Returns the Set of all header names that this message contains. |
List<Map.Entry<String,String>> |
getHeaders()
Returns the all header names and values that this message contains. |
List<String> |
getHeaders(String name)
Returns the header values with the specified header name. |
HttpVersion |
getProtocolVersion()
Returns the protocol version of this message. |
boolean |
isChunked()
Returns true if and only if this message does not have any
content but the HttpChunks, which is generated by
HttpMessageDecoder consecutively, contain the actual content. |
boolean |
isKeepAlive()
Deprecated. |
void |
removeHeader(String name)
Removes the header with the specified name. |
void |
setChunked(boolean chunked)
Sets if this message does not have any content but the HttpChunks, which is generated by HttpMessageDecoder
consecutively, contain the actual content. |
void |
setContent(org.jboss.netty.buffer.ChannelBuffer content)
Sets the content of this message. |
void |
setHeader(String name,
Iterable<?> values)
Sets a new header with the specified name and values. |
void |
setHeader(String name,
Object value)
Sets a new header with the specified name and value. |
void |
setProtocolVersion(HttpVersion version)
Sets the protocol version of this message. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected DefaultHttpMessage(HttpVersion version)
| Method Detail |
|---|
public void addHeader(String name,
Object value)
HttpMessage
addHeader in interface HttpMessage
public void setHeader(String name,
Object value)
HttpMessage
setHeader in interface HttpMessage
public void setHeader(String name,
Iterable<?> values)
HttpMessage
setHeader in interface HttpMessagepublic void removeHeader(String name)
HttpMessage
removeHeader in interface HttpMessage@Deprecated public long getContentLength()
getContentLength in interface HttpMessage@Deprecated public long getContentLength(long defaultValue)
getContentLength in interface HttpMessagepublic boolean isChunked()
HttpMessagetrue if and only if this message does not have any
content but the HttpChunks, which is generated by
HttpMessageDecoder consecutively, contain the actual content.
Please note that this method will keep returning true if the
"Transfer-Encoding" of this message is "chunked", even if
you attempt to override this property by calling HttpMessage.setChunked(boolean)
with false.
isChunked in interface HttpMessagepublic void setChunked(boolean chunked)
HttpMessageHttpChunks, which is generated by HttpMessageDecoder
consecutively, contain the actual content.
If this method is called with true, the content of this message
becomes ChannelBuffers.EMPTY_BUFFER.
Even if this method is called with false, HttpMessage.isChunked()
will keep returning true if the "Transfer-Encoding" of
this message is "chunked".
setChunked in interface HttpMessage@Deprecated public boolean isKeepAlive()
isKeepAlive in interface HttpMessagepublic void clearHeaders()
HttpMessage
clearHeaders in interface HttpMessagepublic void setContent(org.jboss.netty.buffer.ChannelBuffer content)
HttpMessagenull is specified,
the content of this message will be set to ChannelBuffers.EMPTY_BUFFER.
setContent in interface HttpMessagepublic String getHeader(String name)
HttpMessage
getHeader in interface HttpMessagenull if there is no such headerpublic List<String> getHeaders(String name)
HttpMessage
getHeaders in interface HttpMessageList of header values. An empty list if there is no
such header.public List<Map.Entry<String,String>> getHeaders()
HttpMessage
getHeaders in interface HttpMessageList of the header name-value pairs. An empty list
if there is no header in this message.public boolean containsHeader(String name)
HttpMessagetrue if and only if there is a header with the specified
header name.
containsHeader in interface HttpMessagepublic Set<String> getHeaderNames()
HttpMessageSet of all header names that this message contains.
getHeaderNames in interface HttpMessagepublic HttpVersion getProtocolVersion()
HttpMessage
getProtocolVersion in interface HttpMessagepublic void setProtocolVersion(HttpVersion version)
HttpMessage
setProtocolVersion in interface HttpMessagepublic org.jboss.netty.buffer.ChannelBuffer getContent()
HttpMessageHttpMessage.isChunked() returns true, an
ChannelBuffers.EMPTY_BUFFER is returned.
getContent in interface HttpMessagepublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||