Commit 35baeb5b authored by amir.yosef's avatar amir.yosef

Update INFO command processing

parent ed221821
package command;
import model.Command;
import server.ServerInfo;
import util.Response;
......@@ -23,14 +22,11 @@ public class InfoCommand implements CommandExecutable<byte[]> {
return Response.getResponse("unsupported args");
}
String command = args.getFirst();
if (command.equalsIgnoreCase(Command.REPLICATION.getValue())) {
Map<String, String> info = configuration.getInfo();
String response = info.entrySet()
.stream()
.map(data -> data.getKey() + ":" + data.getValue())
.collect(Collectors.joining());
return Response.getResponse(response);
}
return null;
Map<String, String> info = configuration.getInfo();
String response = info.entrySet()
.stream()
.map(data -> data.getKey() + ":" + data.getValue())
.collect(Collectors.joining());
return Response.getResponse(response);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment