add more status notifications to core listener
[jSite2.git] / src / net / pterodactylus / jsite / core / CoreListener.java
index 45772bc..812ce89 100644 (file)
@@ -21,21 +21,115 @@ package net.pterodactylus.jsite.core;
 
 /**
  * Interface definition for user interfaces.
- * 
+ *
  * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
  * @version $Id$
  */
 public interface CoreListener {
 
+       //
+       // project configuration
+       //
+
+       /**
+        * Notifies a listener that loading the projects finished successfully.
+        *
+        * @param directory
+        *            The directory the nodes were loaded from
+        */
+       public void loadingProjectsDone(String directory);
+
+       /**
+        * Notifies all listeners that loading the projects has failed.
+        *
+        * @param directory
+        *            The directory the projects were tried to load from
+        * @param throwable
+        *            The exception that occured while saving, if any
+        */
+       public void loadingProjectsFailed(String directory, Throwable throwable);
+
+       /**
+        * Notifies a listener that the projects were successfully saved to the
+        * given directory.
+        *
+        * @param directory
+        *            The directory the projects were saved to
+        */
+       public void savingProjectsDone(String directory);
+
+       /**
+        * Notifies a listener that saving the projects has failed.
+        *
+        * @param directory
+        *            The directory the projects were to be saved to
+        * @param throwable
+        *            The exception that occured when saving the projects, if any
+        */
+       public void savingProjectsFailed(String directory, Throwable throwable);
+
+       //
+       // node configuration
+       //
+
+       /**
+        * Notifies a listener that the nodes were successfully loaded.
+        *
+        * @param directory
+        *            The directory the nodes were loaded from
+        */
+       public void loadingNodesDone(String directory);
+
+       /**
+        * Notifies a listener that loading the nodes has failed.
+        *
+        * @param directory
+        *            The directory the nodes were loaded from
+        * @param throwable
+        *            The exception that occured while loading the nodes
+        */
+       public void loadingNodesFailed(String directory, Throwable throwable);
+
+       /**
+        * Notifies a listener that the nodes were successfully saved.
+        *
+        * @param directory
+        *            The directory the nodes were saved to
+        */
+       public void savingNodesDone(String directory);
+
+       /**
+        * Notifies a listener that saving the nodes has failed.
+        *
+        * @param directory
+        *            The directory the nodes were saved to
+        * @param throwable
+        *            The exception that occured while saving the nodes
+        */
+       public void savingNodesFailed(String directory, Throwable throwable);
+
+       //
+       // basic core functionality
+       //
+
        /**
         * Notifies all listeners that the core has loaded.
         */
        public void coreLoaded();
 
        /**
+        * Notifies a listener that the core was stopped.
+        */
+       public void coreStopped();
+
+       //
+       // node stuff
+       //
+
+       /**
         * Notifies all listeners that the core started connecting to the given
         * node.
-        * 
+        *
         * @param node
         *            The node that is being connected
         */
@@ -43,7 +137,7 @@ public interface CoreListener {
 
        /**
         * Notifies all listeners that the core connected to the given node.
-        * 
+        *
         * @param node
         *            The node that is connected
         */
@@ -51,7 +145,7 @@ public interface CoreListener {
 
        /**
         * Notifies all listeners that the core disconnected from the given node.
-        * 
+        *
         * @param node
         *            The node that was diconnected
         */