net.sourceforge.pebble.event.blog
Class PebbleAPIBlogEntryAggregator

java.lang.Object
  extended by java.util.TimerTask
      extended by net.sourceforge.pebble.event.blog.PebbleAPIBlogEntryAggregator
All Implemented Interfaces:
java.lang.Runnable, BlogListener

public abstract class PebbleAPIBlogEntryAggregator
extends java.util.TimerTask
implements BlogListener

Blog listener that polls a Pebble blog, using the Pebble XML-RPC API, to pull across and aggregate blog entries. This assumes that the IDs of blog entries in both the local and remote blogs don't clash.

Author:
Simon Brown

Field Summary
static java.lang.String BLOG_ENTRIES_KEY
           
static java.lang.String BLOG_KEY
           
static java.lang.String PASSWORD_KEY
           
static java.lang.String USERNAME_KEY
           
static java.lang.String XMLRPC_URL_KEY
           
 
Constructor Summary
PebbleAPIBlogEntryAggregator()
           
 
Method Summary
 void blogStarted(BlogEvent event)
          Called when a blog has been started.
 void blogStopped(BlogEvent event)
          Called when a blog has been stopped.
protected  java.lang.String getPropertyPrefix()
          Gets the prefix to use when defining properties for this plugin.
protected abstract  void postAggregate(BlogEntry blogEntry)
          Called after each blog entry is aggregated.
protected abstract  boolean preAggregate(java.util.Hashtable blogEntry)
          Called before each blog entry is aggregated.
 void run()
           
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XMLRPC_URL_KEY

public static final java.lang.String XMLRPC_URL_KEY
See Also:
Constant Field Values

BLOG_KEY

public static final java.lang.String BLOG_KEY
See Also:
Constant Field Values

USERNAME_KEY

public static final java.lang.String USERNAME_KEY
See Also:
Constant Field Values

PASSWORD_KEY

public static final java.lang.String PASSWORD_KEY
See Also:
Constant Field Values

BLOG_ENTRIES_KEY

public static final java.lang.String BLOG_ENTRIES_KEY
See Also:
Constant Field Values
Constructor Detail

PebbleAPIBlogEntryAggregator

public PebbleAPIBlogEntryAggregator()
Method Detail

blogStarted

public void blogStarted(BlogEvent event)
Called when a blog has been started.

Specified by:
blogStarted in interface BlogListener
Parameters:
event - a BlogEvent instance

blogStopped

public void blogStopped(BlogEvent event)
Called when a blog has been stopped.

Specified by:
blogStopped in interface BlogListener
Parameters:
event - a BlogEvent instance

run

public void run()
Specified by:
run in interface java.lang.Runnable
Specified by:
run in class java.util.TimerTask

preAggregate

protected abstract boolean preAggregate(java.util.Hashtable blogEntry)
Called before each blog entry is aggregated. Returning false will stop the entry from being aggregated.

Parameters:
blogEntry - a Hashtable instance representing a blog entry
Returns:
true if the blog entry should be aggregated, false otherwise

postAggregate

protected abstract void postAggregate(BlogEntry blogEntry)
Called after each blog entry is aggregated. Use this to enrich aggregated blog entries.

Parameters:
blogEntry - a Hashtable instance representing a blog entry

getPropertyPrefix

protected java.lang.String getPropertyPrefix()
Gets the prefix to use when defining properties for this plugin.

Returns:
a String (the class name)


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