Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.stats
Class ViewCountManager

java.lang.Object
  extended by com.jivesoftware.forum.stats.ViewCountManager
All Implemented Interfaces:
JivePropertyListener, CategoryListener, ForumListener, ThreadListener

public class ViewCountManager
extends java.lang.Object
implements CategoryListener, ForumListener, ThreadListener, JivePropertyListener

A class to handle saving and retrieving view counts for various Jive Forums objects.


Method Summary
 void addCategoryCount(ForumCategory category)
          Increments the view count of the given category by 1 or does nothing if view counts are not enabled.
 void addForumCount(Forum forum)
          Increments the view count of the given forum by 1 or does nothing if view counts are not enabled.
 void addThreadCount(ForumThread thread)
          Increments the view count of the given thread by 1 or does nothing if view counts are not enabled.
 void categoryAdded(CategoryEvent event)
          From the CategoryListener interface.
 void categoryDeleted(CategoryEvent event)
          From the CategoryListener interface.
 void categoryModified(CategoryEvent event)
          From the CategoryListener interface.
 void categoryMoved(CategoryEvent event)
          From the CategoryListener interface.
 void clearAllCounts(int objectType)
          Resets the count to zero for all objects of this type.
 void clearCount(Forum forum)
          Resets the read count for the given forum to 0 or does nothing if view counts are not enabled.
 void clearCount(ForumCategory category)
          Resets the read count for the given category to 0 or does nothing if view counts are not enabled.
 void clearCount(ForumThread thread)
          Resets the read count for the given thread to 0 or does nothing if view counts are not enabled.
 void forumAdded(ForumEvent event)
          From the ForumListener interface.
 void forumDeleted(ForumEvent event)
          Deletes all views associated with the forum being deleted.
 void forumMerged(ForumEvent event)
          From the ForumListener interface.
 void forumModified(ForumEvent event)
          From the ForumListener interface.
 void forumMoved(ForumEvent event)
          From the ForumListener interface.
 int getCategoryCount(ForumCategory category)
          Returns the number of times the given object has been read or -1 if view counts are not enabled.
 int getForumCount(Forum forum)
          Returns the number of times the given object has been read or -1 if view counts are not enabled.
static ViewCountManager getInstance()
          Returns an instance of this class.
 int getThreadCount(ForumThread thread)
          Returns the number of times the given object has been read or -1 if view counts are not enabled.
static boolean isViewCountsEnabled()
           
 void jivePropertyAdded(JivePropertyEvent event)
          Fired when a jive property is added
 void jivePropertyModified(JivePropertyEvent event)
          Fired when a jive property is modified
 void jivePropertyRemoved(JivePropertyEvent event)
          Fired when a jive property is removed
 void threadAdded(ThreadEvent event)
          From the ThreadListener interface.
 void threadDeleted(ThreadEvent event)
          From the ThreadListener interface.
 void threadModerationModified(ThreadEvent event)
          From the ThreadListener interface.
 void threadMoved(ThreadEvent event)
          From the ThreadListener interface.
 void threadRated(ThreadEvent event)
          From the ThreadListener interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isViewCountsEnabled

public static boolean isViewCountsEnabled()

getInstance

public static ViewCountManager getInstance()
Returns an instance of this class.

Returns:
an instance of this class.

getCategoryCount

public int getCategoryCount(ForumCategory category)
Returns the number of times the given object has been read or -1 if view counts are not enabled.

Parameters:
category - the category to check.
Returns:
the number of times the category has been read or 0 if it's never been read.

getForumCount

public int getForumCount(Forum forum)
Returns the number of times the given object has been read or -1 if view counts are not enabled.

Parameters:
forum - the forum to check.
Returns:
the number of times the forum has been read or 0 if it's never been read.

getThreadCount

public int getThreadCount(ForumThread thread)
Returns the number of times the given object has been read or -1 if view counts are not enabled.

Parameters:
thread - the category to check.
Returns:
the number of times the thread has been read or 0 if it's never been read.

addCategoryCount

public void addCategoryCount(ForumCategory category)
Increments the view count of the given category by 1 or does nothing if view counts are not enabled.

Parameters:
category - the category we're viewing.

addForumCount

public void addForumCount(Forum forum)
Increments the view count of the given forum by 1 or does nothing if view counts are not enabled.

Parameters:
forum - the forum we're viewing.

addThreadCount

public void addThreadCount(ForumThread thread)
Increments the view count of the given thread by 1 or does nothing if view counts are not enabled.

Parameters:
thread - the thread we're viewing.

clearCount

public void clearCount(ForumCategory category)
                throws UnauthorizedException
Resets the read count for the given category to 0 or does nothing if view counts are not enabled.

Parameters:
category - the category to reset the counts.
Throws:
UnauthorizedException - if the user is not an admin.

clearCount

public void clearCount(Forum forum)
                throws UnauthorizedException
Resets the read count for the given forum to 0 or does nothing if view counts are not enabled.

Parameters:
forum - the forum to reset the counts.
Throws:
UnauthorizedException - if the user is not an admin.

clearCount

public void clearCount(ForumThread thread)
                throws UnauthorizedException
Resets the read count for the given thread to 0 or does nothing if view counts are not enabled.

Parameters:
thread - the thread to reset the counts.
Throws:
UnauthorizedException - if the user is not an admin.

clearAllCounts

public void clearAllCounts(int objectType)
Resets the count to zero for all objects of this type. Example: use this method to clear the view counts for all forums (manager.clearAllCounts(JiveConstants.FORUM)). Does nothing if view counts are not enabled.

Parameters:
objectType - the type of object to reset counts.

categoryAdded

public void categoryAdded(CategoryEvent event)
From the CategoryListener interface. In this implementation nothing is done for this type of event.

Specified by:
categoryAdded in interface CategoryListener
Parameters:
event - the event object.

categoryDeleted

public void categoryDeleted(CategoryEvent event)
From the CategoryListener interface. Removes all view counts for the deleted category or does nothing if view counts are not enabled.

Specified by:
categoryDeleted in interface CategoryListener
Parameters:
event - the category deleted event.

categoryModified

public void categoryModified(CategoryEvent event)
From the CategoryListener interface. In this implementation nothing is done for this type of event.

Specified by:
categoryModified in interface CategoryListener
Parameters:
event - the event object.

categoryMoved

public void categoryMoved(CategoryEvent event)
From the CategoryListener interface. In this implementation nothing is done for this type of event.

Specified by:
categoryMoved in interface CategoryListener
Parameters:
event - the event object.

forumAdded

public void forumAdded(ForumEvent event)
From the ForumListener interface. In this implementation nothing is done for this type of event.

Specified by:
forumAdded in interface ForumListener
Parameters:
event - the event object.

forumDeleted

public void forumDeleted(ForumEvent event)
Deletes all views associated with the forum being deleted. Also deletes all views for threads in the forum or does nothing if view counts are not enabled.

Specified by:
forumDeleted in interface ForumListener
Parameters:
event - the delete event.

forumModified

public void forumModified(ForumEvent event)
From the ForumListener interface. In this implementation nothing is done for this type of event.

Specified by:
forumModified in interface ForumListener
Parameters:
event - the event object.

forumMoved

public void forumMoved(ForumEvent event)
From the ForumListener interface. In this implementation nothing is done for this type of event.

Specified by:
forumMoved in interface ForumListener
Parameters:
event - the event object.

forumMerged

public void forumMerged(ForumEvent event)
From the ForumListener interface. Adds the forum view counts together or does nothing if view counts are not enabled.

Specified by:
forumMerged in interface ForumListener
Parameters:
event - the merge event.

threadAdded

public void threadAdded(ThreadEvent event)
From the ThreadListener interface. In this implementation nothing is done for this type of event.

Specified by:
threadAdded in interface ThreadListener
Parameters:
event - the event object.

threadDeleted

public void threadDeleted(ThreadEvent event)
From the ThreadListener interface. Deletes the view count for the given thread or does nothing if view counts are not enabled.

Specified by:
threadDeleted in interface ThreadListener
Parameters:
event - the delete event.

threadMoved

public void threadMoved(ThreadEvent event)
From the ThreadListener interface. In this implementation nothing is done for this type of event.

Specified by:
threadMoved in interface ThreadListener
Parameters:
event - the event object.

threadModerationModified

public void threadModerationModified(ThreadEvent event)
From the ThreadListener interface. In this implementation nothing is done for this type of event.

Specified by:
threadModerationModified in interface ThreadListener
Parameters:
event - the event object.

threadRated

public void threadRated(ThreadEvent event)
From the ThreadListener interface. In this implementation nothing is done for this type of event.

Specified by:
threadRated in interface ThreadListener
Parameters:
event - the event object.

jivePropertyAdded

public void jivePropertyAdded(JivePropertyEvent event)
Description copied from interface: JivePropertyListener
Fired when a jive property is added

Specified by:
jivePropertyAdded in interface JivePropertyListener
Parameters:
event - event fired

jivePropertyRemoved

public void jivePropertyRemoved(JivePropertyEvent event)
Description copied from interface: JivePropertyListener
Fired when a jive property is removed

Specified by:
jivePropertyRemoved in interface JivePropertyListener
Parameters:
event - event fired

jivePropertyModified

public void jivePropertyModified(JivePropertyEvent event)
Description copied from interface: JivePropertyListener
Fired when a jive property is modified

Specified by:
jivePropertyModified in interface JivePropertyListener
Parameters:
event - event fired

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.