com.atlassian.johnson.filters
Class Johnson503Filter

java.lang.Object
  extended by com.atlassian.johnson.filters.AbstractJohnsonFilter
      extended by com.atlassian.johnson.filters.Johnson503Filter
All Implemented Interfaces:
javax.servlet.Filter

public class Johnson503Filter
extends AbstractJohnsonFilter

A handler that returns a no-content temporarily unavailable response suitable for refusing responses when an application is unable to handle normal requests. This is especially useful for cases where the normal response is of an unknown, or dynamic content-type and sending actual content may confuse clients.

Example uses include AJAX requests, generated images, pdf, excel and word docs.


Field Summary
static org.apache.log4j.Category log
           
 
Fields inherited from class com.atlassian.johnson.filters.AbstractJohnsonFilter
config, filterConfig, TEXT_XML_UTF8_CONTENT_TYPE
 
Constructor Summary
Johnson503Filter()
           
 
Method Summary
protected  void handleError(JohnsonEventContainer appEventContainer, javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse)
          Handles the given request for error cases when there is a Johnson Event which stops normal application functioning.
protected  void handleNotSetup(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse)
          Handles the given request for cases when the application is not yet setup which stops normal application functioning.
 
Methods inherited from class com.atlassian.johnson.filters.AbstractJohnsonFilter
destroy, doFilter, getContainerAndRunEventChecks, getServletPath, getStringForEvents, ignoreURI, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final org.apache.log4j.Category log
Constructor Detail

Johnson503Filter

public Johnson503Filter()
Method Detail

handleError

protected void handleError(JohnsonEventContainer appEventContainer,
                           javax.servlet.http.HttpServletRequest servletRequest,
                           javax.servlet.http.HttpServletResponse servletResponse)
                    throws java.io.IOException
Description copied from class: AbstractJohnsonFilter
Handles the given request for error cases when there is a Johnson Event which stops normal application functioning.

Specified by:
handleError in class AbstractJohnsonFilter
Parameters:
appEventContainer - the JohnsonEventContainer that contains the events.
servletRequest - the request being directed to the error.
servletResponse - the response.
Throws:
java.io.IOException - when the error cannot be handled.

handleNotSetup

protected void handleNotSetup(javax.servlet.http.HttpServletRequest servletRequest,
                              javax.servlet.http.HttpServletResponse servletResponse)
                       throws java.io.IOException
Description copied from class: AbstractJohnsonFilter
Handles the given request for cases when the application is not yet setup which stops normal application functioning.

Specified by:
handleNotSetup in class AbstractJohnsonFilter
Parameters:
servletRequest - the request being directed to the error.
servletResponse - the response.
Throws:
java.io.IOException - when the error cannot be handled.


Copyright © 2012 Atlassian. All Rights Reserved.