1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
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  }