X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Fjsite%2Fcore%2FRequest.java;h=a61bb94ef0a11f571890dcaac97e67c7e1d31d99;hb=a75c596cfcbb46de853452efc23e83bf239212f1;hp=6f05e7b75f3df1ec3f49227ce145df4262080cd2;hpb=b926296901ce9c088cf3a376a3bc809306a5a556;p=jSite2.git diff --git a/src/net/pterodactylus/jsite/core/Request.java b/src/net/pterodactylus/jsite/core/Request.java index 6f05e7b..a61bb94 100644 --- a/src/net/pterodactylus/jsite/core/Request.java +++ b/src/net/pterodactylus/jsite/core/Request.java @@ -23,17 +23,15 @@ import net.pterodactylus.util.beans.AbstractBean; /** * A request is an ongoing download or upload reported by the freenet node. - * + * * @author David ‘Bombe’ Roden <bombe@freenetproject.org> - * @version $Id$ */ public class Request extends AbstractBean { /** * The type of a request. - * + * * @author David ‘Bombe’ Roden <bombe@freenetproject.org> - * @version $Id$ */ public enum Type { @@ -66,6 +64,9 @@ public class Request extends AbstractBean { /** Name of the “fetchable” property. */ public static final String PROPERTY_FETCHABLE = "fetchable"; + /** Name of the “URI” property. */ + public static final String PROPERTY_URI = "uri"; + /** Name of the “total blocks” property. */ public static final String PROPERTY_TOTAL_BLOCKS = "totalBlocks"; @@ -105,6 +106,9 @@ public class Request extends AbstractBean { /** Whether the data is already fetchable (in case of put requests). */ private boolean fetchable; + /** The generated URI. */ + private String uri; + /** The total number of blocks. */ private int totalBlocks; @@ -125,7 +129,7 @@ public class Request extends AbstractBean { /** * Creates a new request with the given identifier. - * + * * @param node * The node the request belongs to * @param identifier @@ -142,7 +146,7 @@ public class Request extends AbstractBean { /** * Returns the node the request belongs to. - * + * * @return The node the request belongs to */ public Node getNode() { @@ -151,7 +155,7 @@ public class Request extends AbstractBean { /** * Returns the identifier of the request. It is unique per node. - * + * * @return The identifier of the request */ public String getIdentifier() { @@ -160,7 +164,7 @@ public class Request extends AbstractBean { /** * Returns the type of the request. - * + * * @return The type of the request */ @@ -170,7 +174,7 @@ public class Request extends AbstractBean { /** * Sets the type of the request. - * + * * @param type * The type of the request */ @@ -182,7 +186,7 @@ public class Request extends AbstractBean { /** * Returns the client token of the request. - * + * * @return The client token of the request */ public String getClientToken() { @@ -191,7 +195,7 @@ public class Request extends AbstractBean { /** * Sets the client token of the request. - * + * * @param clientToken * The client token of the request */ @@ -203,7 +207,7 @@ public class Request extends AbstractBean { /** * Returns whether the request has finished. - * + * * @see #isSuccessful() * @return true if the request is finished, * false otherwise @@ -214,7 +218,7 @@ public class Request extends AbstractBean { /** * Sets whether the request has finished. - * + * * @param finished * true if the request has finished, * false otherwise @@ -228,7 +232,7 @@ public class Request extends AbstractBean { /** * Returns whether the request finished successfully. This value will only * have meaning if {@link #isFinished()} returns true. - * + * * @return true if the request finished successfully, * false otherwise */ @@ -238,7 +242,7 @@ public class Request extends AbstractBean { /** * Sets whether this request finished successfully. - * + * * @param successful * true if the request finished successfully, * false otherwise @@ -252,7 +256,7 @@ public class Request extends AbstractBean { /** * Returns whether the data inserted by this {@link Type#put} or * {@link Type#putDir} request is already fetchable by other clients. - * + * * @return true if the data is already fetchable, * false otherwise */ @@ -263,7 +267,7 @@ public class Request extends AbstractBean { /** * Sets whether the data inserted by this {@link Type#put} or * {@link Type#putDir} request is already fetchable by other clients. - * + * * @param fetchable * true if the data is already fetchable, * false otherwise @@ -275,10 +279,29 @@ public class Request extends AbstractBean { } /** + * Returns the URI generated by this request. + * + * @return The generated URI + */ + public String getURI() { + return uri; + } + + /** + * Sets the URI generated by this request. + * + * @param uri + * The generated URI + */ + void setURI(String uri) { + this.uri = uri; + } + + /** * Returns the total number of blocks of a request. Until * {@link #isTotalFinalized()} returns true this value may * change! - * + * * @return The total number of blocks of a request */ public int getTotalBlocks() { @@ -287,7 +310,7 @@ public class Request extends AbstractBean { /** * Sets the total number of blocks of a request. - * + * * @param totalBlocks * The total number of blocks */