Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.action
Class ViewCountInterceptor

java.lang.Object
  extended by com.opensymphony.xwork.interceptor.AroundInterceptor
      extended by com.jivesoftware.forum.action.ViewCountInterceptor
All Implemented Interfaces:
com.opensymphony.xwork.interceptor.Interceptor, java.io.Serializable

public class ViewCountInterceptor
extends com.opensymphony.xwork.interceptor.AroundInterceptor

A WebWork interceptor which records a view count for a particular object. This is designed to intercept an action which views a category, forum or thread. Set the type as to which type of object is being viewed. Category, forum and thread views are supported.

See Also:
Serialized Form

Field Summary
static java.lang.String CATEGORY
          Indicates a category view.
static java.lang.String FORUM
          Indicates a forum view.
static java.lang.String THREAD
          Indicates a thread view.
 
Fields inherited from class com.opensymphony.xwork.interceptor.AroundInterceptor
log
 
Constructor Summary
ViewCountInterceptor()
           
 
Method Summary
protected  void after(com.opensymphony.xwork.ActionInvocation in, java.lang.String result)
          Records a view count for a given object.
protected  void before(com.opensymphony.xwork.ActionInvocation in)
          Does nothing in this implementation.
 java.lang.String getType()
          Returns the type of object this interceptor operates on.
 void setType(java.lang.String type)
          Sets the type of view count to create.
 
Methods inherited from class com.opensymphony.xwork.interceptor.AroundInterceptor
destroy, init, intercept
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CATEGORY

public static final java.lang.String CATEGORY
Indicates a category view.

See Also:
Constant Field Values

FORUM

public static final java.lang.String FORUM
Indicates a forum view.

See Also:
Constant Field Values

THREAD

public static final java.lang.String THREAD
Indicates a thread view.

See Also:
Constant Field Values
Constructor Detail

ViewCountInterceptor

public ViewCountInterceptor()
Method Detail

getType

public java.lang.String getType()
Returns the type of object this interceptor operates on.

Returns:
the type of object this interceptor operates on.
See Also:
CATEGORY, FORUM, THREAD

setType

public void setType(java.lang.String type)
Sets the type of view count to create. Must be a CATEGORY, FORUM or a THREAD type. Any other input will result in an IllegalArgumentException.

Parameters:
type - the type of view count to create.

before

protected void before(com.opensymphony.xwork.ActionInvocation in)
               throws java.lang.Exception
Does nothing in this implementation.

Specified by:
before in class com.opensymphony.xwork.interceptor.AroundInterceptor
Throws:
java.lang.Exception

after

protected void after(com.opensymphony.xwork.ActionInvocation in,
                     java.lang.String result)
              throws java.lang.Exception
Records a view count for a given object.

Specified by:
after in class com.opensymphony.xwork.interceptor.AroundInterceptor
Parameters:
in - the action invocation (the context of the action).
result - the result from the action execution.
Throws:
java.lang.Exception - if an error occurs while executing the action.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.