|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.grizzly.http.HttpHeader
org.glassfish.grizzly.http.HttpResponsePacket
public abstract class HttpResponsePacket
The HttpHeader object, which represents HTTP response message.
HttpHeader,
HttpRequestPacket| Nested Class Summary | |
|---|---|
static class |
HttpResponsePacket.Builder
HttpResponsePacket message builder. |
| Field Summary | |
|---|---|
static int |
NON_PARSED_STATUS
|
protected int |
parsedStatusInt
Status code. |
protected BufferChunk |
statusBC
|
| Fields inherited from class org.glassfish.grizzly.http.HttpHeader |
|---|
charEncoding, charEncodingParsed, contentLength, contentType, contentTypeParsed, headers, isChunked, isCommitted, isExpectContent, isSkipRemainder, parsedProtocol, protocolBC, secure, upgrade |
| Constructor Summary | |
|---|---|
protected |
HttpResponsePacket()
|
| Method Summary | |
|---|---|
void |
acknowledged()
Mark this packet as having been acknowledged. |
void |
addHeader(String name,
String value)
Add the HTTP mime header. |
static HttpResponsePacket.Builder |
builder(HttpRequestPacket request)
Returns HttpResponsePacket builder. |
String |
getContentLanguage()
|
Locale |
getLocale()
|
String |
getReasonPhrase()
Gets the status reason phrase for this response. |
BufferChunk |
getReasonPhraseBC(boolean useDefault)
Gets the status reason phrase for this response as BufferChunk
(avoid creation of a String object}. |
HttpRequestPacket |
getRequest()
|
int |
getStatus()
Gets the status code for this response. |
BufferChunk |
getStatusBC()
Gets the status code for this response as BufferChunk (avoid
the status code parsing}. |
boolean |
isAcknowledgement()
|
boolean |
isRequest()
Returns true, if the current HttpHeader represent HTTP request message, or false otherwise. |
protected void |
reset()
Reset the internal state. |
void |
setAcknowledgement(boolean acknowledgement)
Mark this packet as an acknowledgement to a client expectation. |
void |
setContentLanguage(String contentLanguage)
Set the value that will be used by the Content-Language
response header. |
void |
setHeader(String name,
String value)
Set the value, of the specific HTTP mime header. |
void |
setLocale(Locale locale)
Called explicitly by user to set the Content-Language and the default encoding |
void |
setReasonPhrase(String message)
Sets the status reason phrase for this response. |
void |
setRequest(HttpRequestPacket request)
Associates the request that triggered this response. |
void |
setStatus(int status)
Sets the status code for this response. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int NON_PARSED_STATUS
protected int parsedStatusInt
protected final BufferChunk statusBC
| Constructor Detail |
|---|
protected HttpResponsePacket()
| Method Detail |
|---|
public static HttpResponsePacket.Builder builder(HttpRequestPacket request)
HttpResponsePacket builder.
HttpResponsePacket.Builder.public BufferChunk getStatusBC()
BufferChunk (avoid
the status code parsing}.
BufferChunk (avoid
the status code parsing}.public int getStatus()
public void setStatus(int status)
status - the status code for this response.public BufferChunk getReasonPhraseBC(boolean useDefault)
BufferChunk
(avoid creation of a String object}.
useDefault - if true and no reason phase has been
explicitly set, the default as defined by RFC 2616 will
be returned.
BufferChunk
(avoid creation of a String object}.public String getReasonPhrase()
public void setReasonPhrase(String message)
message - the status reason phrase for this response.public HttpRequestPacket getRequest()
public boolean isAcknowledgement()
true if this response packet is intended
as an acknowledgement to an expectation from a client request.public void setAcknowledgement(boolean acknowledgement)
acknowledgement - true if this packet is an
acknowledgement to a client expectation.public void acknowledged()
protected void reset()
reset in class HttpHeaderpublic final boolean isRequest()
isRequest in class HttpHeaderpublic String toString()
toString in class Object
public void setHeader(String name,
String value)
HttpHeader
setHeader in interface MimeHeadersPacketsetHeader in class HttpHeadername - the mime header name.value - the mime header value.
public void addHeader(String name,
String value)
HttpHeader
addHeader in interface MimeHeadersPacketaddHeader in class HttpHeadername - the mime header name.value - the mime header value.public Locale getLocale()
Locale of this response.public void setLocale(Locale locale)
public String getContentLanguage()
Content-Language
response headerpublic void setContentLanguage(String contentLanguage)
Content-Language
response header.
public void setRequest(HttpRequestPacket request)
request - the request that triggered this response
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||