mirror of
https://github.com/google/nomulus
synced 2025-12-23 14:25:44 +00:00
Add extra flow logic hook for domain allocation
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=138679232
This commit is contained in:
@@ -37,6 +37,7 @@ import static google.registry.util.CollectionUtils.isNullOrEmpty;
|
||||
import static google.registry.util.DateTimeUtils.END_OF_TIME;
|
||||
import static google.registry.util.DateTimeUtils.leapSafeAddYears;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.net.InternetDomainName;
|
||||
@@ -175,6 +176,7 @@ public class DomainAllocateFlow implements TransactionalFlow {
|
||||
.setNameservers(command.getNameservers())
|
||||
.setContacts(command.getContacts())
|
||||
.build();
|
||||
handleExtraFlowLogic(registry.getTldStr(), years, historyEntry, newDomain, now);
|
||||
entitiesToSave.add(
|
||||
newDomain,
|
||||
buildApplicationHistory(application, now),
|
||||
@@ -360,6 +362,22 @@ public class DomainAllocateFlow implements TransactionalFlow {
|
||||
&& !matchesAnchorTenantReservation(domainName, authInfoToken);
|
||||
}
|
||||
|
||||
private void handleExtraFlowLogic(
|
||||
String tld, int years, HistoryEntry historyEntry, DomainResource newDomain, DateTime now)
|
||||
throws EppException {
|
||||
Optional<RegistryExtraFlowLogic> extraFlowLogic =
|
||||
RegistryExtraFlowLogicProxy.newInstanceForTld(tld);
|
||||
if (extraFlowLogic.isPresent()) {
|
||||
extraFlowLogic.get().performAdditionalDomainAllocateLogic(
|
||||
newDomain,
|
||||
clientId,
|
||||
now,
|
||||
years,
|
||||
eppInput,
|
||||
historyEntry);
|
||||
}
|
||||
}
|
||||
|
||||
private void enqueueTasks(AllocateCreateExtension allocateCreate, DomainResource newDomain) {
|
||||
if (newDomain.shouldPublishToDns()) {
|
||||
DnsQueue.create().addDomainRefreshTask(newDomain.getFullyQualifiedDomainName());
|
||||
|
||||
@@ -69,6 +69,15 @@ public interface RegistryExtraFlowLogic {
|
||||
EppInput eppInput,
|
||||
HistoryEntry historyEntry) throws EppException;
|
||||
|
||||
/** Performs additional tasks required for an allocate command. */
|
||||
public void performAdditionalDomainAllocateLogic(
|
||||
DomainResource domain,
|
||||
String clientId,
|
||||
DateTime asOfDate,
|
||||
int years,
|
||||
EppInput eppInput,
|
||||
HistoryEntry historyEntry) throws EppException;
|
||||
|
||||
/** Computes the expected creation fee. */
|
||||
public BaseFee getCreateFeeOrCredit(
|
||||
String domainName,
|
||||
|
||||
Reference in New Issue
Block a user