mirror of
https://github.com/google/nomulus
synced 2026-07-19 06:22:33 +00:00
Use Dagger to @Inject WhoisReader instances
This is a precursor to adding metrics to WHOIS queries (as I'd like to be able to @Inject the metrics builders). ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=149418018
This commit is contained in:
@@ -58,7 +58,7 @@ public class WhoisServer implements Runnable {
|
||||
@Inject Clock clock;
|
||||
@Inject Reader input;
|
||||
@Inject Response response;
|
||||
@Inject @Config("whoisCommandFactory") WhoisCommandFactory commandFactory;
|
||||
@Inject WhoisReaderFactory whoisReaderFactory;
|
||||
@Inject @Config("whoisDisclaimer") String disclaimer;
|
||||
@Inject WhoisServer() {}
|
||||
|
||||
@@ -68,8 +68,9 @@ public class WhoisServer implements Runnable {
|
||||
DateTime now = clock.nowUtc();
|
||||
try {
|
||||
responseText =
|
||||
new WhoisReader(input, commandFactory, now)
|
||||
.readCommand()
|
||||
whoisReaderFactory
|
||||
.create(now)
|
||||
.readCommand(input)
|
||||
.executeQuery(now)
|
||||
.getPlainTextOutput(PREFER_UNICODE, disclaimer);
|
||||
} catch (WhoisException e) {
|
||||
|
||||
Reference in New Issue
Block a user