View Javadoc

1   /*
2    * Copyright 2000-2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
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  
17  package org.apache.jetspeed.services.webpage;
18  
19  import javax.servlet.http.*;
20  
21  /***
22   * State information per request, easily passed within proxy service.
23   * 
24   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
25   * @version $Id: ProxyRunData.java,v 1.2 2004/02/23 03:46:26 jford Exp $ 
26   */
27  
28  public class ProxyRunData
29  {
30      private HttpServletRequest request;
31      private HttpServletResponse response;
32      private HttpServlet servlet;
33      private boolean posting = false;
34  
35      /*
36       * Construct a rundata object. Only lives per one request.
37       *
38       * @param servlet The HTTP Servlet object that contains the proxy server.
39       * @param request The HTTP Request.
40       * @param response The HTTP Response.
41       * @param posting If true it means we are in a HTTP POST, otherwise HTTP GET.
42       */
43      ProxyRunData( HttpServlet servlet,
44                    HttpServletRequest request,
45                    HttpServletResponse response,
46                    boolean posting)
47      {
48          this.servlet = servlet;
49          this.request = request;
50          this.response = response;
51          this.posting = posting;
52      }
53  
54      /*
55       * Gets the HttpServlet for this request.
56       *
57       * @return The HttpServlet object for this request.
58       *
59       */
60      public HttpServlet getServlet()
61      {
62          return servlet;
63      }
64  
65      /*
66       * Gets the HttpServletRequest for this request.
67       *
68       * @return The HttpServletRequest object for this request.
69       *
70       */
71      public HttpServletRequest getRequest()
72      {
73          return request;
74      }
75  
76      /*
77       * Gets the HttpServletResponse for this request.
78       *
79       * @return The HttpServletResponse object for this request.
80       *
81       */
82      public HttpServletResponse getResponse()
83      {
84          return response;
85      }
86  
87      /*
88       * Gets the state of this request, either a HTTP post or get.
89       *
90       * @return The state of the request, true for post, false for get.
91       *
92       */
93      public boolean getPosting()
94      {
95          return posting;
96      }
97  
98  }
99