- java.lang.Object
-
- org.redkale.net.Response<HttpContext,HttpRequest>
-
- org.redkale.net.http.HttpResponse
-
- org.redkale.mq.spi.HttpMessageResponse
-
public class HttpMessageResponse extends HttpResponse
详情见: https://redkale.org- 从以下版本开始:
- 2.1.0
- 作者:
- zhangjx
-
-
嵌套类概要
-
从类继承的嵌套类/接口 org.redkale.net.http.HttpResponse
HttpResponse.HttpResponseConfig
-
-
字段概要
字段 修饰符和类型 字段 说明 protected MessageRecord
message
protected MessageClient
messageClient
-
从类继承的字段 org.redkale.net.http.HttpResponse
bytes304, bytes404, bytes405, bytes500, bytes504, connectAliveBytes, connectCloseBytes, CONTENT_TYPE_HTML_UTF8, convertHandler, EMPTY_BTYES, LINE, serverNameBytes, status200Bytes
-
从类继承的字段 org.redkale.net.Response
afterFinishListeners, channel, context, errorHandler, filter, inNonBlocking, output, readRegistered, recycleListener, request, responseConsumer, responseSupplier, servlet, thread, workExecutor
-
-
构造器概要
构造器 构造器 说明 HttpMessageResponse(MessageClient messageClient, HttpContext context, HttpMessageRequest request)
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 void
finish(boolean kill, byte[] bs, int offset, int length)
void
finish(boolean kill, String contentType, byte[] bs, int offset, int length)
将指定byte[]按响应结果输出protected <A> void
finish(boolean kill, String contentType, byte[] bs, int offset, int length, Consumer<A> consumer, A attachment)
将指定byte[]按响应结果输出void
finish(int status, String msg)
以指定响应码附带内容输出void
finish(String obj)
将指定字符串以响应结果输出void
finish(Convert convert, Type type, Object obj)
将结果对象输出void
finish(Convert convert, Type type, HttpResult result)
将HttpResult对象输出void
finish(Convert convert, Type type, RetResult ret)
将RetResult对象输出void
finish304()
以304状态码输出void
finish404()
以404状态码输出void
finish500()
以500状态码输出void
finish504()
以504状态码输出void
finishBuffer(boolean kill, ByteBuffer buffer)
void
finishBuffers(boolean kill, ByteBuffer... buffers)
static void
finishHttpResult(boolean finest, Convert respConvert, Type type, MessageRecord msg, MessageClient messageClient, String respTopic, HttpResult result)
void
finishHttpResult(Type type, HttpResult result)
void
finishHttpResult(Convert respConvert, Type type, HttpResult result)
void
finishJson(Convert convert, Type type, Object obj)
将对象以JSON格式输出protected void
prepare()
void
prepare(MessageRecord message)
protected boolean
recycle()
HttpMessageRequest
request()
-
从类继承的方法 org.redkale.net.http.HttpResponse
addCookie, addCookie, addHeader, addHeader, createAsyncHandler, createAsyncHandler, createHeader, defaultError, duplicateHeader, existsHeader, finish, finish, finish, finish, finish, finish, finish, finish, finish, finish, finish, finish, finish405, finishFile, finishFile, finishFuture, finishFuture, finishJson, finishJson, finishJson, finishJsonFuture, finishJsonFuture, finishPublisher, finishPublisher, finishPublisher, finishPublisher, finishScopeFuture, finishScopeFuture, getCacheHandler, getChannel, getContentLength, getContentType, getHeader, getHttpCode, getHttpCode, getRequest, getRetResultHandler, getSendHandler, getStatus, getWorkExecutor, init, inNonBlocking, isAutoOptions, removeChannel, retResultHandler, sendBody, sendHandler, setCacheHandler, setContentLength, setContentType, setFilter, setHeader, setStatus, skipHeader, thenEvent, thenEvent, updateNonBlocking
-
从类继承的方法 org.redkale.net.Response
addAfterFinishListener, codecError, completeFinishBytes, errorHandler, finish, finish, finish, finish, finish, finish, finishBuffer, finishBuffers, finishError, getContext, getOutput, isClosed, nextEvent, recycleListener, refuseAlive, send, send, send
-
-
-
-
字段详细资料
-
messageClient
protected MessageClient messageClient
-
message
protected MessageRecord message
-
-
构造器详细资料
-
HttpMessageResponse
public HttpMessageResponse(MessageClient messageClient, HttpContext context, HttpMessageRequest request)
-
-
方法详细资料
-
prepare
public void prepare(MessageRecord message)
-
request
public HttpMessageRequest request()
-
finishHttpResult
public void finishHttpResult(Type type, HttpResult result)
-
finishHttpResult
public void finishHttpResult(Convert respConvert, Type type, HttpResult result)
-
finishHttpResult
public static void finishHttpResult(boolean finest, Convert respConvert, Type type, MessageRecord msg, MessageClient messageClient, String respTopic, HttpResult result)
-
prepare
protected void prepare()
- 覆盖:
prepare
在类中HttpResponse
-
recycle
protected boolean recycle()
- 覆盖:
recycle
在类中HttpResponse
-
finish
public void finish(Convert convert, Type type, RetResult ret)
从类复制的说明:HttpResponse
将RetResult对象输出- 覆盖:
finish
在类中HttpResponse
- 参数:
convert
- 指定的Converttype
- 指定的RetResult泛型类型ret
- RetResult输出对象
-
finish
public void finish(Convert convert, Type type, HttpResult result)
从类复制的说明:HttpResponse
将HttpResult对象输出- 覆盖:
finish
在类中HttpResponse
- 参数:
convert
- 指定的Converttype
- HttpResult.result的泛型类型result
- HttpResult输出对象
-
finishJson
public void finishJson(Convert convert, Type type, Object obj)
从类复制的说明:HttpResponse
将对象以JSON格式输出- 覆盖:
finishJson
在类中HttpResponse
- 参数:
convert
- 指定的Converttype
- 指定的类型obj
- 输出对象
-
finish
public void finish(Convert convert, Type type, Object obj)
从类复制的说明:HttpResponse
将结果对象输出- 覆盖:
finish
在类中HttpResponse
- 参数:
convert
- 指定的Converttype
- 指定的类型, 不一定是obj的数据类型,必然obj为CompletionStage, type应该为Future的元素类型obj
- 输出对象
-
finish
public void finish(String obj)
从类复制的说明:HttpResponse
将指定字符串以响应结果输出- 覆盖:
finish
在类中HttpResponse
- 参数:
obj
- 输出内容
-
finish304
public void finish304()
从类复制的说明:HttpResponse
以304状态码输出- 覆盖:
finish304
在类中HttpResponse
-
finish404
public void finish404()
从类复制的说明:HttpResponse
以404状态码输出- 覆盖:
finish404
在类中HttpResponse
-
finish500
public void finish500()
从类复制的说明:HttpResponse
以500状态码输出- 覆盖:
finish500
在类中HttpResponse
-
finish504
public void finish504()
从类复制的说明:HttpResponse
以504状态码输出- 覆盖:
finish504
在类中HttpResponse
-
finish
public void finish(int status, String msg)
从类复制的说明:HttpResponse
以指定响应码附带内容输出- 覆盖:
finish
在类中HttpResponse
- 参数:
status
- 响应码msg
- 输出内容
-
finish
public void finish(boolean kill, byte[] bs, int offset, int length)
- 覆盖:
finish
在类中HttpResponse
-
finish
public void finish(boolean kill, String contentType, byte[] bs, int offset, int length)
从类复制的说明:HttpResponse
将指定byte[]按响应结果输出- 覆盖:
finish
在类中HttpResponse
- 参数:
kill
- killcontentType
- ContentTypebs
- 输出内容offset
- 偏移量length
- 长度
-
finish
protected <A> void finish(boolean kill, String contentType, byte[] bs, int offset, int length, Consumer<A> consumer, A attachment)
从类复制的说明:HttpResponse
将指定byte[]按响应结果输出- 覆盖:
finish
在类中HttpResponse
- 类型参数:
A
- A- 参数:
kill
- killcontentType
- ContentTypebs
- 输出内容offset
- 偏移量length
- 长度consumer
- Consumerattachment
- ConvertWriter
-
finishBuffer
public void finishBuffer(boolean kill, ByteBuffer buffer)
- 覆盖:
finishBuffer
在类中Response<HttpContext,HttpRequest>
-
finishBuffers
public void finishBuffers(boolean kill, ByteBuffer... buffers)
- 覆盖:
finishBuffers
在类中Response<HttpContext,HttpRequest>
-
-