com.xpn.xwiki.stats.impl
Class VisitStats

java.lang.Object
  extended by com.xpn.xwiki.objects.BaseElement<R>
      extended by com.xpn.xwiki.objects.BaseCollection
          extended by com.xpn.xwiki.stats.impl.XWikiStats
              extended by 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: 71a720cee5d8cc29ca3d2f9f5df8dc4e0f3b70cf $
See Also:
Serialized Form

Nested Class Summary
static class VisitStats.Property
          The properties of visit statistics object.
 
Field Summary
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, localEntityReferenceSerializer, ownerDocument, referenceCache
 
Constructor Summary
VisitStats()
          Default VisitStats constructor.
VisitStats(String user, String uniqueID, String cookie, String ip, String userAgent, Date startDate, StatsUtil.PeriodType periodType)
           
 
Method Summary
 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, getCustomMappingMap, getDateValue, getDiff, getDoubleValue, getField, getFieldList, getFieldsToRemove, getFloatValue, getIntValue, getIntValue, getLargeStringValue, getListValue, getLongValue, getNumber, getProperties, getPropertyList, getPropertyNames, getRelativeXClassReference, getSetValue, getSortedIterator, getStringValue, getXClass, getXClassReference, merge, merge, put, removeField, safeget, safeput, setClassName, setDateValue, setDBStringListValue, setDocumentReference, setDoubleValue, setFields, setFieldsToRemove, setFloatValue, setIntValue, setLargeStringValue, setLongValue, setNumber, setOwnerDocument, setSetValue, setStringListValue, setStringValue, setXClassReference, toString, toXMLString
 
Methods inherited from class com.xpn.xwiki.objects.BaseElement
createReference, getDocumentReference, getId, getLocalUidStringEntityReferenceSerializer, getName, getOwnerDocument, getPrettyName, getReference, setId, setName, setPrettyName
 
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, setName
 

Field Detail

oldObject

protected VisitStats oldObject
The previous visit object.

Constructor Detail

VisitStats

public VisitStats()
Default VisitStats 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.


Copyright © 2004–2014 XWiki. All rights reserved.