001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.servlet;
016    
017    import java.util.Enumeration;
018    
019    import javax.servlet.ServletContext;
020    import javax.servlet.http.HttpSession;
021    
022    /**
023     * @author Brian Wing Shun Chan
024     */
025    public class HttpSessionWrapper implements HttpSession {
026    
027            public HttpSessionWrapper(HttpSession session) {
028                    _session = session;
029            }
030    
031            @Override
032            public Object getAttribute(String name) {
033                    return _session.getAttribute(name);
034            }
035    
036            @Override
037            public Enumeration<String> getAttributeNames() {
038                    return _session.getAttributeNames();
039            }
040    
041            @Override
042            public long getCreationTime() {
043                    return _session.getCreationTime();
044            }
045    
046            @Override
047            public String getId() {
048                    return _session.getId();
049            }
050    
051            @Override
052            public long getLastAccessedTime() {
053                    return _session.getLastAccessedTime();
054            }
055    
056            @Override
057            public int getMaxInactiveInterval() {
058                    return _session.getMaxInactiveInterval();
059            }
060    
061            @Override
062            public ServletContext getServletContext() {
063                    return _session.getServletContext();
064            }
065    
066            /**
067             * @deprecated As of 6.1.0
068             */
069            @Override
070            public javax.servlet.http.HttpSessionContext getSessionContext() {
071                    return _session.getSessionContext();
072            }
073    
074            /**
075             * @deprecated As of 6.1.0
076             */
077            @Override
078            public Object getValue(String name) {
079                    return _session.getValue(name);
080            }
081    
082            /**
083             * @deprecated As of 6.1.0
084             */
085            @Override
086            public String[] getValueNames() {
087                    return _session.getValueNames();
088            }
089    
090            public HttpSession getWrappedSession() {
091                    return _session;
092            }
093    
094            @Override
095            public void invalidate() {
096                    _session.invalidate();
097            }
098    
099            @Override
100            public boolean isNew() {
101                    return _session.isNew();
102            }
103    
104            /**
105             * @deprecated As of 6.1.0
106             */
107            @Override
108            public void putValue(String name, Object value) {
109                    _session.putValue(name, value);
110            }
111    
112            @Override
113            public void removeAttribute(String name) {
114                    _session.removeAttribute(name);
115            }
116    
117            /**
118             * @deprecated As of 6.1.0
119             */
120            @Override
121            public void removeValue(String name) {
122                    _session.removeValue(name);
123            }
124    
125            @Override
126            public void setAttribute(String name, Object value) {
127                    _session.setAttribute(name, value);
128            }
129    
130            @Override
131            public void setMaxInactiveInterval(int interval) {
132                    _session.setMaxInactiveInterval(interval);
133            }
134    
135            private HttpSession _session;
136    
137    }