projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change dates in file headers
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
fcp
/
FcpInterface.java
diff --git
a/src/main/java/net/pterodactylus/sone/fcp/FcpInterface.java
b/src/main/java/net/pterodactylus/sone/fcp/FcpInterface.java
index
763a06e
..
440cb4c
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/fcp/FcpInterface.java
+++ b/
src/main/java/net/pterodactylus/sone/fcp/FcpInterface.java
@@
-1,5
+1,5
@@
/*
/*
- * Sone - FcpInterface.java - Copyright © 2011–201
3
David Roden
+ * Sone - FcpInterface.java - Copyright © 2011–201
6
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
*
* 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
@@
-18,6
+18,7
@@
package net.pterodactylus.sone.fcp;
import static com.google.common.base.Preconditions.checkNotNull;
package net.pterodactylus.sone.fcp;
import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.logging.Logger.getLogger;
import java.util.Collections;
import java.util.HashMap;
import java.util.Collections;
import java.util.HashMap;
@@
-28,14
+29,12
@@
import java.util.logging.Level;
import java.util.logging.Logger;
import net.pterodactylus.sone.core.Core;
import java.util.logging.Logger;
import net.pterodactylus.sone.core.Core;
-import net.pterodactylus.sone.core.Options.Option;
-import net.pterodactylus.sone.core.Options.OptionWatcher;
import net.pterodactylus.sone.fcp.event.FcpInterfaceActivatedEvent;
import net.pterodactylus.sone.fcp.event.FcpInterfaceDeactivatedEvent;
import net.pterodactylus.sone.fcp.event.FcpInterfaceActivatedEvent;
import net.pterodactylus.sone.fcp.event.FcpInterfaceDeactivatedEvent;
+import net.pterodactylus.sone.fcp.event.FullAccessRequiredChanged;
import net.pterodactylus.sone.freenet.fcp.Command.AccessType;
import net.pterodactylus.sone.freenet.fcp.Command.ErrorResponse;
import net.pterodactylus.sone.freenet.fcp.Command.Response;
import net.pterodactylus.sone.freenet.fcp.Command.AccessType;
import net.pterodactylus.sone.freenet.fcp.Command.ErrorResponse;
import net.pterodactylus.sone.freenet.fcp.Command.Response;
-import net.pterodactylus.util.logging.Logging;
import freenet.pluginmanager.FredPluginFCP;
import freenet.pluginmanager.PluginNotFoundException;
import freenet.pluginmanager.FredPluginFCP;
import freenet.pluginmanager.PluginNotFoundException;
@@
-76,7
+75,7
@@
public class FcpInterface {
}
/** The logger. */
}
/** The logger. */
- private static final Logger logger =
Logging.getLogger(FcpInterface.class
);
+ private static final Logger logger =
getLogger(FcpInterface.class.getName()
);
/** Whether the FCP interface is currently active. */
private final AtomicBoolean active = new AtomicBoolean();
/** Whether the FCP interface is currently active. */
private final AtomicBoolean active = new AtomicBoolean();
@@
-130,13
+129,7
@@
public class FcpInterface {
return fullAccessRequired.get();
}
return fullAccessRequired.get();
}
- /**
- * Sets the action level for which full FCP access is required.
- *
- * @param fullAccessRequired
- * The action level for which full FCP access is required
- */
- public void setFullAccessRequired(FullAccessRequired fullAccessRequired) {
+ private void setFullAccessRequired(FullAccessRequired fullAccessRequired) {
this.fullAccessRequired.set(checkNotNull(fullAccessRequired, "fullAccessRequired must not be null"));
}
this.fullAccessRequired.set(checkNotNull(fullAccessRequired, "fullAccessRequired must not be null"));
}
@@
-238,13
+231,9
@@
public class FcpInterface {
setActive(false);
}
setActive(false);
}
- public class SetFullAccessRequired implements OptionWatcher<Integer> {
-
- @Override
- public void optionChanged(Option<Integer> option, Integer oldValue, Integer newValue) {
- setFullAccessRequired(FullAccessRequired.values()[newValue]);
- }
-
+ @Subscribe
+ public void fullAccessRequiredChanged(FullAccessRequiredChanged fullAccessRequiredChanged) {
+ setFullAccessRequired(fullAccessRequiredChanged.getFullAccessRequired());
}
}
}
}