|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface HttpResponder
HttpResponder is used to send response back to clients.
| Method Summary | |
|---|---|
void |
sendByteArray(org.jboss.netty.handler.codec.http.HttpResponseStatus status,
byte[] bytes,
com.google.common.collect.Multimap<String,String> headers)
Send a response containing raw bytes. |
void |
sendBytes(org.jboss.netty.handler.codec.http.HttpResponseStatus status,
ByteBuffer buffer,
com.google.common.collect.Multimap<String,String> headers)
Sends a response containing raw bytes. |
void |
sendChunk(org.jboss.netty.buffer.ChannelBuffer content)
Add a chunk of data to the response. |
void |
sendChunkEnd()
Called after all chunks are done. |
void |
sendChunkStart(org.jboss.netty.handler.codec.http.HttpResponseStatus status,
com.google.common.collect.Multimap<String,String> headers)
Respond to the client saying the response will be in chunks. |
void |
sendContent(org.jboss.netty.handler.codec.http.HttpResponseStatus status,
org.jboss.netty.buffer.ChannelBuffer content,
String contentType,
com.google.common.collect.Multimap<String,String> headers)
Send response back to client. |
void |
sendError(org.jboss.netty.handler.codec.http.HttpResponseStatus status,
String errorMessage)
Sends error message back to the client. |
void |
sendFile(File file,
com.google.common.collect.Multimap<String,String> headers)
Sends a file content back to client. |
void |
sendJson(org.jboss.netty.handler.codec.http.HttpResponseStatus status,
Object object)
Sends json response back to the client. |
void |
sendJson(org.jboss.netty.handler.codec.http.HttpResponseStatus status,
Object object,
Type type)
Sends json response back to the client. |
void |
sendJson(org.jboss.netty.handler.codec.http.HttpResponseStatus status,
Object object,
Type type,
com.google.gson.Gson gson)
Sends json response back to the client using the given gson object. |
void |
sendStatus(org.jboss.netty.handler.codec.http.HttpResponseStatus status)
Send only a status code back to client without any content. |
void |
sendStatus(org.jboss.netty.handler.codec.http.HttpResponseStatus status,
com.google.common.collect.Multimap<String,String> headers)
Send only a status code back to client without any content. |
void |
sendString(org.jboss.netty.handler.codec.http.HttpResponseStatus status,
String data)
Send a string response back to the http client. |
| Method Detail |
|---|
void sendJson(org.jboss.netty.handler.codec.http.HttpResponseStatus status,
Object object)
status - Status of the response.object - Object that will be serialized into Json and sent back as content.
void sendJson(org.jboss.netty.handler.codec.http.HttpResponseStatus status,
Object object,
Type type)
status - Status of the response.object - Object that will be serialized into Json and sent back as content.type - Type of object.
void sendJson(org.jboss.netty.handler.codec.http.HttpResponseStatus status,
Object object,
Type type,
com.google.gson.Gson gson)
status - Status of the response.object - Object that will be serialized into Json and sent back as content.type - Type of object.gson - Gson object for serialization.
void sendString(org.jboss.netty.handler.codec.http.HttpResponseStatus status,
String data)
status - status of the Http response.data - string data to be sent back.void sendStatus(org.jboss.netty.handler.codec.http.HttpResponseStatus status)
status - status of the Http response.
void sendStatus(org.jboss.netty.handler.codec.http.HttpResponseStatus status,
com.google.common.collect.Multimap<String,String> headers)
status - status of the Http response.headers - Headers to send.
void sendByteArray(org.jboss.netty.handler.codec.http.HttpResponseStatus status,
byte[] bytes,
com.google.common.collect.Multimap<String,String> headers)
status - status of the Http response.bytes - bytes to be sent back.headers - headers to be sent back. This will overwrite any headers set by the framework.
void sendBytes(org.jboss.netty.handler.codec.http.HttpResponseStatus status,
ByteBuffer buffer,
com.google.common.collect.Multimap<String,String> headers)
status - status of the Http responsebuffer - bytes to sendheaders - Headers to send.
void sendError(org.jboss.netty.handler.codec.http.HttpResponseStatus status,
String errorMessage)
status - Status of the response.errorMessage - Error message sent back to the client.
void sendChunkStart(org.jboss.netty.handler.codec.http.HttpResponseStatus status,
com.google.common.collect.Multimap<String,String> headers)
sendChunk(ChannelBuffer) and sendChunkEnd().
status - the status code to respond with. Defaults to 200-OK if null.headers - additional headers to send with the response. May be null.void sendChunk(org.jboss.netty.buffer.ChannelBuffer content)
sendChunkStart(HttpResponseStatus, Multimap)
should be called before calling this method. sendChunkEnd() should be called after all chunks are done.
content - the chunk of content to sendvoid sendChunkEnd()
void sendContent(org.jboss.netty.handler.codec.http.HttpResponseStatus status,
org.jboss.netty.buffer.ChannelBuffer content,
String contentType,
com.google.common.collect.Multimap<String,String> headers)
status - Status of the response.content - Content to be sent back.contentType - Type of content.headers - Headers to be sent back.
void sendFile(File file,
com.google.common.collect.Multimap<String,String> headers)
file - headers -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||