|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.webbitserver.netty.NettyHttpResponse
public class NettyHttpResponse
| Constructor Summary | |
|---|---|
NettyHttpResponse(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.handler.codec.http.HttpResponse response,
boolean isKeepAlive,
Thread.UncaughtExceptionHandler exceptionHandler)
|
|
| Method Summary | |
|---|---|
Charset |
charset()
Current Charset used to encode to response as. |
NettyHttpResponse |
charset(Charset charset)
For text based responses, sets the Charset to encode the response as. |
NettyHttpResponse |
chunked()
Turns the response into a chunked response after this method is called, HttpResponse.write(String) should be used to send chunks |
boolean |
containsHeader(String name)
Test to see if this response has a header of the specified name |
NettyHttpResponse |
content(byte[] content)
Write binary based content back to the client. |
NettyHttpResponse |
content(ByteBuffer buffer)
Write binary based content back to the client. |
NettyHttpResponse |
content(String content)
Write text based content back to the client. |
NettyHttpResponse |
cookie(HttpCookie httpCookie)
Adds a cookie |
NettyHttpResponse |
end()
Marks the response as ended. |
NettyHttpResponse |
error(Throwable error)
Marks the response as erroneous. |
NettyHttpResponse |
header(String name,
Date value)
Adds a Date (RFC 1123 format) HTTP header. |
NettyHttpResponse |
header(String name,
long value)
Adds a numeric HTTP header. |
NettyHttpResponse |
header(String name,
String value)
Adds an HTTP header. |
int |
status()
Retrieve HTTP status code that this response is going to return. |
NettyHttpResponse |
status(int status)
Sets the HTTP status code. |
NettyHttpResponse |
write(String content)
Writes immediately to the client without closing the connection. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NettyHttpResponse(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.handler.codec.http.HttpResponse response,
boolean isKeepAlive,
Thread.UncaughtExceptionHandler exceptionHandler)
| Method Detail |
|---|
public NettyHttpResponse charset(Charset charset)
HttpResponse
charset in interface HttpResponsepublic Charset charset()
HttpResponse
charset in interface HttpResponseHttpResponse.charset(Charset)public NettyHttpResponse status(int status)
HttpResponse
status in interface HttpResponsepublic NettyHttpResponse chunked()
HttpResponseHttpResponse.write(String) should be used to send chunks
chunked in interface HttpResponsepublic int status()
HttpResponse
status in interface HttpResponseHttpResponse.status(int)
public NettyHttpResponse header(String name,
String value)
HttpResponse
header in interface HttpResponse
public NettyHttpResponse header(String name,
long value)
HttpResponse
header in interface HttpResponse
public NettyHttpResponse header(String name,
Date value)
HttpResponse
header in interface HttpResponsepublic boolean containsHeader(String name)
HttpResponse
containsHeader in interface HttpResponsepublic NettyHttpResponse cookie(HttpCookie httpCookie)
HttpResponse
cookie in interface HttpResponsehttpCookie - the cookiepublic NettyHttpResponse content(String content)
HttpResponse
content in interface HttpResponseHttpResponse.charset(Charset),
HttpResponse.content(byte[])public NettyHttpResponse content(byte[] content)
HttpResponse
content in interface HttpResponseHttpResponse.content(String)public NettyHttpResponse content(ByteBuffer buffer)
HttpResponse
content in interface HttpResponseHttpResponse.content(String)public NettyHttpResponse write(String content)
HttpResponseHttpResponse.content(String) method caches content until HttpResponse.end() is called()
TODO: Make content write immediately instead and remove this method?
write in interface HttpResponsecontent - what to writepublic NettyHttpResponse error(Throwable error)
HttpResponseHttpResponse.end() or HttpResponse.error(Throwable) called. No more
operations should be performed on a response after these.
error in interface HttpResponsepublic NettyHttpResponse end()
HttpResponseHttpResponse.end() or HttpResponse.error(Throwable) called. No more
operations should be performed on a response after these.
end in interface HttpResponse
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||