Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base.stats
Class ReadStatsFilter

java.lang.Object
  extended by com.jivesoftware.base.stats.ReadStatsFilter
All Implemented Interfaces:
javax.servlet.Filter

public class ReadStatsFilter
extends java.lang.Object
implements javax.servlet.Filter

A servlet filter which initializes a ReadStatSession if one is not found in the session. A ReadStatSession encapsulates information about the session for use in stats calculations. This filter also gets the referrer if there is one.

See Also:
ReadStatSession

Field Summary
static java.lang.String READ_STAT_SESSION_KEY
          Name of the session attribute key used to store the ReadStatSession object.
static java.lang.String REFERRER_SESSION_KEY
          The session attribute name of the referrer string in the session.
static boolean setup
           
 
Constructor Summary
ReadStatsFilter()
           
 
Method Summary
 void destroy()
          Does nothing.
 void doFilter(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, javax.servlet.FilterChain chain)
          Checks the session for the existence of a ReadStatSession object.
static HTTPReadStatSession getReadStatSession(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Gets the ReadStatSession associated with this user's HTTP session.
 void init(javax.servlet.FilterConfig config)
          Does nothing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

READ_STAT_SESSION_KEY

public static final java.lang.String READ_STAT_SESSION_KEY
Name of the session attribute key used to store the ReadStatSession object.

See Also:
Constant Field Values

REFERRER_SESSION_KEY

public static final java.lang.String REFERRER_SESSION_KEY
The session attribute name of the referrer string in the session.

See Also:
Constant Field Values

setup

public static boolean setup
Constructor Detail

ReadStatsFilter

public ReadStatsFilter()
Method Detail

init

public void init(javax.servlet.FilterConfig config)
          throws javax.servlet.ServletException
Does nothing.

Specified by:
init in interface javax.servlet.Filter
Throws:
javax.servlet.ServletException

doFilter

public void doFilter(javax.servlet.ServletRequest servletRequest,
                     javax.servlet.ServletResponse servletResponse,
                     javax.servlet.FilterChain chain)
              throws java.io.IOException,
                     javax.servlet.ServletException
Checks the session for the existence of a ReadStatSession object. If one is not found a new one is initialized and put in the session. After that, control is passed down the chain.

Specified by:
doFilter in interface javax.servlet.Filter
Parameters:
servletRequest - a ServletRequest instance
servletResponse - a ServletResponse instance
chain - a FilterChain instance
Throws:
java.io.IOException - if bad stuff happens...
javax.servlet.ServletException - if bad stuff happens...

getReadStatSession

public static HTTPReadStatSession getReadStatSession(javax.servlet.http.HttpServletRequest request,
                                                     javax.servlet.http.HttpServletResponse response)
Gets the ReadStatSession associated with this user's HTTP session. This has a couple of side effects:

This method is static so it can be called by other filters which might need to do something with the user's read stat session.

Parameters:
request - the servlet request.
response - the servlet response.
Returns:
the ReadStatSession associated with this user's HTTP session (or a new one if one did not exist before).

destroy

public void destroy()
Does nothing.

Specified by:
destroy in interface javax.servlet.Filter

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.