Class WebDelegatingSubject
- java.lang.Object
-
- org.apache.shiro.subject.support.DelegatingSubject
-
- org.apache.shiro.web.subject.support.WebDelegatingSubject
-
- All Implemented Interfaces:
org.apache.shiro.subject.Subject,WebSubject,RequestPairSource
public class WebDelegatingSubject extends org.apache.shiro.subject.support.DelegatingSubject implements WebSubject
DefaultWebSubjectimplementation that additional ensures the ability to retain a servlet request/response pair to be used by internal shiro components as necessary during the request execution.- Since:
- 1.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.shiro.subject.Subject
org.apache.shiro.subject.Subject.Builder
-
Nested classes/interfaces inherited from interface org.apache.shiro.web.subject.WebSubject
WebSubject.Builder
-
-
Constructor Summary
Constructors Constructor Description WebDelegatingSubject(org.apache.shiro.subject.PrincipalCollection principals, boolean authenticated, String host, org.apache.shiro.session.Session session, boolean sessionEnabled, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, org.apache.shiro.mgt.SecurityManager securityManager)WebDelegatingSubject(org.apache.shiro.subject.PrincipalCollection principals, boolean authenticated, String host, org.apache.shiro.session.Session session, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, org.apache.shiro.mgt.SecurityManager securityManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.shiro.session.mgt.SessionContextcreateSessionContext()javax.servlet.ServletRequestgetServletRequest()Returns theServletRequestaccessible when the Subject instance was created.javax.servlet.ServletResponsegetServletResponse()Returns theServletResponseaccessible when the Subject instance was created.protected booleanisSessionCreationEnabled()Returnstrueif session creation is allowed (as determined by the super class's {@link super#isSessionCreationEnabled()} value and no request-specific override has disabled sessions for this subject,falseotherwise.-
Methods inherited from class org.apache.shiro.subject.support.DelegatingSubject
assertAuthzCheckPossible, associateWith, associateWith, checkPermission, checkPermission, checkPermissions, checkPermissions, checkRole, checkRoles, checkRoles, decorate, execute, execute, getHost, getPreviousPrincipals, getPrincipal, getPrincipals, getSecurityManager, getSession, getSession, hasAllRoles, hasPrincipals, hasRole, hasRoles, isAuthenticated, isPermitted, isPermitted, isPermitted, isPermitted, isPermittedAll, isPermittedAll, isRemembered, isRunAs, login, logout, releaseRunAs, runAs
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.shiro.subject.Subject
associateWith, associateWith, checkPermission, checkPermission, checkPermissions, checkPermissions, checkRole, checkRoles, checkRoles, execute, execute, getPreviousPrincipals, getPrincipal, getPrincipals, getSession, getSession, hasAllRoles, hasRole, hasRoles, isAuthenticated, isPermitted, isPermitted, isPermitted, isPermitted, isPermittedAll, isPermittedAll, isRemembered, isRunAs, login, logout, releaseRunAs, runAs
-
-
-
-
Constructor Detail
-
WebDelegatingSubject
public WebDelegatingSubject(org.apache.shiro.subject.PrincipalCollection principals, boolean authenticated, String host, org.apache.shiro.session.Session session, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, org.apache.shiro.mgt.SecurityManager securityManager)
-
WebDelegatingSubject
public WebDelegatingSubject(org.apache.shiro.subject.PrincipalCollection principals, boolean authenticated, String host, org.apache.shiro.session.Session session, boolean sessionEnabled, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, org.apache.shiro.mgt.SecurityManager securityManager)
-
-
Method Detail
-
getServletRequest
public javax.servlet.ServletRequest getServletRequest()
Description copied from interface:WebSubjectReturns theServletRequestaccessible when the Subject instance was created.- Specified by:
getServletRequestin interfaceRequestPairSource- Specified by:
getServletRequestin interfaceWebSubject- Returns:
- the
ServletRequestaccessible when the Subject instance was created.
-
getServletResponse
public javax.servlet.ServletResponse getServletResponse()
Description copied from interface:WebSubjectReturns theServletResponseaccessible when the Subject instance was created.- Specified by:
getServletResponsein interfaceRequestPairSource- Specified by:
getServletResponsein interfaceWebSubject- Returns:
- the
ServletResponseaccessible when the Subject instance was created.
-
isSessionCreationEnabled
protected boolean isSessionCreationEnabled()
Returnstrueif session creation is allowed (as determined by the super class's {@link super#isSessionCreationEnabled()} value and no request-specific override has disabled sessions for this subject,falseotherwise. This means session creation is disabled if the super {@link super#isSessionCreationEnabled()} property isfalseor if a request attribute is discovered that turns off sessions for the current request.- Overrides:
isSessionCreationEnabledin classorg.apache.shiro.subject.support.DelegatingSubject- Returns:
trueif session creation is allowed (as determined by the super class's {@link super#isSessionCreationEnabled()} value and no request-specific override has disabled sessions for this subject,falseotherwise.- Since:
- 1.2
-
createSessionContext
protected org.apache.shiro.session.mgt.SessionContext createSessionContext()
- Overrides:
createSessionContextin classorg.apache.shiro.subject.support.DelegatingSubject
-
-