net.sourceforge.java.feednread.backend.jobs
Class NewsFeedUpdateJob

java.lang.Object
  extended bynet.sourceforge.java.util.jobs.Job
      extended bynet.sourceforge.java.feednread.backend.jobs.NewsFeedParserJob
          extended bynet.sourceforge.java.feednread.backend.jobs.NewsFeedUpdateJob
All Implemented Interfaces:
IJob, IRunnableWithProgress

public class NewsFeedUpdateJob
extends NewsFeedParserJob

Job to update a NewsFeed either by a given url or a Favorite.

Author:
Sebastian Machhausen

Field Summary
 
Fields inherited from class net.sourceforge.java.feednread.backend.jobs.NewsFeedParserJob
favorite, mainWindow, newsFeedUrl
 
Fields inherited from class net.sourceforge.java.util.jobs.Job
 
Fields inherited from interface net.sourceforge.java.util.jobs.IJob
HIGH_PRIORITY, LOW_PRIORITY, NORM_PRIORITY
 
Constructor Summary
NewsFeedUpdateJob(Favorite favorite, MainApplicationWindow mainWindow)
           Creates a new NewsFeedUpdateJob to update the newsfeed set in the specified Favorite.
NewsFeedUpdateJob(String newsFeedUrl, MainApplicationWindow mainWindow)
           Creates a new NewsFeedUpdateJob to update the newsfeed at the specified url.
 
Method Summary
 void run(IProgressMonitor monitor)
           Activates the update process.
private  void updateFailed(LanguageResource resource)
           Called in case this NewsFeedUpdateJob failed.
private  void updateSucceeded(NewsFeed updatedNewsFeed)
           Called in case this NewsFeedUpdateJob succeeded.
 
Methods inherited from class net.sourceforge.java.feednread.backend.jobs.NewsFeedParserJob
getNewsFeedFromCache, parseNewsFeed
 
Methods inherited from class net.sourceforge.java.util.jobs.Job
cancel, done, getException, getJobManager, getName, getPriority, getStatus, getThread, isCanceled, join, setException, setJobManager, setName, setPriority, setThread, start, started, statusChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NewsFeedUpdateJob

public NewsFeedUpdateJob(String newsFeedUrl,
                         MainApplicationWindow mainWindow)

Creates a new NewsFeedUpdateJob to update the newsfeed at the specified url.

Parameters:
newsFeedUrl - the url of the newsfeed to update
mainWindow - the Feed'n Read main window

NewsFeedUpdateJob

public NewsFeedUpdateJob(Favorite favorite,
                         MainApplicationWindow mainWindow)

Creates a new NewsFeedUpdateJob to update the newsfeed set in the specified Favorite.

Parameters:
favorite - the Favorite to update the newsfeed for
mainWindow - the Feed'n Read main window
Method Detail

run

public void run(IProgressMonitor monitor)

Activates the update process. If the update completes correctly and succesfully the corresponding tab is updated in the NewsFeedTabBar showing the gui representation of the updated newsfeed.

If the update process failed the reason for that can be queried using the IJob.getException() method.

Specified by:
run in interface IRunnableWithProgress
Overrides:
run in class NewsFeedParserJob
Parameters:
monitor - the IProgressMonitor to use for reporting the progress of this NewsFeedUpdateJob
See Also:
IRunnableWithProgress.run(org.eclipse.core.runtime.IProgressMonitor), IJob.getException()

updateSucceeded

private void updateSucceeded(NewsFeed updatedNewsFeed)

Called in case this NewsFeedUpdateJob succeeded. The corresponding tab in the NewsFeedTabBar is updated to the specified NewsFeed. In addition a success message is shown in the application status line.

Parameters:
updatedNewsFeed - the successfully updated NewsFeed

updateFailed

private void updateFailed(LanguageResource resource)

Called in case this NewsFeedUpdateJob failed. An error message is shown in the application status line.

Parameters:
resource - the LanguageResource used