public class PlayWebContext extends Object implements org.pac4j.core.context.WebContext
This class is the web context for Play (used both for Java and Scala).
"Session objects" are managed by the defined SessionStore
.
"Request attributes" are saved/restored to/from the context.
Modifier and Type | Field and Description |
---|---|
protected play.mvc.Http.Context |
context |
protected Map<String,String[]> |
formParameters |
static play.libs.typedmap.TypedKey<Object> |
PAC4J_USER_PROFILES |
protected play.mvc.Http.Request |
request |
protected play.mvc.Http.Response |
response |
protected String |
responseContent |
protected play.mvc.Http.Session |
session |
protected org.pac4j.core.context.session.SessionStore<PlayWebContext> |
sessionStore |
Constructor and Description |
---|
PlayWebContext(play.mvc.Http.Context context,
org.pac4j.core.context.session.SessionStore<PlayWebContext> sessionStore) |
PlayWebContext(play.api.mvc.RequestHeader requestHeader,
Object body,
org.pac4j.core.context.session.SessionStore<PlayWebContext> sessionStore)
We retrieve the body apart from the request.
|
PlayWebContext(play.api.mvc.RequestHeader requestHeader,
org.pac4j.core.context.session.SessionStore<PlayWebContext> sessionStore) |
public static final play.libs.typedmap.TypedKey<Object> PAC4J_USER_PROFILES
protected final play.mvc.Http.Context context
protected final play.mvc.Http.Request request
protected final play.mvc.Http.Response response
protected final play.mvc.Http.Session session
protected org.pac4j.core.context.session.SessionStore<PlayWebContext> sessionStore
protected String responseContent
public PlayWebContext(play.mvc.Http.Context context, org.pac4j.core.context.session.SessionStore<PlayWebContext> sessionStore)
public PlayWebContext(play.api.mvc.RequestHeader requestHeader, org.pac4j.core.context.session.SessionStore<PlayWebContext> sessionStore)
public PlayWebContext(play.api.mvc.RequestHeader requestHeader, Object body, org.pac4j.core.context.session.SessionStore<PlayWebContext> sessionStore)
requestHeader
- the request without the bodybody
- the body (maybe)sessionStore
- the session storepublic org.pac4j.core.context.session.SessionStore getSessionStore()
getSessionStore
in interface org.pac4j.core.context.WebContext
public void setSessionStore(org.pac4j.core.context.session.SessionStore sessionStore)
setSessionStore
in interface org.pac4j.core.context.WebContext
public play.mvc.Http.Session getJavaSession()
public play.mvc.Http.Context getJavaContext()
public void setResponseStatus(int code)
setResponseStatus
in interface org.pac4j.core.context.WebContext
public void writeResponseContent(String content)
writeResponseContent
in interface org.pac4j.core.context.WebContext
public String getResponseContent()
public String getRequestHeader(String name)
getRequestHeader
in interface org.pac4j.core.context.WebContext
public String getRequestMethod()
getRequestMethod
in interface org.pac4j.core.context.WebContext
public String getRequestParameter(String name)
getRequestParameter
in interface org.pac4j.core.context.WebContext
public Map<String,String[]> getRequestParameters()
getRequestParameters
in interface org.pac4j.core.context.WebContext
public void setResponseHeader(String name, String value)
setResponseHeader
in interface org.pac4j.core.context.WebContext
public String getServerName()
getServerName
in interface org.pac4j.core.context.WebContext
public int getServerPort()
getServerPort
in interface org.pac4j.core.context.WebContext
public String getScheme()
getScheme
in interface org.pac4j.core.context.WebContext
public boolean isSecure()
isSecure
in interface org.pac4j.core.context.WebContext
public String getFullRequestURL()
getFullRequestURL
in interface org.pac4j.core.context.WebContext
public String getRemoteAddr()
getRemoteAddr
in interface org.pac4j.core.context.WebContext
public Object getRequestAttribute(String name)
getRequestAttribute
in interface org.pac4j.core.context.WebContext
public void setRequestAttribute(String name, Object value)
setRequestAttribute
in interface org.pac4j.core.context.WebContext
public Collection<org.pac4j.core.context.Cookie> getRequestCookies()
getRequestCookies
in interface org.pac4j.core.context.WebContext
public String getPath()
getPath
in interface org.pac4j.core.context.WebContext
public void addResponseCookie(org.pac4j.core.context.Cookie cookie)
addResponseCookie
in interface org.pac4j.core.context.WebContext
public void setResponseContentType(String content)
setResponseContentType
in interface org.pac4j.core.context.WebContext
public String getLocation()
Copyright © 2017. All rights reserved.