Rename buildHistory() methods to buildHistoryEntry()

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165707934
This commit is contained in:
mcilwain 2017-08-18 08:25:52 -07:00 committed by Ben McIlwain
parent dedabfb076
commit fcb554947c
6 changed files with 16 additions and 14 deletions

View file

@ -156,7 +156,7 @@ public class DomainAllocateFlow implements TransactionalFlow {
loadAndValidateApplication(allocateCreate.getApplicationRoid(), now);
String repoId = createDomainRepoId(ObjectifyService.allocateId(), registry.getTldStr());
ImmutableSet.Builder<ImmutableObject> entitiesToSave = new ImmutableSet.Builder<>();
HistoryEntry historyEntry = buildHistory(repoId, period, now);
HistoryEntry historyEntry = buildHistoryEntry(repoId, period, now);
entitiesToSave.add(historyEntry);
ImmutableSet<? extends ImmutableObject> billsAndPolls = createBillingEventsAndPollMessages(
domainName, application, historyEntry, isSunrushAddGracePeriod, registry, now, years);
@ -229,7 +229,7 @@ public class DomainAllocateFlow implements TransactionalFlow {
return application;
}
private HistoryEntry buildHistory(String repoId, Period period, DateTime now) {
private HistoryEntry buildHistoryEntry(String repoId, Period period, DateTime now) {
return historyBuilder
.setType(HistoryEntry.Type.DOMAIN_ALLOCATE)
.setPeriod(period)

View file

@ -267,7 +267,8 @@ public final class DomainApplicationCreateFlow implements TransactionalFlow {
}})
.toList())
.build();
HistoryEntry historyEntry = buildHistory(newApplication.getRepoId(), command.getPeriod(), now);
HistoryEntry historyEntry =
buildHistoryEntry(newApplication.getRepoId(), command.getPeriod(), now);
ImmutableSet.Builder<ImmutableObject> entitiesToSave = new ImmutableSet.Builder<>();
entitiesToSave.add(
newApplication,
@ -364,7 +365,7 @@ public final class DomainApplicationCreateFlow implements TransactionalFlow {
}
}
private HistoryEntry buildHistory(String repoId, Period period, DateTime now) {
private HistoryEntry buildHistoryEntry(String repoId, Period period, DateTime now) {
return historyBuilder
.setType(HistoryEntry.Type.DOMAIN_APPLICATION_CREATE)
.setPeriod(period)

View file

@ -163,7 +163,7 @@ public class DomainApplicationUpdateFlow implements TransactionalFlow {
verifyNoDisallowedStatuses(existingApplication, UPDATE_DISALLOWED_STATUSES);
verifyOptionalAuthInfo(authInfo, existingApplication);
verifyUpdateAllowed(existingApplication, command, now);
HistoryEntry historyEntry = buildHistory(existingApplication, now);
HistoryEntry historyEntry = buildHistoryEntry(existingApplication, now);
DomainApplication newApplication = updateApplication(existingApplication, command, now);
validateNewApplication(newApplication);
ofy().save().<ImmutableObject>entities(newApplication, historyEntry);
@ -215,7 +215,7 @@ public class DomainApplicationUpdateFlow implements TransactionalFlow {
domainName, nullToEmpty(add.getNameserverFullyQualifiedHostNames()));
}
private HistoryEntry buildHistory(DomainApplication existingApplication, DateTime now) {
private HistoryEntry buildHistoryEntry(DomainApplication existingApplication, DateTime now) {
return historyBuilder
.setType(HistoryEntry.Type.DOMAIN_APPLICATION_UPDATE)
.setModificationTime(now)

View file

@ -258,7 +258,7 @@ public class DomainCreateFlow implements TransactionalFlow {
validateSecDnsExtension(eppInput.getSingleExtension(SecDnsCreateExtension.class));
String repoId = createDomainRepoId(ObjectifyService.allocateId(), registry.getTldStr());
DateTime registrationExpirationTime = leapSafeAddYears(now, years);
HistoryEntry historyEntry = buildHistory(repoId, period, now);
HistoryEntry historyEntry = buildHistoryEntry(repoId, period, now);
// Bill for the create.
BillingEvent.OneTime createBillingEvent =
createOneTimeBillingEvent(
@ -360,7 +360,7 @@ public class DomainCreateFlow implements TransactionalFlow {
}
}
private HistoryEntry buildHistory(String repoId, Period period, DateTime now) {
private HistoryEntry buildHistoryEntry(String repoId, Period period, DateTime now) {
return historyBuilder
.setType(HistoryEntry.Type.DOMAIN_CREATE)
.setPeriod(period)

View file

@ -138,7 +138,7 @@ public final class DomainRestoreRequestFlow implements TransactionalFlow {
FeeUpdateCommandExtension feeUpdate =
eppInput.getSingleExtension(FeeUpdateCommandExtension.class);
verifyRestoreAllowed(command, existingDomain, feeUpdate, feesAndCredits, now);
HistoryEntry historyEntry = buildHistory(existingDomain, now);
HistoryEntry historyEntry = buildHistoryEntry(existingDomain, now);
ImmutableSet.Builder<ImmutableObject> entitiesToSave = new ImmutableSet.Builder<>();
entitiesToSave.addAll(
createRestoreAndRenewBillingEvents(
@ -172,7 +172,7 @@ public final class DomainRestoreRequestFlow implements TransactionalFlow {
.build();
}
private HistoryEntry buildHistory(DomainResource existingDomain, DateTime now) {
private HistoryEntry buildHistoryEntry(DomainResource existingDomain, DateTime now) {
DomainTransactionRecord transactionRecord =
new DomainTransactionRecord.Builder()
.setTld(existingDomain.getTld())

View file

@ -141,7 +141,7 @@ public final class DomainTransferRequestFlow implements TransactionalFlow {
eppInput.getSingleExtension(FeeTransferCommandExtension.class);
FeesAndCredits feesAndCredits = pricingLogic.getTransferPrice(registry, targetId, now);
validateFeeChallenge(targetId, tld, now, feeTransfer, feesAndCredits);
HistoryEntry historyEntry = buildHistory(period, existingDomain, now);
HistoryEntry historyEntry = buildHistoryEntry(period, existingDomain, now);
DateTime automaticTransferTime = now.plus(registry.getAutomaticTransferLength());
// If the domain will be in the auto-renew grace period at the moment of transfer, the transfer
@ -251,13 +251,14 @@ public final class DomainTransferRequestFlow implements TransactionalFlow {
}
}
private HistoryEntry buildHistory(Period period, DomainResource existingResource, DateTime now) {
private HistoryEntry buildHistoryEntry(
Period period, DomainResource existingDomain, DateTime now) {
return historyBuilder
.setType(HistoryEntry.Type.DOMAIN_TRANSFER_REQUEST)
.setOtherClientId(existingResource.getCurrentSponsorClientId())
.setOtherClientId(existingDomain.getCurrentSponsorClientId())
.setPeriod(period)
.setModificationTime(now)
.setParent(Key.create(existingResource))
.setParent(Key.create(existingDomain))
.build();
}