From bb52f8a8424a1fb38c99875dc17b39648b2d5d8b Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sun, 22 Jun 2008 11:25:00 +0200 Subject: [PATCH] add javadoc --- .../jsite/application/InsertListener.java | 66 +++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/src/de/todesbaum/jsite/application/InsertListener.java b/src/de/todesbaum/jsite/application/InsertListener.java index 7cc7d8d..1371061 100644 --- a/src/de/todesbaum/jsite/application/InsertListener.java +++ b/src/de/todesbaum/jsite/application/InsertListener.java @@ -22,19 +22,83 @@ package de.todesbaum.jsite.application; import java.util.EventListener; /** + * Interface for objects that want to be notified abount insert events. + * * @author David ‘Bombe’ Roden <bombe@freenetproject.org> */ public interface InsertListener extends EventListener { + /** + * Enumeration for the different error situations. + * + * @author David ‘Bombe’ Roden <bombe@freenetproject.org> + */ public static enum ErrorType { - KEY_COLLISION, ROUTE_NOT_FOUND, DATA_NOT_FOUND, FCP_ERROR, IO_ERROR + + /** The key does already exist. */ + KEY_COLLISION, + + /** The route to the key was not found. */ + ROUTE_NOT_FOUND, + + /** The data was not found. */ + DATA_NOT_FOUND, + + /** Error in the FCP communication. */ + FCP_ERROR, + + /** General error in the communication. */ + IO_ERROR } + /** + * Notifies a listener that an insert has started. + * + * @param project + * The project that is now being inserted + */ public void projectInsertStarted(Project project); + + /** + * Notifies a listener that a project insert has generated a URI. + * + * @param project + * The project being inserted + * @param uri + * The generated URI + */ public void projectURIGenerated(Project project, String uri); + /** + * Notifies a listener that an insert has made some progress. + * + * @param project + * The project being inserted + * @param succeeded + * The number of succeeded blocks + * @param failed + * The number of failed blocks + * @param fatal + * The number of fatally failed blocks + * @param total + * The total number of blocks + * @param finalized + * true if the total number of blocks has been + * finalized, false otherwise + */ public void projectInsertProgress(Project project, int succeeded, int failed, int fatal, int total, boolean finalized); + /** + * Notifies a listener that a project insert has finished. + * + * @param project + * The project being inserted + * @param success + * true if the insert succeeded, + * false otherwise + * @param cause + * The cause of a failure, if any (may be null) + */ public void projectInsertFinished(Project project, boolean success, Throwable cause); } -- 2.7.4