2 * jSite - Persistence.java - Copyright © 2006–2012 David Roden
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 package de.todesbaum.util.freenet.fcp2;
22 * The possible persistence options. This specify whether (and for how long) the
23 * node remembers to execute a request and the results. Possible values are
24 * <code>connection</code>, <code>reboot</code>, and <code>forever</code>.
25 * <code>connection</code> means that a request is aborted as soon as the
26 * connection to the node is severed. <code>reboot</code> means that a request
27 * is remembered as long as the node is running but not after restarts.
28 * <code>forever</code> finally means that a request persists until it is
29 * explicitely deleted.
31 * @author David Roden <droden@gmail.com>
33 * @see de.todesbaum.util.freenet.fcp2.ModifyPersistentRequest
34 * @see de.todesbaum.util.freenet.fcp2.RemovePersistentRequest
36 public final class Persistence {
39 * Denotes that a request should be terminated if the connection to the node
42 public static final Persistence CONNECTION = new Persistence("connection");
44 /** Denotes that a request should be remembered until the node is restarted. */
45 public static final Persistence REBOOT = new Persistence("reboot");
48 * Denotes that a request should be remembered until it is explicitely
51 public static final Persistence FOREVER = new Persistence("forever");
53 /** The name of this persistence option. */
57 * Private constructor that creates a persistence option with the specified
61 * The name of the persistence option.
63 private Persistence(String name) {
68 * Returns the name of this persistence option.
70 * @return The name of this persistence option
72 public String getName() {
77 * Returns a textual representation of this persistence option. The result
78 * is identical to calling {@link #getName()}.
80 * @return The name of this persistence option
83 public String toString() {