Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.database
Class DbQueryLogger

java.lang.Object
  extended by com.jivesoftware.forum.database.DbQueryLogger
All Implemented Interfaces:
ForumListener, QueryLogger

public class DbQueryLogger
extends java.lang.Object
implements QueryLogger, ForumListener

Implementation of QueryLogger.


Field Summary
static java.lang.String SELECT_OLD_ENTRIES
           
 
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.
static DbQueryLogger getInstance()
           
 java.util.Map getLoggedQueryInfo(Query query)
          Returns the logged information about the query, or null if the query has not been logged yet.
 java.util.Iterator getQueries()
          Returns an iterator of all the queries that have been made.
 java.util.Iterator getQueries(User user)
          Returns an Iterator consisting of all the Query's that the specified user has made.
 Query getQuery(long queryID)
          Convenience method to load a particular search query.
 int getQueryCount()
          Returns a count of all the queries that have been made in the system.
 int getQueryCount(User user)
          Returns a count of all the queries that the user has made.
 void logQuery(User user, DbQuery query)
          Log a query to the database.
 void logSearchClick(long searchID, long messageID)
          Logs a search result clickthrough.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SELECT_OLD_ENTRIES

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

getInstance

public static DbQueryLogger getInstance()

getQueryCount

public int getQueryCount()
                  throws UnauthorizedException
Description copied from interface: QueryLogger
Returns a count of all the queries that have been made in the system.

Specified by:
getQueryCount in interface QueryLogger
Returns:
a count of all the queries that have been made in the system.
Throws:
UnauthorizedException - if not a System Administrator

getQueryCount

public int getQueryCount(User user)
                  throws UnauthorizedException
Description copied from interface: QueryLogger
Returns a count of all the queries that the user has made.

Specified by:
getQueryCount in interface QueryLogger
Parameters:
user - the user to return the query count for.
Returns:
a count of all the queries that the user has made.
Throws:
UnauthorizedException - if not a System Administrator or the specified user.

getQueries

public java.util.Iterator getQueries()
                              throws UnauthorizedException
Description copied from interface: QueryLogger
Returns an iterator of all the queries that have been made. The returned Iterator will return Query objects ordered by search date with the most recent search first and oldest last.

Specified by:
getQueries in interface QueryLogger
Returns:
an iterator of all the queries that have been made.
Throws:
UnauthorizedException - if not a System Administrator

getQueries

public java.util.Iterator getQueries(User user)
                              throws UnauthorizedException
Description copied from interface: QueryLogger
Returns an Iterator consisting of all the Query's that the specified user has made. The returned Iterator will return Query objects ordered by search date with the most recent search first and oldest last.

Specified by:
getQueries in interface QueryLogger
Parameters:
user - the user to return the query count for.
Returns:
an Iterator consisting of all the Query's that the specified user has made.
Throws:
UnauthorizedException - if not a System Administrator or the specified user.

logQuery

public void logQuery(User user,
                     DbQuery query)
Log a query to the database.

Parameters:
user - the user making the query, or null if no user
query - the query

logSearchClick

public void logSearchClick(long searchID,
                           long messageID)
Logs a search result clickthrough.

Parameters:
searchID - the searchID of the search associated with the clickthrough.
messageID - the messageID of the search result that was clicked

getQuery

public Query getQuery(long queryID)
               throws NotFoundException
Convenience method to load a particular search query.

Specified by:
getQuery in interface QueryLogger
Parameters:
queryID - the ID of the search query to load
Returns:
the Query corresponding to the search ID specified
Throws:
NotFoundException - if the search query was not found

getLoggedQueryInfo

public java.util.Map getLoggedQueryInfo(Query query)
Description copied from interface: QueryLogger
Returns the logged information about the query, or null if the query has not been logged yet. The returned Map will have the following:

Key (String) Value
searchDurationInteger
numResultsInteger
searchDateDate
categoriesKbCategory[] or null if none specified (searching all categories)

Specified by:
getLoggedQueryInfo in interface QueryLogger
Returns:
a map of the logged query info.

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.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.