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 marked as known” 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
4fc9532
..
a88bef5
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,8
+17,9
@@
package net.pterodactylus.sone.core;
package net.pterodactylus.sone.core;
+import net.pterodactylus.sone.data.Image;
import net.pterodactylus.sone.data.Post;
import net.pterodactylus.sone.data.Post;
-import net.pterodactylus.sone.data.Reply;
+import net.pterodactylus.sone.data.
Post
Reply;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.util.event.AbstractListenerManager;
import net.pterodactylus.util.version.Version;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.util.event.AbstractListenerManager;
import net.pterodactylus.util.version.Version;
@@
-45,171
+46,182
@@
public class CoreListenerManager extends AbstractListenerManager<Core, CoreListe
//
/**
//
/**
- * Notifies all listener
s that the given Sone is now being rescu
ed.
+ * Notifies all listener
that the given Sone was remov
ed.
*
*
- * @see CoreListener#
rescuingSone
(Sone)
+ * @see CoreListener#
soneRemoved
(Sone)
* @param sone
* @param sone
- * The
Sone that is being rescued
+ * The
removed Sone
*/
*/
- void fire
RescuingSone
(Sone sone) {
+ void fire
SoneRemoved
(Sone sone) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
rescuingSone
(sone);
+ coreListener.
soneRemoved
(sone);
}
}
/**
}
}
/**
- * Notifies all listener
s that the given Sone was rescu
ed.
+ * Notifies all listener
that the given post was remov
ed.
*
*
- * @see CoreListener#
rescuedSone(Sone
)
- * @param
sone
- * The
Sone that was rescued
+ * @see CoreListener#
postRemoved(Post
)
+ * @param
post
+ * The
removed post
*/
*/
- void fire
RescuedSone(Sone sone
) {
+ void fire
PostRemoved(Post post
) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
rescuedSone(sone
);
+ coreListener.
postRemoved(post
);
}
}
/**
}
}
/**
- * Notifies all listener
s that a new Sone has been discover
ed.
+ * Notifies all listener
that the given reply was remov
ed.
*
*
- * @see CoreListener#
newSoneFound(Sone
)
- * @param
sone
- * The
discovered sone
+ * @see CoreListener#
replyRemoved(PostReply
)
+ * @param
reply
+ * The
removed reply
*/
*/
- void fire
NewSoneFound(Sone sone
) {
+ void fire
ReplyRemoved(PostReply reply
) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
newSoneFound(sone
);
+ coreListener.
replyRemoved(reply
);
}
}
/**
}
}
/**
- * Notifies all listeners that
a new post has been foun
d.
+ * Notifies all listeners that
the given Sone was locke
d.
*
*
- * @see CoreListener#
newPostFound(Post
)
- * @param
post
- * The
new post
+ * @see CoreListener#
soneLocked(Sone
)
+ * @param
sone
+ * The
Sone that was locked
*/
*/
- void fire
NewPostFound(Post post
) {
+ void fire
SoneLocked(Sone sone
) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
newPostFound(post
);
+ coreListener.
soneLocked(sone
);
}
}
/**
}
}
/**
- * Notifies all listeners that
a new reply has been foun
d.
+ * Notifies all listeners that
the given Sone was unlocke
d.
*
*
- * @see CoreListener#
newReplyFound(Reply
)
- * @param
reply
- * The
new reply
+ * @see CoreListener#
soneUnlocked(Sone
)
+ * @param
sone
+ * The
Sone that was unlocked
*/
*/
- void fire
NewReplyFound(Reply reply
) {
+ void fire
SoneUnlocked(Sone sone
) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
newReplyFound(reply
);
+ coreListener.
soneUnlocked(sone
);
}
}
/**
}
}
/**
- * Notifies all listeners that the
given Sone is now marked as known
.
+ * Notifies all listeners that the
insert of the given Sone has started
.
*
*
- * @see
CoreListener#markSoneKnown
(Sone)
+ * @see
SoneInsertListener#insertStarted
(Sone)
* @param sone
* @param sone
- * The
known Sone
+ * The
Sone being inserted
*/
*/
- void fire
MarkSoneKnown
(Sone sone) {
+ void fire
SoneInserting
(Sone sone) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
markSoneKnown
(sone);
+ coreListener.
soneInserting
(sone);
}
}
/**
}
}
/**
- * Notifies all listeners that the given post is now marked as known.
+ * Notifies all listeners that the insert of the given Sone has finished
+ * successfully.
*
*
- * @param post
- * The known post
+ * @see SoneInsertListener#insertFinished(Sone, long)
+ * @param sone
+ * The Sone that was inserted
+ * @param insertDuration
+ * The insert duration (in milliseconds)
*/
*/
- void fire
MarkPostKnown(Post post
) {
+ void fire
SoneInserted(Sone sone, long insertDuration
) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
markPostKnown(post
);
+ coreListener.
soneInserted(sone, insertDuration
);
}
}
/**
}
}
/**
- * Notifies all listeners that the
given reply is now marked as known
.
+ * Notifies all listeners that the
insert of the given Sone was aborted
.
*
*
- * @param reply
- * The known reply
+ * @see SoneInsertListener#insertStarted(Sone)
+ * @param sone
+ * The Sone being inserted
+ * @param cause
+ * The cause for the abortion (may be {@code null}
*/
*/
- void fire
MarkReplyKnown(Reply reply
) {
+ void fire
SoneInsertAborted(Sone sone, Throwable cause
) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
markReplyKnown(reply
);
+ coreListener.
soneInsertAborted(sone, cause
);
}
}
/**
}
}
/**
- * Notifies all listener
that the given post was remove
d.
+ * Notifies all listener
s that a new version was foun
d.
*
*
- * @see CoreListener#postRemoved(Post)
- * @param post
- * The removed 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
PostRemoved(Post post
) {
+ void fire
UpdateFound(Version version, long releaseTime, long latestEdition
) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
postRemoved(post
);
+ coreListener.
updateFound(version, releaseTime, latestEdition
);
}
}
/**
}
}
/**
- * Notifies all listener
that the given reply was remov
ed.
+ * Notifies all listener
s that an image has started being insert
ed.
*
*
- * @see CoreListener#
replyRemoved(Reply
)
- * @param
reply
- * The
removed reply
+ * @see CoreListener#
imageInsertStarted(Image
)
+ * @param
image
+ * The
image that is now inserted
*/
*/
- void fire
ReplyRemoved(Reply reply
) {
+ void fire
ImageInsertStarted(Image image
) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
replyRemoved(reply
);
+ coreListener.
imageInsertStarted(image
);
}
}
/**
}
}
/**
- * Notifies all listeners that
the given Sone was locked
.
+ * Notifies all listeners that
an image insert was aborted by the user
.
*
*
- * @see CoreListener#
soneLocked(Son
e)
- * @param
son
e
- * The
Sone that was locked
+ * @see CoreListener#
imageInsertAborted(Imag
e)
+ * @param
imag
e
+ * The
image that is not inserted anymore
*/
*/
- void fire
SoneLocked(Sone son
e) {
+ void fire
ImageInsertAborted(Image imag
e) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
soneLocked(son
e);
+ coreListener.
imageInsertAborted(imag
e);
}
}
/**
}
}
/**
- * Notifies all listeners that
the given Sone was unlock
ed.
+ * Notifies all listeners that
an image was successfully insert
ed.
*
*
- * @see CoreListener#
soneUnlocked(Son
e)
- * @param
son
e
- * The
Sone that was unlock
ed
+ * @see CoreListener#
imageInsertFinished(Imag
e)
+ * @param
imag
e
+ * The
image that was insert
ed
*/
*/
- void fire
SoneUnlocked(Sone son
e) {
+ void fire
ImageInsertFinished(Image imag
e) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
soneUnlocked(son
e);
+ coreListener.
imageInsertFinished(imag
e);
}
}
/**
}
}
/**
- * Notifies all listeners that a
new version was foun
d.
+ * Notifies all listeners that a
n image failed to be inserte
d.
*
*
- * @see CoreListener#
updateFound(Version, long
)
- * @param
version
- * The
new version
- * @param
releaseTim
e
- * The
release time of the new version
+ * @see CoreListener#
imageInsertFailed(Image, Throwable
)
+ * @param
image
+ * The
image that could not be inserted
+ * @param
caus
e
+ * The
cause of the failure
*/
*/
- void fire
UpdateFound(Version version, long releaseTim
e) {
+ void fire
ImageInsertFailed(Image image, Throwable caus
e) {
for (CoreListener coreListener : getListeners()) {
for (CoreListener coreListener : getListeners()) {
- coreListener.
updateFound(version, releaseTim
e);
+ coreListener.
imageInsertFailed(image, caus
e);
}
}
}
}