public class SocketdContext extends ContextEmpty
限定符和类型 | 字段和说明 |
---|---|
protected AsyncContextState |
asyncState |
cookieMap, filesMap, headerMap, headerOfResponseMap, paramMap
charset, 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, isSecure, output, output, outputStream, outputStreamAsGzip, paramMap, redirect, request, response, session, sessionAsDouble, sessionAsDouble, sessionAsInt, sessionAsInt, sessionAsLong, sessionAsLong, sessionClear, sessionId, sessionOrDefault, sessionRemove, sessionReset, sessionSet, status, statusDoSet
accept, accept, acceptNew, action, asyncStart, attr, attrMap, attrNames, attrOrDefault, attrsClear, attrSet, attrSet, autoMultipart, autoMultipart, body, body, bodyAsBytes, bodyNew, bodyNew, 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, 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, session, sessionState, sessionState, setHandled, setLocale, setRendered, status, userAgent
protected 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.IOException
protected org.noear.socketd.transport.core.Session session()
protected org.noear.socketd.transport.core.Message message()
public java.lang.Object request()
Context
request
在类中 ContextEmpty
public java.lang.String remoteIp()
Context
remoteIp
在类中 ContextEmpty
public int remotePort()
Context
remotePort
在类中 ContextEmpty
public boolean isMultipart()
Context
isMultipart
在类中 Context
public java.lang.String method()
Context
method
在类中 ContextEmpty
public java.lang.String protocol()
Context
protocol
在类中 ContextEmpty
public java.net.URI uri()
Context
uri
在类中 ContextEmpty
public java.lang.String url()
Context
url
在类中 ContextEmpty
public java.lang.String path()
path
在类中 ContextEmpty
public long contentLength()
Context
contentLength
在类中 ContextEmpty
public java.lang.String contentType()
Context
contentType
在类中 ContextEmpty
public java.lang.String queryString()
Context
queryString
在类中 ContextEmpty
public java.io.InputStream bodyAsStream() throws java.io.IOException
Context
bodyAsStream
在类中 ContextEmpty
java.io.IOException
public java.lang.Object response()
Context
response
在类中 ContextEmpty
public void contentType(java.lang.String contentType)
Context
contentType
在类中 Context
public void headerSet(java.lang.String key, java.lang.String val)
Context
headerSet
在类中 ContextEmpty
public void headerAdd(java.lang.String key, java.lang.String val)
Context
headerAdd
在类中 ContextEmpty
public java.lang.String headerOfResponse(java.lang.String name)
Context
headerOfResponse
在类中 ContextEmpty
public void outputAsFile(java.io.File file) throws java.io.IOException
Context
outputAsFile
在类中 ContextEmpty
java.io.IOException
public void outputAsFile(DownloadedFile file) throws java.io.IOException
Context
outputAsFile
在类中 ContextEmpty
java.io.IOException
protected void innerCommit() throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
Context
close
在类中 ContextEmpty
java.io.IOException
public boolean asyncSupported()
Context
asyncSupported
在类中 ContextEmpty
public boolean asyncStarted()
Context
asyncStarted
在类中 ContextEmpty
public void asyncListener(ContextAsyncListener listener)
Context
asyncListener
在类中 ContextEmpty
public void asyncStart(long timeout, java.lang.Runnable runnable)
Context
asyncStart
在类中 ContextEmpty
timeout
- 超时runnable
- 运行器public void asyncComplete()
Context
asyncComplete
在类中 ContextEmpty