- public SoneInserter(Core core, EventBus eventBus, FreenetInterface freenetInterface, Sone sone) {
- super("Sone Inserter for β" + sone.getName() + "β", false);
+ public SoneInserter(final Core core, EventBus eventBus, FreenetInterface freenetInterface, final String soneId) {
+ this(core, eventBus, freenetInterface, soneId, new SoneModificationDetector(new LockableFingerprintProvider() {
+ @Override
+ public boolean isLocked() {
+ Sone sone = core.getSone(soneId);
+ if (sone == null) {
+ return false;
+ }
+ return core.isLocked(sone);
+ }
+
+ @Override
+ public String getFingerprint() {
+ Sone sone = core.getSone(soneId);
+ if (sone == null) {
+ return null;
+ }
+ return sone.getFingerprint();
+ }
+ }, insertionDelay), 1000);
+ }
+
+ @VisibleForTesting
+ SoneInserter(Core core, EventBus eventBus, FreenetInterface freenetInterface, String soneId, SoneModificationDetector soneModificationDetector, long delay) {
+ super("Sone Inserter for β" + soneId + "β", false);