de.nava.informa.utils.poller
Class PersistenceObserver

java.lang.Object
  extended by de.nava.informa.utils.poller.PersistenceObserver
All Implemented Interfaces:
PollerObserverIF

public class PersistenceObserver
extends Object
implements PollerObserverIF

Watches for event about new items and calls given manager to create items in channels.

Author:
Aleksey Gureev (spyromus@noizeramp.com)

Constructor Summary
PersistenceObserver(PersistenceManagerIF manager)
          Creates observer.
 
Method Summary
 void channelChanged(ChannelIF channel)
          Invoked when Poller detected changes in channel information (title and etc).
 void channelErrored(ChannelIF channel, Exception e)
          Invoked by Poller when poller of the channel failed.
 void itemFound(ItemIF item, ChannelIF channel)
          Invoked by Poller when new item is approved for addition.
 void pollFinished(ChannelIF channel)
          Invoked by Poller when checking of the channel finished.
 void pollStarted(ChannelIF channel)
          Invoked by Poller when checking of the channel started.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistenceObserver

public PersistenceObserver(PersistenceManagerIF manager)
Creates observer.

Parameters:
manager - persistence manager to use.
Throws:
IllegalArgumentException - if manager isn't specified.
Method Detail

itemFound

public final void itemFound(ItemIF item,
                            ChannelIF channel)
Invoked by Poller when new item is approved for addition. Item is transient and should be added to specified channel.

Specified by:
itemFound in interface PollerObserverIF
Parameters:
item - item added.
channel - destination channel.

channelErrored

public void channelErrored(ChannelIF channel,
                           Exception e)
Invoked by Poller when poller of the channel failed.

Specified by:
channelErrored in interface PollerObserverIF
Parameters:
channel - channel.
e - original cause of failure.

channelChanged

public void channelChanged(ChannelIF channel)
Invoked when Poller detected changes in channel information (title and etc).

Specified by:
channelChanged in interface PollerObserverIF
Parameters:
channel - channel.

pollStarted

public void pollStarted(ChannelIF channel)
Invoked by Poller when checking of the channel started.

Specified by:
pollStarted in interface PollerObserverIF
Parameters:
channel - channel.

pollFinished

public void pollFinished(ChannelIF channel)
Invoked by Poller when checking of the channel finished.

Specified by:
pollFinished in interface PollerObserverIF
Parameters:
channel - channel.


Copyright © 2002-2007 Niko Schmuck. All Rights Reserved.