Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base.stats
Class ReadStatSession

java.lang.Object
  extended by com.jivesoftware.base.stats.ReadStatSession
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
HTTPReadStatSession, NNTPReadStatSession

public class ReadStatSession
extends java.lang.Object
implements java.io.Serializable

Encapsulates a series of read stat occurrences. Each session has an ID and the date it was created.

Note, this class is basically a simple bean and does not handle its own persistence. Other classes should persist it to a db or filesystem.

This class has been marked as serializable since it or subclasses might need to be saved to an external session manager (ie, the HTTP session in an appserver).

See Also:
Serialized Form

Constructor Summary
ReadStatSession()
           
ReadStatSession(long sessionID, java.lang.String visitorID, java.util.Date creationDate)
          Creates a session given all parameters.
ReadStatSession(java.lang.String visitorID, java.util.Date creationDate)
          Creates an 'unsaved' session given all parameters but the ID.
 
Method Summary
 java.util.Date getCreationDate()
          Returns the creation date of this session.
 long getSessionID()
          Returns the ID of this session.
 java.lang.String getVisitorID()
          Returns the visitor ID associated with this read stat session.
 void setSessionID(long sessionID)
          Sets the session ID for this object.
 java.lang.String toString()
          Returns a simple string format of this class for debugging purposes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReadStatSession

public ReadStatSession()

ReadStatSession

public ReadStatSession(long sessionID,
                       java.lang.String visitorID,
                       java.util.Date creationDate)
Creates a session given all parameters. This method is protected because it should only be used by a factory method to initialize an instance of this class from persistence.

Parameters:
sessionID - a unique session ID.
creationDate - the date the session was created.

ReadStatSession

public ReadStatSession(java.lang.String visitorID,
                       java.util.Date creationDate)
Creates an 'unsaved' session given all parameters but the ID. The ID is -1 by default.

Parameters:
creationDate - the date the session was created.
Method Detail

getSessionID

public long getSessionID()
Returns the ID of this session. An ID of -1 means the session has not been persisted yet.

Returns:
the ID of the session.

setSessionID

public void setSessionID(long sessionID)
Sets the session ID for this object. It's protected since classes that persist this class are the only ones that need to reset the session ID.

Parameters:
sessionID - the unique ID for this object.

getVisitorID

public java.lang.String getVisitorID()
Returns the visitor ID associated with this read stat session.

Returns:
the session's visitor ID.

getCreationDate

public java.util.Date getCreationDate()
Returns the creation date of this session.

Returns:
the creation date of this session.

toString

public java.lang.String toString()
Returns a simple string format of this class for debugging purposes.

Overrides:
toString in class java.lang.Object
Returns:
a string representing the properties of the class.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.