Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.proxy
Class QueryLoggerProxy

java.lang.Object
  extended by com.jivesoftware.forum.proxy.QueryLoggerProxy
All Implemented Interfaces:
QueryLogger

public class QueryLoggerProxy
extends java.lang.Object
implements QueryLogger

A protection proxy for the QueryLogger. A proxy has a set of permissions that are specified at creation time of the proxy. Subsequently, those permissions are use to restrict access to protected methods. If a user does not have the right to execute a particular method, an UnauthorizedException is thrown.

See Also:
QueryLogger, Permissions, UnauthorizedException

Constructor Summary
QueryLoggerProxy(QueryLogger queryLogger, AuthToken auth, Permissions permissions)
          Creates a new QueryLoggerProxy object.
 
Method Summary
 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)
          Returns the query associated with the given queryID.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryLoggerProxy

public QueryLoggerProxy(QueryLogger queryLogger,
                        AuthToken auth,
                        Permissions permissions)
Creates a new QueryLoggerProxy object.

Parameters:
queryLogger - the QueryLogger to protect by proxy
auth - the user's authorization token
permissions - the permissions to use with this proxy
Method Detail

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.

getQuery

public Query getQuery(long queryID)
               throws NotFoundException,
                      UnauthorizedException
Description copied from interface: QueryLogger
Returns the query associated with the given queryID.

Specified by:
getQuery in interface QueryLogger
Parameters:
queryID - the id of the query to retrieve
Returns:
the query
Throws:
NotFoundException - if the query associated with the queryID cannot be found.
UnauthorizedException - if not the user who issued the query or an administrator.

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.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.