net.sourceforge.pebble.event.response
Class ContentSpamListener

java.lang.Object
  extended by net.sourceforge.pebble.event.response.BlogEntryResponseListenerSupport
      extended by net.sourceforge.pebble.event.response.ContentSpamListener
All Implemented Interfaces:
CommentListener, TrackBackListener

public class ContentSpamListener
extends BlogEntryResponseListenerSupport

Checks comment and TrackBack content for specified regexs and sets the state of such responses to pending. This includes all user-definable fields of the response : title, content, source name and source link. The spam score is incremented for each field that exceeds the threshold.

Author:
Simon Brown

Field Summary
static java.lang.String DEFAULT_REGEX_LIST
          the default regex list
static int DEFAULT_THRESHOLD
          the default threshold for the number of content matches
static java.lang.String REGEX_LIST_KEY
          the name of the regex list property
static java.lang.String THRESHOLD_KEY
          the name of the threshold property
 
Constructor Summary
ContentSpamListener()
           
 
Method Summary
protected  void blogEntryResponseAdded(Response response)
          Called when a comment or TrackBack has been added.
 
Methods inherited from class net.sourceforge.pebble.event.response.BlogEntryResponseListenerSupport
blogEntryResponseApproved, blogEntryResponseRejected, blogEntryResponseRemoved, commentAdded, commentApproved, commentRejected, commentRemoved, trackBackAdded, trackBackApproved, trackBackRejected, trackBackRemoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_REGEX_LIST

public static final java.lang.String DEFAULT_REGEX_LIST
the default regex list

See Also:
Constant Field Values

DEFAULT_THRESHOLD

public static final int DEFAULT_THRESHOLD
the default threshold for the number of content matches

See Also:
Constant Field Values

REGEX_LIST_KEY

public static final java.lang.String REGEX_LIST_KEY
the name of the regex list property

See Also:
Constant Field Values

THRESHOLD_KEY

public static final java.lang.String THRESHOLD_KEY
the name of the threshold property

See Also:
Constant Field Values
Constructor Detail

ContentSpamListener

public ContentSpamListener()
Method Detail

blogEntryResponseAdded

protected void blogEntryResponseAdded(Response response)
Called when a comment or TrackBack has been added.

Overrides:
blogEntryResponseAdded in class BlogEntryResponseListenerSupport
Parameters:
response - a Response


Copyright © 2003-2006, Simon Brown. All Rights Reserved.