- public SoneInserter(Core core, EventBus eventBus, FreenetInterface freenetInterface, Sone sone) {
- this(core, eventBus, freenetInterface, sone, new SoneModificationDetector(core, sone, insertionDelay));
+ 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() {
+ final Optional<Sone> sone = core.getSone(soneId);
+ if (!sone.isPresent()) {
+ return false;
+ }
+ return core.isLocked(sone.get());
+ }
+
+ @Override
+ public String getFingerprint() {
+ final Optional<Sone> sone = core.getSone(soneId);
+ if (!sone.isPresent()) {
+ return null;
+ }
+ return sone.get().getFingerprint();
+ }
+ }, insertionDelay), 1000);