2 * jFCPlib-high-level-client - GetRequestResult.java -
3 * Copyright © 2008 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 net.pterodactylus.fcp.highlevel;
22 import net.pterodactylus.fcp.Persistence;
23 import net.pterodactylus.fcp.PersistentGet;
24 import net.pterodactylus.fcp.Priority;
25 import net.pterodactylus.fcp.ReturnType;
26 import net.pterodactylus.fcp.Verbosity;
29 * A Get result result is generated by {@link HighLevelClient#getRequests()}.
31 * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
34 public class GetRequestResult extends RequestResult {
36 /** The PersistentGet FCP message. */
37 private final PersistentGet persistentGet;
40 * Creates a new Get request result.
42 * @param persistentGet
43 * The PersistentGet message wrapped by this result
45 public GetRequestResult(PersistentGet persistentGet) {
46 super(persistentGet.getIdentifier());
47 this.persistentGet = persistentGet;
51 * Returns the client token associated with the request.
53 * @return The client token
54 * @see net.pterodactylus.fcp.PersistentGet#getClientToken()
56 public String getClientToken() {
57 return persistentGet.getClientToken();
61 * Returns the filename of the request.
63 * @return The filename
64 * @see net.pterodactylus.fcp.PersistentGet#getFilename()
66 public String getFilename() {
67 return persistentGet.getFilename();
71 * Returns the maximum number of retries for the request.
73 * @return The maximum number of retries
74 * @see net.pterodactylus.fcp.PersistentGet#getMaxRetries()
76 public int getMaxRetries() {
77 return persistentGet.getMaxRetries();
81 * Returns the persistence level of the request
83 * @return The persistence level
84 * @see net.pterodactylus.fcp.PersistentGet#getPersistence()
86 public Persistence getPersistence() {
87 return persistentGet.getPersistence();
91 * Returns the priority of the request.
93 * @return The priority
94 * @see net.pterodactylus.fcp.PersistentGet#getPriority()
96 public Priority getPriority() {
97 return persistentGet.getPriority();
101 * Returns the return type of the request.
103 * @return The return type of the request
104 * @see net.pterodactylus.fcp.PersistentGet#getReturnType()
106 public ReturnType getReturnType() {
107 return persistentGet.getReturnType();
111 * Returns the temporary filename of the request.
113 * @return The temporary filename
114 * @see net.pterodactylus.fcp.PersistentGet#getTempFilename()
116 public String getTempFilename() {
117 return persistentGet.getTempFilename();
121 * Returns the URI of the request.
123 * @return The URI of the request
124 * @see net.pterodactylus.fcp.PersistentGet#getURI()
126 public String getURI() {
127 return persistentGet.getURI();
131 * Returns the verbosity of the request.
133 * @return The verbosity of the request
134 * @see net.pterodactylus.fcp.PersistentGet#getVerbosity()
136 public Verbosity getVerbosity() {
137 return persistentGet.getVerbosity();
141 * Returns whether this request is on the global queue.
143 * @return <code>true</code> if the request is on the global queue,
144 * <code>false</code> if it is on the client-local queue
145 * @see net.pterodactylus.fcp.PersistentGet#isGlobal()
147 public boolean isGlobal() {
148 return persistentGet.isGlobal();