Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.database
Class DbReadTracker

java.lang.Object
  extended by com.jivesoftware.forum.database.DbReadTracker
All Implemented Interfaces:
JiveManager, ReadTracker

public class DbReadTracker
extends java.lang.Object
implements ReadTracker, JiveManager

Database implementation of the ReadTracker interface.


Nested Class Summary
static class DbReadTracker.ReadTrackerKey
           
static class DbReadTracker.UserReadTracker
          Tracks the read status of threads and messages for a user.
 
Field Summary
static java.lang.String DELETE_OLD_ENTRIES
           
static java.lang.String DELETE_OLD_MESSAGES_IN_FORUM
           
static java.lang.String DELETE_OLD_OBJECT_IN_FORUM
           
static java.lang.String DELETE_OLD_THREADS_IN_FORUM
           
static java.lang.String GET_FORUM_OBJECTS
           
static java.lang.String GET_MESSAGE_OBJECTS
           
static java.lang.String GET_THREAD_OBJECTS
           
static java.lang.String INSERT_OBJECT_READ
           
static java.lang.String SELECT_OLD_MESSAGES_IN_FORUM
           
static java.lang.String SELECT_OLD_THREADS_IN_FORUM
           
static java.lang.String UPDATE_OBJECT_READ
           
 
Fields inherited from interface com.jivesoftware.forum.ReadTracker
READ, UNREAD, UPDATED
 
Method Summary
 void destroy()
          Notifies the manager to release any resources that may be holding on too.
static DbReadTracker getInstance()
          Returns a Singleton instance of DbReadTracker.
 int getReadStatus(User user, ForumMessage message)
          Returns the read status on the specified message.
 int getReadStatus(User user, ForumThread thread)
          Returns the read status on the specified thread.
static long getTimeWindow()
          The time window defines which content can participate in read tracking.
 int getUnreadMessageCount(User user, Forum forum)
          Returns the count of unread messages that the user has in the forum.
 int getUnreadMessageCount(User user, ForumCategory category)
          Returns the count of unread messages that the user has in the category.
 java.util.Iterator getUnreadMessages(User user, Forum forum)
          Returns an iterator for the unread messages in the forum.
 java.util.Iterator getUnreadMessages(User user, ForumCategory category)
          Returns an iterator for the unread messages in the category.
 int getUnreadThreadCount(User user, Forum forum)
          Returns the count of unread threads that the user has in the forum.
 int getUnreadThreadCount(User user, ForumCategory category)
          Returns the count of unread threads that the user has in the category.
 java.util.Iterator getUnreadThreads(User user, Forum forum)
          Returns an iterator for the unread threads in the forum.
 java.util.Iterator getUnreadThreads(User user, ForumCategory category)
          Returns an iterator for the unread threads in the category.
 void initialize()
          Initialize the manager.
 boolean isReadTrackingEnabled()
          Returns true if read tracking is enabled, false otherwise.
 void markRead(User user, Forum forum)
          Marks an entire forum as read up until the current instant in time.
 void markRead(User user, ForumCategory category)
          Marks an entire category as read up until the current instant in time.
 void markRead(User user, ForumMessage message)
          Marks an individual message as read.
 void setReadTrackingEnabled(boolean enabled)
          Enables or disables the read tracking feature.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GET_FORUM_OBJECTS

public static final java.lang.String GET_FORUM_OBJECTS
See Also:
Constant Field Values

GET_THREAD_OBJECTS

public static final java.lang.String GET_THREAD_OBJECTS
See Also:
Constant Field Values

GET_MESSAGE_OBJECTS

public static final java.lang.String GET_MESSAGE_OBJECTS
See Also:
Constant Field Values

INSERT_OBJECT_READ

public static final java.lang.String INSERT_OBJECT_READ
See Also:
Constant Field Values

UPDATE_OBJECT_READ

public static final java.lang.String UPDATE_OBJECT_READ
See Also:
Constant Field Values

DELETE_OLD_ENTRIES

public static final java.lang.String DELETE_OLD_ENTRIES
See Also:
Constant Field Values

DELETE_OLD_THREADS_IN_FORUM

public static final java.lang.String DELETE_OLD_THREADS_IN_FORUM
See Also:
Constant Field Values

DELETE_OLD_MESSAGES_IN_FORUM

public static final java.lang.String DELETE_OLD_MESSAGES_IN_FORUM
See Also:
Constant Field Values

SELECT_OLD_THREADS_IN_FORUM

public static final java.lang.String SELECT_OLD_THREADS_IN_FORUM
See Also:
Constant Field Values

SELECT_OLD_MESSAGES_IN_FORUM

public static final java.lang.String SELECT_OLD_MESSAGES_IN_FORUM
See Also:
Constant Field Values

DELETE_OLD_OBJECT_IN_FORUM

public static final java.lang.String DELETE_OLD_OBJECT_IN_FORUM
See Also:
Constant Field Values
Method Detail

getInstance

public static DbReadTracker getInstance()
Returns a Singleton instance of DbReadTracker.

Returns:
a DbReadTracker instance.

initialize

public void initialize()
Description copied from interface: JiveManager
Initialize the manager. It is within this method that it is ok to create, access and/or otherwise use external classes (including caches). Until this method is called implementation should not access any external classes that could possibly either access one of the main Factory classes or any caches since doing so can cause deadlocks and possible clustering issues during startup.

This method is used internally by Jive during application startup and should not be called during normal usage of the class.

Specified by:
initialize in interface JiveManager

destroy

public void destroy()
Description copied from interface: JiveManager
Notifies the manager to release any resources that may be holding on too. This could also be used to clear out the managers caches, etc.

This method is used internally by Jive during application startup and should not be called during normal usage of the class.

Specified by:
destroy in interface JiveManager

isReadTrackingEnabled

public boolean isReadTrackingEnabled()
Description copied from interface: ReadTracker
Returns true if read tracking is enabled, false otherwise.

Specified by:
isReadTrackingEnabled in interface ReadTracker
Returns:
true if read tracking is enabled, false otherwise.

setReadTrackingEnabled

public void setReadTrackingEnabled(boolean enabled)
Description copied from interface: ReadTracker
Enables or disables the read tracking feature.

Specified by:
setReadTrackingEnabled in interface ReadTracker
Parameters:
enabled - true to enable read tracking, false otherwise.

getTimeWindow

public static long getTimeWindow()
The time window defines which content can participate in read tracking. Any threads or messages with a modified date older than the time window are automatically considered read.

Returns:
the time window

getReadStatus

public int getReadStatus(User user,
                         ForumThread thread)
Description copied from interface: ReadTracker
Returns the read status on the specified thread.

Specified by:
getReadStatus in interface ReadTracker
Parameters:
user - the user reading the thread.
thread - the thread to check read status on.
Returns:
the read status of the thread.

getReadStatus

public int getReadStatus(User user,
                         ForumMessage message)
Description copied from interface: ReadTracker
Returns the read status on the specified message.

Specified by:
getReadStatus in interface ReadTracker
Parameters:
user - the user reading the message.
message - the message to check read status on.
Returns:
the read status of the message.

markRead

public void markRead(User user,
                     ForumMessage message)
Description copied from interface: ReadTracker
Marks an individual message as read. This will automatically update the read status of the message's thread.

Specified by:
markRead in interface ReadTracker
Parameters:
user - the user that read the message.
message - the message that should be marked as read.

markRead

public void markRead(User user,
                     Forum forum)
Description copied from interface: ReadTracker
Marks an entire forum as read up until the current instant in time. This method is useful if a user wants to "catch up"

Specified by:
markRead in interface ReadTracker
Parameters:
user - the user marking the forum as read.
forum - the forum to mark as read.

markRead

public void markRead(User user,
                     ForumCategory category)
Description copied from interface: ReadTracker
Marks an entire category as read up until the current instant in time. This method is useful if a user wants to "catch up"

Specified by:
markRead in interface ReadTracker
Parameters:
user - the user marking the forum as read.
category - the category to mark as read.

getUnreadThreadCount

public int getUnreadThreadCount(User user,
                                Forum forum)
Description copied from interface: ReadTracker
Returns the count of unread threads that the user has in the forum. Threads with a status of UPDATED count as unread for the purposes of this method.

Specified by:
getUnreadThreadCount in interface ReadTracker
Parameters:
user - the user to check unread threads for.
forum - the forum to check unread threads in.
Returns:
the number of unread threads in the forum.

getUnreadThreadCount

public int getUnreadThreadCount(User user,
                                ForumCategory category)
Description copied from interface: ReadTracker
Returns the count of unread threads that the user has in the category. Threads with a status of UPDATED count as unread for the purposes of this method.

Specified by:
getUnreadThreadCount in interface ReadTracker
Parameters:
user - the user to check unread threads for.
category - the category to check unread threads in.
Returns:
the number of unread threads in the category.

getUnreadThreads

public java.util.Iterator getUnreadThreads(User user,
                                           Forum forum)
Description copied from interface: ReadTracker
Returns an iterator for the unread threads in the forum. Threads with a status of UPDATED count as unread for the purposes of this method.

Specified by:
getUnreadThreads in interface ReadTracker
Parameters:
user - the user to check unread threads for.
forum - the forum to check unread threads in.
Returns:
an iterator for the unread threads in the forum.

getUnreadThreads

public java.util.Iterator getUnreadThreads(User user,
                                           ForumCategory category)
Description copied from interface: ReadTracker
Returns an iterator for the unread threads in the category. Threads with a status of UPDATED count as unread for the purposes of this method.

Specified by:
getUnreadThreads in interface ReadTracker
Parameters:
user - the user to check unread threads for.
category - the category to check unread threads in.
Returns:
an iterator for the unread threads in the category.

getUnreadMessageCount

public int getUnreadMessageCount(User user,
                                 Forum forum)
Description copied from interface: ReadTracker
Returns the count of unread messages that the user has in the forum. Messages with a status of UPDATED count as unread for the purposes of this method.

Specified by:
getUnreadMessageCount in interface ReadTracker
Parameters:
user - user the user to check unread messages for.
forum - forum the forum to check unread messages in.
Returns:
the number of unread messages in the forum.

getUnreadMessageCount

public int getUnreadMessageCount(User user,
                                 ForumCategory category)
Description copied from interface: ReadTracker
Returns the count of unread messages that the user has in the category. Messages with a status of UPDATED count as unread for the purposes of this method.

Specified by:
getUnreadMessageCount in interface ReadTracker
Parameters:
user - user the user to check unread messages for.
category - category the forum to check unread messages in.
Returns:
the number of unread messages in the category.

getUnreadMessages

public java.util.Iterator getUnreadMessages(User user,
                                            Forum forum)
Description copied from interface: ReadTracker
Returns an iterator for the unread messages in the forum. Messages with a status of UPDATED count as unread for the purposes of this method.

Specified by:
getUnreadMessages in interface ReadTracker
Parameters:
user - user the user to check unread messages for.
forum - forum the forum to check unread messages in.
Returns:
an iterator for the unread messages in the forum.

getUnreadMessages

public java.util.Iterator getUnreadMessages(User user,
                                            ForumCategory category)
Description copied from interface: ReadTracker
Returns an iterator for the unread messages in the category. Messages with a status of UPDATED count as unread for the purposes of this method.

Specified by:
getUnreadMessages in interface ReadTracker
Parameters:
user - user the user to check unread messages for.
category - forum the category to check unread messages in.
Returns:
an iterator for the unread messages in the category.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.