001package org.openimaj.picslurper.output; 002 003import java.net.URL; 004 005import org.openimaj.picslurper.StatusConsumer; 006import org.openimaj.picslurper.StatusConsumption; 007 008/** 009 * @author Sina Samangooei (ss@ecs.soton.ac.uk) 010 * 011 */ 012public interface OutputListener { 013 /** 014 * Called for each image successfully downloaded. This function is told 015 * about the status which generated the image, the url from which the image 016 * was eventually downloaded (after various redirects) and the output file. 017 * The {@link StatusConsumption} instance from the {@link StatusConsumer} that 018 * processed the status is also provided 019 * @param written 020 * 021 * 022 */ 023 public void newImageDownloaded(WriteableImageOutput written); 024 025 /** 026 * Called for every URL that is a failure 027 * @param url 028 * @param reason 029 */ 030 public void failedURL(URL url, String reason); 031 032 /** 033 * When the picslurper is done 034 */ 035 public void finished(); 036 037 /** 038 * start things off 039 */ 040 public void prepare(); 041}