Rename Command.Reply to Command.Response.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 8 Apr 2011 14:03:03 +0000 (16:03 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 8 Apr 2011 14:03:03 +0000 (16:03 +0200)
src/main/java/net/pterodactylus/sone/fcp/FcpInterface.java
src/main/java/net/pterodactylus/sone/fcp/GetLocalSonesCommand.java
src/main/java/net/pterodactylus/sone/fcp/GetPostFeedCommand.java
src/main/java/net/pterodactylus/sone/fcp/VersionCommand.java
src/main/java/net/pterodactylus/sone/freenet/fcp/Command.java

index 81928dd..3a64bbf 100644 (file)
@@ -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()) {
index 5d44bef..1054f76 100644 (file)
@@ -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()));
        }
 
 }
index 2dc59a1..38b240a 100644 (file)
@@ -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.<Post> emptyList()));
+                       return new Response(encodePosts(Collections.<Post> 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()))));
        }
 
 }
index 89c5c3c..ff57c40 100644 (file)
@@ -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());
        }
 
 }
index 07fb7a4..faa10db 100644 (file)
@@ -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 <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
         */
-       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;