PersistChanGrpMgr - Controls and Manages a single Hibernate based Informa
ChannelGroup. Provides for threaded Updating of the Channel Group,
persistence management, session management etc.
N O T T H R E A D S A F E
Constructor.
Parameters: handler - - SessionHandler to use. This needs to have been built by caller. Parameters: debug - - - true will run this in debug mode, which basically means that threads are runwith no delays thereby revealing threading bugs.
Add a channel to this Persisten Channel Group. If Channel already exists then just add it,
if it doesn't then create it and add it.
Parameters: url - the url of the rss feed Channel so created or located
Interrupts the update task and return immediately. Do not waits for task to stop.
deActivate
public synchronized void deActivate(boolean waitForFinish)(Code)
Interrupts the update task and return immediately. Waits for task to finish
if waitForFinish argument set.
Parameters: waitForFinish - TRUE to wait until task actually finishes.
Delete specified channel from this PersistChanGrpMgr. Status indicates whether Channel was
previously part of this group.
Parameters: channel - - Channel being removed from the Group. true if channel was deleted, false if channel was not a member to begin with
Delete specified item from specified Channel
Parameters: channel - - Channel to delete from Parameters: item - - Item to delete from that channel number of items left in the channel AFTER the deletion.
Simply return whether we are currently activated (that is, running the tasks that download and
process RSS. Will also return true if the PersistChanGrpMgrTask is still in the middle of
finishing.
true = activated
Move a Channel from this PersistentChannelGroup to a different one
Parameters: channel - channel in this PersistentChannelGroup that is being moved. Parameters: destGrp - destination where the Channel is going to
notifyChannelRetrieved
public void notifyChannelRetrieved(Channel chan)(Code)
Send notification that specified channel was retrieved.
Parameters: chan - -
Send notifications about all Channels in this group (but not their items) -
notifyChannelsAndItems
public void notifyChannelsAndItems(Channel channel)(Code)
notifyChannelsAndItems - Notify both item and channel listeners for a channel and all its
items. This is useful if the client wants to treat a Channel that was recently read in by
hibernate in a consistent way with listeners.
Parameters: channel - - Relevant channel.
Setup the one and only Global observer. Note this is not an observer chain, but just a single
one.
Parameters: obser - Observer to register
setParams
public void setParams(int startDel, int period, int acceptErr)(Code)
Change parameters of how this PersistChanGrpMgr works. Only allowed when this PersistChanGrp is
inactive.
Parameters: startDel - ms before starting (-1 means don't change.) Parameters: period - ms between iterations (-1 means don't change.) Parameters: acceptErr - number of errors before putting a channel offline (-1 means don't change)