|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.nava.informa.utils.PersistChanGrpMgr
public class PersistChanGrpMgr
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
Field Summary | |
---|---|
(package private) int |
acceptNrErrors
|
(package private) int |
taskPeriod
|
(package private) int |
taskStartDelay
|
Constructor Summary | |
---|---|
PersistChanGrpMgr(SessionHandler handler,
boolean debug)
Constructor. |
Method Summary | |
---|---|
void |
activate()
activate - - |
Channel |
addChannel(String url)
Add a channel to this Persisten Channel Group. |
Iterator |
channelIterator()
Create an iterator to iterate across all the channels in this group. |
ChannelGroup |
createGroup(String name)
Called to create a Group. |
void |
deActivate()
Interrupts the update task and return immediately. |
void |
deActivate(boolean waitForFinish)
Interrupts the update task and return immediately. |
boolean |
deleteChannel(Channel channel)
Delete specified channel from this PersistChanGrpMgr. |
void |
deleteGroup()
Deletes persistent group. |
int |
deleteItemFromChannel(Channel channel,
Item item)
Delete specified item from specified Channel |
int |
getAcceptNrErrors()
|
ChannelBuilder |
getBuilder()
Get currently associated ChannelBuilder |
ChannelGroup |
getChannelGroup()
Get currently assocaited ChannelGrouo |
SessionHandler |
getHandler()
Get currently assocaited SessionHandler |
int |
getItemCount(Channel channel)
Return number of Items currently in specified Channel |
int |
getPollingCounter()
Return how many times the task has polled the feed since this PersistChanGrp was built |
boolean |
hasChannel(Channel achannel)
Check if this PersistChanGrp has specified CHannel as a member already |
void |
incrPollingCounter()
Bump up polling counter by one. |
boolean |
isActivated()
Simply return whether we are currently activated (that is, running the tasks that download and process RSS. |
void |
moveChannelTo(Channel channel,
PersistChanGrpMgr destGrp)
Move a Channel from this PersistentChannelGroup to a different one |
void |
notifyChannelRetrieved(Channel chan)
Send notification that specified channel was retrieved. |
void |
notifyChannels()
Send notifications about all Channels in this group (but not their items) - |
void |
notifyChannelsAndItems()
notifyChannelsAndItems - Call notifyChannelAndItems(channels) across all channels in this PersistentChanGrpMgr. |
void |
notifyChannelsAndItems(Channel channel)
notifyChannelsAndItems - Notify both item and channel listeners for a channel and all its items. |
void |
notifyItemAdded(Item newItem)
Send notification that specified item was retrieved. |
void |
notifyItems(Channel channelHandle)
Send notifications for all the items of this channel that they have been added. |
void |
notifyPolling(boolean isPolling)
Notify that the PersistChanGrpMgrTask is currently in the middle of its 'run()' method. |
void |
setGlobalObserver(PersistChanGrpMgrObserverIF obser)
Setup the one and only Global observer. |
void |
setParams(int startDel,
int period,
int acceptErr)
Change parameters of how this PersistChanGrpMgr works. |
String |
toString()
Return nicely formatted string for this object |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
int taskStartDelay
int taskPeriod
int acceptNrErrors
Constructor Detail |
---|
public PersistChanGrpMgr(SessionHandler handler, boolean debug)
handler
- - SessionHandler to use. This needs to have been built by caller.debug
- - - true will run this in debug mode, which basically means that threads are run
with no delays thereby revealing threading bugs.Method Detail |
---|
public ChannelGroup createGroup(String name)
name
- - Text name of the group
public void deleteGroup()
public boolean hasChannel(Channel achannel)
achannel
- - candidate channel to check
public Channel addChannel(String url)
url
- the url of the rss feed
public void moveChannelTo(Channel channel, PersistChanGrpMgr destGrp)
channel
- channel in this PersistentChannelGroup that is being moved.destGrp
- destination where the Channel is going topublic boolean deleteChannel(Channel channel)
channel
- - Channel being removed from the Group.
public int deleteItemFromChannel(Channel channel, Item item)
channel
- - Channel to delete fromitem
- - Item to delete from that channel
public int getItemCount(Channel channel)
channel
- Channel to query
public void notifyChannelsAndItems(Channel channel)
channel
- - Relevant channel.public void notifyItems(Channel channelHandle)
channelHandle
- -public void notifyChannelsAndItems()
public void notifyChannels()
public void notifyChannelRetrieved(Channel chan)
chan
- -public void notifyItemAdded(Item newItem)
newItem
- -public void notifyPolling(boolean isPolling)
isPolling
- true - start polling, false- endpublic void setGlobalObserver(PersistChanGrpMgrObserverIF obser)
obser
- Observer to registerpublic void activate()
public boolean isActivated()
public void incrPollingCounter()
public int getPollingCounter()
public void deActivate()
public void deActivate(boolean waitForFinish)
waitForFinish
argument set.
waitForFinish
- TRUE to wait until task actually finishes.public void setParams(int startDel, int period, int acceptErr)
startDel
- ms before starting (-1 means don't change.)period
- ms between iterations (-1 means don't change.)acceptErr
- number of errors before putting a channel offline (-1 means don't change)public Iterator channelIterator()
public ChannelBuilder getBuilder()
public ChannelGroup getChannelGroup()
public SessionHandler getHandler()
public int getAcceptNrErrors()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |