From 9d2917f19baf773fa8b4e140994bc4cf65c09217 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 7 Jun 2010 17:23:00 +0200 Subject: [PATCH] =?utf8?q?Add=20=E2=80=9CEarlyEncode=E2=80=9D=20option=20t?= =?utf8?q?o=20ClientPut*=20commands.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/de/todesbaum/util/freenet/fcp2/ClientPut.java | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/de/todesbaum/util/freenet/fcp2/ClientPut.java b/src/de/todesbaum/util/freenet/fcp2/ClientPut.java index dd0de6a..acaad49 100644 --- a/src/de/todesbaum/util/freenet/fcp2/ClientPut.java +++ b/src/de/todesbaum/util/freenet/fcp2/ClientPut.java @@ -49,6 +49,9 @@ public abstract class ClientPut extends Command { /** The maximum number of retries of this command. */ protected int maxRetries = 0; + /** Whether to generate the keys early. */ + protected boolean earlyEncode = false; + /** The persistence of this request. */ protected Persistence persistence = Persistence.CONNECTION; @@ -151,6 +154,29 @@ public abstract class ClientPut extends Command { } /** + * Returns whether the data should be encoded early to generate the final + * key as fast as possible. + * + * @return {@code true} if the key should be generated early, {@code false} + * otherwise + */ + public boolean isEarlyEncode() { + return earlyEncode; + } + + /** + * Sets whether the data should be encoded early to generate the final key + * as fast as possible. + * + * @param earlyEncode + * {@code true} if the key should be generated early, {@code + * false} otherwise + */ + public void setEarlyEncode(boolean earlyEncode) { + this.earlyEncode = earlyEncode; + } + + /** * Returns the priority class of this request. * @return The priority class of this request */ @@ -203,6 +229,7 @@ public abstract class ClientPut extends Command { writer.write("Verbosity=" + verbosity.getValue() + LINEFEED); if (maxRetries != 0) writer.write("MaxRetries=" + maxRetries + LINEFEED); + writer.write("EarlyEncode=" + earlyEncode); if (priorityClass != null) writer.write("PriorityClass=" + priorityClass.getValue() + LINEFEED); writer.write("GetCHKOnly=" + getCHKOnly + LINEFEED); -- 2.7.4