projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Convert “post reply removed” 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
7ba226b
..
031fdb3
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,130
+44,143
@@
public class CoreListenerManager extends AbstractListenerManager<Core, CoreListe
//
/**
//
/**
- * Notifies all listeners that the given Sone
is now being rescu
ed.
+ * Notifies all listeners that the given Sone
was lock
ed.
*
*
- * @see CoreListener#
rescuingSone
(Sone)
+ * @see CoreListener#
soneLocked
(Sone)
* @param sone
* @param sone
- * The Sone that
is being rescu
ed
+ * The Sone that
was lock
ed
*/
*/
- void fire
RescuingSone
(Sone sone) {
+ void fire
SoneLocked
(Sone sone) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
rescuingSone
(sone);
+ coreListener.
soneLocked
(sone);
}
}
/**
}
}
/**
- * Notifies all listeners that the given Sone was
rescu
ed.
+ * Notifies all listeners that the given Sone was
unlock
ed.
*
*
- * @see CoreListener#
rescuedSone
(Sone)
+ * @see CoreListener#
soneUnlocked
(Sone)
* @param sone
* @param sone
- * The Sone that was
rescu
ed
+ * The Sone that was
unlock
ed
*/
*/
- void fire
RescuedSone
(Sone sone) {
+ void fire
SoneUnlocked
(Sone sone) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
rescuedSone
(sone);
+ coreListener.
soneUnlocked
(sone);
}
}
/**
}
}
/**
- * Notifies all listeners that
a new Sone has been discover
ed.
+ * Notifies all listeners that
the insert of the given Sone has start
ed.
*
*
- * @see
CoreListener#newSoneFoun
d(Sone)
+ * @see
SoneInsertListener#insertStarte
d(Sone)
* @param sone
* @param sone
- * The
discovered sone
+ * The
Sone being inserted
*/
*/
- void fire
NewSoneFound
(Sone sone) {
+ void fire
SoneInserting
(Sone sone) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
newSoneFound
(sone);
+ coreListener.
soneInserting
(sone);
}
}
/**
}
}
/**
- * Notifies all listeners that a new post has been found.
+ * Notifies all listeners that the insert of the given Sone has finished
+ * successfully.
*
*
- * @see CoreListener#newPostFound(Post)
- * @param post
- * The new post
+ * @see SoneInsertListener#insertFinished(Sone, long)
+ * @param sone
+ * The Sone that was inserted
+ * @param insertDuration
+ * The insert duration (in milliseconds)
*/
*/
- void fire
NewPostFound(Post post
) {
+ void fire
SoneInserted(Sone sone, long insertDuration
) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
newPostFound(post
);
+ coreListener.
soneInserted(sone, insertDuration
);
}
}
/**
}
}
/**
- * Notifies all listeners that
a new reply has been foun
d.
+ * Notifies all listeners that
the insert of the given Sone was aborte
d.
*
*
- * @see CoreListener#newReplyFound(Reply)
- * @param reply
- * The new reply
+ * @see SoneInsertListener#insertStarted(Sone)
+ * @param sone
+ * The Sone being inserted
+ * @param cause
+ * The cause for the abortion (may be {@code null}
*/
*/
- void fire
NewReplyFound(Reply reply
) {
+ void fire
SoneInsertAborted(Sone sone, Throwable cause
) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
newReplyFound(reply
);
+ coreListener.
soneInsertAborted(sone, cause
);
}
}
/**
}
}
/**
- * Notifies all listeners that
the given Sone is now marked as known
.
+ * Notifies all listeners that
a new version was found
.
*
*
- * @see CoreListener#markSoneKnown(Sone)
- * @param sone
- * The known Sone
+ * @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
MarkSoneKnown(Sone sone
) {
+ void fire
UpdateFound(Version version, long releaseTime, long latestEdition
) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
markSoneKnown(sone
);
+ coreListener.
updateFound(version, releaseTime, latestEdition
);
}
}
/**
}
}
/**
- * Notifies all listeners that
the given post is now marked as known
.
+ * Notifies all listeners that
an image has started being inserted
.
*
*
- * @param post
- * The known post
+ * @see CoreListener#imageInsertStarted(Image)
+ * @param image
+ * The image that is now inserted
*/
*/
- void fire
MarkPostKnown(Post post
) {
+ void fire
ImageInsertStarted(Image image
) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
markPostKnown(post
);
+ coreListener.
imageInsertStarted(image
);
}
}
/**
}
}
/**
- * Notifies all listeners that
the given reply is now marked as known
.
+ * Notifies all listeners that
an image insert was aborted by the user
.
*
*
- * @param reply
- * The known reply
+ * @see CoreListener#imageInsertAborted(Image)
+ * @param image
+ * The image that is not inserted anymore
*/
*/
- void fire
MarkReplyKnown(Reply reply
) {
+ void fire
ImageInsertAborted(Image image
) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
markReplyKnown(reply
);
+ coreListener.
imageInsertAborted(image
);
}
}
/**
}
}
/**
- * Notifies all listener
that the given post was remov
ed.
+ * Notifies all listener
s that an image was successfully insert
ed.
*
*
- * @see CoreListener#
postRemoved(Post
)
- * @param
post
- * The
removed post
+ * @see CoreListener#
imageInsertFinished(Image
)
+ * @param
image
+ * The
image that was inserted
*/
*/
- void fire
PostRemoved(Post post
) {
+ void fire
ImageInsertFinished(Image image
) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
postRemoved(post
);
+ coreListener.
imageInsertFinished(image
);
}
}
/**
}
}
/**
- * Notifies all listener
that the given reply was remov
ed.
+ * Notifies all listener
s that an image failed to be insert
ed.
*
*
- * @see CoreListener#replyRemoved(Reply)
- * @param reply
- * The removed reply
+ * @see CoreListener#imageInsertFailed(Image, Throwable)
+ * @param image
+ * The image that could not be inserted
+ * @param cause
+ * The cause of the failure
*/
*/
- void fire
ReplyRemoved(Reply reply
) {
+ void fire
ImageInsertFailed(Image image, Throwable cause
) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
replyRemoved(reply
);
+ coreListener.
imageInsertFailed(image, cause
);
}
}
}
}