net.sac.mymo
Class IMDBParser

java.lang.Object
  extended by java.lang.Thread
      extended by net.sac.mymo.IMDBParser
All Implemented Interfaces:
java.lang.Runnable, Progressable

public class IMDBParser
extends java.lang.Thread
implements Progressable


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
IMDBParser(AgentConfiguration agentConfiguration, java.lang.String voteHistoryURL, java.lang.String movieLinkPrefix, java.util.List<java.lang.String> currentMovieIds)
           
 
Method Summary
 void addIMDBParserListener(IMDBParserListener listener)
           
 void cancelExecution()
           
 int getProgessPercentage()
           
 boolean isExecutionCancelled()
           
 boolean isImportNew()
           
 boolean isUpdateExistingRatingsAndVotes()
           
 boolean isUpdateNewRatingsAndVotes()
           
 void run()
          Parse vote history from the IMDB.
 void setImportNew(boolean importNew)
           
 void setRestrictExistingMovieIds(java.util.List<java.lang.String> restrictExistingMovieIds)
           
 void setUpdateExistingRatingsAndVotes(boolean updateExistingRatingsAndVotes)
           
 void setUpdateNewRatingsAndVotes(boolean updateNewRatingsAndVotes)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IMDBParser

public IMDBParser(AgentConfiguration agentConfiguration,
                  java.lang.String voteHistoryURL,
                  java.lang.String movieLinkPrefix,
                  java.util.List<java.lang.String> currentMovieIds)
Method Detail

setRestrictExistingMovieIds

public void setRestrictExistingMovieIds(java.util.List<java.lang.String> restrictExistingMovieIds)

getProgessPercentage

public int getProgessPercentage()
Specified by:
getProgessPercentage in interface Progressable

isImportNew

public boolean isImportNew()

setImportNew

public void setImportNew(boolean importNew)

isUpdateNewRatingsAndVotes

public boolean isUpdateNewRatingsAndVotes()

setUpdateNewRatingsAndVotes

public void setUpdateNewRatingsAndVotes(boolean updateNewRatingsAndVotes)

isUpdateExistingRatingsAndVotes

public boolean isUpdateExistingRatingsAndVotes()

setUpdateExistingRatingsAndVotes

public void setUpdateExistingRatingsAndVotes(boolean updateExistingRatingsAndVotes)

addIMDBParserListener

public void addIMDBParserListener(IMDBParserListener listener)

cancelExecution

public void cancelExecution()
Specified by:
cancelExecution in interface Progressable

isExecutionCancelled

public boolean isExecutionCancelled()
Specified by:
isExecutionCancelled in interface Progressable

run

public void run()
Parse vote history from the IMDB. Successful parsing is dependent on current implementation of the IDMB vote history page. Each time the IMDB updates their vote history page it may also be necessary to update this parsing routine. Reading ratings and votes requires an extra web page parsing for each movie in the vote history and will cause this routine to take a fair amount longer to complete.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread