net.sourceforge.pebble.event.response
Class IpAddressListener

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

public class IpAddressListener
extends BlogEntryResponseListenerSupport

Checks comment and TrackBack IP address against a whitelist and a blacklist. If in the whitelist, the response is left as-is. If in the blacklist, the response is set to pending and the spam score incremented by 1 point. If in neither, the response is set to pending but the spam score isn't increased. This allows responses from new IP addresses to be manually verified before publication.

Author:
Simon Brown

Field Summary
static java.lang.String BLACKLIST_KEY
          the name of the blacklist property
static java.lang.String WHITELIST_KEY
          the name of the whitelist property
 
Constructor Summary
IpAddressListener()
           
 
Method Summary
protected  void blogEntryResponseAdded(Response response)
          Called when a comment or TrackBack has been added.
protected  void blogEntryResponseApproved(Response response)
          Called when a comment or TrackBack has been approved.
protected  void blogEntryResponseRejected(Response response)
          Called when a comment or TrackBack has been rejected.
 
Methods inherited from class net.sourceforge.pebble.event.response.BlogEntryResponseListenerSupport
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

WHITELIST_KEY

public static final java.lang.String WHITELIST_KEY
the name of the whitelist property

See Also:
Constant Field Values

BLACKLIST_KEY

public static final java.lang.String BLACKLIST_KEY
the name of the blacklist property

See Also:
Constant Field Values
Constructor Detail

IpAddressListener

public IpAddressListener()
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

blogEntryResponseApproved

protected void blogEntryResponseApproved(Response response)
Called when a comment or TrackBack has been approved.

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

blogEntryResponseRejected

protected void blogEntryResponseRejected(Response response)
Called when a comment or TrackBack has been rejected.

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


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