|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.shiro.subject.Subject.Builder org.apache.shiro.web.subject.WebSubject.Builder
public static class WebSubject.Builder
A WebSubject.Builder
performs the same function as a Subject.Builder
, but
additionally ensures that the Servlet request/response pair that is triggering the Subject instance's creation
is retained for use by internal Shiro components as necessary.
Constructor Summary | |
---|---|
WebSubject.Builder(SecurityManager securityManager,
ServletRequest request,
ServletResponse response)
Constructs a new Web.Builder instance using the specified SecurityManager instance to
create the WebSubject instance. |
|
WebSubject.Builder(ServletRequest request,
ServletResponse response)
Constructs a new Web.Builder instance using the SecurityManager obtained by
calling SecurityUtils. getSecurityManager() . |
Method Summary | |
---|---|
WebSubject |
buildWebSubject()
Returns super.buildSubject() , but additionally ensures that the returned instance
is an instanceof WebSubject and to support a type-safe method so a caller
does not have to cast. |
protected SubjectContext |
newSubjectContextInstance()
Overrides the parent implementation to return a new instance of a DefaultWebSubjectContext to account for the additional request/response
pair. |
protected WebSubject.Builder |
setRequest(ServletRequest request)
Called by the WebSubject.Builder constructor, this method places the request object in the
context map for later retrieval. |
protected WebSubject.Builder |
setResponse(ServletResponse response)
Called by the WebSubject.Builder constructor, this method places the response object in the
context map for later retrieval. |
Methods inherited from class org.apache.shiro.subject.Subject.Builder |
---|
authenticated, buildSubject, contextAttribute, getSubjectContext, host, principals, session, sessionCreationEnabled, sessionId |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WebSubject.Builder(ServletRequest request, ServletResponse response)
Web.Builder
instance using the SecurityManager
obtained by
calling SecurityUtils.
getSecurityManager()
. If you want
to specify your own SecurityManager instance, use the
#Builder(SecurityManager, ServletRequest, ServletResponse)
constructor instead.
request
- the incoming ServletRequest that will be associated with the built WebSubject
instance.response
- the outgoing ServletRequest paired with the ServletRequest that will be associated with the
built WebSubject
instance.public WebSubject.Builder(SecurityManager securityManager, ServletRequest request, ServletResponse response)
Web.Builder
instance using the specified SecurityManager
instance to
create the WebSubject
instance.
securityManager
- the SecurityManager SecurityManager
instance to use to build the
WebSubject
instance.request
- the incoming ServletRequest that will be associated with the built WebSubject
instance.response
- the outgoing ServletRequest paired with the ServletRequest that will be associated
with the built WebSubject
instance.Method Detail |
---|
protected SubjectContext newSubjectContextInstance()
DefaultWebSubjectContext
to account for the additional request/response
pair.
newSubjectContextInstance
in class Subject.Builder
DefaultWebSubjectContext
to account for the
additional request/response pair.protected WebSubject.Builder setRequest(ServletRequest request)
WebSubject.Builder
constructor, this method places the request object in the
context map for later retrieval.
request
- the incoming ServletRequest that triggered the creation of the WebSubject
instance.
protected WebSubject.Builder setResponse(ServletResponse response)
WebSubject.Builder
constructor, this method places the response object in the
context map for later retrieval.
response
- the outgoing ServletRequest paired with the ServletRequest that triggered the creation of
the WebSubject
instance.
public WebSubject buildWebSubject()
super.buildSubject()
, but additionally ensures that the returned instance
is an instanceof
WebSubject
and to support a type-safe method so a caller
does not have to cast. Per the parent class's method JavaDoc, this method will return a new instance
each time it is called.
WebSubject
instance built by this Builder
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |