From 8ccdcfac71952461b658622aca4c6cce7af91fc1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 12 Oct 2010 21:15:42 +0200 Subject: [PATCH] Add web interface container stub. --- .../net/pterodactylus/sone/web/WebInterface.java | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 src/main/java/net/pterodactylus/sone/web/WebInterface.java diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java new file mode 100644 index 0000000..33e04d6 --- /dev/null +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -0,0 +1,72 @@ +/* + * FreenetSone - WebInterface.java - Copyright © 2010 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package net.pterodactylus.sone.web; + +import freenet.clients.http.SessionManager; +import freenet.l10n.BaseL10n; + +/** + * Bundles functionality that a web interface of a Freenet plugin needs, e.g. + * references to l10n helpers. + * + * @author David ‘Bombe’ Roden + */ +public class WebInterface { + + /** The node’s l10n helper. */ + private final BaseL10n l10n; + + /** The node’s session manager. */ + private final SessionManager sessionManager; + + /** + * Creates a new web interface. + * + * @param l10n + * The node’s l10n helper + * @param sessionManager + * The node’s session manager + */ + public WebInterface(BaseL10n l10n, SessionManager sessionManager) { + this.l10n = l10n; + this.sessionManager = sessionManager; + } + + // + // ACCESSORS + // + + /** + * Returns the l10n helper of the node. + * + * @return The node’s l10n helper + */ + public BaseL10n l10n() { + return l10n; + } + + /** + * Returns the session manager of the node. + * + * @return The node’s session manager + */ + public SessionManager sessionManager() { + return sessionManager; + } + +} -- 2.7.4