mirror of
https://github.com/google/nomulus
synced 2026-01-05 04:56:03 +00:00
Remove the ofy().load() inside of HostResource.cloneProjectedAtTime
In fact, completely eviscerate cloneProjectedAtTime (to be removed in a followup CL) in favor of doing the projection of transfers and the loading of values from the superordinate domain at call sites. This is one of the issues that blocked the memcache audit work, since the load inside of cloneProjectedAtTime could not be controlled by the caller. Note: fixed a minor bug where a subordinate host created after its superordinate domain was last transferred should have lastTransferTime==null but was previously reporting the domain's lastTransferTime. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=149769125
This commit is contained in:
@@ -18,7 +18,7 @@ import static google.registry.flows.FlowUtils.validateClientIsLoggedIn;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyResourceDoesNotExist;
|
||||
import static google.registry.flows.host.HostFlowUtils.lookupSuperordinateDomain;
|
||||
import static google.registry.flows.host.HostFlowUtils.validateHostName;
|
||||
import static google.registry.flows.host.HostFlowUtils.verifyDomainIsSameRegistrar;
|
||||
import static google.registry.flows.host.HostFlowUtils.verifySuperordinateDomainOwnership;
|
||||
import static google.registry.model.EppResourceUtils.createRepoId;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import static google.registry.util.CollectionUtils.isNullOrEmpty;
|
||||
@@ -98,7 +98,7 @@ public final class HostCreateFlow implements TransactionalFlow {
|
||||
// we can detect error conditions earlier.
|
||||
Optional<DomainResource> superordinateDomain =
|
||||
lookupSuperordinateDomain(validateHostName(targetId), now);
|
||||
verifyDomainIsSameRegistrar(superordinateDomain.orNull(), clientId);
|
||||
verifySuperordinateDomainOwnership(clientId, superordinateDomain.orNull());
|
||||
boolean willBeSubordinate = superordinateDomain.isPresent();
|
||||
boolean hasIpAddresses = !isNullOrEmpty(command.getInetAddresses());
|
||||
if (willBeSubordinate != hasIpAddresses) {
|
||||
@@ -109,7 +109,7 @@ public final class HostCreateFlow implements TransactionalFlow {
|
||||
}
|
||||
HostResource newHost = new Builder()
|
||||
.setCreationClientId(clientId)
|
||||
.setCurrentSponsorClientId(clientId)
|
||||
.setPersistedCurrentSponsorClientId(clientId)
|
||||
.setFullyQualifiedHostName(targetId)
|
||||
.setInetAddresses(command.getInetAddresses())
|
||||
.setRepoId(createRepoId(ObjectifyService.allocateId(), roidSuffix))
|
||||
|
||||
Reference in New Issue
Block a user