package net.pterodactylus.sone.core;
+import net.pterodactylus.sone.data.Image;
import net.pterodactylus.sone.data.Post;
import net.pterodactylus.sone.data.Reply;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.util.event.AbstractListenerManager;
+import net.pterodactylus.util.version.Version;
/**
* Manager for {@link CoreListener}s.
}
}
+ /**
+ * Notifies all listeners that the given Sone was locked.
+ *
+ * @see CoreListener#soneLocked(Sone)
+ * @param sone
+ * The Sone that was locked
+ */
+ void fireSoneLocked(Sone sone) {
+ for (CoreListener coreListener : getListeners()) {
+ coreListener.soneLocked(sone);
+ }
+ }
+
+ /**
+ * Notifies all listeners that the given Sone was unlocked.
+ *
+ * @see CoreListener#soneUnlocked(Sone)
+ * @param sone
+ * The Sone that was unlocked
+ */
+ void fireSoneUnlocked(Sone sone) {
+ for (CoreListener coreListener : getListeners()) {
+ coreListener.soneUnlocked(sone);
+ }
+ }
+
+ /**
+ * Notifies all listeners that a new version was found.
+ *
+ * @see CoreListener#updateFound(Version, long, long)
+ * @param version
+ * The new version
+ * @param releaseTime
+ * The release time of the new version
+ * @param latestEdition
+ * The latest edition of the Sone homepage
+ */
+ void fireUpdateFound(Version version, long releaseTime, long latestEdition) {
+ for (CoreListener coreListener : getListeners()) {
+ coreListener.updateFound(version, releaseTime, latestEdition);
+ }
+ }
+
+ /**
+ * Notifies all listeners that an image has started being inserted.
+ *
+ * @see CoreListener#imageInsertStarted(Image)
+ * @param image
+ * The image that is now inserted
+ */
+ void fireImageInsertStarted(Image image) {
+ for (CoreListener coreListener : getListeners()) {
+ coreListener.imageInsertStarted(image);
+ }
+ }
+
+ /**
+ * Notifies all listeners that an image insert was aborted by the user.
+ *
+ * @see CoreListener#imageInsertAborted(Image)
+ * @param image
+ * The image that is not inserted anymore
+ */
+ void fireImageInsertAborted(Image image) {
+ for (CoreListener coreListener : getListeners()) {
+ coreListener.imageInsertAborted(image);
+ }
+ }
+
+ /**
+ * Notifies all listeners that an image was successfully inserted.
+ *
+ * @see CoreListener#imageInsertFinished(Image)
+ * @param image
+ * The image that was inserted
+ */
+ void fireImageInsertFinished(Image image) {
+ for (CoreListener coreListener : getListeners()) {
+ coreListener.imageInsertFinished(image);
+ }
+ }
+
+ /**
+ * Notifies all listeners that an image failed to be inserted.
+ *
+ * @see CoreListener#imageInsertFailed(Image, Throwable)
+ * @param image
+ * The image that could not be inserted
+ * @param cause
+ * The cause of the failure
+ */
+ void fireImageInsertFailed(Image image, Throwable cause) {
+ for (CoreListener coreListener : getListeners()) {
+ coreListener.imageInsertFailed(image, cause);
+ }
+ }
+
}