bobik
Class JobListener

java.lang.Object
  extended by bobik.JobListener

public abstract class JobListener
extends java.lang.Object

Contains async callbacks for Bobik jobs


Constructor Summary
JobListener()
           
 
Method Summary
 void init(Job job)
          Called when the job is started
abstract  void onErrors(java.util.Collection<java.lang.String> errors)
          Called whenever there is an error during job execution.
abstract  void onProgress(float currentProgress)
          Called whenever some progress is made.
abstract  void onSuccess(JSONObject scraped_data)
          Called when the job is finished and data is scraped
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobListener

public JobListener()
Method Detail

init

public final void init(Job job)
Called when the job is started

Parameters:
job -

onSuccess

public abstract void onSuccess(JSONObject scraped_data)
Called when the job is finished and data is scraped

Parameters:
scraped_data -

onProgress

public abstract void onProgress(float currentProgress)
Called whenever some progress is made. Unless overridden, simply prints progress to System.out

Parameters:
currentProgress - a value between 0 and 1 (inclusive)

onErrors

public abstract void onErrors(java.util.Collection<java.lang.String> errors)
Called whenever there is an error during job execution. If a successful job contains some errors, this function will be called prior to onSuccess.

Parameters:
errors -