whitespace fixups
[jSite2.git] / src / net / pterodactylus / jsite / core / Request.java
index 6f05e7b..a61bb94 100644 (file)
@@ -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 <code>true</code> if the request is finished,
         *         <code>false</code> otherwise
@@ -214,7 +218,7 @@ public class Request extends AbstractBean {
 
        /**
         * Sets whether the request has finished.
-        * 
+        *
         * @param finished
         *            <code>true</code> if the request has finished,
         *            <code>false</code> 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 <code>true</code>.
-        * 
+        *
         * @return <code>true</code> if the request finished successfully,
         *         <code>false</code> otherwise
         */
@@ -238,7 +242,7 @@ public class Request extends AbstractBean {
 
        /**
         * Sets whether this request finished successfully.
-        * 
+        *
         * @param successful
         *            <code>true</code> if the request finished successfully,
         *            <code>false</code> 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 <code>true</code> if the data is already fetchable,
         *         <code>false</code> 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
         *            <code>true</code> if the data is already fetchable,
         *            <code>false</code> 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 <code>true</code> 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
         */