Package com.xpn.xwiki.stats.impl
Class VisitStats
- java.lang.Object
-
- com.xpn.xwiki.objects.BaseElement<R>
-
- com.xpn.xwiki.objects.BaseCollection
-
- com.xpn.xwiki.stats.impl.XWikiStats
-
- com.xpn.xwiki.stats.impl.VisitStats
-
- All Implemented Interfaces:
ElementInterface
,ObjectInterface
,Serializable
,Cloneable
public class VisitStats extends XWikiStats
The visit statistics database object.- Version:
- $Id: 1ec051ac2403a730593ff15bb453cdcdde11bd9c $
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VisitStats.Property
The properties of visit statistics object.
-
Field Summary
Fields Modifier and Type Field Description protected VisitStats
oldObject
The previous visit object.-
Fields inherited from class com.xpn.xwiki.objects.BaseCollection
currentReferenceDocumentReferenceResolver, fields, fieldsToRemove, number, relativeEntityReferenceResolver
-
Fields inherited from class com.xpn.xwiki.objects.BaseElement
documentReference, ownerDocument, referenceCache
-
-
Constructor Summary
Constructors Constructor Description VisitStats()
DefaultVisitStats
constructor.VisitStats(String user, String uniqueID, String cookie, String ip, String userAgent, Date startDate, StatsUtil.PeriodType periodType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getCookie()
int
getDownloads()
Date
getEndDate()
String
getIP()
VisitStats
getOldObject()
int
getPageSaves()
Date
getStartDate()
String
getUniqueID()
String
getUser()
String
getUserAgent()
void
incDownloads()
Add 1 to the number of downloaded pages during this visit.void
incPageSaves()
Add 1 to the number of saved pages during this visit.void
rememberOldObject(VisitStats vobject)
Store previous object to be able to remove it from the database later.void
setCookie(String cookie)
void
setDownloads(int downloads)
void
setEndDate(Date endDate)
void
setIP(String ip)
void
setPageSaves(int pageSaves)
void
setStartDate(Date startDate)
void
setUniqueID(String uniqueID)
void
setUser(String user)
void
setUserAgent(String userAgent)
void
unrememberOldObject()
Set old visit object to null.-
Methods inherited from class com.xpn.xwiki.stats.impl.XWikiStats
equals, fromXML, getLocalKey, getPageViews, getPeriod, hashCode, incPageViews, setPageViews, setPeriod, toXML
-
Methods inherited from class com.xpn.xwiki.objects.BaseCollection
addField, addPropertyForRemoval, apply, clone, get, getClassName, getCurrentReferenceDocumentReferenceResolver, getCustomMappingMap, getDateValue, getDiff, getDoubleValue, getField, getFieldList, getFieldsToRemove, getFloatValue, getIntValue, getIntValue, getLargeStringValue, getListValue, getLongValue, getNumber, getProperties, getPropertyList, getPropertyNames, getRelativeEntityReferenceResolver, getRelativeXClassReference, getSetValue, getSortedIterator, getStringValue, getXClass, getXClassReference, merge, merge, mergeField, put, removeField, safeget, safeput, setClassName, setDateValue, setDBStringListValue, setDocumentReference, setDoubleValue, setFields, setFieldsToRemove, setFloatValue, setIntValue, setLargeStringValue, setLongValue, setNumber, setOwnerDocument, setSetValue, setStringListValue, setStringValue, setXClassReference, toXML, toXMLString
-
Methods inherited from class com.xpn.xwiki.objects.BaseElement
createReference, fromXML, getDocumentReference, getId, getLocalEntityReferenceSerializer, getLocalization, getLocalUidStringEntityReferenceSerializer, getMergeManager, getName, getOwnerDocument, getPrettyName, getReference, getXWikiContext, localizePlain, localizePlainOrKey, merge, setId, setName, setPrettyName, toString, toXMLString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.xpn.xwiki.objects.ElementInterface
getDocumentReference, getName, getReference, merge, setName, toString
-
-
-
-
Field Detail
-
oldObject
protected VisitStats oldObject
The previous visit object.
-
-
Constructor Detail
-
VisitStats
public VisitStats()
DefaultVisitStats
constructor.
-
VisitStats
public VisitStats(String user, String uniqueID, String cookie, String ip, String userAgent, Date startDate, StatsUtil.PeriodType periodType)
- Parameters:
user
- the user name.uniqueID
- the visit object unique id.cookie
- the cookie id.ip
- the IP of the user.userAgent
- the user agent of the user.startDate
- the starting date of the visit.periodType
- the type of the period.
-
-
Method Detail
-
rememberOldObject
public void rememberOldObject(VisitStats vobject)
Store previous object to be able to remove it from the database later.- Parameters:
vobject
- the previous object.
-
unrememberOldObject
public void unrememberOldObject()
Set old visit object to null.
-
getOldObject
public VisitStats getOldObject()
- Returns:
- the previous visit object.
-
getPageSaves
public int getPageSaves()
- Returns:
- the number of saved pages during this visit.
-
setPageSaves
public void setPageSaves(int pageSaves)
- Parameters:
pageSaves
- the number of saved pages during this visit.
-
incPageSaves
public void incPageSaves()
Add 1 to the number of saved pages during this visit.
-
getDownloads
public int getDownloads()
- Returns:
- the number of downloaded pages during this visit.
-
setDownloads
public void setDownloads(int downloads)
- Parameters:
downloads
- the number of downloaded pages during this visit.
-
incDownloads
public void incDownloads()
Add 1 to the number of downloaded pages during this visit.
-
getStartDate
public Date getStartDate()
- Returns:
- the starting date of the user visit.
-
setStartDate
public void setStartDate(Date startDate)
- Parameters:
startDate
- the starting date of the user visit.
-
getEndDate
public Date getEndDate()
- Returns:
- the ending date of the user visit.
-
setEndDate
public void setEndDate(Date endDate)
- Parameters:
endDate
- the ending date of the user visit.
-
getUniqueID
public String getUniqueID()
- Returns:
- the unique id of the user visit.
-
setUniqueID
public void setUniqueID(String uniqueID)
- Parameters:
uniqueID
- the unique id of the user visit.
-
getCookie
public String getCookie()
- Returns:
- the cookie id of the user.
-
setCookie
public void setCookie(String cookie)
- Parameters:
cookie
- the cookie id of the user.
-
getIP
public String getIP()
- Returns:
- the IP address of the user.
-
setIP
public void setIP(String ip)
- Parameters:
ip
- the IP address of the user.
-
getUserAgent
public String getUserAgent()
- Returns:
- the user agent of the user.
-
setUserAgent
public void setUserAgent(String userAgent)
- Parameters:
userAgent
- the user agent of the user.
-
getUser
public String getUser()
- Returns:
- the user name.
-
setUser
public void setUser(String user)
- Parameters:
user
- the user name.
-
-