mirror of
https://github.com/google/nomulus.git
synced 2025-05-15 08:57:12 +02:00
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:
parent
9eddbe2b6e
commit
815dae2749
8 changed files with 23 additions and 49 deletions
|
@ -134,7 +134,7 @@ public final class WhoisHttpServer implements Runnable {
|
|||
@Inject Response response;
|
||||
@Inject @Config("whoisDisclaimer") String disclaimer;
|
||||
@Inject @Config("whoisHttpExpires") Duration expires;
|
||||
@Inject WhoisReaderFactory whoisReaderFactory;
|
||||
@Inject WhoisReader whoisReader;
|
||||
@Inject @RequestPath String requestPath;
|
||||
@Inject WhoisMetric.Builder metricBuilder;
|
||||
@Inject WhoisMetrics whoisMetrics;
|
||||
|
@ -149,8 +149,7 @@ public final class WhoisHttpServer implements Runnable {
|
|||
String commandText =
|
||||
decode(JOINER.join(SLASHER.split(path.substring(PATH.length())))) + "\r\n";
|
||||
DateTime now = clock.nowUtc();
|
||||
WhoisCommand command =
|
||||
whoisReaderFactory.create(now).readCommand(new StringReader(commandText));
|
||||
WhoisCommand command = whoisReader.readCommand(new StringReader(commandText), now);
|
||||
metricBuilder.setCommand(command);
|
||||
sendResponse(SC_OK, command.executeQuery(now));
|
||||
} catch (WhoisException e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue