Coverage Report - org.kuali.rice.krad.web.filter.SessionFilter
 
Classes in this File Line Coverage Branch Coverage Complexity
SessionFilter
0%
0/13
N/A
1.667
 
 1  
 /*
 2  
  * Copyright 2006-2007 The Kuali Foundation
 3  
  * 
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  * 
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  * 
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.rice.krad.web.filter;
 17  
 
 18  
 import java.io.IOException;
 19  
 
 20  
 import javax.servlet.Filter;
 21  
 import javax.servlet.FilterChain;
 22  
 import javax.servlet.FilterConfig;
 23  
 import javax.servlet.ServletException;
 24  
 import javax.servlet.ServletRequest;
 25  
 import javax.servlet.ServletResponse;
 26  
 import javax.servlet.http.HttpServletRequest;
 27  
 
 28  
 import org.apache.log4j.Logger;
 29  
 
 30  0
 public class SessionFilter implements Filter {
 31  0
     private static final Logger LOG = Logger.getLogger(SessionFilter.class);
 32  
 
 33  
     public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException {
 34  
         try {
 35  0
             ((HttpServletRequest) request).getSession();
 36  
         }
 37  0
         catch (IllegalStateException ise) {
 38  0
             LOG.info("A user was denied a session");
 39  0
             throw new IllegalStateException(new StringBuffer("Thank you for visiting Kuali Test Drive!\n\n").append("To ensure that test drivers of the Kuali System demo site have a safe and uneventful trip, we must limit the number of concurrent users and, unfortunately, that number has been reached.\n\n").append("Please check back later.\n\n").append("Questions can be submitted to the Kuali Test Drive listserv at mailto:kualitestdrive@oncourse.iu.edu").toString());
 40  0
         }
 41  0
         filterChain.doFilter(request, response);
 42  0
     }
 43  
 
 44  
     public void init(FilterConfig filterConfig) throws ServletException {
 45  0
         LOG.info("Initialized");
 46  0
     }
 47  
 
 48  
     public void destroy() {
 49  0
         LOG.info("Destroyed");
 50  0
     }
 51  
 }