Remove remnants of the old Rescue Mode.
[Sone.git] / src / main / java / net / pterodactylus / sone / core / CoreListener.java
1 /*
2  * Sone - CoreListener.java - Copyright © 2010 David Roden
3  *
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.
8  *
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.
13  *
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/>.
16  */
17
18 package net.pterodactylus.sone.core;
19
20 import java.util.EventListener;
21
22 import net.pterodactylus.sone.data.Post;
23 import net.pterodactylus.sone.data.Reply;
24 import net.pterodactylus.sone.data.Sone;
25 import net.pterodactylus.util.version.Version;
26
27 /**
28  * Listener interface for objects that want to be notified on certain
29  * {@link Core} events, such es discovery of new data.
30  *
31  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
32  */
33 public interface CoreListener extends EventListener {
34
35         /**
36          * Notifies a listener that a new Sone has been discovered.
37          *
38          * @param sone
39          *            The new Sone
40          */
41         public void newSoneFound(Sone sone);
42
43         /**
44          * Notifies a listener that a new post has been found.
45          *
46          * @param post
47          *            The new post
48          */
49         public void newPostFound(Post post);
50
51         /**
52          * Notifies a listener that a new reply has been found.
53          *
54          * @param reply
55          *            The new reply
56          */
57         public void newReplyFound(Reply reply);
58
59         /**
60          * Notifies a listener that the given Sone is now marked as known.
61          *
62          * @param sone
63          *            The known Sone
64          */
65         public void markSoneKnown(Sone sone);
66
67         /**
68          * Notifies a listener that the given post is now marked as known.
69          *
70          * @param post
71          *            The known post
72          */
73         public void markPostKnown(Post post);
74
75         /**
76          * Notifies a listener that the given reply is now marked as known.
77          *
78          * @param reply
79          *            The known reply
80          */
81         public void markReplyKnown(Reply reply);
82
83         /**
84          * Notifies a listener that the given Sone was removed.
85          *
86          * @param sone
87          *            The removed Sone
88          */
89         public void soneRemoved(Sone sone);
90
91         /**
92          * Notifies a listener that the given post was removed.
93          *
94          * @param post
95          *            The removed post
96          */
97         public void postRemoved(Post post);
98
99         /**
100          * Notifies a listener that the given reply was removed.
101          *
102          * @param reply
103          *            The removed reply
104          */
105         public void replyRemoved(Reply reply);
106
107         /**
108          * Notifies a listener when a Sone was locked.
109          *
110          * @param sone
111          *            The Sone that was locked
112          */
113         public void soneLocked(Sone sone);
114
115         /**
116          * Notifies a listener that a Sone was unlocked.
117          *
118          * @param sone
119          *            The Sone that was unlocked
120          */
121         public void soneUnlocked(Sone sone);
122
123         /**
124          * Notifies a listener that the insert of the given Sone has started.
125          *
126          * @see SoneInsertListener#insertStarted(Sone)
127          * @param sone
128          *            The Sone that is being inserted
129          */
130         public void soneInserting(Sone sone);
131
132         /**
133          * Notifies a listener that the insert of the given Sone has finished
134          * successfully.
135          *
136          * @see SoneInsertListener#insertFinished(Sone, long)
137          * @param sone
138          *            The Sone that has been inserted
139          * @param insertDuration
140          *            The insert duration (in milliseconds)
141          */
142         public void soneInserted(Sone sone, long insertDuration);
143
144         /**
145          * Notifies a listener that the insert of the given Sone was aborted.
146          *
147          * @see SoneInsertListener#insertAborted(Sone, Throwable)
148          * @param sone
149          *            The Sone that was inserted
150          * @param cause
151          *            The cause for the abortion (may be {@code null})
152          */
153         public void soneInsertAborted(Sone sone, Throwable cause);
154
155         /**
156          * Notifies a listener that a new version has been found.
157          *
158          * @param version
159          *            The version that was found
160          * @param releaseTime
161          *            The release time of the new version
162          * @param latestEdition
163          *            The latest edition of the Sone homepage
164          */
165         public void updateFound(Version version, long releaseTime, long latestEdition);
166
167 }