add more status notifications to core listener
[jSite2.git] / src / net / pterodactylus / jsite / core / CoreListener.java
1 /*
2  * jSite2 - UserInterface.java -
3  * Copyright © 2008 David Roden
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  */
19
20 package net.pterodactylus.jsite.core;
21
22 /**
23  * Interface definition for user interfaces.
24  *
25  * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
26  * @version $Id$
27  */
28 public interface CoreListener {
29
30         //
31         // project configuration
32         //
33
34         /**
35          * Notifies a listener that loading the projects finished successfully.
36          *
37          * @param directory
38          *            The directory the nodes were loaded from
39          */
40         public void loadingProjectsDone(String directory);
41
42         /**
43          * Notifies all listeners that loading the projects has failed.
44          *
45          * @param directory
46          *            The directory the projects were tried to load from
47          * @param throwable
48          *            The exception that occured while saving, if any
49          */
50         public void loadingProjectsFailed(String directory, Throwable throwable);
51
52         /**
53          * Notifies a listener that the projects were successfully saved to the
54          * given directory.
55          *
56          * @param directory
57          *            The directory the projects were saved to
58          */
59         public void savingProjectsDone(String directory);
60
61         /**
62          * Notifies a listener that saving the projects has failed.
63          *
64          * @param directory
65          *            The directory the projects were to be saved to
66          * @param throwable
67          *            The exception that occured when saving the projects, if any
68          */
69         public void savingProjectsFailed(String directory, Throwable throwable);
70
71         //
72         // node configuration
73         //
74
75         /**
76          * Notifies a listener that the nodes were successfully loaded.
77          *
78          * @param directory
79          *            The directory the nodes were loaded from
80          */
81         public void loadingNodesDone(String directory);
82
83         /**
84          * Notifies a listener that loading the nodes has failed.
85          *
86          * @param directory
87          *            The directory the nodes were loaded from
88          * @param throwable
89          *            The exception that occured while loading the nodes
90          */
91         public void loadingNodesFailed(String directory, Throwable throwable);
92
93         /**
94          * Notifies a listener that the nodes were successfully saved.
95          *
96          * @param directory
97          *            The directory the nodes were saved to
98          */
99         public void savingNodesDone(String directory);
100
101         /**
102          * Notifies a listener that saving the nodes has failed.
103          *
104          * @param directory
105          *            The directory the nodes were saved to
106          * @param throwable
107          *            The exception that occured while saving the nodes
108          */
109         public void savingNodesFailed(String directory, Throwable throwable);
110
111         //
112         // basic core functionality
113         //
114
115         /**
116          * Notifies all listeners that the core has loaded.
117          */
118         public void coreLoaded();
119
120         /**
121          * Notifies a listener that the core was stopped.
122          */
123         public void coreStopped();
124
125         //
126         // node stuff
127         //
128
129         /**
130          * Notifies all listeners that the core started connecting to the given
131          * node.
132          *
133          * @param node
134          *            The node that is being connected
135          */
136         public void nodeConnecting(Node node);
137
138         /**
139          * Notifies all listeners that the core connected to the given node.
140          *
141          * @param node
142          *            The node that is connected
143          */
144         public void nodeConnected(Node node);
145
146         /**
147          * Notifies all listeners that the core disconnected from the given node.
148          *
149          * @param node
150          *            The node that was diconnected
151          */
152         public void nodeDisconnected(Node node);
153
154 }