X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FFcpInterface.java;h=551dc4f67747522c77ae6bf527cb2057d5fc2c68;hb=5bcdc1b924c598b1e59551d44e2302ef29258dad;hp=c71fd82a003b37cc2f4a0897d077911237f3f312;hpb=b343a185e8b89ea5973bf57ec74217652834f5ea;p=Sone.git
diff --git a/src/main/java/net/pterodactylus/sone/fcp/FcpInterface.java b/src/main/java/net/pterodactylus/sone/fcp/FcpInterface.java
index c71fd82..551dc4f 100644
--- a/src/main/java/net/pterodactylus/sone/fcp/FcpInterface.java
+++ b/src/main/java/net/pterodactylus/sone/fcp/FcpInterface.java
@@ -41,6 +41,7 @@ import freenet.support.api.Bucket;
import com.google.common.annotations.VisibleForTesting;
import com.google.inject.Inject;
+import com.google.inject.Singleton;
/**
* Implementation of an FCP interface for other clients or plugins to
@@ -48,6 +49,7 @@ import com.google.inject.Inject;
*
* @author David âBombeâ Roden
*/
+@Singleton
public class FcpInterface {
/**
@@ -126,6 +128,11 @@ public class FcpInterface {
this.active = active;
}
+ @VisibleForTesting
+ FullAccessRequired getFullAccessRequired() {
+ return fullAccessRequired;
+ }
+
/**
* Sets the action level for which full FCP access is required.
*
@@ -233,4 +240,13 @@ public class FcpInterface {
}
+ public class SetFullAccessRequired implements OptionWatcher {
+
+ @Override
+ public void optionChanged(Option option, Integer oldValue, Integer newValue) {
+ setFullAccessRequired(FullAccessRequired.values()[newValue]);
+ }
+
+ }
+
}