3 * Copyright (C) 2006 David Roden
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 package de.todesbaum.util.freenet.fcp2;
23 * The possible persistence options. This specify whether (and for how long) the
24 * node remembers to execute a request and the results. Possible values are
25 * <code>connection</code>, <code>reboot</code>, and <code>forever</code>.
26 * <code>connection</code> means that a request is aborted as soon as the
27 * connection to the node is severed. <code>reboot</code> means that a request
28 * is remembered as long as the node is running but not after restarts.
29 * <code>forever</code> finally means that a request persists until it is
30 * explicitely deleted.
32 * @author David Roden <droden@gmail.com>
34 * @see de.todesbaum.util.freenet.fcp2.ModifyPersistentRequest
35 * @see de.todesbaum.util.freenet.fcp2.RemovePersistentRequest
37 public final class Persistence {
40 * Denotes that a request should be terminated if the connection to the node
43 public static final Persistence CONNECTION = new Persistence("connection");
45 /** Denotes that a request should be remembered until the node is restarted. */
46 public static final Persistence REBOOT = new Persistence("reboot");
49 * Denotes that a request should be remembered until it is explicitely
52 public static final Persistence FOREVER = new Persistence("forever");
54 /** The name of this persistence option. */
58 * Private constructor that creates a persistence option with the specified
62 * The name of the persistence option.
64 private Persistence(String name) {
69 * Returns the name of this persistence option.
71 * @return The name of this persistence option
73 public String getName() {
78 * Returns a textual representation of this persistence option. The result
79 * is identical to calling {@link #getName()}.
81 * @return The name of this persistence option
83 public String toString() {