mirror of
https://github.com/google/nomulus.git
synced 2025-05-16 01:17:14 +02:00
Add extra flow logic hook for application create
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=137396935
This commit is contained in:
parent
bc0116f3a0
commit
60cb1b4dfb
5 changed files with 113 additions and 0 deletions
|
@ -44,6 +44,7 @@ import static google.registry.model.ofy.ObjectifyService.ofy;
|
|||
import static google.registry.model.registry.label.ReservedList.matchesAnchorTenantReservation;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.collect.FluentIterable;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
@ -233,6 +234,8 @@ public final class DomainApplicationCreateFlow extends LoggedInFlow implements T
|
|||
DomainApplication newApplication = applicationBuilder.build();
|
||||
HistoryEntry historyEntry = buildHistory(newApplication.getRepoId(), command.getPeriod());
|
||||
ImmutableSet.Builder<ImmutableObject> entitiesToSave = new ImmutableSet.Builder<>();
|
||||
handleExtraFlowLogic(
|
||||
registry.getTldStr(), command.getPeriod().getValue(), historyEntry, newApplication);
|
||||
entitiesToSave.add(
|
||||
newApplication,
|
||||
historyEntry,
|
||||
|
@ -333,6 +336,23 @@ public final class DomainApplicationCreateFlow extends LoggedInFlow implements T
|
|||
return responseExtensionsBuilder.build();
|
||||
}
|
||||
|
||||
private void handleExtraFlowLogic(
|
||||
String tld, int years, HistoryEntry historyEntry, DomainApplication newApplication)
|
||||
throws EppException {
|
||||
Optional<RegistryExtraFlowLogic> extraFlowLogic =
|
||||
RegistryExtraFlowLogicProxy.newInstanceForTld(tld);
|
||||
if (extraFlowLogic.isPresent()) {
|
||||
extraFlowLogic.get().performAdditionalApplicationCreateLogic(
|
||||
newApplication,
|
||||
clientId,
|
||||
now,
|
||||
years,
|
||||
eppInput,
|
||||
historyEntry);
|
||||
extraFlowLogic.get().commitAdditionalLogicChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/** Landrush applications are disallowed during sunrise. */
|
||||
static class LandrushApplicationDisallowedDuringSunriseException
|
||||
extends RequiredParameterMissingException {
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
package google.registry.flows.domain;
|
||||
|
||||
import google.registry.flows.EppException;
|
||||
import google.registry.model.domain.DomainApplication;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.fee.BaseFee;
|
||||
import google.registry.model.eppinput.EppInput;
|
||||
|
@ -36,6 +37,20 @@ public interface RegistryExtraFlowLogic {
|
|||
public Set<String> getExtensionFlags(
|
||||
DomainResource domainResource, String clientId, DateTime asOfDate);
|
||||
|
||||
/**
|
||||
* Performs additional tasks required for an application create command.
|
||||
*
|
||||
* <p>Any changes should not be persisted to Datastore until commitAdditionalLogicChanges is
|
||||
* called.
|
||||
*/
|
||||
public void performAdditionalApplicationCreateLogic(
|
||||
DomainApplication application,
|
||||
String clientId,
|
||||
DateTime asOfDate,
|
||||
int years,
|
||||
EppInput eppInput,
|
||||
HistoryEntry historyEntry) throws EppException;
|
||||
|
||||
/**
|
||||
* Computes the expected creation fee.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue