org.jasig.cas.client.util
Class AbstractCasFilter

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

public abstract class AbstractCasFilter
extends AbstractConfigurationFilter

Abstract filter that contains code that is common to all CAS filters.

The following filter options can be configured (either at the context-level or filter-level).

Please note that one of the two above parameters must be set.

Since:
3.1
Author:
Scott Battaglia, Misagh Moayyed

Field Summary
static String CONST_CAS_ASSERTION
          Represents the constant for where the assertion will be located in memory.
 
Fields inherited from class org.jasig.cas.client.util.AbstractConfigurationFilter
logger
 
Constructor Summary
protected AbstractCasFilter(Protocol protocol)
           
 
Method Summary
protected  String constructServiceUrl(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 void destroy()
           
protected  Protocol getProtocol()
           
 void init()
          Initialization method.
 void init(javax.servlet.FilterConfig filterConfig)
           
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  String retrieveTicketFromRequest(javax.servlet.http.HttpServletRequest request)
          Template method to allow you to change how you retrieve the ticket.
 void setEncodeServiceUrl(boolean encodeServiceUrl)
           
 void setServerName(String serverName)
          Note that trailing slashes should not be used in the serverName.
 void setService(String service)
           
 
Methods inherited from class org.jasig.cas.client.util.AbstractConfigurationFilter
getBoolean, getClass, getInt, getLong, getString, isIgnoreInitConfiguration, setIgnoreInitConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.Filter
doFilter
 

Field Detail

CONST_CAS_ASSERTION

public static final String CONST_CAS_ASSERTION
Represents the constant for where the assertion will be located in memory.

See Also:
Constant Field Values
Constructor Detail

AbstractCasFilter

protected AbstractCasFilter(Protocol protocol)
Method Detail

init

public final void init(javax.servlet.FilterConfig filterConfig)
                throws javax.servlet.ServletException
Specified by:
init in interface javax.servlet.Filter
Overrides:
init in class AbstractConfigurationFilter
Throws:
javax.servlet.ServletException

initInternal

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

Parameters:
filterConfig - the original filter configuration.
Throws:
javax.servlet.ServletException - if there is a problem.

init

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


destroy

public void destroy()

constructServiceUrl

protected final String constructServiceUrl(javax.servlet.http.HttpServletRequest request,
                                           javax.servlet.http.HttpServletResponse response)

setServerName

public final void setServerName(String serverName)
Note that trailing slashes should not be used in the serverName. As a convenience for this common misconfiguration, we strip them from the provided value.

Parameters:
serverName - the serverName. If this method is called, this should not be null. This AND service should not be both configured.

setService

public final void setService(String service)

setEncodeServiceUrl

public final void setEncodeServiceUrl(boolean encodeServiceUrl)

getProtocol

protected Protocol getProtocol()

retrieveTicketFromRequest

protected String retrieveTicketFromRequest(javax.servlet.http.HttpServletRequest request)
Template method to allow you to change how you retrieve the ticket.

Parameters:
request - the HTTP ServletRequest. CANNOT be NULL.
Returns:
the ticket if its found, null otherwise.


Copyright © 2006-2015 Jasig. All Rights Reserved.