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