projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace Sone change detector with simple comparison helper
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
core
/
SoneDownloaderImpl.java
diff --git
a/src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java
b/src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java
index
c50c852
..
91bf13b
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java
+++ b/
src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java
@@
-45,8
+45,6
@@
import freenet.support.api.Bucket;
/**
* The Sone downloader is responsible for download Sones as they are updated.
/**
* The Sone downloader is responsible for download Sones as they are updated.
- *
- * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
public class SoneDownloaderImpl extends AbstractService implements SoneDownloader {
*/
public class SoneDownloaderImpl extends AbstractService implements SoneDownloader {
@@
-57,7
+55,7
@@
public class SoneDownloaderImpl extends AbstractService implements SoneDownloade
private static final int MAX_PROTOCOL_VERSION = 0;
/** The core. */
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. */
private final SoneParser soneParser;
/** The Freenet interface. */
@@
-66,19
+64,10
@@
public class SoneDownloaderImpl extends AbstractService implements SoneDownloade
/** The sones to update. */
private final Set<Sone> sones = new HashSet<Sone>();
/** The sones to update. */
private final Set<Sone> sones = new HashSet<Sone>();
- /**
- * Creates a new Sone downloader.
- *
- * @param core
- * The core
- * @param freenetInterface
- * The Freenet interface
- * @param soneParser
- */
@Inject
@Inject
- SoneDownloaderImpl(
Core core
, FreenetInterface freenetInterface, SoneParser soneParser) {
+ SoneDownloaderImpl(
UpdatedSoneProcessor updatedSoneProcessor
, FreenetInterface freenetInterface, SoneParser soneParser) {
super("Sone Downloader", false);
super("Sone Downloader", false);
- this.
core = core
;
+ this.
updatedSoneProcessor = updatedSoneProcessor
;
this.freenetInterface = freenetInterface;
this.soneParser = soneParser;
}
this.freenetInterface = freenetInterface;
this.soneParser = soneParser;
}
@@
-172,7
+161,7
@@
public class SoneDownloaderImpl extends AbstractService implements SoneDownloade
if (parsedSone != null) {
if (!fetchOnly) {
parsedSone.setStatus((parsedSone.getTime() == 0) ? SoneStatus.unknown : SoneStatus.idle);
if (parsedSone != null) {
if (!fetchOnly) {
parsedSone.setStatus((parsedSone.getTime() == 0) ? SoneStatus.unknown : SoneStatus.idle);
-
core
.updateSone(parsedSone);
+
updatedSoneProcessor
.updateSone(parsedSone);
addSone(parsedSone);
}
}
addSone(parsedSone);
}
}