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 TypeMethodDescriptionAdds aUser
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 the map from the OT&E registrarIds we will create to the new TLDs they will have access to.void
grantIapPermission
(Optional<String> groupEmailAddress, CloudTasksUtils cloudTasksUtils, IamClient iamClient) Grants the users permission to pass IAP.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 allowlist 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)
-
addUser
Adds aUser
with Web Console access.NOTE: can be called more than once, adding multiple users. Each user will have access to all OT&E Registrars.
- Parameters:
email
- the login email that will have web-console access to all the Registrars. Must be from "our Google Workspace 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 allowlist 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 the map from the OT&E registrarIds we will create to the new TLDs they will have access to. -
grantIapPermission
public void grantIapPermission(Optional<String> groupEmailAddress, CloudTasksUtils cloudTasksUtils, IamClient iamClient) Grants the users permission to pass IAP. -
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.
-