View Javadoc

1   // ========================================================================
2   // Copyright (c) 2004-2009 Mort Bay Consulting Pty. Ltd.
3   // ------------------------------------------------------------------------
4   // All rights reserved. This program and the accompanying materials
5   // are made available under the terms of the Eclipse Public License v1.0
6   // and Apache License v2.0 which accompanies this distribution.
7   // The Eclipse Public License is available at 
8   // http://www.eclipse.org/legal/epl-v10.html
9   // The Apache License v2.0 is available at
10  // http://www.opensource.org/licenses/apache2.0.php
11  // You may elect to redistribute this code under either of these licenses. 
12  // ========================================================================
13  
14  package org.eclipse.jetty.ajp;
15  
16  import org.eclipse.jetty.server.HttpConnection;
17  import org.eclipse.jetty.server.Request;
18  
19  public class Ajp13Request extends Request
20  {
21      protected String _remoteAddr;
22      protected String _remoteHost;
23      protected String _remoteUser;
24      protected boolean _sslSecure;
25  
26      /* ------------------------------------------------------------ */
27      public Ajp13Request(HttpConnection connection)
28      {
29          super(connection);     
30      }
31      
32      /* ------------------------------------------------------------ */
33      public Ajp13Request()
34      {     
35      }
36  
37      /* ------------------------------------------------------------ */
38      void setConnection(Ajp13Connection connection)
39      {
40          super.setConnection(connection);
41      }
42  
43      /* ------------------------------------------------------------ */
44      public void setRemoteUser(String remoteUser)
45      {
46          _remoteUser = remoteUser;
47      }
48  
49      /* ------------------------------------------------------------ */
50      public String getRemoteUser()
51      {
52          if(_remoteUser != null)
53              return _remoteUser;
54          return super.getRemoteUser();
55      }
56  
57      /* ------------------------------------------------------------ */
58      public String getRemoteAddr()
59      {
60          if (_remoteAddr != null)
61              return _remoteAddr;
62          if (_remoteHost != null)
63              return _remoteHost;
64          return super.getRemoteAddr();
65      }
66  
67  
68  
69      /* ------------------------------------------------------------ */
70      public void setRemoteAddr(String remoteAddr)
71      {
72          _remoteAddr = remoteAddr;
73      }
74  
75      /* ------------------------------------------------------------ */
76      public String getRemoteHost()
77      {
78          if (_remoteHost != null)
79              return _remoteHost;
80          if (_remoteAddr != null)
81              return _remoteAddr;
82          return super.getRemoteHost();
83      }
84  
85      /* ------------------------------------------------------------ */
86      public void setRemoteHost(String remoteHost)
87      {
88          _remoteHost = remoteHost;
89      }
90      
91      /* ------------------------------------------------------------ */
92      public boolean isSslSecure()
93      {
94          return _sslSecure;
95      }
96  
97      /* ------------------------------------------------------------ */
98      public void setSslSecure(boolean sslSecure)
99      {
100         _sslSecure = sslSecure;
101     }
102 
103     /* ------------------------------------------------------------ */
104     protected void recycle()
105     {
106         super.recycle();
107         _remoteAddr = null;
108         _remoteHost = null;
109 	_remoteUser = null;
110 	_sslSecure = false;
111     }
112 
113 }