View Javadoc

1   //========================================================================
2   //Copyright 2004-2008 Mort Bay Consulting Pty. Ltd.
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   //http://www.apache.org/licenses/LICENSE-2.0
8   //Unless required by applicable law or agreed to in writing, software
9   //distributed under the License is distributed on an "AS IS" BASIS,
10  //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11  //See the License for the specific language governing permissions and
12  //limitations under the License.
13  //========================================================================
14  
15  package org.mortbay.jetty.ajp;
16  
17  import org.mortbay.jetty.HttpConnection;
18  import org.mortbay.jetty.Request;
19  
20  public class Ajp13Request extends Request
21  {
22      protected String _remoteAddr;
23      protected String _remoteHost;
24      protected String _remoteUser;
25      protected HttpConnection _connection;
26  
27  
28  
29      public Ajp13Request(HttpConnection connection)
30      {
31          super(connection);
32          _remoteAddr = null;
33          _remoteHost = null;
34          _remoteUser = null;
35          
36      }
37  
38      public void setRemoteUser(String remoteUser)
39      {
40          _remoteUser = remoteUser;
41      }
42  
43      public String getRemoteUser()
44      {
45          if(_remoteUser != null)
46              return _remoteUser;
47          return super.getRemoteUser();
48      }
49  
50      public String getRemoteAddr()
51      {
52          if (_remoteAddr != null)
53              return _remoteAddr;
54          if (_remoteHost != null)
55              return _remoteHost;
56          return super.getRemoteAddr();
57      }
58  
59  
60  
61      public void setRemoteAddr(String remoteAddr)
62      {
63          _remoteAddr = remoteAddr;
64      }
65  
66      public String getRemoteHost()
67      {
68          if (_remoteHost != null)
69              return _remoteHost;
70          if (_remoteAddr != null)
71              return _remoteAddr;
72          return super.getRemoteHost();
73      }
74  
75      public void setRemoteHost(String remoteHost)
76      {
77          _remoteHost = remoteHost;
78      }
79  
80      protected void recycle()
81      {
82          super.recycle();
83          _remoteAddr = null;
84          _remoteHost = null;
85      }
86  
87  }