X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FSoneDownloaderImpl.java;h=91bf13b8e2a502f34a2fc4600cf949309814a83d;hp=f3d5068d7bbb61cd7d598e3071e52af1257982b3;hb=e82bcd0c57096e722421a263fd2e95f88974b65b;hpb=2493e844ddeece59211c6a3c40e7ecc5d2cdb8b5 diff --git a/src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java b/src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java index f3d5068..91bf13b 100644 --- a/src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java +++ b/src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java @@ -31,7 +31,6 @@ import java.util.logging.Logger; import javax.inject.Inject; -import net.pterodactylus.sone.core.FreenetInterface.Fetched; import net.pterodactylus.sone.data.Sone; import net.pterodactylus.sone.data.Sone.SoneStatus; import net.pterodactylus.util.service.AbstractService; @@ -46,8 +45,6 @@ import freenet.support.api.Bucket; /** * The Sone downloader is responsible for download Sones as they are updated. - * - * @author David ‘Bombe’ Roden */ public class SoneDownloaderImpl extends AbstractService implements SoneDownloader { @@ -58,7 +55,7 @@ public class SoneDownloaderImpl extends AbstractService implements SoneDownloade private static final int MAX_PROTOCOL_VERSION = 0; /** The core. */ - private final Core core; + private final UpdatedSoneProcessor updatedSoneProcessor; private final SoneParser soneParser; /** The Freenet interface. */ @@ -67,19 +64,10 @@ public class SoneDownloaderImpl extends AbstractService implements SoneDownloade /** The sones to update. */ private final Set sones = new HashSet(); - /** - * Creates a new Sone downloader. - * - * @param core - * The core - * @param freenetInterface - * The Freenet interface - * @param soneParser - */ @Inject - SoneDownloaderImpl(Core core, FreenetInterface freenetInterface, SoneParser soneParser) { + SoneDownloaderImpl(UpdatedSoneProcessor updatedSoneProcessor, FreenetInterface freenetInterface, SoneParser soneParser) { super("Sone Downloader", false); - this.core = core; + this.updatedSoneProcessor = updatedSoneProcessor; this.freenetInterface = freenetInterface; this.soneParser = soneParser; } @@ -173,7 +161,7 @@ public class SoneDownloaderImpl extends AbstractService implements SoneDownloade if (parsedSone != null) { if (!fetchOnly) { parsedSone.setStatus((parsedSone.getTime() == 0) ? SoneStatus.unknown : SoneStatus.idle); - core.updateSone(parsedSone); + updatedSoneProcessor.updateSone(parsedSone); addSone(parsedSone); } }