import net.pterodactylus.util.config.ConfigurationException;
import net.pterodactylus.util.logging.Logging;
import net.pterodactylus.util.number.Numbers;
+import net.pterodactylus.util.version.Version;
import freenet.keys.FreenetURI;
/**
*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
-public class Core implements IdentityListener {
+public class Core implements IdentityListener, UpdateListener {
/**
* Enumeration for the possible states of a {@link Sone}.
/** The Sone downloader. */
private final SoneDownloader soneDownloader;
+ /** The update checker. */
+ private final UpdateChecker updateChecker;
+
/** Whether the core has been stopped. */
private volatile boolean stopped;
this.freenetInterface = freenetInterface;
this.identityManager = identityManager;
this.soneDownloader = new SoneDownloader(this, freenetInterface);
+ this.updateChecker = new UpdateChecker(freenetInterface);
}
//
}
/**
+ * Returns the update checker.
+ *
+ * @return The update checker
+ */
+ public UpdateChecker getUpdateChecker() {
+ return updateChecker;
+ }
+
+ /**
* Returns the status of the given Sone.
*
* @param sone
*/
public void start() {
loadConfiguration();
+ updateChecker.addUpdateListener(this);
+ updateChecker.start();
}
/**
soneInserter.stop();
}
}
+ updateChecker.stop();
+ updateChecker.removeUpdateListener(this);
soneDownloader.stop();
saveConfiguration();
stopped = true;
/* TODO */
}
+ //
+ // INTERFACE UpdateListener
+ //
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void updateFound(Version version, long releaseTime) {
+ }
+
}