projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Convert “Sone was inserted” into EventBus-based event.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
core
/
CoreListenerManager.java
diff --git
a/src/main/java/net/pterodactylus/sone/core/CoreListenerManager.java
b/src/main/java/net/pterodactylus/sone/core/CoreListenerManager.java
index
74838a1
..
a4c3b78
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/core/CoreListenerManager.java
+++ b/
src/main/java/net/pterodactylus/sone/core/CoreListenerManager.java
@@
-1,5
+1,5
@@
/*
/*
- * Sone - CoreListenerManager.java - Copyright © 2010 David Roden
+ * Sone - CoreListenerManager.java - Copyright © 2010
–2012
David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-17,10
+17,10
@@
package net.pterodactylus.sone.core;
package net.pterodactylus.sone.core;
-import net.pterodactylus.sone.data.Post;
-import net.pterodactylus.sone.data.Reply;
+import net.pterodactylus.sone.data.Image;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.util.event.AbstractListenerManager;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.util.event.AbstractListenerManager;
+import net.pterodactylus.util.version.Version;
/**
* Manager for {@link CoreListener}s.
/**
* Manager for {@link CoreListener}s.
@@
-44,78
+44,88
@@
public class CoreListenerManager extends AbstractListenerManager<Core, CoreListe
//
/**
//
/**
- * Notifies all listeners that
a new Sone has been discover
ed.
+ * Notifies all listeners that
the insert of the given Sone was abort
ed.
*
*
- * @see
CoreListener#newSoneFoun
d(Sone)
+ * @see
SoneInsertListener#insertStarte
d(Sone)
* @param sone
* @param sone
- * The discovered sone
+ * The Sone being inserted
+ * @param cause
+ * The cause for the abortion (may be {@code null}
*/
*/
- void fire
NewSoneFound(Sone son
e) {
+ void fire
SoneInsertAborted(Sone sone, Throwable caus
e) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
newSoneFound(son
e);
+ coreListener.
soneInsertAborted(sone, caus
e);
}
}
/**
}
}
/**
- * Notifies all listeners that a new
post has been
found.
+ * Notifies all listeners that a new
version was
found.
*
*
- * @see CoreListener#newPostFound(Post)
- * @param post
- * The new post
+ * @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 fire
NewPostFound(Post post
) {
+ void fire
UpdateFound(Version version, long releaseTime, long latestEdition
) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
newPostFound(post
);
+ coreListener.
updateFound(version, releaseTime, latestEdition
);
}
}
/**
}
}
/**
- * Notifies all listeners that a
new reply has been foun
d.
+ * Notifies all listeners that a
n image has started being inserte
d.
*
*
- * @see CoreListener#
newReplyFound(Reply
)
- * @param
reply
- * The
new reply
+ * @see CoreListener#
imageInsertStarted(Image
)
+ * @param
image
+ * The
image that is now inserted
*/
*/
- void fire
NewReplyFound(Reply reply
) {
+ void fire
ImageInsertStarted(Image image
) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
newReplyFound(reply
);
+ coreListener.
imageInsertStarted(image
);
}
}
/**
}
}
/**
- * Notifies all listeners that
the given Sone is now marked as known
.
+ * Notifies all listeners that
an image insert was aborted by the user
.
*
*
- * @see CoreListener#
markSoneKnown(Son
e)
- * @param
son
e
- * The
known Son
e
+ * @see CoreListener#
imageInsertAborted(Imag
e)
+ * @param
imag
e
+ * The
image that is not inserted anymor
e
*/
*/
- void fire
MarkSoneKnown(Sone son
e) {
+ void fire
ImageInsertAborted(Image imag
e) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
markSoneKnown(son
e);
+ coreListener.
imageInsertAborted(imag
e);
}
}
/**
}
}
/**
- * Notifies all listeners that
the given post is now marked as known
.
+ * Notifies all listeners that
an image was successfully inserted
.
*
*
- * @param post
- * The known post
+ * @see CoreListener#imageInsertFinished(Image)
+ * @param image
+ * The image that was inserted
*/
*/
- void fire
MarkPostKnown(Post post
) {
+ void fire
ImageInsertFinished(Image image
) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
markPostKnown(post
);
+ coreListener.
imageInsertFinished(image
);
}
}
/**
}
}
/**
- * Notifies all listeners that
the given reply is now marked as known
.
+ * Notifies all listeners that
an image failed to be inserted
.
*
*
- * @param reply
- * The known reply
+ * @see CoreListener#imageInsertFailed(Image, Throwable)
+ * @param image
+ * The image that could not be inserted
+ * @param cause
+ * The cause of the failure
*/
*/
- void fire
MarkReplyKnown(Reply reply
) {
+ void fire
ImageInsertFailed(Image image, Throwable cause
) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
markReplyKnown(reply
);
+ coreListener.
imageInsertFailed(image, cause
);
}
}
}
}