Make all but one field on RegistryConfig static

The next step will be to get rid of RegistryConfig descendants and RegistryConfigLoader entirely.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143812815
This commit is contained in:
mcilwain 2017-01-06 14:06:01 -08:00 committed by Ben McIlwain
parent 7fba7c1e4f
commit c5c74961bb
23 changed files with 224 additions and 324 deletions

View file

@ -15,14 +15,9 @@
package google.registry.config;
import static com.google.common.base.Preconditions.checkNotNull;
import static google.registry.config.ConfigUtils.makeUrl;
import static org.joda.time.Duration.standardDays;
import com.google.common.base.Optional;
import com.google.common.net.HostAndPort;
import java.net.URL;
import javax.annotation.concurrent.Immutable;
import org.joda.time.Duration;
/**
* Default production configuration for global constants that can't be injected.
@ -34,15 +29,9 @@ import org.joda.time.Duration;
@Immutable
public final class ProductionRegistryConfigExample extends RegistryConfig {
@SuppressWarnings("unused")
private final RegistryEnvironment environment;
private static final String RESERVED_TERMS_EXPORT_DISCLAIMER = ""
+ "# This list contains reserve terms for the TLD. Other terms may be reserved\n"
+ "# but not included in this list, including terms EXAMPLE REGISTRY chooses not\n"
+ "# to publish, and terms that ICANN commonly mandates to be reserved. This\n"
+ "# list is subject to change and the most up-to-date source is always to\n"
+ "# check availability directly with the Registry server.\n";
public ProductionRegistryConfigExample(RegistryEnvironment environment) {
this.environment = checkNotNull(environment);
}
@ -51,50 +40,4 @@ public final class ProductionRegistryConfigExample extends RegistryConfig {
public Optional<String> getECatcherAddress() {
throw new UnsupportedOperationException(); // n/a
}
@Override
public HostAndPort getServer() {
switch (environment) {
case LOCAL:
return HostAndPort.fromParts("localhost", 8080);
default:
return HostAndPort.fromParts(
String.format("tools-dot-%s.appspot.com", getProjectId()), 443);
}
}
@Override
public String getReservedTermsExportDisclaimer() {
return RESERVED_TERMS_EXPORT_DISCLAIMER;
}
@Override
public String getRegistrarDefaultWhoisServer() {
return "whois.nic.registry.example";
}
@Override
public URL getRegistrarDefaultReferralUrl() {
return makeUrl("https://www.registry.example");
}
@Override
public int getEppResourceIndexBucketCount() {
return 997;
}
@Override
public Duration getBaseOfyRetryDuration() {
return Duration.millis(100);
}
@Override
public Duration getContactAutomaticTransferLength() {
return standardDays(5);
}
@Override
public String getCheckApiServletRegistrarClientId() {
return "TheRegistrar";
}
}