mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02:00
Add extensibility framework for allocation tokens
This uses an extensibility mechanism similar to that of WhoisCommandFactory and CustomLogicFactory, namely, that a fully qualified Java class is specified in the YAML file for each environment with the allocation token custom logic to be used. By default, this points to a no-op base class that does nothing. Users that wish to add their own allocation token custom logic can simply create a new class that extends AllocationTokenCustomLogic and then configure it in their .yaml config files. This also renames the existing *FlowCustomLogic *Flow instance variables from customLogic to flowCustomLogic, to avoid the potential confusion with the new AllocationTokenCustomLogic class that also now exists. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=183003112
This commit is contained in:
parent
e6a097a590
commit
9d532cb507
17 changed files with 320 additions and 61 deletions
|
@ -123,14 +123,14 @@ public final class DomainRenewFlow implements TransactionalFlow {
|
|||
@Inject @Superuser boolean isSuperuser;
|
||||
@Inject HistoryEntry.Builder historyBuilder;
|
||||
@Inject EppResponse.Builder responseBuilder;
|
||||
@Inject DomainRenewFlowCustomLogic customLogic;
|
||||
@Inject DomainRenewFlowCustomLogic flowCustomLogic;
|
||||
@Inject DomainPricingLogic pricingLogic;
|
||||
@Inject DomainRenewFlow() {}
|
||||
|
||||
@Override
|
||||
public final EppResponse run() throws EppException {
|
||||
extensionManager.register(FeeRenewCommandExtension.class, MetadataExtension.class);
|
||||
customLogic.beforeValidation();
|
||||
flowCustomLogic.beforeValidation();
|
||||
extensionManager.validate();
|
||||
validateClientIsLoggedIn(clientId);
|
||||
DateTime now = ofy().getTransactionTime();
|
||||
|
@ -147,7 +147,7 @@ public final class DomainRenewFlow implements TransactionalFlow {
|
|||
FeesAndCredits feesAndCredits =
|
||||
pricingLogic.getRenewPrice(Registry.get(existingDomain.getTld()), targetId, now, years);
|
||||
validateFeeChallenge(targetId, existingDomain.getTld(), now, feeRenew, feesAndCredits);
|
||||
customLogic.afterValidation(
|
||||
flowCustomLogic.afterValidation(
|
||||
AfterValidationParameters.newBuilder()
|
||||
.setExistingDomain(existingDomain)
|
||||
.setNow(now)
|
||||
|
@ -178,7 +178,7 @@ public final class DomainRenewFlow implements TransactionalFlow {
|
|||
.addGracePeriod(GracePeriod.forBillingEvent(GracePeriodStatus.RENEW, explicitRenewEvent))
|
||||
.build();
|
||||
EntityChanges entityChanges =
|
||||
customLogic.beforeSave(
|
||||
flowCustomLogic.beforeSave(
|
||||
BeforeSaveParameters.newBuilder()
|
||||
.setExistingDomain(existingDomain)
|
||||
.setNewDomain(newDomain)
|
||||
|
@ -198,7 +198,7 @@ public final class DomainRenewFlow implements TransactionalFlow {
|
|||
.build());
|
||||
persistEntityChanges(entityChanges);
|
||||
BeforeResponseReturnData responseData =
|
||||
customLogic.beforeResponse(
|
||||
flowCustomLogic.beforeResponse(
|
||||
BeforeResponseParameters.newBuilder()
|
||||
.setDomain(newDomain)
|
||||
.setResData(DomainRenewData.create(targetId, newExpirationTime))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue