Class OteAccountBuilder
This includes the TLDs (Registries), Registrars, and the RegistrarContacts that can access the web console.
This class is basically a "builder" for the parameters needed to generate the OT&E
entities. Nothing is created until you call buildAndPersist()
.
Usage example:
OteAccountBuilder.forRegistrarId("example")
.addContact("contact@email.com") // OPTIONAL
.setPassword("password") // OPTIONAL
.setCertificateHash(certificateHash) // OPTIONAL
.setIpAllowList(ImmutableList.of("1.1.1.1", "2.2.2.0/24")) // OPTIONAL
.buildAndPersist();
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.google.common.collect.ImmutableMap
<org.joda.money.CurrencyUnit, String> The default billing account map applied to all OT&E registrars. -
Method Summary
Modifier and TypeMethodDescriptionaddContact
(String email) Adds a RegistrarContact with Web Console access.Persists all the OT&E entities to the database.createRegistrarIdToTldMap
(String baseRegistrarId) Returns the registrar IDs of the OT&E, with the TLDs each has access to.static OteAccountBuilder
forRegistrarId
(String baseRegistrarId) Creates an OteAccountBuilder for the given base client ID.static String
getBaseRegistrarId
(String oteRegistrarId) Returns the base registrar ID that corresponds to a given OT&E registrar ID.Return map from the OT&E registrarIds we will create to the new TLDs they will have access to.setCertificate
(String asciiCert, org.joda.time.DateTime now) Sets the client certificate to all the OT&E Registrars.setIpAllowList
(Collection<String> ipAllowList) Sets the IP allow list to all the OT&E Registrars.setPassword
(String password) Sets the EPP login password for all the OT&E Registrars.setReplaceExisting
(boolean replaceExisting) Set whether to replace any conflicting existing entities.
-
Field Details
-
DEFAULT_BILLING_ACCOUNT_MAP
public static final com.google.common.collect.ImmutableMap<org.joda.money.CurrencyUnit,String> DEFAULT_BILLING_ACCOUNT_MAPThe default billing account map applied to all OT&E registrars.This contains dummy values for USD and JPY so that OT&E registrars can be granted access to all existing TLDs in sandbox. Note that OT&E is only on sandbox and thus these dummy values will never be used in production (the only environment where real invoicing takes place).
-
-
Method Details
-
forRegistrarId
Creates an OteAccountBuilder for the given base client ID.- Parameters:
baseRegistrarId
- the base registrar ID which will help name all the entities we create. Normally is the same as the "prod" ID designated for this registrar.
-
setReplaceExisting
Set whether to replace any conflicting existing entities.If true, any existing entity that conflicts with the entities we want to create will be replaced with the newly created data.
If false, encountering an existing entity that conflicts with one we want to create will throw an exception during
buildAndPersist()
.NOTE that if we fail, no entities are created (the creation is atomic).
Default is false (failing if entities exist)
-
addContact
Adds a RegistrarContact with Web Console access.NOTE: can be called more than once, adding multiple contacts. Each contact will have access to all OT&E Registrars.
- Parameters:
email
- the contact/login email that will have web-console access to all the Registrars. Must be from "our G Suite domain".
-
setPassword
Sets the EPP login password for all the OT&E Registrars. -
setCertificate
Sets the client certificate to all the OT&E Registrars. -
setIpAllowList
Sets the IP allow list to all the OT&E Registrars. -
buildAndPersist
Persists all the OT&E entities to the database.- Returns:
- map from the new clientIds created to the new TLDs they have access to. Can be used to go over all the newly created Registrars / Registries / RegistrarContacts if any post-creation work is needed.
-
getRegistrarIdToTldMap
Return map from the OT&E registrarIds we will create to the new TLDs they will have access to. -
createRegistrarIdToTldMap
public static com.google.common.collect.ImmutableMap<String,String> createRegistrarIdToTldMap(String baseRegistrarId) Returns the registrar IDs of the OT&E, with the TLDs each has access to. -
getBaseRegistrarId
Returns the base registrar ID that corresponds to a given OT&E registrar ID.
-