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

Update INFO command processing

parent ed221821
package command; package command;
import model.Command;
import server.ServerInfo; import server.ServerInfo;
import util.Response; import util.Response;
...@@ -23,14 +22,11 @@ public class InfoCommand implements CommandExecutable<byte[]> { ...@@ -23,14 +22,11 @@ public class InfoCommand implements CommandExecutable<byte[]> {
return Response.getResponse("unsupported args"); return Response.getResponse("unsupported args");
} }
String command = args.getFirst(); String command = args.getFirst();
if (command.equalsIgnoreCase(Command.REPLICATION.getValue())) { Map<String, String> info = configuration.getInfo();
Map<String, String> info = configuration.getInfo(); String response = info.entrySet()
String response = info.entrySet() .stream()
.stream() .map(data -> data.getKey() + ":" + data.getValue())
.map(data -> data.getKey() + ":" + data.getValue()) .collect(Collectors.joining());
.collect(Collectors.joining()); return Response.getResponse(response);
return Response.getResponse(response);
}
return null;
} }
} }
\ 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