001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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            public Object getAttribute(String name) {
032                    return _session.getAttribute(name);
033            }
034    
035            public Enumeration<String> getAttributeNames() {
036                    return _session.getAttributeNames();
037            }
038    
039            public long getCreationTime() {
040                    return _session.getCreationTime();
041            }
042    
043            public String getId() {
044                    return _session.getId();
045            }
046    
047            public long getLastAccessedTime() {
048                    return _session.getLastAccessedTime();
049            }
050    
051            public int getMaxInactiveInterval() {
052                    return _session.getMaxInactiveInterval();
053            }
054    
055            public ServletContext getServletContext() {
056                    return _session.getServletContext();
057            }
058    
059            /**
060             * @deprecated
061             */
062            public javax.servlet.http.HttpSessionContext getSessionContext() {
063                    return _session.getSessionContext();
064            }
065    
066            /**
067             * @deprecated
068             */
069            public Object getValue(String name) {
070                    return _session.getValue(name);
071            }
072    
073            /**
074             * @deprecated
075             */
076            public String[] getValueNames() {
077                    return _session.getValueNames();
078            }
079    
080            public HttpSession getWrappedSession() {
081                    return _session;
082            }
083    
084            public void invalidate() {
085                    _session.invalidate();
086            }
087    
088            public boolean isNew() {
089                    return _session.isNew();
090            }
091    
092            /**
093             * @deprecated
094             */
095            public void putValue(String name, Object value) {
096                    _session.putValue(name, value);
097            }
098    
099            public void removeAttribute(String name) {
100                    _session.removeAttribute(name);
101            }
102    
103            /**
104             * @deprecated
105             */
106            public void removeValue(String name) {
107                    _session.removeValue(name);
108            }
109    
110            public void setAttribute(String name, Object value) {
111                    _session.setAttribute(name, value);
112            }
113    
114            public void setMaxInactiveInterval(int interval) {
115                    _session.setMaxInactiveInterval(interval);
116            }
117    
118            private HttpSession _session;
119    
120    }