Interface WebSudoManager


public interface WebSudoManager
Allows the client to request WebSudo protection from the host application.

Usage pattern:

 public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
 {
      try {
          webSudoManager.willExecuteWebSudoRequest(request);
          // do something
      } catch(WebSudoSessionException wes) {
          webSudoManager.enforceWebSudoProtection(request, response);
      }
 }
 
Since:
2.2
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canExecuteRequest(javax.servlet.http.HttpServletRequest request)
    Check whether this request can be executed.
    void
    enforceWebSudoProtection(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    Ensure that the current request is protected by a WebSudo session.
    void
    willExecuteWebSudoRequest(javax.servlet.http.HttpServletRequest request)
    Mark the current request as a request for a WebSudo protected resource.
  • Method Details

    • canExecuteRequest

      boolean canExecuteRequest(javax.servlet.http.HttpServletRequest request)
      Check whether this request can be executed. This checks if the request is already part of a WebSudo session or if WebSudo is enabled at all.

      Calling this method has no side effects.

      Parameters:
      request - the current HttpServletRequest
      Returns:
      true if this request is protected by a WebSudo session or WebSudo is disabled, false otherwise.
    • enforceWebSudoProtection

      void enforceWebSudoProtection(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Ensure that the current request is protected by a WebSudo session. Typically this will result in a redirect to a WebSudo form which in turn redirects to the original request.

      This is a no op if this request is already protected by a WebSudo session (i.e. canExecuteRequest(javax.servlet.http.HttpServletRequest) would return true).

      Parameters:
      request - the current HttpServletRequest
      response - the current HttpServletResponse
    • willExecuteWebSudoRequest

      void willExecuteWebSudoRequest(javax.servlet.http.HttpServletRequest request) throws WebSudoSessionException
      Mark the current request as a request for a WebSudo protected resource.

      Throws a WebSudoSessionException if the current request is not protected by WebSudo.

      This notifies the host application that the request is a request for a WebSudp protected resource.

      Parameters:
      request - the current HttpServletRequest
      Throws:
      WebSudoSessionException - if the current request is not protected by WebSudo.
      Since:
      2.2.0-beta10