Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base.stats
Class BytesSentFilter

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

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

A filter to measure the total bytes transferred over the lifetime of the user's session. Note, this will only measure resources the filter is mapped to (ie, *.jsp or /foo/something.jsp).

Since:
4.0

Nested Class Summary
 class BytesSentFilter.MonitoredPrintWriter
          An extension of PrintWriter that counts bytes.
 class BytesSentFilter.MonitoredResponse
          A wrapper class to a HttpServletResponse which monitors the amount of bytes transferred.
 class BytesSentFilter.MonitoredServletOutputStream
          A simple extension of the ServletOutputStream class which counts outgoing bytes.
 
Field Summary
static boolean setup
           
 
Constructor Summary
BytesSentFilter()
           
 
Method Summary
 void destroy()
          Does nothing.
 void doFilter(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, javax.servlet.FilterChain chain)
          Wraps the HTTP response object with a class to measure the bytes sent back to the user.
 void init(javax.servlet.FilterConfig filterConfig)
          Does nothing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

setup

public static boolean setup
Constructor Detail

BytesSentFilter

public BytesSentFilter()
Method Detail

init

public void init(javax.servlet.FilterConfig filterConfig)
          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
Wraps the HTTP response object with a class to measure the bytes sent back to the user. After the page is executed the bytes sent are stored in a read stat session object which is then stored in the user's session.

Specified by:
doFilter in interface javax.servlet.Filter
Throws:
java.io.IOException
javax.servlet.ServletException

destroy

public void destroy()
Does nothing.

Specified by:
destroy in interface javax.servlet.Filter

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.