Refactor WhoisReader.readCommand() method to take a now param

This obviates the need for the use of @AutoFactory.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=149570411
This commit is contained in:
mcilwain 2017-03-08 12:40:14 -08:00 committed by Ben McIlwain
parent 9eddbe2b6e
commit 815dae2749
8 changed files with 23 additions and 49 deletions

View file

@ -61,7 +61,7 @@ public class WhoisServer implements Runnable {
@Inject Clock clock;
@Inject Reader input;
@Inject Response response;
@Inject WhoisReaderFactory whoisReaderFactory;
@Inject WhoisReader whoisReader;
@Inject @Config("whoisDisclaimer") String disclaimer;
@Inject WhoisMetric.Builder metricBuilder;
@Inject WhoisMetrics whoisMetrics;
@ -72,7 +72,7 @@ public class WhoisServer implements Runnable {
String responseText;
DateTime now = clock.nowUtc();
try {
WhoisCommand command = whoisReaderFactory.create(now).readCommand(input);
WhoisCommand command = whoisReader.readCommand(input, now);
metricBuilder.setCommand(command);
WhoisResponseResults results =
command.executeQuery(now).getResponse(PREFER_UNICODE, disclaimer);