View Javadoc
1   /**
2    * Waffle (https://github.com/dblock/waffle)
3    *
4    * Copyright (c) 2010 - 2015 Application Security, Inc.
5    *
6    * All rights reserved. This program and the accompanying materials
7    * are made available under the terms of the Eclipse Public License v1.0
8    * which accompanies this distribution, and is available at
9    * http://www.eclipse.org/legal/epl-v10.html
10   *
11   * Contributors:
12   *     Application Security, Inc.
13   */
14  package waffle.mock.http;
15  
16  import java.io.IOException;
17  
18  import javax.servlet.FilterChain;
19  import javax.servlet.ServletException;
20  import javax.servlet.ServletRequest;
21  import javax.servlet.ServletResponse;
22  
23  /**
24   * Simple filter chain.
25   * 
26   * @author dblock[at]dblock[dot]org
27   */
28  public class SimpleFilterChain implements FilterChain {
29  
30      /** The request. */
31      private ServletRequest  request;
32      
33      /** The response. */
34      private ServletResponse response;
35  
36      /**
37       * Gets the request.
38       *
39       * @return the request
40       */
41      public ServletRequest getRequest() {
42          return this.request;
43      }
44  
45      /**
46       * Gets the response.
47       *
48       * @return the response
49       */
50      public ServletResponse getResponse() {
51          return this.response;
52      }
53  
54      /* (non-Javadoc)
55       * @see javax.servlet.FilterChain#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
56       */
57      @Override
58      public void doFilter(final ServletRequest sreq, final ServletResponse srep) throws IOException, ServletException {
59  
60          this.request = sreq;
61          this.response = srep;
62      }
63  }