Move ROID suffix handling from RegistryConfig to ConfigModule

This is the first in a decently long series of commits to delete RegistryConfig
entirely and centralize all configuration in ConfigModule using Dagger. Once
this is done, then the text-based YAML configuration work can begin in earnest.

Note that the configuration settings from TestRegistryConfig will be moving
into ConfigModule.LocalTestConfig. This way they can be referred to in a static
context from test and test utility helpers, rather than having to be injected
everywhere, which we don't typically bother with for tests.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143473089
This commit is contained in:
mcilwain 2017-01-03 12:30:12 -08:00 committed by Ben McIlwain
parent ab3f352782
commit 0b112f17a7
11 changed files with 43 additions and 46 deletions

View file

@ -113,6 +113,19 @@ public final class ConfigModule {
return "Nomulus";
}
/**
* Returns the roid suffix to be used for the roids of all contacts and hosts. E.g. a value of
* "ROID" would end up creating roids that look like "ABC123-ROID".
*
* @see <a href="http://www.iana.org/assignments/epp-repository-ids/epp-repository-ids.xhtml">
* Extensible Provisioning Protocol (EPP) Repository Identifiers</a>
*/
@Provides
@Config("contactAndHostRoidSuffix")
public static String provideContactAndHostRoidSuffix(RegistryEnvironment environment) {
return LocalTestConfig.CONTACT_AND_HOST_ROID_SUFFIX;
}
/**
* The e-mail address for questions about integrating with the registry. Used in the
* "contact-us" section of the registrar console.
@ -1007,4 +1020,10 @@ public final class ConfigModule {
.build())
.build();
}
/** Config values used for local and unit test environments. */
public static class LocalTestConfig {
public static final String CONTACT_AND_HOST_ROID_SUFFIX = "ROID";
}
}