2 * Sone - ImageInsertListener.java - Copyright © 2011 David Roden
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 package net.pterodactylus.sone.core;
20 import java.util.EventListener;
22 import net.pterodactylus.sone.core.FreenetInterface.InsertToken;
23 import net.pterodactylus.sone.data.Image;
24 import freenet.keys.FreenetURI;
27 * Listener interface for objects that want to be notified about the status of
30 * @see ImageInserter#insertImage(net.pterodactylus.sone.data.TemporaryImage,
32 * @see FreenetInterface#insertImage(net.pterodactylus.sone.data.TemporaryImage,
33 * Image, net.pterodactylus.sone.core.FreenetInterface.InsertToken)
35 * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
37 public interface ImageInsertListener extends EventListener {
40 * Notifies a listener that the insert of the given image started.
43 * The image that is being inserted
45 public void imageInsertStarted(Image image);
48 * Notifies a listener that the insert of the given image was aborted by the
52 * The image that is no longer being inserted
54 public void imageInsertAborted(Image image);
57 * Notifies a listener that the given image was inserted successfully.
60 * The image that was inserted
62 * The final key of the image
64 public void imageInsertFinished(Image image, FreenetURI key);
67 * Notifies a listener that the given image could not be inserted.
70 * The image that could not be inserted
72 * The cause of the insertion failure
74 public void imageInsertFailed(Image image, Throwable cause);