Class WebDelegatingSubject

  • All Implemented Interfaces:
    Subject, WebSubject, RequestPairSource


    public class WebDelegatingSubject
    extends 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
    • Constructor Detail

      • WebDelegatingSubject

        public WebDelegatingSubject(PrincipalCollection principals,
                                    boolean authenticated,
                                    String host,
                                    Session session,
                                    boolean sessionEnabled,
                                    ServletRequest request,
                                    ServletResponse response,
                                    SecurityManager securityManager)
    • Method Detail

      • getServletRequest

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

        public ServletResponse getServletResponse()
        Description copied from interface: WebSubject
        Returns the ServletResponse accessible when the Subject instance was created.
        Specified by:
        getServletResponse in interface  WebSubject
        Specified by:
        getServletResponse in interface  RequestPairSource
        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 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 super#isSessionCreationEnabled() property is false or if a request attribute is discovered that turns off sessions for the current request.
        Overrides:
        isSessionCreationEnabled in class  DelegatingSubject
        Returns:
        true if session creation is allowed (as determined by the super class's super#isSessionCreationEnabled() value and no request-specific override has disabled sessions for this subject, false otherwise.
        Since:
        1.2
      • createSessionContext

        protected SessionContext createSessionContext()