Class HtmlToApproximateMarkdownServicePlugin.NonModifyingRequestWrapper

  • All Implemented Interfaces:
    javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest, org.apache.sling.api.adapter.Adaptable, org.apache.sling.api.SlingHttpServletRequest
    Enclosing class:
    HtmlToApproximateMarkdownServicePlugin

    protected class HtmlToApproximateMarkdownServicePlugin.NonModifyingRequestWrapper
    extends org.apache.sling.api.wrappers.SlingHttpServletRequestWrapper
    Wraps the request to make sure nothing is modified.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean hadInvalidOperation  
      protected boolean inAdaptTo  
      • Fields inherited from interface javax.servlet.http.HttpServletRequest

        BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
    • Constructor Summary

      Constructors 
      Constructor Description
      NonModifyingRequestWrapper​(org.apache.sling.api.SlingHttpServletRequest wrappedRequest, String debuginfo)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <AdapterType>
      AdapterType
      adaptTo​(Class<AdapterType> type)  
      boolean authenticate​(javax.servlet.http.HttpServletResponse response)  
      String changeSessionId()  
      javax.servlet.AsyncContext getAsyncContext()  
      Object getAttribute​(String name)  
      String getMethod()
      We render with GET, obviously.
      @Nullable javax.servlet.RequestDispatcher getRequestDispatcher​(@NotNull String path, org.apache.sling.api.request.RequestDispatcherOptions options)  
      @Nullable javax.servlet.RequestDispatcher getRequestDispatcher​(@NotNull org.apache.sling.api.resource.Resource resource)  
      @Nullable javax.servlet.RequestDispatcher getRequestDispatcher​(@NotNull org.apache.sling.api.resource.Resource resource, org.apache.sling.api.request.RequestDispatcherOptions options)  
      org.apache.sling.api.request.RequestParameter getRequestParameter​(String name)  
      List<org.apache.sling.api.request.RequestParameter> getRequestParameterList()  
      org.apache.sling.api.request.RequestParameterMap getRequestParameterMap()  
      org.apache.sling.api.request.RequestParameter[] getRequestParameters​(String name)  
      javax.servlet.http.HttpSession getSession()  
      javax.servlet.http.HttpSession getSession​(boolean create)  
      protected HtmlToApproximateMarkdownServicePlugin.UnsupportedOperationCalled logAndThrow​(String error)  
      void login​(String username, String password)  
      void logout()  
      void removeAttribute​(String name)  
      void setAttribute​(String name, Object o)  
      void setCharacterEncoding​(String env)  
      javax.servlet.AsyncContext startAsync()  
      javax.servlet.AsyncContext startAsync​(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse)  
      <T extends javax.servlet.http.HttpUpgradeHandler>
      T
      upgrade​(Class<T> handlerClass)  
      • Methods inherited from class org.apache.sling.api.wrappers.SlingHttpServletRequestWrapper

        getCookie, getRequestPathInfo, getRequestProgressTracker, getResource, getResourceBundle, getResourceBundle, getResourceResolver, getResponseContentType, getResponseContentTypes, getSlingRequest
      • Methods inherited from class javax.servlet.http.HttpServletRequestWrapper

        getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole
      • Methods inherited from class javax.servlet.ServletRequestWrapper

        getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, setRequest
      • Methods inherited from interface javax.servlet.http.HttpServletRequest

        getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole
      • Methods inherited from interface javax.servlet.ServletRequest

        getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure
    • Field Detail

      • inAdaptTo

        protected boolean inAdaptTo
      • hadInvalidOperation

        protected boolean hadInvalidOperation
    • Constructor Detail

      • NonModifyingRequestWrapper

        public NonModifyingRequestWrapper​(org.apache.sling.api.SlingHttpServletRequest wrappedRequest,
                                          String debuginfo)
    • Method Detail

      • getRequestParameter

        public org.apache.sling.api.request.RequestParameter getRequestParameter​(String name)
        Specified by:
        getRequestParameter in interface org.apache.sling.api.SlingHttpServletRequest
        Overrides:
        getRequestParameter in class org.apache.sling.api.wrappers.SlingHttpServletRequestWrapper
      • getRequestParameterMap

        public org.apache.sling.api.request.RequestParameterMap getRequestParameterMap()
        Specified by:
        getRequestParameterMap in interface org.apache.sling.api.SlingHttpServletRequest
        Overrides:
        getRequestParameterMap in class org.apache.sling.api.wrappers.SlingHttpServletRequestWrapper
      • getRequestParameterList

        public List<org.apache.sling.api.request.RequestParameter> getRequestParameterList()
        Specified by:
        getRequestParameterList in interface org.apache.sling.api.SlingHttpServletRequest
        Overrides:
        getRequestParameterList in class org.apache.sling.api.wrappers.SlingHttpServletRequestWrapper
      • getRequestParameters

        public org.apache.sling.api.request.RequestParameter[] getRequestParameters​(String name)
        Specified by:
        getRequestParameters in interface org.apache.sling.api.SlingHttpServletRequest
        Overrides:
        getRequestParameters in class org.apache.sling.api.wrappers.SlingHttpServletRequestWrapper
      • getMethod

        public String getMethod()
        We render with GET, obviously.
        Specified by:
        getMethod in interface javax.servlet.http.HttpServletRequest
        Overrides:
        getMethod in class javax.servlet.http.HttpServletRequestWrapper
      • getRequestDispatcher

        @Nullable
        public @Nullable javax.servlet.RequestDispatcher getRequestDispatcher​(@NotNull
                                                                              @NotNull String path,
                                                                              org.apache.sling.api.request.RequestDispatcherOptions options)
        Specified by:
        getRequestDispatcher in interface org.apache.sling.api.SlingHttpServletRequest
        Overrides:
        getRequestDispatcher in class org.apache.sling.api.wrappers.SlingHttpServletRequestWrapper
      • getRequestDispatcher

        @Nullable
        public @Nullable javax.servlet.RequestDispatcher getRequestDispatcher​(@NotNull
                                                                              @NotNull org.apache.sling.api.resource.Resource resource,
                                                                              org.apache.sling.api.request.RequestDispatcherOptions options)
        Specified by:
        getRequestDispatcher in interface org.apache.sling.api.SlingHttpServletRequest
        Overrides:
        getRequestDispatcher in class org.apache.sling.api.wrappers.SlingHttpServletRequestWrapper
      • getRequestDispatcher

        @Nullable
        public @Nullable javax.servlet.RequestDispatcher getRequestDispatcher​(@NotNull
                                                                              @NotNull org.apache.sling.api.resource.Resource resource)
        Specified by:
        getRequestDispatcher in interface org.apache.sling.api.SlingHttpServletRequest
        Overrides:
        getRequestDispatcher in class org.apache.sling.api.wrappers.SlingHttpServletRequestWrapper
      • getSession

        public javax.servlet.http.HttpSession getSession​(boolean create)
        Specified by:
        getSession in interface javax.servlet.http.HttpServletRequest
        Overrides:
        getSession in class javax.servlet.http.HttpServletRequestWrapper
      • getSession

        public javax.servlet.http.HttpSession getSession()
        Specified by:
        getSession in interface javax.servlet.http.HttpServletRequest
        Overrides:
        getSession in class javax.servlet.http.HttpServletRequestWrapper
      • changeSessionId

        public String changeSessionId()
        Specified by:
        changeSessionId in interface javax.servlet.http.HttpServletRequest
        Overrides:
        changeSessionId in class javax.servlet.http.HttpServletRequestWrapper
      • authenticate

        public boolean authenticate​(javax.servlet.http.HttpServletResponse response)
                             throws IOException,
                                    javax.servlet.ServletException
        Specified by:
        authenticate in interface javax.servlet.http.HttpServletRequest
        Overrides:
        authenticate in class javax.servlet.http.HttpServletRequestWrapper
        Throws:
        IOException
        javax.servlet.ServletException
      • login

        public void login​(String username,
                          String password)
                   throws javax.servlet.ServletException
        Specified by:
        login in interface javax.servlet.http.HttpServletRequest
        Overrides:
        login in class javax.servlet.http.HttpServletRequestWrapper
        Throws:
        javax.servlet.ServletException
      • logout

        public void logout()
                    throws javax.servlet.ServletException
        Specified by:
        logout in interface javax.servlet.http.HttpServletRequest
        Overrides:
        logout in class javax.servlet.http.HttpServletRequestWrapper
        Throws:
        javax.servlet.ServletException
      • upgrade

        public <T extends javax.servlet.http.HttpUpgradeHandler> T upgrade​(Class<T> handlerClass)
                                                                    throws IOException,
                                                                           javax.servlet.ServletException
        Specified by:
        upgrade in interface javax.servlet.http.HttpServletRequest
        Overrides:
        upgrade in class javax.servlet.http.HttpServletRequestWrapper
        Throws:
        IOException
        javax.servlet.ServletException
      • setCharacterEncoding

        public void setCharacterEncoding​(String env)
        Specified by:
        setCharacterEncoding in interface javax.servlet.ServletRequest
        Overrides:
        setCharacterEncoding in class javax.servlet.ServletRequestWrapper
      • setAttribute

        public void setAttribute​(String name,
                                 Object o)
        Specified by:
        setAttribute in interface javax.servlet.ServletRequest
        Overrides:
        setAttribute in class javax.servlet.ServletRequestWrapper
      • removeAttribute

        public void removeAttribute​(String name)
        Specified by:
        removeAttribute in interface javax.servlet.ServletRequest
        Overrides:
        removeAttribute in class javax.servlet.ServletRequestWrapper
      • getAttribute

        public Object getAttribute​(String name)
        Specified by:
        getAttribute in interface javax.servlet.ServletRequest
        Overrides:
        getAttribute in class javax.servlet.ServletRequestWrapper
      • startAsync

        public javax.servlet.AsyncContext startAsync()
                                              throws IllegalStateException
        Specified by:
        startAsync in interface javax.servlet.ServletRequest
        Overrides:
        startAsync in class javax.servlet.ServletRequestWrapper
        Throws:
        IllegalStateException
      • startAsync

        public javax.servlet.AsyncContext startAsync​(javax.servlet.ServletRequest servletRequest,
                                                     javax.servlet.ServletResponse servletResponse)
                                              throws IllegalStateException
        Specified by:
        startAsync in interface javax.servlet.ServletRequest
        Overrides:
        startAsync in class javax.servlet.ServletRequestWrapper
        Throws:
        IllegalStateException
      • getAsyncContext

        public javax.servlet.AsyncContext getAsyncContext()
        Specified by:
        getAsyncContext in interface javax.servlet.ServletRequest
        Overrides:
        getAsyncContext in class javax.servlet.ServletRequestWrapper
      • adaptTo

        public <AdapterType> AdapterType adaptTo​(Class<AdapterType> type)
        Specified by:
        adaptTo in interface org.apache.sling.api.adapter.Adaptable
        Overrides:
        adaptTo in class org.apache.sling.api.wrappers.SlingHttpServletRequestWrapper