com.atlassian.sal.core.websudo
Class NoopWebSudoManager

java.lang.Object
  extended by com.atlassian.sal.core.websudo.NoopWebSudoManager
All Implemented Interfaces:
WebSudoManager

public class NoopWebSudoManager
extends Object
implements WebSudoManager

NO OP implementation of the WebSudoManager that can be used if the host application does not support WebSudo.


Constructor Summary
NoopWebSudoManager()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoopWebSudoManager

public NoopWebSudoManager()
Method Detail

canExecuteRequest

public boolean canExecuteRequest(javax.servlet.http.HttpServletRequest request)
Description copied from interface: WebSudoManager
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.

Specified by:
canExecuteRequest in interface WebSudoManager
Parameters:
request - the current HttpServletRequest
Returns:
true if this request is protected by a WebSudo session or WebSudo is disabled, false otherwise.

enforceWebSudoProtection

public void enforceWebSudoProtection(javax.servlet.http.HttpServletRequest request,
                                     javax.servlet.http.HttpServletResponse response)
Description copied from interface: WebSudoManager
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. WebSudoManager.canExecuteRequest(javax.servlet.http.HttpServletRequest) would return true).

Specified by:
enforceWebSudoProtection in interface WebSudoManager
Parameters:
request - the current HttpServletRequest
response - the current HttpServletResponse

willExecuteWebSudoRequest

public void willExecuteWebSudoRequest(javax.servlet.http.HttpServletRequest request)
                               throws WebSudoSessionException
Description copied from interface: WebSudoManager
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.

Specified by:
willExecuteWebSudoRequest in interface WebSudoManager
Parameters:
request - the current HttpServletRequest
Throws:
WebSudoSessionException - if the current request is not protected by WebSudo.


Copyright © 2015 Atlassian. All rights reserved.