Remove deprecated singular DNS writer field and update tooling

Note that even though the nomulus command line tool now supports multiple
DNS writers for all subcommands, this still won't work quite yet because
the DNS task queue format migration from [] is still in progress.
After next week's push that migration will be complete and we can remove
the final restriction against only having one DNS writer per TLD.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162490399
This commit is contained in:
mcilwain 2017-07-19 08:47:48 -07:00 committed by Ben McIlwain
parent 8ff1102223
commit d3e9ebad16
8 changed files with 101 additions and 123 deletions

View file

@ -15,6 +15,7 @@
package google.registry.dns;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.collect.Iterables.getOnlyElement;
import static google.registry.util.FormattingLogger.getLoggerForCallerClass;
import com.google.common.collect.ImmutableMap;
@ -40,7 +41,7 @@ public final class DnsWriterProxy {
// TODO(b/63385597): Delete this method after DNS writers migration is complete.
@Deprecated
public DnsWriter getForTld(String tld) {
return getByClassNameForTld(Registry.get(tld).getDnsWriter(), tld);
return getByClassNameForTld(getOnlyElement(Registry.get(tld).getDnsWriters()), tld);
}
/** Returns the instance of {@link DnsWriter} by class name. */