Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base.stats
Class ReadStat

java.lang.Object
  extended by com.jivesoftware.base.stats.ReadStat

public class ReadStat
extends java.lang.Object

A read stat encapsulates information about an object read. Information includes what type of object is being read (a forum, thread, message, document, etc), the object ID, the date it was read, the user who read it (or null if it was read by a Guest) and the session it was read under.


Constructor Summary
ReadStat(User user, int objectType, long objectID, ReadStatSession session)
          Creates a new ReadStat.
 
Method Summary
 java.util.Date getCreationDate()
          Returns the date the read occured.
 long getID()
          Returns the ID of the read stat, or -1 if the object has not been saved.
 long getObjectID()
          Returns the ID of the object being read.
 int getObjectType()
          Returns the type of object being read (ie, JiveConstants.FORUM).
 ReadStatSession getReadStatSession()
          Returns the session in which the read occurred.
 User getUser()
          Returns the user who read the object, or null if the user was a Guest.
 void setID(long ID)
          Sets the ID of the read stat - this is protected because the manager sets it when saving the read stat to the database.
 java.lang.String toString()
          Returns the read stat in a readable format -- good for debugging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReadStat

public ReadStat(User user,
                int objectType,
                long objectID,
                ReadStatSession session)
Creates a new ReadStat. Note, the user parameter may be null (denotes a guest) but the session parameter may not be. In other words, a valid ReadStatSession object is required to create a new ReadStat.

Parameters:
user - the user reading the object or null if it is a guest.
objectType - the type of object being read.
objectID - the ID of the object being read.
session - the session the read occurs under.
Method Detail

getID

public long getID()
Returns the ID of the read stat, or -1 if the object has not been saved.

Returns:
the ID of the read stat, or -1 if the object has not been saved.

setID

public void setID(long ID)
Sets the ID of the read stat - this is protected because the manager sets it when saving the read stat to the database.

Parameters:
ID - the new ID of the read stat.

getObjectType

public int getObjectType()
Returns the type of object being read (ie, JiveConstants.FORUM).

Returns:
the type of object being read.

getObjectID

public long getObjectID()
Returns the ID of the object being read.

Returns:
the ID of the object being read.

getCreationDate

public java.util.Date getCreationDate()
Returns the date the read occured.

Returns:
the date the read occured.

getUser

public User getUser()
Returns the user who read the object, or null if the user was a Guest.

Returns:
the user who read the object, or null if the user was a Guest.

getReadStatSession

public ReadStatSession getReadStatSession()
Returns the session in which the read occurred.

Returns:
the session in which the read occurred.

toString

public java.lang.String toString()
Returns the read stat in a readable format -- good for debugging.

Overrides:
toString in class java.lang.Object
Returns:
the read stat in a readable format -- good for debugging.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.