001    /**
002     * Copyright (c) 2000-2011 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.poller.comet;
016    
017    import com.liferay.portal.util.PortalUtil;
018    
019    import javax.servlet.http.HttpServletRequest;
020    
021    /**
022     * @author Edward Han
023     * @author Brian Wing Shun Chan
024     */
025    public abstract class BaseCometRequest implements CometRequest {
026    
027            public long getCompanyId() {
028                    return _companyId;
029            }
030    
031            public String getPathInfo() {
032                    return _pathInfo;
033            }
034    
035            public HttpServletRequest getRequest() {
036                    return _request;
037            }
038    
039            public long getTimestamp() {
040                    return _timestamp;
041            }
042    
043            public long getUserId() {
044                    return _userId;
045            }
046    
047            public void setCompanyId(long companyId) {
048                    _companyId = companyId;
049            }
050    
051            public void setRequest(HttpServletRequest request) {
052                    setCompanyId(PortalUtil.getCompanyId(request));
053                    setPathInfo(request.getPathInfo());
054                    setUserId(PortalUtil.getUserId(request));
055            }
056    
057            public void setPathInfo(String pathInfo) {
058                    _pathInfo = pathInfo;
059            }
060    
061            public void setTimestamp(long timestamp) {
062                    _timestamp = timestamp;
063            }
064    
065            public void setUserId(long userId) {
066                    _userId = userId;
067            }
068    
069            private long _companyId;
070            private String _pathInfo;
071            private HttpServletRequest _request;
072            private long _timestamp = System.currentTimeMillis();
073            private long _userId;
074    
075    }