X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebInterface.java;h=946e6d6ca6f44776cf77eafa6b77cb332f851a1e;hp=ee309df9bd6b5d834168eec3a10ffbdc04d77939;hb=fdc047dd37e982776d55d827ca405868efe32c5a;hpb=de7568a82eb4150bf6d2b0553841b7b69f84c968 diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index ee309df..946e6d6 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -223,7 +223,7 @@ import com.google.inject.Inject; * * @author David ‘Bombe’ Roden */ -public class WebInterface { +public class WebInterface implements SessionProvider { /** The logger. */ private static final Logger logger = getLogger(WebInterface.class.getName()); @@ -469,6 +469,12 @@ public class WebInterface { return getCore().getLocalSone(soneId); } + @Override + @Nullable + public Sone getCurrentSone(@Nonnull ToadletContext toadletContext, boolean createSession) { + return createSession ? getCurrentSoneCreatingSession(toadletContext) : getCurrentSoneWithoutCreatingSession(toadletContext); + } + /** * Sets the currently logged in Sone. * @@ -477,7 +483,8 @@ public class WebInterface { * @param sone * The Sone to set as currently logged in */ - public void setCurrentSone(ToadletContext toadletContext, Sone sone) { + @Override + public void setCurrentSone(@Nonnull ToadletContext toadletContext, @Nullable Sone sone) { Session session = getOrCreateCurrentSession(toadletContext); if (sone == null) { session.removeAttribute("Sone.CurrentSone");