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