import net.pterodactylus.sone.core.Core;
import net.pterodactylus.sone.core.FreenetInterface;
import net.pterodactylus.sone.freenet.PluginStoreConfigurationBackend;
+import net.pterodactylus.sone.freenet.wot.IdentityManager;
+import net.pterodactylus.sone.freenet.wot.PluginConnector;
+import net.pterodactylus.sone.freenet.wot.WebOfTrustConnector;
import net.pterodactylus.sone.web.WebInterface;
import net.pterodactylus.util.config.Configuration;
import net.pterodactylus.util.config.ConfigurationException;
freenet.support.Logger.error(loggerClass, String.format(logRecord.getMessage(), logRecord.getParameters()), logRecord.getThrown());
}
}
-
});
}
/** The version. */
- public static final Version VERSION = new Version("RC2", 0, 1);
+ public static final Version VERSION = new Version(0, 2, 3);
/** The logger. */
private static final Logger logger = Logging.getLogger(SonePlugin.class);
/** The plugin store. */
private PluginStore pluginStore;
+ /** The identity manager. */
+ private IdentityManager identityManager;
+
//
// ACCESSORS
//
/* create a configuration. */
Configuration configuration;
try {
- configuration = new Configuration(new PluginStoreConfigurationBackend(pluginStore = pluginRespirator.getStore()));
+ configuration = new Configuration(new PluginStoreConfigurationBackend(pluginRespirator));
} catch (DatabaseDisabledException dde1) {
logger.log(Level.WARNING, "Could not load plugin store, using XML files.");
try {
/* create freenet interface. */
FreenetInterface freenetInterface = new FreenetInterface(pluginRespirator.getNode(), pluginRespirator.getHLSimpleClient());
+ /* create web of trust connector. */
+ PluginConnector pluginConnector = new PluginConnector(pluginRespirator);
+ WebOfTrustConnector webOfTrustConnector = new WebOfTrustConnector(pluginConnector);
+ identityManager = new IdentityManager(webOfTrustConnector);
+ identityManager.setContext("Sone");
+
/* create the web interface. */
webInterface = new WebInterface(this);
/* create core. */
- core = new Core();
- core.configuration(configuration);
- core.freenetInterface(freenetInterface);
+ core = new Core(configuration, freenetInterface, identityManager);
+
+ /* create the identity manager. */
+ identityManager.addIdentityListener(core);
/* start core! */
boolean startupFailed = true;
try {
core.start();
webInterface.start();
+ identityManager.start();
startupFailed = false;
} finally {
if (startupFailed) {
/* stop the core. */
core.stop();
+ /* stop the identity manager. */
+ identityManager.stop();
+
/* TODO wait for core to stop? */
try {
pluginRespirator.putStore(pluginStore);