1 package com.dotmarketing.beans; 2 3 import java.io.Serializable ; 4 import java.util.ArrayList ; 5 import java.util.Collections ; 6 import java.util.Date ; 7 import java.util.HashMap ; 8 import java.util.List ; 9 import java.util.Map ; 10 import java.util.Set ; 11 12 17 public class Clickstream implements Serializable { 18 19 private static final long serialVersionUID = 1L; 20 @SuppressWarnings ("unchecked") 21 private List clickstreamRequests = Collections.synchronizedList(new ArrayList ()); 22 private long clickstreamId; 23 private Map attributes = new HashMap (); 24 private String hostname; 25 private String userId; 26 private String cookieId; 27 private String remoteAddress; 28 private String initialReferrer; 29 private String userAgent; 30 private Date start = new Date (); 31 private Date lastRequest = new Date (); 32 private boolean bot = false; 33 34 35 public Clickstream() { 36 37 } 38 39 44 public Object getAttribute(String name) { 45 return attributes.get(name); 46 } 47 48 51 public Set getAttributeNames() { 52 return attributes.keySet(); 53 } 54 55 61 public void setAttribute(String name, Object value) { 62 attributes.put(name, value); 63 } 64 65 70 public String getHostname() { 71 return hostname; 72 } 73 74 79 public boolean isBot() { 80 return bot; 81 } 82 83 89 public String getInitialReferrer() { 90 return initialReferrer; 91 } 92 93 98 public Date getStart() { 99 return start; 100 } 101 102 107 public Date getLastRequest() { 108 return lastRequest; 109 } 110 111 116 117 118 121 public String getCookieId() { 122 return cookieId; 123 } 124 127 public void setCookieId(String cookieId) { 128 this.cookieId = cookieId; 129 } 130 133 public long getClickstreamId() { 134 return clickstreamId; 135 } 136 139 public void setClickstreamId(long clickstreamId) { 140 this.clickstreamId = clickstreamId; 141 } 142 145 public String getUserId() { 146 return userId; 147 } 148 151 public void setUserId(String userId) { 152 this.userId = userId; 153 } 154 157 public void setBot(boolean bot) { 158 this.bot = bot; 159 } 160 163 public void setClickstreamRequests(List clickstreamRequests) { 164 this.clickstreamRequests = clickstreamRequests; 165 } 166 169 public void addClickstreamRequest(ClickstreamRequest clickstreamRequest) { 170 clickstreamRequests.add(clickstreamRequest); 171 } 172 175 public void setHostname(String hostname) { 176 this.hostname = hostname; 177 } 178 181 public void setInitialReferrer(String initialReferrer) { 182 if(initialReferrer.length()>255){ 183 initialReferrer = initialReferrer.substring(0,254); 184 } 185 this.initialReferrer = initialReferrer; 186 } 187 190 public void setLastRequest(Date lastRequest) { 191 this.lastRequest = lastRequest; 192 } 193 196 public void setStart(Date start) { 197 this.start = start; 198 } 199 200 203 public List getClickstreamRequests() { 204 return clickstreamRequests; 205 } 206 207 208 209 210 213 public String getUserAgent() { 214 return userAgent; 215 } 216 219 public void setUserAgent(String userAgent) { 220 if(userAgent!=null && userAgent.length()>255){ 221 userAgent = userAgent.substring(0,254); 222 } 223 this.userAgent = userAgent; 224 } 225 228 public String getRemoteAddress() { 229 return remoteAddress; 230 } 231 234 public void setRemoteAddress(String remoteAddress) { 235 this.remoteAddress = remoteAddress; 236 } 237 } 238 239 240 | Popular Tags |