com.atlassian.sal.api.websudo
Interface WebSudoManager

All Known Implementing Classes:
NoopWebSudoManager

public interface WebSudoManager

Allows the client to request WebSudo protection from the host application.

Usage pattern:

Since:
2.2

Method Summary
 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 Detail

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


Copyright © 2015 Atlassian. All rights reserved.