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.poller;
16  
17  import com.liferay.portal.kernel.util.StringBundler;
18  
19  /**
20   * <a href="PollerHeader.java.html"><b><i>View Source</i></b></a>
21   *
22   * @author Brian Wing Shun Chan
23   */
24  public class PollerHeader {
25  
26      public PollerHeader(
27          long companyId, long userId, long browserKey, String[] portletIds,
28          boolean initialRequest, boolean startPolling) {
29  
30          _companyId = companyId;
31          _userId = userId;
32          _browserKey = browserKey;
33          _portletIds = portletIds;
34          _initialRequest = initialRequest;
35          _startPolling = startPolling;
36      }
37  
38      public long getBrowserKey() {
39          return _browserKey;
40      }
41  
42      public long getCompanyId() {
43          return _companyId;
44      }
45  
46      public String[] getPortletIds() {
47          return _portletIds;
48      }
49  
50      public long getTimestamp() {
51          return _timestamp;
52      }
53  
54      public long getUserId() {
55          return _userId;
56      }
57  
58      public boolean isInitialRequest() {
59          return _initialRequest;
60      }
61  
62      public boolean isStartPolling() {
63          return _startPolling;
64      }
65  
66      public String toString() {
67          StringBundler sb = new StringBundler(13);
68  
69          sb.append("{_browserKey=");
70          sb.append(_browserKey);
71          sb.append(", companyId=");
72          sb.append(_companyId);
73          sb.append(", initialRequest=");
74          sb.append(_initialRequest);
75          sb.append(", portletIds=");
76          sb.append(_portletIds);
77          sb.append(", startPolling=");
78          sb.append(_startPolling);
79          sb.append(", timestamp=");
80          sb.append(_timestamp);
81          sb.append(", userId=");
82          sb.append(_userId);
83          sb.append("}");
84  
85          return sb.toString();
86      }
87  
88      private long _browserKey;
89      private long _companyId;
90      private boolean _initialRequest;
91      private String[] _portletIds;
92      private boolean _startPolling;
93      private long _timestamp = System.currentTimeMillis();
94      private long _userId;
95  
96  }