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}
018         * that processed the status is also provided
019         * 
020         * @param written
021         *
022         *
023         */
024        public void newImageDownloaded(WriteableImageOutput written);
025
026        /**
027         * Called for every URL that is a failure
028         * 
029         * @param url
030         * @param reason
031         */
032        public void failedURL(URL url, String reason);
033
034        /**
035         * When the picslurper is done
036         */
037        public void finished();
038
039        /**
040         * start things off
041         */
042        public void prepare();
043}