From: David ‘Bombe’ Roden Date: Fri, 8 Apr 2011 14:03:03 +0000 (+0200) Subject: Rename Command.Reply to Command.Response. X-Git-Tag: 0.6.5^2~39^2~35 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=6a426e5c3a82f3e63a8763d2a5ad57f311bc6065;p=Sone.git Rename Command.Reply to Command.Response. --- diff --git a/src/main/java/net/pterodactylus/sone/fcp/FcpInterface.java b/src/main/java/net/pterodactylus/sone/fcp/FcpInterface.java index 81928dd..3a64bbf 100644 --- a/src/main/java/net/pterodactylus/sone/fcp/FcpInterface.java +++ b/src/main/java/net/pterodactylus/sone/fcp/FcpInterface.java @@ -25,7 +25,7 @@ import net.pterodactylus.sone.core.Core; import net.pterodactylus.sone.freenet.fcp.Command; import net.pterodactylus.sone.freenet.fcp.FcpException; import net.pterodactylus.sone.freenet.fcp.Command.AccessType; -import net.pterodactylus.sone.freenet.fcp.Command.Reply; +import net.pterodactylus.sone.freenet.fcp.Command.Response; import freenet.pluginmanager.FredPluginFCP; import freenet.pluginmanager.PluginNotFoundException; import freenet.pluginmanager.PluginReplySender; @@ -81,7 +81,7 @@ public class FcpInterface { return; } try { - Reply reply = command.execute(parameters, data, AccessType.values()[accessType]); + Response reply = command.execute(parameters, data, AccessType.values()[accessType]); SimpleFieldSet replyParameters = reply.getReplyParameters(); replyParameters.putOverwrite("Identifier", identifier); if (reply.hasData()) { diff --git a/src/main/java/net/pterodactylus/sone/fcp/GetLocalSonesCommand.java b/src/main/java/net/pterodactylus/sone/fcp/GetLocalSonesCommand.java index 5d44bef..1054f76 100644 --- a/src/main/java/net/pterodactylus/sone/fcp/GetLocalSonesCommand.java +++ b/src/main/java/net/pterodactylus/sone/fcp/GetLocalSonesCommand.java @@ -44,8 +44,8 @@ public class GetLocalSonesCommand extends AbstractSoneCommand { * {@inheritDoc} */ @Override - public Reply execute(SimpleFieldSet parameters, Bucket data, AccessType accessType) throws FcpException { - return new Reply(encodeSones(getCore().getLocalSones())); + public Response execute(SimpleFieldSet parameters, Bucket data, AccessType accessType) throws FcpException { + return new Response(encodeSones(getCore().getLocalSones())); } } diff --git a/src/main/java/net/pterodactylus/sone/fcp/GetPostFeedCommand.java b/src/main/java/net/pterodactylus/sone/fcp/GetPostFeedCommand.java index 2dc59a1..38b240a 100644 --- a/src/main/java/net/pterodactylus/sone/fcp/GetPostFeedCommand.java +++ b/src/main/java/net/pterodactylus/sone/fcp/GetPostFeedCommand.java @@ -53,7 +53,7 @@ public class GetPostFeedCommand extends AbstractSoneCommand { * {@inheritDoc} */ @Override - public Reply execute(SimpleFieldSet parameters, Bucket data, AccessType accessType) throws FcpException { + public Response execute(SimpleFieldSet parameters, Bucket data, AccessType accessType) throws FcpException { Sone sone = getSone(parameters, "Sone"); int startPost = getInt(parameters, "StartPost", 0); int maxPosts = getInt(parameters, "MaxPosts", -1); @@ -73,10 +73,10 @@ public class GetPostFeedCommand extends AbstractSoneCommand { Collections.sort(sortedPosts, Post.TIME_COMPARATOR); if (sortedPosts.size() < startPost) { - return new Reply(encodePosts(Collections. emptyList())); + return new Response(encodePosts(Collections. emptyList())); } - return new Reply(encodePosts(sortedPosts.subList(startPost, (maxPosts == -1) ? sortedPosts.size() : Math.min(startPost + maxPosts, sortedPosts.size())))); + return new Response(encodePosts(sortedPosts.subList(startPost, (maxPosts == -1) ? sortedPosts.size() : Math.min(startPost + maxPosts, sortedPosts.size())))); } } diff --git a/src/main/java/net/pterodactylus/sone/fcp/VersionCommand.java b/src/main/java/net/pterodactylus/sone/fcp/VersionCommand.java index 89c5c3c..ff57c40 100644 --- a/src/main/java/net/pterodactylus/sone/fcp/VersionCommand.java +++ b/src/main/java/net/pterodactylus/sone/fcp/VersionCommand.java @@ -34,8 +34,8 @@ public class VersionCommand implements Command { * {@inheritDoc} */ @Override - public Reply execute(SimpleFieldSet parameters, Bucket data, AccessType accessType) { - return new Reply(new SimpleFieldSetBuilder().put("Version", SonePlugin.VERSION.toString()).put("ProtocolVersion", 1).get()); + public Response execute(SimpleFieldSet parameters, Bucket data, AccessType accessType) { + return new Response(new SimpleFieldSetBuilder().put("Version", SonePlugin.VERSION.toString()).put("ProtocolVersion", 1).get()); } } diff --git a/src/main/java/net/pterodactylus/sone/freenet/fcp/Command.java b/src/main/java/net/pterodactylus/sone/freenet/fcp/Command.java index 07fb7a4..faa10db 100644 --- a/src/main/java/net/pterodactylus/sone/freenet/fcp/Command.java +++ b/src/main/java/net/pterodactylus/sone/freenet/fcp/Command.java @@ -42,7 +42,7 @@ public interface Command { * @throws FcpException * if an error processing the parameters occurs */ - public Reply execute(SimpleFieldSet parameters, Bucket data, AccessType accessType) throws FcpException; + public Response execute(SimpleFieldSet parameters, Bucket data, AccessType accessType) throws FcpException; /** * The access type of the request. @@ -67,7 +67,7 @@ public interface Command { * * @author David ‘Bombe’ Roden */ - public static class Reply { + public static class Response { /** The reply parameters. */ private final SimpleFieldSet replyParameters; @@ -84,7 +84,7 @@ public interface Command { * @param replyParameters * The reply parameters */ - public Reply(SimpleFieldSet replyParameters) { + public Response(SimpleFieldSet replyParameters) { this(replyParameters, null, null); } @@ -96,7 +96,7 @@ public interface Command { * @param data * The data of the reply (may be {@code null}) */ - public Reply(SimpleFieldSet replyParameters, byte[] data) { + public Response(SimpleFieldSet replyParameters, byte[] data) { this(replyParameters, data, null); } @@ -108,7 +108,7 @@ public interface Command { * @param bucket * The bucket of the reply (may be {@code null}) */ - public Reply(SimpleFieldSet replyParameters, Bucket bucket) { + public Response(SimpleFieldSet replyParameters, Bucket bucket) { this(replyParameters, null, bucket); } @@ -122,7 +122,7 @@ public interface Command { * @param bucket * The bucket of the reply (may be {@code null}) */ - private Reply(SimpleFieldSet replyParameters, byte[] data, Bucket bucket) { + private Response(SimpleFieldSet replyParameters, byte[] data, Bucket bucket) { this.replyParameters = replyParameters; this.data = data; this.bucket = bucket;