1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions 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   */
36  public class HttpSessionWrapper implements HttpSession {
37  
38      public HttpSessionWrapper(HttpSession session) {
39          _session = session;
40      }
41  
42      public Object getAttribute(String name) {
43          return _session.getAttribute(name);
44      }
45  
46      public Enumeration<String> getAttributeNames() {
47          return _session.getAttributeNames();
48      }
49  
50      public long getCreationTime() {
51          return _session.getCreationTime();
52      }
53  
54      public String getId() {
55          return _session.getId();
56      }
57  
58      public long getLastAccessedTime() {
59          return _session.getLastAccessedTime();
60      }
61  
62      public int getMaxInactiveInterval() {
63          return _session.getMaxInactiveInterval();
64      }
65  
66      public ServletContext getServletContext() {
67          return _session.getServletContext();
68      }
69  
70      /**
71       * @deprecated
72       */
73      public javax.servlet.http.HttpSessionContext getSessionContext() {
74          return _session.getSessionContext();
75      }
76  
77      /**
78       * @deprecated
79       */
80      public Object getValue(String name) {
81          return _session.getValue(name);
82      }
83  
84      /**
85       * @deprecated
86       */
87      public String[] getValueNames() {
88          return _session.getValueNames();
89      }
90  
91      public void invalidate() {
92          _session.invalidate();
93      }
94  
95      public boolean isNew() {
96          return _session.isNew();
97      }
98  
99      /**
100      * @deprecated
101      */
102     public void putValue(String name, Object value) {
103         _session.putValue(name, value);
104     }
105 
106     public void removeAttribute(String name) {
107         _session.removeAttribute(name);
108     }
109 
110     /**
111      * @deprecated
112      */
113     public void removeValue(String name) {
114         _session.removeValue(name);
115     }
116 
117     public void setAttribute(String name, Object value) {
118         _session.setAttribute(name, value);
119     }
120 
121     public void setMaxInactiveInterval(int interval) {
122         _session.setMaxInactiveInterval(interval);
123     }
124 
125     private HttpSession _session;
126 
127 }