X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Fjsite%2Fcore%2FCoreListener.java;h=57eea5a9aae87d292e339f93e802ed805488b732;hb=dc37f1e959fe36099d157e6d09b5790d4e06897c;hp=96fcd9d00ac94b1053b0dd9aa323dde9b61e1584;hpb=a6d31fa9f170c57ba80b0f5ede4ef9bcbe3c9375;p=jSite2.git diff --git a/src/net/pterodactylus/jsite/core/CoreListener.java b/src/net/pterodactylus/jsite/core/CoreListener.java index 96fcd9d..57eea5a 100644 --- a/src/net/pterodactylus/jsite/core/CoreListener.java +++ b/src/net/pterodactylus/jsite/core/CoreListener.java @@ -23,7 +23,6 @@ package net.pterodactylus.jsite.core; * Interface definition for user interfaces. * * @author David ‘Bombe’ Roden <bombe@freenetproject.org> - * @version $Id$ */ public interface CoreListener { @@ -68,6 +67,32 @@ public interface CoreListener { */ public void savingProjectsFailed(String directory, Throwable throwable); + /** + * Notifies a listener that the given project was added. + * + * @param project + * The project that was added. + */ + public void projectAdded(Project project); + + /** + * Notifies a listener that a project was cloned. + * + * @param clonedProject + * The clones project + * @param projectClone + * The clone of the project + */ + public void projectCloned(Project clonedProject, Project projectClone); + + /** + * Notifies a listener that the given project was removed. + * + * @param project + * The project that was removed. + */ + public void projectRemoved(Project project); + // // node configuration // @@ -184,23 +209,58 @@ public interface CoreListener { public void nodeDisconnected(Node node, Throwable throwable); // - // request stuff + // project insertion stuff // /** - * Notifies a listener that a request was added to a node. + * Notifies a listener that a project insert started. + * + * @param project + * The project that is now inserting + */ + public void projectInsertStarted(Project project); + + /** + * Notifies a listener that a project insert made progress. + * + * @param project + * The project that made progress + * @param totalBlocks + * The number of total blocks + * @param requiredBlocks + * The number of required blocks + * @param successfulBlocks + * The number of successfully inserted blocks + * @param failedBlocks + * The number of blocks that could not be inserted + * @param fatallyFailedBlocks + * The number of blocks that can not be inserted even with + * retries + * @param finalizedTotal + * true if the number of total blocks is already + * finalized, false otherwise + */ + public void projectInsertProgressed(Project project, int totalBlocks, int requiredBlocks, int successfulBlocks, int failedBlocks, int fatallyFailedBlocks, boolean finalizedTotal); + + /** + * Notifies a listener that a project insert has generated a URI. * - * @param request - * The request that was added + * @param project + * The project that generated a URI + * @param uri + * The URI that was generated */ - public void requestAdded(Request request); + public void projectInsertGeneratedURI(Project project, String uri); /** - * Notifies a listener that a request made some progress. + * Notifies a listener that a project insert has finished. * - * @param request - * The request that made the progress + * @param project + * The project that has finished + * @param success + * true if the project was inserted successfully, + * false otherwise */ - public void requestProgressed(Request request); + public void projectInsertFinished(Project project, boolean success); }