public class SocketdContext extends ContextEmpty
| 限定符和类型 | 字段和说明 |
|---|---|
protected AsyncContextState |
asyncState |
cookieMap, filesMap, headerMap, headerOfResponseMap, paramMapcharset, errors, result, sessionState| 构造器和说明 |
|---|
SocketdContext(org.noear.socketd.transport.core.Session session,
org.noear.socketd.transport.core.Message message) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
asyncComplete()
异步完成
|
void |
asyncListener(ContextAsyncListener listener)
异步监听
|
void |
asyncStart(long timeout,
java.lang.Runnable runnable)
异步开始
|
boolean |
asyncStarted()
异步已开始
|
boolean |
asyncSupported()
是否支持异步
|
java.io.InputStream |
bodyAsStream()
获取body内容为Stream
|
void |
close()
关闭响应(一些特殊的boot才有效)
|
long |
contentLength()
获取内容长度
|
java.lang.String |
contentType()
获取内容类型
|
void |
contentType(java.lang.String contentType)
设置内容类型
|
void |
headerAdd(java.lang.String key,
java.lang.String val)
添加 header
|
java.lang.String |
headerOfResponse(java.lang.String name)
获取响应 header
|
void |
headerSet(java.lang.String key,
java.lang.String val)
设置 header
|
protected void |
innerCommit() |
boolean |
isMultipart()
是否为分段内容
|
protected org.noear.socketd.transport.core.Message |
message() |
java.lang.String |
method()
获取请求方法
|
void |
outputAsFile(DownloadedFile file)
输出为文件
|
void |
outputAsFile(java.io.File file)
输出为文件
|
java.lang.String |
path()
获取请求的URI路径
|
java.lang.String |
protocol()
获取请求协议
|
java.lang.String |
queryString()
获取查询字符串
|
java.lang.String |
remoteIp()
获取远程IP
|
int |
remotePort()
获取远程Port
|
java.lang.Object |
request()
获取请求对象
|
java.lang.Object |
response()
获取响应对象
|
protected org.noear.socketd.transport.core.Session |
session() |
java.net.URI |
uri()
获取请求的URI
|
java.lang.String |
url()
获取请求的URL字符串
|
contentCharset, contentTypeDoSet, cookieMap, cookieSet, create, fileMap, filesDelete, flush, headerMap, headerNamesOfResponse, headerOfResponseMap, headerValuesOfResponse, isHeadersSent, isSecure, output, output, outputStream, outputStreamAsGzip, paramMap, redirect, request, response, sendHandlers, session, sessionAsDouble, sessionAsDouble, sessionAsInt, sessionAsInt, sessionAsLong, sessionAsLong, sessionClear, sessionId, sessionOrDefault, sessionRemove, sessionReset, sessionSet, status, statusDoSetaccept, accept, acceptNew, action, asyncStart, attr, attrMap, attrNames, attrOrDefault, attrsClear, attrSet, attrSet, autoMultipart, autoMultipart, body, body, bodyAsBytes, bodyNew, bodyNew, cacheControl, charset, contentLength, contentTypeNew, controller, cookie, cookieNames, cookieOrDefault, cookieRemove, cookieSet, cookieSet, cookieSet, cookieSet, cookieValues, current, file, fileNames, fileValues, forward, getHandled, getLocale, getRendered, header, headerNames, headerOrDefault, headerValues, isFormUrlencoded, isMultipartFormData, keepAlive, mainHandler, output, output, outputAsHtml, outputAsJson, param, paramAsBean, paramAsDecimal, paramAsDecimal, paramAsDouble, paramAsDouble, paramAsInt, paramAsInt, paramAsLong, paramAsLong, paramNames, paramOrDefault, paramValues, pathAsLower, pathAsUpper, pathMap, pathNew, pathNew, protocolAsUpper, pull, realIp, redirect, referer, remoting, remotingSet, render, render, renderAndReturn, returnValue, session, sessionState, sessionState, setHandled, setLocale, setRendered, status, userAgentprotected final AsyncContextState asyncState
public SocketdContext(org.noear.socketd.transport.core.Session session,
org.noear.socketd.transport.core.Message message)
throws java.io.IOException
java.io.IOExceptionprotected org.noear.socketd.transport.core.Session session()
protected org.noear.socketd.transport.core.Message message()
public java.lang.Object request()
Contextrequest 在类中 ContextEmptypublic java.lang.String remoteIp()
ContextremoteIp 在类中 ContextEmptypublic int remotePort()
ContextremotePort 在类中 ContextEmptypublic boolean isMultipart()
ContextisMultipart 在类中 Contextpublic java.lang.String method()
Contextmethod 在类中 ContextEmptypublic java.lang.String protocol()
Contextprotocol 在类中 ContextEmptypublic java.net.URI uri()
Contexturi 在类中 ContextEmptypublic java.lang.String url()
Contexturl 在类中 ContextEmptypublic java.lang.String path()
path 在类中 ContextEmptypublic long contentLength()
ContextcontentLength 在类中 ContextEmptypublic java.lang.String contentType()
ContextcontentType 在类中 ContextEmptypublic java.lang.String queryString()
ContextqueryString 在类中 ContextEmptypublic java.io.InputStream bodyAsStream()
throws java.io.IOException
ContextbodyAsStream 在类中 ContextEmptyjava.io.IOExceptionpublic java.lang.Object response()
Contextresponse 在类中 ContextEmptypublic void contentType(java.lang.String contentType)
ContextcontentType 在类中 Contextpublic void headerSet(java.lang.String key,
java.lang.String val)
ContextheaderSet 在类中 ContextEmptypublic void headerAdd(java.lang.String key,
java.lang.String val)
ContextheaderAdd 在类中 ContextEmptypublic java.lang.String headerOfResponse(java.lang.String name)
ContextheaderOfResponse 在类中 ContextEmptypublic void outputAsFile(java.io.File file)
throws java.io.IOException
ContextoutputAsFile 在类中 ContextEmptyjava.io.IOExceptionpublic void outputAsFile(DownloadedFile file) throws java.io.IOException
ContextoutputAsFile 在类中 ContextEmptyjava.io.IOExceptionprotected void innerCommit()
throws java.io.IOException
java.io.IOExceptionpublic void close()
throws java.io.IOException
Contextclose 在类中 ContextEmptyjava.io.IOExceptionpublic boolean asyncSupported()
ContextasyncSupported 在类中 ContextEmptypublic boolean asyncStarted()
ContextasyncStarted 在类中 ContextEmptypublic void asyncListener(ContextAsyncListener listener)
ContextasyncListener 在类中 ContextEmptypublic void asyncStart(long timeout,
java.lang.Runnable runnable)
ContextasyncStart 在类中 ContextEmptytimeout - 超时runnable - 运行器public void asyncComplete()
ContextasyncComplete 在类中 ContextEmpty