org.jasig.cas.client.validation
Class AbstractTicketValidationFilter

java.lang.Object
  extended by org.jasig.cas.client.util.AbstractConfigurationFilter
      extended by org.jasig.cas.client.util.AbstractCasFilter
          extended by org.jasig.cas.client.validation.AbstractTicketValidationFilter
All Implemented Interfaces:
javax.servlet.Filter
Direct Known Subclasses:
Cas10TicketValidationFilter, Cas20ProxyReceivingTicketValidationFilter, Saml11TicketValidationFilter

public abstract class AbstractTicketValidationFilter
extends AbstractCasFilter

The filter that handles all the work of validating ticket requests.

This filter can be configured with the following values:

Since:
3.1
Version:
$Revision$ $Date$
Author:
Scott Battaglia

Field Summary
 
Fields inherited from class org.jasig.cas.client.util.AbstractCasFilter
CONST_CAS_ASSERTION, log
 
Constructor Summary
AbstractTicketValidationFilter()
           
 
Method Summary
 void doFilter(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, javax.servlet.FilterChain filterChain)
           
protected  TicketValidator getTicketValidator(javax.servlet.FilterConfig filterConfig)
          Template method to return the appropriate validator.
 void init()
          Initialization method.
protected  void initInternal(javax.servlet.FilterConfig filterConfig)
          Controls the ordering of filter initialization and checking by defining a method that runs before the init.
protected  void onFailedValidation(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Template method that gets executed if validation fails.
protected  void onSuccessfulValidation(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Assertion assertion)
          Template method that gets executed if ticket validation succeeds.
protected  boolean preFilter(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, javax.servlet.FilterChain filterChain)
          Pre-process the request before the normal filter process starts.
 void setExceptionOnValidationFailure(boolean exceptionOnValidationFailure)
           
 void setRedirectAfterValidation(boolean redirectAfterValidation)
           
 void setTicketValidator(TicketValidator ticketValidator)
           
 void setUseSession(boolean useSession)
           
 
Methods inherited from class org.jasig.cas.client.util.AbstractCasFilter
constructServiceUrl, destroy, getArtifactParameterName, getServiceParameterName, init, setArtifactParameterName, setEncodeServiceUrl, setServerName, setService, setServiceParameterName
 
Methods inherited from class org.jasig.cas.client.util.AbstractConfigurationFilter
getPropertyFromInitParams, isIgnoreInitConfiguration, loadFromContext, parseBoolean, setIgnoreInitConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTicketValidationFilter

public AbstractTicketValidationFilter()
Method Detail

getTicketValidator

protected TicketValidator getTicketValidator(javax.servlet.FilterConfig filterConfig)
Template method to return the appropriate validator.

Parameters:
filterConfig - the FilterConfiguration that may be needed to construct a validator.
Returns:
the ticket validator.

initInternal

protected void initInternal(javax.servlet.FilterConfig filterConfig)
                     throws javax.servlet.ServletException
Description copied from class: AbstractCasFilter
Controls the ordering of filter initialization and checking by defining a method that runs before the init.

Overrides:
initInternal in class AbstractCasFilter
Parameters:
filterConfig - the original filter configuration.
Throws:
javax.servlet.ServletException - if there is a problem.

init

public void init()
Description copied from class: AbstractCasFilter
Initialization method. Called by Filter's init method or by Spring. Similar in concept to the InitializingBean interface's afterPropertiesSet();

Overrides:
init in class AbstractCasFilter

preFilter

protected boolean preFilter(javax.servlet.ServletRequest servletRequest,
                            javax.servlet.ServletResponse servletResponse,
                            javax.servlet.FilterChain filterChain)
                     throws java.io.IOException,
                            javax.servlet.ServletException
Pre-process the request before the normal filter process starts. This could be useful for pre-empting code.

Parameters:
servletRequest - The servlet request.
servletResponse - The servlet response.
filterChain - the filter chain.
Returns:
true if processing should continue, false otherwise.
Throws:
java.io.IOException - if there is an I/O problem
javax.servlet.ServletException - if there is a servlet problem.

onSuccessfulValidation

protected void onSuccessfulValidation(javax.servlet.http.HttpServletRequest request,
                                      javax.servlet.http.HttpServletResponse response,
                                      Assertion assertion)
Template method that gets executed if ticket validation succeeds. Override if you want additional behavior to occur if ticket validation succeeds. This method is called after all ValidationFilter processing required for a successful authentication occurs.

Parameters:
request - the HttpServletRequest.
response - the HttpServletResponse.
assertion - the successful Assertion from the server.

onFailedValidation

protected void onFailedValidation(javax.servlet.http.HttpServletRequest request,
                                  javax.servlet.http.HttpServletResponse response)
Template method that gets executed if validation fails. This method is called right after the exception is caught from the ticket validator but before any of the processing of the exception occurs.

Parameters:
request - the HttpServletRequest.
response - the HttpServletResponse.

doFilter

public final void doFilter(javax.servlet.ServletRequest servletRequest,
                           javax.servlet.ServletResponse servletResponse,
                           javax.servlet.FilterChain filterChain)
                    throws java.io.IOException,
                           javax.servlet.ServletException
Throws:
java.io.IOException
javax.servlet.ServletException

setTicketValidator

public final void setTicketValidator(TicketValidator ticketValidator)

setRedirectAfterValidation

public final void setRedirectAfterValidation(boolean redirectAfterValidation)

setExceptionOnValidationFailure

public final void setExceptionOnValidationFailure(boolean exceptionOnValidationFailure)

setUseSession

public final void setUseSession(boolean useSession)


Copyright © 2006-2009 JA-SIG. All Rights Reserved.