public class HttpRequest
extends io.netty.handler.codec.http.DefaultHttpRequest
| Modifier and Type | Field and Description |
|---|---|
protected List<MediaType> |
acceptedMediaTypes |
protected boolean |
chunked |
protected HttpProtocolConfiguration |
config |
protected io.netty.buffer.ByteBuf |
content |
protected List<MediaType> |
contentType |
protected HttpCookies |
cookies |
protected org.joda.time.DateTime |
createdAt |
protected FormFiles |
files |
protected FormParams |
form |
protected org.slf4j.Logger |
log |
protected MediaType |
matchedMediaType |
protected boolean |
multipart |
protected boolean |
newSession |
protected ResourcePath |
path |
protected QueryParams |
queryParams |
protected org.apache.shiro.session.Session |
session |
protected static io.netty.util.AttributeKey<String> |
sessionAttr |
protected HttpCookie |
sessionCookie |
protected String |
sessionId |
static String |
SID |
protected org.apache.shiro.subject.Subject |
subject |
| Constructor and Description |
|---|
HttpRequest(io.netty.handler.codec.http.FullHttpRequest msg) |
HttpRequest(io.netty.handler.codec.http.HttpVersion httpVersion,
io.netty.handler.codec.http.HttpMethod method,
String uri)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFormField(String name,
Object value) |
void |
addFormFile(HttpFile file) |
io.netty.buffer.ByteBuf |
content() |
List<MediaType> |
getAcceptedMediaTypes() |
HttpProtocolConfiguration |
getConfig() |
List<MediaType> |
getContentType() |
HttpCookie |
getCookie(String name) |
HttpCookies |
getCookies() |
org.joda.time.DateTime |
getCreatedAt() |
FormFiles |
getFormFiles()
Get all files uploaded with this request
|
FormParams |
getFormParam()
Get all form fields send with this request
|
MediaType |
getMatchedMediaType() |
ResourcePath |
getPath() |
QueryParams |
getQueryParams()
Get the query string parameters associated with this request
|
HttpCookie |
getSessionCookie() |
String |
getSessionId() |
org.apache.shiro.subject.Subject |
getSubject() |
void |
init(io.netty.channel.ChannelHandlerContext ctx)
Because some custom fields depend on headers not set on construction this method
must be invoked after Netty populates the headers.
|
void |
initSession(io.netty.channel.ChannelHandlerContext ctx) |
boolean |
isChunked() |
boolean |
isDelete() |
boolean |
isGet() |
boolean |
isHead() |
boolean |
isMultipart() |
boolean |
isNewSession() |
boolean |
isOptions() |
boolean |
isPost() |
boolean |
isPut() |
void |
setChunked(boolean chunked) |
void |
setConfig(HttpProtocolConfiguration config) |
void |
setCookie(HttpCookie cookie) |
void |
setCookie(String name,
String value)
Sets a cookie with path as "/"
|
void |
setMatchedMediaType(MediaType matchedMediaType) |
void |
setMultipart(boolean multipart) |
void |
setPath(ResourcePath path) |
String |
toString() |
getMethod, getUri, setMethod, setProtocolVersion, setUrigetProtocolVersion, headersgetDecoderResult, setDecoderResultclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic static final String SID
protected static final io.netty.util.AttributeKey<String> sessionAttr
protected final QueryParams queryParams
protected final FormFiles files
protected final FormParams form
protected final HttpCookies cookies
protected final org.joda.time.DateTime createdAt
protected org.slf4j.Logger log
protected ResourcePath path
protected boolean newSession
protected String sessionId
protected MediaType matchedMediaType
protected HttpProtocolConfiguration config
protected boolean multipart
protected boolean chunked
protected io.netty.buffer.ByteBuf content
protected HttpCookie sessionCookie
protected org.apache.shiro.session.Session session
protected org.apache.shiro.subject.Subject subject
public HttpRequest(io.netty.handler.codec.http.FullHttpRequest msg)
public HttpRequest(io.netty.handler.codec.http.HttpVersion httpVersion,
io.netty.handler.codec.http.HttpMethod method,
String uri)
httpVersion - the HTTP version of the requestmethod - the HTTP method of the requesturi - the URI or path of the requestpublic void init(io.netty.channel.ChannelHandlerContext ctx)
ctx - public void initSession(io.netty.channel.ChannelHandlerContext ctx)
public HttpCookie getCookie(String name)
public boolean isGet()
public boolean isPost()
public boolean isPut()
public boolean isDelete()
public boolean isHead()
public boolean isOptions()
public ResourcePath getPath()
public void setPath(ResourcePath path)
public HttpCookies getCookies()
public void setCookie(String name, String value)
name - value - public void setCookie(HttpCookie cookie)
public boolean isNewSession()
public String getSessionId()
public HttpCookie getSessionCookie()
public org.apache.shiro.subject.Subject getSubject()
public void addFormFile(HttpFile file)
public QueryParams getQueryParams()
public FormFiles getFormFiles()
public FormParams getFormParam()
public String toString()
toString in class io.netty.handler.codec.http.DefaultHttpRequestpublic org.joda.time.DateTime getCreatedAt()
public MediaType getMatchedMediaType()
MediaType.WILDCARD by defaultpublic void setMatchedMediaType(MediaType matchedMediaType)
public HttpProtocolConfiguration getConfig()
public void setConfig(HttpProtocolConfiguration config)
public boolean isMultipart()
public void setMultipart(boolean multipart)
public boolean isChunked()
public void setChunked(boolean chunked)
public io.netty.buffer.ByteBuf content()
Copyright © 2012-2015. All Rights Reserved.