package votorola.a.diff.harvest.run; import java.io.InputStream; /** * Interface to talk to {@linkplain HarvestRunner}. * * Set archiveUrl and url before scheduling the job and access the inpustream * and status-code in the run() method. * */ public interface Fetcher extends Runnable { /** * This is the identifier of the forum necessary to balance requests for * each forum. * * @return archiveUrl */ public String archiveUrl(); /** * The actual Url to fetch. * * @return url */ public String url(); /** * Used by {@linkplain HarvestRunner} to give the job access to the fetched * result. * * @param in */ public void setInputStream(InputStream in); /** * Used by {@linkplain HarvestRunner} to set the return code of the result * for error handling. * * @param code */ public void setStatusCode(int code); /** * The Runnable is called once the input stream and code is set. */ @Override public void run(); /** * This is called instead of run if something below the HTTP layer goes * wrong. */ public void fault(final String msg); }