X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffreenet%2FPluginStoreConfigurationBackend.java;h=5bde0b04aac99e71271e89a41073f8f5237dedb9;hb=601d1b020d8f5feccda4c2bbe78df2b9f336f0cc;hp=eebfe3ec46d844be8a5c3df4f0da04669a826e98;hpb=763715116898c7def5cf72e2c560af3b89450839;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/freenet/PluginStoreConfigurationBackend.java b/src/main/java/net/pterodactylus/sone/freenet/PluginStoreConfigurationBackend.java index eebfe3e..5bde0b0 100644 --- a/src/main/java/net/pterodactylus/sone/freenet/PluginStoreConfigurationBackend.java +++ b/src/main/java/net/pterodactylus/sone/freenet/PluginStoreConfigurationBackend.java @@ -1,5 +1,5 @@ /* - * FreenetSone - PluginStoreConfigurationBackend.java - Copyright © 2010 David Roden + * Sone - PluginStoreConfigurationBackend.java - Copyright © 2010–2013 David Roden * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +17,6 @@ package net.pterodactylus.sone.freenet; -import java.util.logging.Level; import java.util.logging.Logger; import net.pterodactylus.util.config.AttributeNotFoundException; @@ -25,7 +24,7 @@ import net.pterodactylus.util.config.Configuration; import net.pterodactylus.util.config.ConfigurationException; import net.pterodactylus.util.config.ExtendedConfigurationBackend; import net.pterodactylus.util.logging.Logging; -import freenet.client.async.DatabaseDisabledException; +import freenet.client.async.PersistenceDisabledException; import freenet.pluginmanager.PluginRespirator; import freenet.pluginmanager.PluginStore; @@ -37,6 +36,7 @@ import freenet.pluginmanager.PluginStore; public class PluginStoreConfigurationBackend implements ExtendedConfigurationBackend { /** The logger. */ + @SuppressWarnings("unused") private static final Logger logger = Logging.getLogger(PluginStoreConfigurationBackend.class); /** The plugin respirator. */ @@ -50,10 +50,10 @@ public class PluginStoreConfigurationBackend implements ExtendedConfigurationBac * * @param pluginRespirator * The plugin respirator - * @throws DatabaseDisabledException + * @throws PersistenceDisabledException * if the plugin store is not available */ - public PluginStoreConfigurationBackend(PluginRespirator pluginRespirator) throws DatabaseDisabledException { + public PluginStoreConfigurationBackend(PluginRespirator pluginRespirator) throws PersistenceDisabledException { this.pluginRespirator = pluginRespirator; this.pluginStore = pluginRespirator.getStore(); } @@ -166,18 +166,15 @@ public class PluginStoreConfigurationBackend implements ExtendedConfigurationBac save(); } - // - // PRIVATE METHODS - // - /** - * Saves the configuration to the plugin store. + * {@inheritDoc} */ - private void save() { + @Override + public void save() throws ConfigurationException { try { pluginRespirator.putStore(pluginStore); - } catch (DatabaseDisabledException dde1) { - logger.log(Level.WARNING, "Could not store plugin store, database is disabled.", dde1); + } catch (PersistenceDisabledException pde1) { + throw new ConfigurationException("Could not store plugin store, persistence is disabled.", pde1); } }