+ /**
+ * Returns whether this page requires the user to be logged in.
+ *
+ * @return {@code true} if the user needs to be logged in to use this page,
+ * {@code false} otherwise
+ */
+ protected boolean requiresLogin() {
+ return true;
+ }
+
+ //
+ // PROTECTED METHODS
+ //
+
+ /**
+ * Creates a success reply.
+ *
+ * @return A reply signaling success
+ */
+ protected JsonObject createSuccessJsonObject() {
+ return new JsonObject().put("success", true);
+ }
+
+ /**
+ * Creates an error reply.
+ *
+ * @param error
+ * The error that has occured
+ * @return The JSON object, signalling failure and the error code
+ */
+ protected JsonObject createErrorJsonObject(String error) {
+ return new JsonObject().put("success", false).put("error", error);
+ }
+