version 0.5: show usk keys only, update usk on insert completion
[jSite.git] / src / de / todesbaum / util / freenet / fcp2 / Persistence.java
1 /*
2  * todesbaum-lib - 
3  * Copyright (C) 2006 David Roden
4  *
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.
9  *
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.
14  *
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.
18  */
19
20 package de.todesbaum.util.freenet.fcp2;
21
22 /**
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.
31  * 
32  * @author David Roden &lt;droden@gmail.com&gt;
33  * @version $Id$
34  * @see de.todesbaum.util.freenet.fcp2.ModifyPersistentRequest
35  * @see de.todesbaum.util.freenet.fcp2.RemovePersistentRequest
36  */
37 public final class Persistence {
38
39         /**
40          * Denotes that a request should be terminated if the connection to the node
41          * is severed.
42          */
43         public static final Persistence CONNECTION = new Persistence("connection");
44
45         /** Denotes that a request should be remembered until the node is restarted. */
46         public static final Persistence REBOOT = new Persistence("reboot");
47
48         /**
49          * Denotes that a request should be remembered until it is explicitely
50          * deleted.
51          */
52         public static final Persistence FOREVER = new Persistence("forever");
53
54         /** The name of this persistence option. */
55         private String name;
56
57         /**
58          * Private constructor that creates a persistence option with the specified
59          * name.
60          * 
61          * @param name
62          *            The name of the persistence option.
63          */
64         private Persistence(String name) {
65                 this.name = name;
66         }
67
68         /**
69          * Returns the name of this persistence option.
70          * 
71          * @return The name of this persistence option
72          */
73         public String getName() {
74                 return name;
75         }
76
77         /**
78          * Returns a textual representation of this persistence option. The result
79          * is identical to calling {@link #getName()}.
80          * 
81          * @return The name of this persistence option
82          */
83         public String toString() {
84                 return name;
85         }
86
87 }