package net.pterodactylus.jsite.core;
+import net.pterodactylus.jsite.util.IdGenerator;
+import net.pterodactylus.util.number.Hex;
+
/**
* Wraps a request that is executed by the Freenet node.
*
/** The ID of the request. */
private final String id;
+ /** The client token of the request. */
+ private String clientToken;
+
+ /**
+ * Creates a new request with a random ID.
+ */
+ public Request() {
+ this(Hex.toHex(IdGenerator.generateId()));
+ }
+
/**
* Creates a new request.
*
return id;
}
+ /**
+ * Returns the client token of the request.
+ *
+ * @return The request’s client token
+ */
+ public String getClientToken() {
+ return clientToken;
+ }
+
+ /**
+ * Sets the client token of the request
+ *
+ * @param clientToken
+ * The request’s new client token
+ */
+ public void setClientToken(String clientToken) {
+ this.clientToken = clientToken;
+ }
+
}