@SuppressWarnings("synthetic-access")
public void onFoundEdition(long edition, USK key, ObjectContainer objectContainer, ClientContext clientContext, boolean metadata, short codec, byte[] data, boolean newKnownGood, boolean newSlotToo) {
logger.log(Level.FINE, String.format("Found USK update for Sone “%s” at %s, new known good: %s, new slot too: %s.", sone, key, newKnownGood, newSlotToo));
- soneUpdater.updateSone(sone, edition);
+ soneUpdater.updateSone(edition);
}
@Override
* The Sone to add
*/
@Override
- public void addSone(Sone sone) {
+ public void addSone(final Sone sone) {
if (!sones.add(sone)) {
freenetInterface.unregisterUsk(sone);
}
freenetInterface.registerUsk(sone, new SoneUpdater() {
@Override
- public void updateSone(Sone sone, long edition) {
+ public void updateSone(long edition) {
if (edition > sone.getLatestEdition()) {
sone.setLatestEdition(edition);
new Thread(fetchSoneAction(sone),
*/
public interface SoneUpdater {
- void updateSone(Sone sone, long edition);
+ void updateSone(long edition);
}
public void callbackForRegisteredSoneWithHigherEditionTriggersDownload() throws InterruptedException {
freenetInterface.registerUsk(sone, soneUpdater);
callbackCaptor.getValue().onFoundEdition(1, null, null, null, false, (short) 0, null, false, false);
- verify(soneUpdater).updateSone(sone, 1);
+ verify(soneUpdater).updateSone(1);
}
@Test