Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.database
Class PostCountStatusLevelCalculator

java.lang.Object
  extended by com.jivesoftware.forum.database.PostCountStatusLevelCalculator
All Implemented Interfaces:
ForumListener, MessageListener, ThreadListener, StatusLevelCalculator

public class PostCountStatusLevelCalculator
extends java.lang.Object
implements StatusLevelCalculator, MessageListener, ForumListener, ThreadListener

StatusLevelManager implementation that works by counting the number of messages a user has added to the system.


Nested Class Summary
static class PostCountStatusLevelCalculator.PostCountCacheKey
          Keys used in the postCountCache
 
Field Summary
static Cache postCountCache
          Used for caching poing levels at the forum and category level
 
Constructor Summary
PostCountStatusLevelCalculator()
           
 
Method Summary
 void forumAdded(ForumEvent event)
          Fired when a forum has been added to the system.
 void forumDeleted(ForumEvent event)
          Fired when a forum is about to be deleted from the system.
 void forumMerged(ForumEvent event)
          Fired when a forum is merged into another forum.
 void forumModified(ForumEvent event)
          Fired when a forum is modified.
 void forumMoved(ForumEvent event)
          Fired when a forum has been moved from one category to another.
 long[] getLeaderIds(ForumCategory category, int startIndex, int numResults)
          Returns a long array of user ids of forum category leaders given a start index and desired number of results.
 long[] getLeaderIds(Forum forum, int startIndex, int numResults)
          Returns a long array of user ids of forum leaders
 long[] getLeaderIds(int startIndex, int numResults)
          Returns a long array of user ids of system leaders given a start index and desired number of results.
 int getPointLevel(User user)
          Returns the point level for a user system wide.
 int getPointLevel(User user, Forum forum)
          Returns the status level points for a user in regards to a specific forum
 int getPointLevel(User user, ForumCategory category)
          Returns the status level points for a user in regards to a specific category
 void messageAdded(MessageEvent event)
          Fired when a message has been added to the system.
 void messageDeleted(MessageEvent event)
          Fired when a message is about to be deleted from the system.
 void messageModerationModified(MessageEvent event)
          Fired when the moderation value of a message has been changed.
 void messageModified(MessageEvent event)
          Fired when portions of a message have been modified.
 void messageMoved(MessageEvent event)
          Fired when a message is moved to another thread.
 void messageRated(MessageEvent event)
          Fired when a message has been rated.
 void threadAdded(ThreadEvent event)
          Fired when a thread has been added to the system.
 void threadDeleted(ThreadEvent event)
          Fired when a thread is about to be deleted from the system.
 void threadModerationModified(ThreadEvent event)
          Fired when the moderation value of a thread has been changed.
 void threadMoved(ThreadEvent event)
          Fired when a thread is moved from one foru to another.
 void threadRated(ThreadEvent event)
          Fired when the thread has been rated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

postCountCache

public static final Cache postCountCache
Used for caching poing levels at the forum and category level

Constructor Detail

PostCountStatusLevelCalculator

public PostCountStatusLevelCalculator()
Method Detail

getPointLevel

public int getPointLevel(User user)
Description copied from interface: StatusLevelCalculator
Returns the point level for a user system wide.

Specified by:
getPointLevel in interface StatusLevelCalculator
Parameters:
user - user to get status level points for
Returns:
how many status points the user has

getPointLevel

public int getPointLevel(User user,
                         Forum forum)
Description copied from interface: StatusLevelCalculator
Returns the status level points for a user in regards to a specific forum

Specified by:
getPointLevel in interface StatusLevelCalculator
Parameters:
user - user user to get status level points for
forum - forum to filter by
Returns:
how many status level points a user has for the particular forum

getPointLevel

public int getPointLevel(User user,
                         ForumCategory category)
Description copied from interface: StatusLevelCalculator
Returns the status level points for a user in regards to a specific category

Specified by:
getPointLevel in interface StatusLevelCalculator
Parameters:
user - user user to get status level points for
category - category to filter by
Returns:
how many status level points a user has for the particular category

getLeaderIds

public long[] getLeaderIds(int startIndex,
                           int numResults)
Description copied from interface: StatusLevelCalculator
Returns a long array of user ids of system leaders given a start index and desired number of results. Note that the array returned may be smaller than numResults if no more results are available.

Specified by:
getLeaderIds in interface StatusLevelCalculator
Parameters:
startIndex - the start index for results.
numResults - the desired number of results to return.
Returns:
a long array of user the ids of system leaders.

getLeaderIds

public long[] getLeaderIds(ForumCategory category,
                           int startIndex,
                           int numResults)
Description copied from interface: StatusLevelCalculator
Returns a long array of user ids of forum category leaders given a start index and desired number of results. Note that the array returned may be smaller than numResults if no more results are available.

Specified by:
getLeaderIds in interface StatusLevelCalculator
Parameters:
category - category that the leaders lead
startIndex - the start index for results.
numResults - the desired number of results to return.
Returns:
a long array of user ids of forum category leaders leaders.

getLeaderIds

public long[] getLeaderIds(Forum forum,
                           int startIndex,
                           int numResults)
Description copied from interface: StatusLevelCalculator
Returns a long array of user ids of forum leaders

Specified by:
getLeaderIds in interface StatusLevelCalculator
Parameters:
forum - forum that the leaders belong to
startIndex - the start index for results.
numResults - the desired number of results to return.
Returns:
a long array of user ids of forum leaders

messageAdded

public void messageAdded(MessageEvent event)
Description copied from interface: MessageListener
Fired when a message has been added to the system. Care should be taken with this event type since a message being added may need to go through a moderation process before it becomes visible in a forum. Therefore, actions that should only be triggered after moderation has taken place should use the message moderation modified event type instead.

Specified by:
messageAdded in interface MessageListener
Parameters:
event - the event object.

messageDeleted

public void messageDeleted(MessageEvent event)
Description copied from interface: MessageListener
Fired when a message is about to be deleted from the system. This event will only be fired when an individual message is deleted; it is not fired when the thread or forum that contains the message is deleted. Because various code pieces may depend on this event for performing cleanup tasks, it's guaranteed that this method will be called before the message is deleted from the database.

Specified by:
messageDeleted in interface MessageListener
Parameters:
event - the event object.

messageMoved

public void messageMoved(MessageEvent event)
Description copied from interface: MessageListener
Fired when a message is moved to another thread. This happens when a thread is branched such that a message and its children become a new thread.

Specified by:
messageMoved in interface MessageListener
Parameters:
event - the event object.

messageModified

public void messageModified(MessageEvent event)
Description copied from interface: MessageListener
Fired when portions of a message have been modified.

Specified by:
messageModified in interface MessageListener
Parameters:
event - the event object.

messageModerationModified

public void messageModerationModified(MessageEvent event)
Description copied from interface: MessageListener
Fired when the moderation value of a message has been changed.

Specified by:
messageModerationModified in interface MessageListener
Parameters:
event - the event object.

messageRated

public void messageRated(MessageEvent event)
Description copied from interface: MessageListener
Fired when a message has been rated.

Specified by:
messageRated in interface MessageListener
Parameters:
event - the event object.

forumAdded

public void forumAdded(ForumEvent event)
Description copied from interface: ForumListener
Fired when a forum has been added to the system.

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

forumDeleted

public void forumDeleted(ForumEvent event)
Description copied from interface: ForumListener
Fired when a forum is about to be deleted from the system. This event will be fired when an individual forum is deleted or when the forum's category is deleted. Because various code pieces may depend on this event for performing cleanup tasks, it's guaranteed that this method will be called before the forum is deleted from the database.

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

forumModified

public void forumModified(ForumEvent event)
Description copied from interface: ForumListener
Fired when a forum is modified.

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

forumMoved

public void forumMoved(ForumEvent event)
Description copied from interface: ForumListener
Fired when a forum has been moved from one category to another.

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

forumMerged

public void forumMerged(ForumEvent event)
Description copied from interface: ForumListener
Fired when a forum is merged into another forum.

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

threadAdded

public void threadAdded(ThreadEvent event)
Description copied from interface: ThreadListener
Fired when a thread has been added to the system.

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

threadDeleted

public void threadDeleted(ThreadEvent event)
Description copied from interface: ThreadListener
Fired when a thread is about to be deleted from the system. This event will only be fired when an individual thread is deleted; it is not fired when the forum that contains the thread is deleted. Because various code pieces may depend on this event for performing cleanup tasks, it's guaranteed that this method will be called before the thread is deleted from the database.

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

threadMoved

public void threadMoved(ThreadEvent event)
Description copied from interface: ThreadListener
Fired when a thread is moved from one foru to another.

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

threadModerationModified

public void threadModerationModified(ThreadEvent event)
Description copied from interface: ThreadListener
Fired when the moderation value of a thread has been changed.

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

threadRated

public void threadRated(ThreadEvent event)
Description copied from interface: ThreadListener
Fired when the thread has been rated.

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

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.