X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Fjsite%2Fcore%2FCoreListener.java;h=fb109d7696c7425cb2b3997605a3d10930b140b1;hb=7e16d0a3b4f15da04f665fc011f78af2bc93a13d;hp=cef057a7f86d987042f20543b4ae26294703c346;hpb=7ccb1fcb746198ee1417bb2f92c846132bf6bc96;p=jSite2.git diff --git a/src/net/pterodactylus/jsite/core/CoreListener.java b/src/net/pterodactylus/jsite/core/CoreListener.java index cef057a..fb109d7 100644 --- a/src/net/pterodactylus/jsite/core/CoreListener.java +++ b/src/net/pterodactylus/jsite/core/CoreListener.java @@ -127,8 +127,27 @@ public interface CoreListener { // /** + * Notifies a listener that a node was added to the core. + * + * @param node + * The node that was added. + */ + public void nodeAdded(Node node); + + /** + * Notifies a listener that a node was removed from the core. Before a node + * is removed, it will be disconnected (and + * {@link #nodeDisconnected(Node, Throwable)} will be called). + * + * @param node + * The node that was removed + */ + public void nodeRemoved(Node node); + + /** * Notifies all listeners that the core started connecting to the given - * node. + * node. Before a node is connected, it will be added (and + * {@link #nodeAdded(Node)} will be called). * * @param node * The node that is being connected @@ -168,4 +187,25 @@ public interface CoreListener { */ public void requestAdded(Node node, Request request); + /** + * Notifies a listener that a request made some progress. + * + * @param request + * The request that made the progress + * @param totalBlocks + * The total number of blocks + * @param requiredBlocks + * The number of required blocks + * @param successfulBlocks + * The number of successful blocks + * @param failedBlocks + * The number of failed blocks + * @param fatallyFailedBlocks + * The number of fatally failed blocks + * @param finalizedTotal + * true if the number of total blocks is + * finalized, false if it is not + */ + public void requestProgressed(Request request, int totalBlocks, int requiredBlocks, int successfulBlocks, int failedBlocks, int fatallyFailedBlocks, boolean finalizedTotal); + }