1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.kernel.servlet;
24  
25  import java.util.Enumeration;
26  
27  import javax.servlet.ServletContext;
28  import javax.servlet.http.HttpSession;
29  
30  /**
31   * <a href="HttpSessionWrapper.java.html"><b><i>View Source</i></b></a>
32   *
33   * @author Brian Wing Shun Chan
34   */
35  public class HttpSessionWrapper implements HttpSession {
36  
37      public HttpSessionWrapper(HttpSession session) {
38          _session = session;
39      }
40  
41      public Object getAttribute(String name) {
42          return _session.getAttribute(name);
43      }
44  
45      public Enumeration<String> getAttributeNames() {
46          return _session.getAttributeNames();
47      }
48  
49      public long getCreationTime() {
50          return _session.getCreationTime();
51      }
52  
53      public String getId() {
54          return _session.getId();
55      }
56  
57      public long getLastAccessedTime() {
58          return _session.getLastAccessedTime();
59      }
60  
61      public int getMaxInactiveInterval() {
62          return _session.getMaxInactiveInterval();
63      }
64  
65      public ServletContext getServletContext() {
66          return _session.getServletContext();
67      }
68  
69      /**
70       * @deprecated
71       */
72      public javax.servlet.http.HttpSessionContext getSessionContext() {
73          return _session.getSessionContext();
74      }
75  
76      /**
77       * @deprecated
78       */
79      public Object getValue(String name) {
80          return _session.getValue(name);
81      }
82  
83      /**
84       * @deprecated
85       */
86      public String[] getValueNames() {
87          return _session.getValueNames();
88      }
89  
90      public void invalidate() {
91          _session.invalidate();
92      }
93  
94      public boolean isNew() {
95          return _session.isNew();
96      }
97  
98      /**
99       * @deprecated
100      */
101     public void putValue(String name, Object value) {
102         _session.putValue(name, value);
103     }
104 
105     public void removeAttribute(String name) {
106         _session.removeAttribute(name);
107     }
108 
109     /**
110      * @deprecated
111      */
112     public void removeValue(String name) {
113         _session.removeValue(name);
114     }
115 
116     public void setAttribute(String name, Object value) {
117         _session.setAttribute(name, value);
118     }
119 
120     public void setMaxInactiveInterval(int interval) {
121         _session.setMaxInactiveInterval(interval);
122     }
123 
124     private HttpSession _session;
125 
126 }