org.jasig.cas.web.support
Class ThrottledSubmissionByIpAddressHandlerInterceptorAdapter

java.lang.Object
  extended by org.springframework.web.servlet.handler.HandlerInterceptorAdapter
      extended by org.jasig.cas.web.support.ThrottledSubmissionByIpAddressHandlerInterceptorAdapter
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, org.springframework.web.servlet.HandlerInterceptor

public final class ThrottledSubmissionByIpAddressHandlerInterceptorAdapter
extends org.springframework.web.servlet.handler.HandlerInterceptorAdapter
implements org.springframework.beans.factory.InitializingBean

Implementation of a HandlerInterceptorAdapter that keeps track of a mapping of IP Addresses to number of failures to authenticate.

Implementation attempts to optimize access by using the last quad in an IP address as a form of poor man's lock.

Since:
3.0.5
Version:
$Revision: 46097 $ $Date: 2009-05-21 15:33:35 -0400 (Thu, 21 May 2009) $
Author:
Scott Battaglia

Nested Class Summary
protected static class ThrottledSubmissionByIpAddressHandlerInterceptorAdapter.ExpirationThread
           
 
Field Summary
protected static java.math.BigInteger ONE
          Cache of the starting Integer.
 
Constructor Summary
ThrottledSubmissionByIpAddressHandlerInterceptorAdapter()
           
 
Method Summary
 void afterPropertiesSet()
           
 void postHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object handler, org.springframework.web.servlet.ModelAndView modelAndView)
           
 void setFailureThreshhold(int failureThreshhold)
           
 void setFailureTimeout(int failureTimeout)
          Set the timeout for failure in seconds.
 
Methods inherited from class org.springframework.web.servlet.handler.HandlerInterceptorAdapter
afterCompletion, preHandle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ONE

protected static final java.math.BigInteger ONE
Cache of the starting Integer.

Constructor Detail

ThrottledSubmissionByIpAddressHandlerInterceptorAdapter

public ThrottledSubmissionByIpAddressHandlerInterceptorAdapter()
Method Detail

postHandle

public void postHandle(javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response,
                       java.lang.Object handler,
                       org.springframework.web.servlet.ModelAndView modelAndView)
                throws java.lang.Exception
Specified by:
postHandle in interface org.springframework.web.servlet.HandlerInterceptor
Overrides:
postHandle in class org.springframework.web.servlet.handler.HandlerInterceptorAdapter
Throws:
java.lang.Exception

setFailureThreshhold

public void setFailureThreshhold(int failureThreshhold)

setFailureTimeout

public void setFailureTimeout(int failureTimeout)
Set the timeout for failure in seconds.

Parameters:
failureTimeout - the failure timeout

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception


Copyright © 2004-2009 Java Architectures Special Interest Group. All Rights Reserved.