Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.stats
Class QuickStats

java.lang.Object
  extended by com.jivesoftware.forum.stats.QuickStats

public class QuickStats
extends java.lang.Object

A class of static methods for retrieving quick statistics from the Jive Forums system. This is not meant to be a comprehensive list of stats from the Jive Forums system - for more indepth data you should use the other stats/reporting APIs.


Nested Class Summary
static class QuickStats.QuickStatsGenerator
          A runnable class used to generate a set of quick stats.
static class QuickStats.Type
          A simple class to encapsulate the type of stat being asked for - usually either HTTP or NNTP.
 
Field Summary
static QuickStats.Type HTTP_STAT
           
static QuickStats.Type NNTP_STAT
           
 
Method Summary
static double[] getAvViewsPerSession(java.util.Date start, java.util.Date end, QuickStats.Type type)
          Returns the average views per session of type given type of stat.
static int getNewMessageCount(java.util.Date start, java.util.Date end, QuickStats.Type type, java.util.List forumIDs)
          Returns the number of new messages posted for the given type over the given date range.
static int getNewTopicCount(java.util.Date start, java.util.Date end, QuickStats.Type type, java.util.List forumIDs)
          Returns the number of new topics posted for the given type over the given date range.
static int getNewUserCount(java.util.Date start, java.util.Date end)
          Returns the number of new user accounts created over the given time frame.
static java.lang.Object[][] getPopularCountries(java.util.Date start, java.util.Date end, QuickStats.Type type, int num)
          Returns an array of arrays which holds country codes and counts which rank the top visiting countries for the given type and over the given date range.
static java.lang.Object[][] getPopularForumsByPost(java.util.Date start, java.util.Date end, QuickStats.Type type, int num)
          Returns an array of arrays which holds forum IDs and counts which rank the top foruums by new message for the given type and over the given date range.
static java.lang.Object[][] getPopularForumsByViews(java.util.Date start, java.util.Date end, QuickStats.Type type, int num)
          Returns an array of arrays which holds forum IDs and counts which rank the top foruums by views for the given type and over the given date range.
static java.util.Map getResults()
          Returns the results of running a set of quick stats or null if no stats have been generated.
static int getTotalViews(java.util.Date start, java.util.Date end, QuickStats.Type type)
          Returns the total views per given type.
static int getUniqueGuestCount(java.util.Date start, java.util.Date end, QuickStats.Type type)
          Returns the number of unique guests for the given type over the given date range.
static int getUniqueUserCount(java.util.Date start, java.util.Date end, QuickStats.Type type)
          Returns the number of unique registered users for the given type over the given date range.
static int getUniqueVisitorCount(java.util.Date start, java.util.Date end, QuickStats.Type type)
          Returns the number of unique visitors (a visitor is a guest or a registered user) for the given type over the given date range.
static void verifyDates(java.util.Date start, java.util.Date end)
          Throws an error if the given dates are invalid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HTTP_STAT

public static QuickStats.Type HTTP_STAT

NNTP_STAT

public static QuickStats.Type NNTP_STAT
Method Detail

getAvViewsPerSession

public static double[] getAvViewsPerSession(java.util.Date start,
                                            java.util.Date end,
                                            QuickStats.Type type)
Returns the average views per session of type given type of stat. For example, if the type is HTTP_STAT then the average HTTP views per HTTP session is returned. The return type is an array of size 2 - index 0 is the total views and index 1 is the total sessions. To get the average simply divide the two numbers: average = array[0] / array[1]. This is returned as an array because you may wish to sum different types of averages together.

Parameters:
start - the start of the date range to examine - must be non null and earlier than the end date.
end - the end of the date range to examine - must be non null and later than the start date.
type - the type of stat.
Returns:
an array of size 2 - index 0 is the total views, index 1 is the total sessions. Divide the two to get the average.

getTotalViews

public static int getTotalViews(java.util.Date start,
                                java.util.Date end,
                                QuickStats.Type type)
Returns the total views per given type. For example, if HTTP_STAT is passed in then this returns the total number of HTTP views in the given time period.

Parameters:
start - the start of the date range to examine - must be non null and earlier than the end date.
end - the end of the date range to examine - must be non null and later than the start date.
type - the type of stat.
Returns:
the total number of views per given type in the given date range.

getUniqueVisitorCount

public static int getUniqueVisitorCount(java.util.Date start,
                                        java.util.Date end,
                                        QuickStats.Type type)
Returns the number of unique visitors (a visitor is a guest or a registered user) for the given type over the given date range.

Parameters:
start - the start of the date range to examine - must be non null and earlier than the end date.
end - the end of the date range to examine - must be non null and later than the start date.
type - the type of stat.
Returns:
the number of unique visitors for the given type over the given date range.

getUniqueGuestCount

public static int getUniqueGuestCount(java.util.Date start,
                                      java.util.Date end,
                                      QuickStats.Type type)
Returns the number of unique guests for the given type over the given date range.

Parameters:
start - the start of the date range to examine - must be non null and earlier than the end date.
end - the end of the date range to examine - must be non null and later than the start date.
type - the type of stat.
Returns:
the number of unique guests for the given type over the given date range.

getUniqueUserCount

public static int getUniqueUserCount(java.util.Date start,
                                     java.util.Date end,
                                     QuickStats.Type type)
Returns the number of unique registered users for the given type over the given date range.

Parameters:
start - the start of the date range to examine - must be non null and earlier than the end date.
end - the end of the date range to examine - must be non null and later than the start date.
type - the type of stat.
Returns:
the number of unique registered users for the given type over the given date range.

getPopularCountries

public static java.lang.Object[][] getPopularCountries(java.util.Date start,
                                                       java.util.Date end,
                                                       QuickStats.Type type,
                                                       int num)
Returns an array of arrays which holds country codes and counts which rank the top visiting countries for the given type and over the given date range. At index 0 in each object array is the String country code and index 1 is the Integer count of visits.

Parameters:
start - the start of the date range to examine - must be non null and earlier than the end date.
end - the end of the date range to examine - must be non null and later than the start date.
type - the type of stat.
num - the maximum number of top countries to return.
Returns:
an array of country codes and counts which is the top visiting countries for the given type and over the given date range.

getNewTopicCount

public static int getNewTopicCount(java.util.Date start,
                                   java.util.Date end,
                                   QuickStats.Type type,
                                   java.util.List forumIDs)
Returns the number of new topics posted for the given type over the given date range.

Parameters:
start - the start of the date range to examine - must be non null and earlier than the end date.
end - the end of the date range to examine - must be non null and later than the start date.
type - the type of stat.
forumIDs - a list of forums to run the query in. If the list is null or empty then all forums will be queried.
Returns:
the number of new topics posted for the given type over the given date range.

getNewMessageCount

public static int getNewMessageCount(java.util.Date start,
                                     java.util.Date end,
                                     QuickStats.Type type,
                                     java.util.List forumIDs)
Returns the number of new messages posted for the given type over the given date range.

Parameters:
start - the start of the date range to examine - must be non null and earlier than the end date.
end - the end of the date range to examine - must be non null and later than the start date.
type - the type of stat.
forumIDs - a list of forums to run the query in. If the list is null or empty then all forums will be queried.
Returns:
the number of new messages posted for the given type over the given date range.

getPopularForumsByPost

public static java.lang.Object[][] getPopularForumsByPost(java.util.Date start,
                                                          java.util.Date end,
                                                          QuickStats.Type type,
                                                          int num)
Returns an array of arrays which holds forum IDs and counts which rank the top foruums by new message for the given type and over the given date range. At index 0 in each object array is the Long forum ID and index 1 is the Integer count of new messages.

Parameters:
start - the start of the date range to examine - must be non null and earlier than the end date.
end - the end of the date range to examine - must be non null and later than the start date.
type - the type of stat.
num - the maximum number of top forums to return.
Returns:
an array of forum IDs and counts which is the top forums by new message for the given type and over the given date range.

getPopularForumsByViews

public static java.lang.Object[][] getPopularForumsByViews(java.util.Date start,
                                                           java.util.Date end,
                                                           QuickStats.Type type,
                                                           int num)
Returns an array of arrays which holds forum IDs and counts which rank the top foruums by views for the given type and over the given date range. At index 0 in each object array is the Long forum ID and index 1 is the Integer count of new messages.

Parameters:
start - the start of the date range to examine - must be non null and earlier than the end date.
end - the end of the date range to examine - must be non null and later than the start date.
type - the type of stat.
num - the maximum number of top forums to return.
Returns:
an array of forum IDs and counts which is the top forums by view for the given type and over the given date range.

getNewUserCount

public static int getNewUserCount(java.util.Date start,
                                  java.util.Date end)
Returns the number of new user accounts created over the given time frame.

Parameters:
start - the start of the date range to examine - must be non null and earlier than the end date.
end - the end of the date range to examine - must be non null and later than the start date.
Returns:
the number of new user accounts created over the given time frame.

verifyDates

public static void verifyDates(java.util.Date start,
                               java.util.Date end)
Throws an error if the given dates are invalid.


getResults

public static java.util.Map getResults()
Returns the results of running a set of quick stats or null if no stats have been generated.

Returns:
the results of running a set of quick stats or null if no stats have been generated.
See Also:
QuickStats.QuickStatsGenerator

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.