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
Default WebSubject implementation 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
  • Field Summary

    Fields inherited from class org.apache.shiro.subject.support.DelegatingSubject

    authenticated, host, principals, securityManager, session, sessionCreationEnabled
  • 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

    Modifier and Type
    Method
    Description
    protected org.apache.shiro.session.mgt.SessionContext
     
    javax.servlet.ServletRequest
    Returns the ServletRequest accessible when the Subject instance was created.
    javax.servlet.ServletResponse
    Returns the ServletResponse accessible when the Subject instance was created.
    protected boolean
    Returns true if session creation is allowed (as determined by the super class's
    invalid @link
    {@link super#isSessionCreationEnabled()
    } value and no request-specific override has disabled sessions for this subject, false otherwise.

    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, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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 Details

    • 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 Details

    • getServletRequest

      public javax.servlet.ServletRequest getServletRequest()
      Description copied from interface: WebSubject
      Returns the ServletRequest accessible when the Subject instance was created.
      Specified by:
      getServletRequest in interface RequestPairSource
      Specified by:
      getServletRequest in interface WebSubject
      Returns:
      the ServletRequest accessible when the Subject instance was created.
    • getServletResponse

      public javax.servlet.ServletResponse getServletResponse()
      Description copied from interface: WebSubject
      Returns the ServletResponse accessible when the Subject instance was created.
      Specified by:
      getServletResponse in interface RequestPairSource
      Specified by:
      getServletResponse in interface WebSubject
      Returns:
      the ServletResponse accessible when the Subject instance was created.
    • isSessionCreationEnabled

      protected boolean isSessionCreationEnabled()
      Returns true if session creation is allowed (as determined by the super class's
      invalid @link
      {@link super#isSessionCreationEnabled()
      } value and no request-specific override has disabled sessions for this subject, false otherwise.

      This means session creation is disabled if the super

      invalid @link
      {@link super#isSessionCreationEnabled()
      } property is false or if a request attribute is discovered that turns off sessions for the current request.
      Overrides:
      isSessionCreationEnabled in class org.apache.shiro.subject.support.DelegatingSubject
      Returns:
      true if session creation is allowed (as determined by the super class's
      invalid @link
      {@link super#isSessionCreationEnabled()
      } value and no request-specific override has disabled sessions for this subject, false otherwise.
      Since:
      1.2
    • createSessionContext

      protected org.apache.shiro.session.mgt.SessionContext createSessionContext()
      Overrides:
      createSessionContext in class org.apache.shiro.subject.support.DelegatingSubject