mirror of
https://github.com/google/nomulus.git
synced 2025-07-01 08:43:34 +02:00
Merge DomainResource into DomainBase
This eliminates the use of Objectify polymorphism for EPP resources entirely (yay!), which makes the Registry 3.0 database migration easier. It is unfortunate that the naming parallelism of EppResources is lost between ContactResource, HostResource, and DomainResource, but the actual type as far as Datastore was concerned was DomainBase all along, and it would be a much more substantial data migration to allow us to continue using the class name DomainResource now that we're no longer using Objectify polymorphism. This simply isn't worth it. This also removes the polymorphic Datastore indexes (which will no longer function as of this change). The non-polymorphic replacement indexes were added in [] ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=230930546
This commit is contained in:
parent
97c2049669
commit
e2528875b2
166 changed files with 1525 additions and 1666 deletions
|
@ -44,7 +44,7 @@ import dagger.Module;
|
|||
import dagger.Provides;
|
||||
import google.registry.flows.domain.DomainFlowUtils.BadCommandForRegistryPhaseException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.InvalidIdnDomainLabelException;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.index.ForeignKeyIndex;
|
||||
import google.registry.model.registry.Registry;
|
||||
import google.registry.model.registry.label.ReservationType;
|
||||
|
@ -157,7 +157,7 @@ public class CheckApiAction implements Runnable {
|
|||
}
|
||||
|
||||
private boolean checkExists(String domainString, DateTime now) {
|
||||
return !ForeignKeyIndex.loadCached(DomainResource.class, ImmutableList.of(domainString), now)
|
||||
return !ForeignKeyIndex.loadCached(DomainBase.class, ImmutableList.of(domainString), now)
|
||||
.isEmpty();
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ public final class EppController {
|
|||
e.getResult(), Trid.create(null, serverTridProvider.createServerTrid()));
|
||||
}
|
||||
if (!eppInput.getTargetIds().isEmpty()) {
|
||||
if (eppInput.isDomainResourceType()) {
|
||||
if (eppInput.isDomainType()) {
|
||||
eppMetricBuilder.setTlds(extractTlds(eppInput.getTargetIds()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,12 +70,8 @@ public class FlowReporter {
|
|||
.put("flowClassName", flowClass.getSimpleName())
|
||||
.put("targetId", singleTargetId)
|
||||
.put("targetIds", targetIds)
|
||||
.put(
|
||||
"tld",
|
||||
eppInput.isDomainResourceType() ? extractTld(singleTargetId).orElse("") : "")
|
||||
.put(
|
||||
"tlds",
|
||||
eppInput.isDomainResourceType() ? extractTlds(targetIds).asList() : EMPTY_LIST)
|
||||
.put("tld", eppInput.isDomainType() ? extractTld(singleTargetId).orElse("") : "")
|
||||
.put("tlds", eppInput.isDomainType() ? extractTlds(targetIds).asList() : EMPTY_LIST)
|
||||
.put("icannActivityReportField", extractActivityReportField(flowClass))
|
||||
.build()));
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ import google.registry.flows.FlowMetadata;
|
|||
import google.registry.flows.SessionMetadata;
|
||||
import google.registry.flows.domain.DomainCreateFlow;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.eppinput.EppInput;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseData;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseExtension;
|
||||
|
@ -125,10 +125,10 @@ public class DomainCreateFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
public abstract static class BeforeSaveParameters extends ImmutableObject {
|
||||
|
||||
/**
|
||||
* The new {@link DomainResource} entity that is going to be persisted at the end of the
|
||||
* The new {@link DomainBase} entity that is going to be persisted at the end of the
|
||||
* transaction.
|
||||
*/
|
||||
public abstract DomainResource newDomain();
|
||||
public abstract DomainBase newDomain();
|
||||
|
||||
/**
|
||||
* The new {@link HistoryEntry} entity for the domain's creation that is going to be persisted
|
||||
|
@ -162,7 +162,7 @@ public class DomainCreateFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
@AutoValue.Builder
|
||||
public abstract static class Builder {
|
||||
|
||||
public abstract Builder setNewDomain(DomainResource newDomain);
|
||||
public abstract Builder setNewDomain(DomainBase newDomain);
|
||||
|
||||
public abstract Builder setHistoryEntry(HistoryEntry historyEntry);
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import google.registry.flows.FlowMetadata;
|
|||
import google.registry.flows.SessionMetadata;
|
||||
import google.registry.flows.domain.DomainDeleteFlow;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.eppinput.EppInput;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseExtension;
|
||||
import google.registry.model.eppoutput.Result;
|
||||
|
@ -83,7 +83,7 @@ public class DomainDeleteFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
@AutoValue
|
||||
public abstract static class AfterValidationParameters extends ImmutableObject {
|
||||
|
||||
public abstract DomainResource existingDomain();
|
||||
public abstract DomainBase existingDomain();
|
||||
|
||||
public static Builder newBuilder() {
|
||||
return new AutoValue_DomainDeleteFlowCustomLogic_AfterValidationParameters.Builder();
|
||||
|
@ -93,7 +93,7 @@ public class DomainDeleteFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
@AutoValue.Builder
|
||||
public abstract static class Builder {
|
||||
|
||||
public abstract Builder setExistingDomain(DomainResource existingDomain);
|
||||
public abstract Builder setExistingDomain(DomainBase existingDomain);
|
||||
|
||||
public abstract AfterValidationParameters build();
|
||||
}
|
||||
|
@ -109,9 +109,9 @@ public class DomainDeleteFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
@AutoValue
|
||||
public abstract static class BeforeSaveParameters extends ImmutableObject {
|
||||
|
||||
public abstract DomainResource existingDomain();
|
||||
public abstract DomainBase existingDomain();
|
||||
|
||||
public abstract DomainResource newDomain();
|
||||
public abstract DomainBase newDomain();
|
||||
|
||||
public abstract HistoryEntry historyEntry();
|
||||
|
||||
|
@ -125,9 +125,9 @@ public class DomainDeleteFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
@AutoValue.Builder
|
||||
public abstract static class Builder {
|
||||
|
||||
public abstract Builder setExistingDomain(DomainResource existingDomain);
|
||||
public abstract Builder setExistingDomain(DomainBase existingDomain);
|
||||
|
||||
public abstract Builder setNewDomain(DomainResource newDomain);
|
||||
public abstract Builder setNewDomain(DomainBase newDomain);
|
||||
|
||||
public abstract Builder setHistoryEntry(HistoryEntry historyEntry);
|
||||
|
||||
|
|
|
@ -21,8 +21,8 @@ import google.registry.flows.FlowMetadata;
|
|||
import google.registry.flows.SessionMetadata;
|
||||
import google.registry.flows.domain.DomainInfoFlow;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.DomainInfoData;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.eppinput.EppInput;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseExtension;
|
||||
|
||||
|
@ -53,7 +53,7 @@ public class DomainInfoFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
/**
|
||||
* A hook that runs before the response is returned.
|
||||
*
|
||||
* <p>This takes the {@link DomainResource} and {@link ResponseExtension}s as input and returns
|
||||
* <p>This takes the {@link DomainBase} and {@link ResponseExtension}s as input and returns
|
||||
* them, potentially with modifications.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
|
@ -69,7 +69,7 @@ public class DomainInfoFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
@AutoValue
|
||||
public abstract static class AfterValidationParameters extends ImmutableObject {
|
||||
|
||||
public abstract DomainResource domain();
|
||||
public abstract DomainBase domain();
|
||||
|
||||
public static Builder newBuilder() {
|
||||
return new AutoValue_DomainInfoFlowCustomLogic_AfterValidationParameters.Builder();
|
||||
|
@ -79,7 +79,7 @@ public class DomainInfoFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
@AutoValue.Builder
|
||||
public abstract static class Builder {
|
||||
|
||||
public abstract Builder setDomain(DomainResource domain);
|
||||
public abstract Builder setDomain(DomainBase domain);
|
||||
|
||||
public abstract AfterValidationParameters build();
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ public class DomainInfoFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
@AutoValue
|
||||
public abstract static class BeforeResponseParameters extends ImmutableObject {
|
||||
|
||||
public abstract DomainResource domain();
|
||||
public abstract DomainBase domain();
|
||||
|
||||
public abstract DomainInfoData resData();
|
||||
|
||||
|
@ -103,7 +103,7 @@ public class DomainInfoFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
@AutoValue.Builder
|
||||
public abstract static class Builder {
|
||||
|
||||
public abstract Builder setDomain(DomainResource domain);
|
||||
public abstract Builder setDomain(DomainBase domain);
|
||||
|
||||
public abstract Builder setResData(DomainInfoData resData);
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import google.registry.flows.FlowMetadata;
|
|||
import google.registry.flows.SessionMetadata;
|
||||
import google.registry.flows.domain.DomainRenewFlow;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.eppinput.EppInput;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseData;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseExtension;
|
||||
|
@ -68,7 +68,7 @@ public class DomainRenewFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
/**
|
||||
* A hook that runs before the response is returned.
|
||||
*
|
||||
* <p>This takes the {@link DomainResource} and {@link ResponseExtension}s as input and returns
|
||||
* <p>This takes the {@link DomainBase} and {@link ResponseExtension}s as input and returns
|
||||
* them, potentially with modifications.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
|
@ -84,7 +84,7 @@ public class DomainRenewFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
@AutoValue
|
||||
public abstract static class AfterValidationParameters extends ImmutableObject {
|
||||
|
||||
public abstract DomainResource existingDomain();
|
||||
public abstract DomainBase existingDomain();
|
||||
|
||||
public abstract int years();
|
||||
|
||||
|
@ -98,7 +98,7 @@ public class DomainRenewFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
@AutoValue.Builder
|
||||
public abstract static class Builder {
|
||||
|
||||
public abstract Builder setExistingDomain(DomainResource existingDomain);
|
||||
public abstract Builder setExistingDomain(DomainBase existingDomain);
|
||||
|
||||
public abstract Builder setYears(int years);
|
||||
|
||||
|
@ -118,9 +118,9 @@ public class DomainRenewFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
@AutoValue
|
||||
public abstract static class BeforeSaveParameters extends ImmutableObject {
|
||||
|
||||
public abstract DomainResource existingDomain();
|
||||
public abstract DomainBase existingDomain();
|
||||
|
||||
public abstract DomainResource newDomain();
|
||||
public abstract DomainBase newDomain();
|
||||
|
||||
public abstract HistoryEntry historyEntry();
|
||||
|
||||
|
@ -138,9 +138,9 @@ public class DomainRenewFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
@AutoValue.Builder
|
||||
public abstract static class Builder {
|
||||
|
||||
public abstract Builder setExistingDomain(DomainResource existingDomain);
|
||||
public abstract Builder setExistingDomain(DomainBase existingDomain);
|
||||
|
||||
public abstract Builder setNewDomain(DomainResource newDomain);
|
||||
public abstract Builder setNewDomain(DomainBase newDomain);
|
||||
|
||||
public abstract Builder setHistoryEntry(HistoryEntry historyEntry);
|
||||
|
||||
|
@ -158,7 +158,7 @@ public class DomainRenewFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
@AutoValue
|
||||
public abstract static class BeforeResponseParameters extends ImmutableObject {
|
||||
|
||||
public abstract DomainResource domain();
|
||||
public abstract DomainBase domain();
|
||||
|
||||
public abstract ResponseData resData();
|
||||
|
||||
|
@ -172,7 +172,7 @@ public class DomainRenewFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
@AutoValue.Builder
|
||||
public abstract static class Builder {
|
||||
|
||||
public abstract BeforeResponseParameters.Builder setDomain(DomainResource domain);
|
||||
public abstract BeforeResponseParameters.Builder setDomain(DomainBase domain);
|
||||
|
||||
public abstract BeforeResponseParameters.Builder setResData(ResponseData resData);
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import google.registry.flows.FlowMetadata;
|
|||
import google.registry.flows.SessionMetadata;
|
||||
import google.registry.flows.domain.DomainUpdateFlow;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.eppinput.EppInput;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
|
||||
|
@ -65,7 +65,7 @@ public class DomainUpdateFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
@AutoValue
|
||||
public abstract static class AfterValidationParameters extends ImmutableObject {
|
||||
|
||||
public abstract DomainResource existingDomain();
|
||||
public abstract DomainBase existingDomain();
|
||||
|
||||
public static Builder newBuilder() {
|
||||
return new AutoValue_DomainUpdateFlowCustomLogic_AfterValidationParameters.Builder();
|
||||
|
@ -75,7 +75,7 @@ public class DomainUpdateFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
@AutoValue.Builder
|
||||
public abstract static class Builder {
|
||||
|
||||
public abstract Builder setExistingDomain(DomainResource existingDomain);
|
||||
public abstract Builder setExistingDomain(DomainBase existingDomain);
|
||||
|
||||
public abstract AfterValidationParameters build();
|
||||
}
|
||||
|
@ -91,9 +91,9 @@ public class DomainUpdateFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
@AutoValue
|
||||
public abstract static class BeforeSaveParameters extends ImmutableObject {
|
||||
|
||||
public abstract DomainResource existingDomain();
|
||||
public abstract DomainBase existingDomain();
|
||||
|
||||
public abstract DomainResource newDomain();
|
||||
public abstract DomainBase newDomain();
|
||||
|
||||
public abstract HistoryEntry historyEntry();
|
||||
|
||||
|
@ -107,9 +107,9 @@ public class DomainUpdateFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
@AutoValue.Builder
|
||||
public abstract static class Builder {
|
||||
|
||||
public abstract Builder setExistingDomain(DomainResource existingDomain);
|
||||
public abstract Builder setExistingDomain(DomainBase existingDomain);
|
||||
|
||||
public abstract Builder setNewDomain(DomainResource newDomain);
|
||||
public abstract Builder setNewDomain(DomainBase newDomain);
|
||||
|
||||
public abstract Builder setHistoryEntry(HistoryEntry historyEntry);
|
||||
|
||||
|
|
|
@ -42,8 +42,8 @@ import google.registry.flows.custom.DomainCheckFlowCustomLogic;
|
|||
import google.registry.flows.custom.DomainCheckFlowCustomLogic.BeforeResponseParameters;
|
||||
import google.registry.flows.custom.DomainCheckFlowCustomLogic.BeforeResponseReturnData;
|
||||
import google.registry.flows.domain.token.AllocationTokenFlowUtils;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.DomainCommand.Check;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.fee.FeeCheckCommandExtension;
|
||||
import google.registry.model.domain.fee.FeeCheckCommandExtensionItem;
|
||||
import google.registry.model.domain.fee.FeeCheckResponseExtensionItem;
|
||||
|
@ -141,7 +141,7 @@ public final class DomainCheckFlow implements Flow {
|
|||
// TODO: Use as of date from fee extension v0.12 instead of now, if specified.
|
||||
.setAsOfDate(now)
|
||||
.build());
|
||||
Set<String> existingIds = checkResourcesExist(DomainResource.class, targetIds, now);
|
||||
Set<String> existingIds = checkResourcesExist(DomainBase.class, targetIds, now);
|
||||
Optional<AllocationTokenExtension> allocationTokenExtension =
|
||||
eppInput.getSingleExtension(AllocationTokenExtension.class);
|
||||
ImmutableMap<InternetDomainName, String> tokenCheckResults =
|
||||
|
|
|
@ -76,9 +76,9 @@ import google.registry.model.billing.BillingEvent;
|
|||
import google.registry.model.billing.BillingEvent.Flag;
|
||||
import google.registry.model.billing.BillingEvent.Reason;
|
||||
import google.registry.model.billing.BillingEvent.Recurring;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.DomainCommand;
|
||||
import google.registry.model.domain.DomainCommand.Create;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.Period;
|
||||
import google.registry.model.domain.fee.FeeCreateCommandExtension;
|
||||
|
@ -221,7 +221,7 @@ public class DomainCreateFlow implements TransactionalFlow {
|
|||
verifyUnitIsYears(period);
|
||||
int years = period.getValue();
|
||||
validateRegistrationPeriod(years);
|
||||
verifyResourceDoesNotExist(DomainResource.class, targetId, now);
|
||||
verifyResourceDoesNotExist(DomainBase.class, targetId, now);
|
||||
// Validate that this is actually a legal domain name on a TLD that the registrar has access to.
|
||||
InternetDomainName domainName = validateDomainName(command.getFullyQualifiedDomainName());
|
||||
String domainLabel = domainName.parts().get(0);
|
||||
|
@ -334,8 +334,8 @@ public class DomainCreateFlow implements TransactionalFlow {
|
|||
createNameCollisionOneTimePollMessage(targetId, historyEntry, clientId, now));
|
||||
}
|
||||
|
||||
DomainResource newDomain =
|
||||
new DomainResource.Builder()
|
||||
DomainBase newDomain =
|
||||
new DomainBase.Builder()
|
||||
.setCreationClientId(clientId)
|
||||
.setPersistedCurrentSponsorClientId(clientId)
|
||||
.setRepoId(repoId)
|
||||
|
@ -477,7 +477,7 @@ public class DomainCreateFlow implements TransactionalFlow {
|
|||
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
||||
.setPeriod(period)
|
||||
.setModificationTime(now)
|
||||
.setParent(Key.create(DomainResource.class, repoId))
|
||||
.setParent(Key.create(DomainBase.class, repoId))
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -573,12 +573,12 @@ public class DomainCreateFlow implements TransactionalFlow {
|
|||
}
|
||||
|
||||
private void enqueueTasks(
|
||||
DomainResource newDomain, boolean hasSignedMarks, boolean hasClaimsNotice) {
|
||||
DomainBase newDomain, boolean hasSignedMarks, boolean hasClaimsNotice) {
|
||||
if (newDomain.shouldPublishToDns()) {
|
||||
dnsQueue.addDomainRefreshTask(newDomain.getFullyQualifiedDomainName());
|
||||
}
|
||||
if (hasClaimsNotice || hasSignedMarks) {
|
||||
LordnTaskUtils.enqueueDomainResourceTask(newDomain);
|
||||
LordnTaskUtils.enqueueDomainBaseTask(newDomain);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -61,8 +61,8 @@ import google.registry.flows.custom.DomainDeleteFlowCustomLogic.BeforeSaveParame
|
|||
import google.registry.flows.custom.EntityChanges;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.billing.BillingEvent;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainResource.Builder;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.DomainBase.Builder;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.fee.BaseFee.FeeType;
|
||||
import google.registry.model.domain.fee.Credit;
|
||||
|
@ -143,7 +143,7 @@ public final class DomainDeleteFlow implements TransactionalFlow {
|
|||
validateClientIsLoggedIn(clientId);
|
||||
DateTime now = ofy().getTransactionTime();
|
||||
// Loads the target resource if it exists
|
||||
DomainResource existingDomain = loadAndVerifyExistence(DomainResource.class, targetId, now);
|
||||
DomainBase existingDomain = loadAndVerifyExistence(DomainBase.class, targetId, now);
|
||||
Registry registry = Registry.get(existingDomain.getTld());
|
||||
verifyDeleteAllowed(existingDomain, registry, now);
|
||||
flowCustomLogic.afterValidation(
|
||||
|
@ -204,7 +204,7 @@ public final class DomainDeleteFlow implements TransactionalFlow {
|
|||
// message are produced (since we are ending the autorenew recurrences at "now" below). For
|
||||
// now at least this is working as intended.
|
||||
}
|
||||
DomainResource newDomain = builder.build();
|
||||
DomainBase newDomain = builder.build();
|
||||
updateForeignKeyIndexDeletionTime(newDomain);
|
||||
handlePendingTransferOnDelete(existingDomain, newDomain, now, historyEntry);
|
||||
// Close the autorenew billing event and poll message. This may delete the poll message.
|
||||
|
@ -245,7 +245,7 @@ public final class DomainDeleteFlow implements TransactionalFlow {
|
|||
.build();
|
||||
}
|
||||
|
||||
private void verifyDeleteAllowed(DomainResource existingDomain, Registry registry, DateTime now)
|
||||
private void verifyDeleteAllowed(DomainBase existingDomain, Registry registry, DateTime now)
|
||||
throws EppException {
|
||||
verifyNoDisallowedStatuses(existingDomain, DISALLOWED_STATUSES);
|
||||
verifyOptionalAuthInfo(authInfo, existingDomain);
|
||||
|
@ -260,7 +260,7 @@ public final class DomainDeleteFlow implements TransactionalFlow {
|
|||
}
|
||||
|
||||
private HistoryEntry buildHistoryEntry(
|
||||
DomainResource existingResource,
|
||||
DomainBase existingResource,
|
||||
Registry registry,
|
||||
DateTime now,
|
||||
Duration durationUntilDelete,
|
||||
|
@ -298,7 +298,7 @@ public final class DomainDeleteFlow implements TransactionalFlow {
|
|||
}
|
||||
|
||||
private OneTime createDeletePollMessage(
|
||||
DomainResource existingResource, HistoryEntry historyEntry, DateTime deletionTime) {
|
||||
DomainBase existingResource, HistoryEntry historyEntry, DateTime deletionTime) {
|
||||
return new PollMessage.OneTime.Builder()
|
||||
.setClientId(existingResource.getCurrentSponsorClientId())
|
||||
.setEventTime(deletionTime)
|
||||
|
@ -312,7 +312,7 @@ public final class DomainDeleteFlow implements TransactionalFlow {
|
|||
|
||||
@Nullable
|
||||
private ImmutableList<FeeTransformResponseExtension> getResponseExtensions(
|
||||
DomainResource existingDomain, DateTime now) {
|
||||
DomainBase existingDomain, DateTime now) {
|
||||
FeeTransformResponseExtension.Builder feeResponseBuilder = getDeleteResponseBuilder();
|
||||
if (feeResponseBuilder == null) {
|
||||
return ImmutableList.of();
|
||||
|
|
|
@ -22,7 +22,7 @@ import static com.google.common.collect.Iterables.any;
|
|||
import static com.google.common.collect.Sets.difference;
|
||||
import static com.google.common.collect.Sets.intersection;
|
||||
import static com.google.common.collect.Sets.union;
|
||||
import static google.registry.model.domain.DomainResource.MAX_REGISTRATION_YEARS;
|
||||
import static google.registry.model.domain.DomainBase.MAX_REGISTRATION_YEARS;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import static google.registry.model.registry.Registries.findTldForName;
|
||||
import static google.registry.model.registry.Registries.getTlds;
|
||||
|
@ -77,7 +77,6 @@ import google.registry.model.domain.DomainCommand.Create;
|
|||
import google.registry.model.domain.DomainCommand.CreateOrUpdate;
|
||||
import google.registry.model.domain.DomainCommand.InvalidReferencesException;
|
||||
import google.registry.model.domain.DomainCommand.Update;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.ForeignKeyedDesignatedContact;
|
||||
import google.registry.model.domain.Period;
|
||||
import google.registry.model.domain.fee.BaseFee.FeeType;
|
||||
|
@ -504,7 +503,7 @@ public class DomainFlowUtils {
|
|||
* Fills in a builder with the data needed for an autorenew billing event for this domain. This
|
||||
* does not copy over the id of the current autorenew billing event.
|
||||
*/
|
||||
public static BillingEvent.Recurring.Builder newAutorenewBillingEvent(DomainResource domain) {
|
||||
public static BillingEvent.Recurring.Builder newAutorenewBillingEvent(DomainBase domain) {
|
||||
return new BillingEvent.Recurring.Builder()
|
||||
.setReason(Reason.RENEW)
|
||||
.setFlags(ImmutableSet.of(Flag.AUTO_RENEW))
|
||||
|
@ -517,7 +516,7 @@ public class DomainFlowUtils {
|
|||
* Fills in a builder with the data needed for an autorenew poll message for this domain. This
|
||||
* does not copy over the id of the current autorenew poll message.
|
||||
*/
|
||||
public static PollMessage.Autorenew.Builder newAutorenewPollMessage(DomainResource domain) {
|
||||
public static PollMessage.Autorenew.Builder newAutorenewPollMessage(DomainBase domain) {
|
||||
return new PollMessage.Autorenew.Builder()
|
||||
.setTargetId(domain.getFullyQualifiedDomainName())
|
||||
.setClientId(domain.getCurrentSponsorClientId())
|
||||
|
@ -533,7 +532,7 @@ public class DomainFlowUtils {
|
|||
* time earlier than its event time (i.e. if it's being ended before it was ever triggered).
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void updateAutorenewRecurrenceEndTime(DomainResource domain, DateTime newEndTime) {
|
||||
public static void updateAutorenewRecurrenceEndTime(DomainBase domain, DateTime newEndTime) {
|
||||
Optional<PollMessage.Autorenew> autorenewPollMessage =
|
||||
Optional.ofNullable(ofy().load().key(domain.getAutorenewPollMessage()).now());
|
||||
|
||||
|
@ -787,7 +786,7 @@ public class DomainFlowUtils {
|
|||
|
||||
/**
|
||||
* Check whether a new expiration time (via a renew) does not extend beyond a maximum number of
|
||||
* years (e.g. {@link DomainResource#MAX_REGISTRATION_YEARS}) from "now".
|
||||
* years (e.g. {@link DomainBase#MAX_REGISTRATION_YEARS}) from "now".
|
||||
*
|
||||
* @throws ExceedsMaxRegistrationYearsException if the new registration period is too long
|
||||
*/
|
||||
|
@ -800,7 +799,7 @@ public class DomainFlowUtils {
|
|||
|
||||
/**
|
||||
* Check that a new registration period (via a create) does not extend beyond a maximum number of
|
||||
* years (e.g. {@link DomainResource#MAX_REGISTRATION_YEARS}).
|
||||
* years (e.g. {@link DomainBase#MAX_REGISTRATION_YEARS}).
|
||||
*
|
||||
* @throws ExceedsMaxRegistrationYearsException if the new registration period is too long
|
||||
*/
|
||||
|
@ -1019,7 +1018,7 @@ public class DomainFlowUtils {
|
|||
* the most recent HistoryEntry that fits the above criteria, with negated reportAmounts.
|
||||
*/
|
||||
static ImmutableSet<DomainTransactionRecord> createCancelingRecords(
|
||||
DomainResource domainResource,
|
||||
DomainBase domainBase,
|
||||
final DateTime now,
|
||||
Duration maxSearchPeriod,
|
||||
final ImmutableSet<TransactionReportField> cancelableFields) {
|
||||
|
@ -1028,7 +1027,7 @@ public class DomainFlowUtils {
|
|||
ofy()
|
||||
.load()
|
||||
.type(HistoryEntry.class)
|
||||
.ancestor(domainResource)
|
||||
.ancestor(domainBase)
|
||||
.filter("modificationTime >=", now.minus(maxSearchPeriod))
|
||||
.order("modificationTime")
|
||||
.list();
|
||||
|
|
|
@ -37,10 +37,10 @@ import google.registry.flows.custom.DomainInfoFlowCustomLogic;
|
|||
import google.registry.flows.custom.DomainInfoFlowCustomLogic.AfterValidationParameters;
|
||||
import google.registry.flows.custom.DomainInfoFlowCustomLogic.BeforeResponseParameters;
|
||||
import google.registry.flows.custom.DomainInfoFlowCustomLogic.BeforeResponseReturnData;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.DomainCommand.Info;
|
||||
import google.registry.model.domain.DomainCommand.Info.HostsRequest;
|
||||
import google.registry.model.domain.DomainInfoData;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.fee06.FeeInfoCommandExtensionV06;
|
||||
import google.registry.model.domain.fee06.FeeInfoResponseExtensionV06;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
|
@ -95,8 +95,8 @@ public final class DomainInfoFlow implements Flow {
|
|||
extensionManager.validate();
|
||||
validateClientIsLoggedIn(clientId);
|
||||
DateTime now = clock.nowUtc();
|
||||
DomainResource domain = verifyExistence(
|
||||
DomainResource.class, targetId, loadByForeignKey(DomainResource.class, targetId, now));
|
||||
DomainBase domain = verifyExistence(
|
||||
DomainBase.class, targetId, loadByForeignKey(DomainBase.class, targetId, now));
|
||||
verifyOptionalAuthInfo(authInfo, domain);
|
||||
flowCustomLogic.afterValidation(
|
||||
AfterValidationParameters.newBuilder().setDomain(domain).build());
|
||||
|
@ -145,7 +145,7 @@ public final class DomainInfoFlow implements Flow {
|
|||
}
|
||||
|
||||
private ImmutableList<ResponseExtension> getDomainResponseExtensions(
|
||||
DomainResource domain, DateTime now) throws EppException {
|
||||
DomainBase domain, DateTime now) throws EppException {
|
||||
ImmutableList.Builder<ResponseExtension> extensions = new ImmutableList.Builder<>();
|
||||
addSecDnsExtensionIfPresent(extensions, domain.getDsData());
|
||||
ImmutableSet<GracePeriodStatus> gracePeriodStatuses = domain.getGracePeriodStatuses();
|
||||
|
|
|
@ -51,9 +51,9 @@ import google.registry.flows.custom.EntityChanges;
|
|||
import google.registry.model.billing.BillingEvent;
|
||||
import google.registry.model.billing.BillingEvent.OneTime;
|
||||
import google.registry.model.billing.BillingEvent.Reason;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.DomainCommand.Renew;
|
||||
import google.registry.model.domain.DomainRenewData;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.Period;
|
||||
import google.registry.model.domain.fee.BaseFee.FeeType;
|
||||
|
@ -139,7 +139,7 @@ public final class DomainRenewFlow implements TransactionalFlow {
|
|||
DateTime now = ofy().getTransactionTime();
|
||||
Renew command = (Renew) resourceCommand;
|
||||
// Loads the target resource if it exists
|
||||
DomainResource existingDomain = loadAndVerifyExistence(DomainResource.class, targetId, now);
|
||||
DomainBase existingDomain = loadAndVerifyExistence(DomainBase.class, targetId, now);
|
||||
verifyRenewAllowed(authInfo, existingDomain, command);
|
||||
int years = command.getPeriod().getValue();
|
||||
DateTime newExpirationTime =
|
||||
|
@ -174,7 +174,7 @@ public final class DomainRenewFlow implements TransactionalFlow {
|
|||
.build();
|
||||
// End the old autorenew billing event and poll message now. This may delete the poll message.
|
||||
updateAutorenewRecurrenceEndTime(existingDomain, now);
|
||||
DomainResource newDomain =
|
||||
DomainBase newDomain =
|
||||
existingDomain
|
||||
.asBuilder()
|
||||
.setLastEppUpdateTime(now)
|
||||
|
@ -220,7 +220,7 @@ public final class DomainRenewFlow implements TransactionalFlow {
|
|||
}
|
||||
|
||||
private HistoryEntry buildHistoryEntry(
|
||||
DomainResource existingDomain, DateTime now, Period period, Duration renewGracePeriod) {
|
||||
DomainBase existingDomain, DateTime now, Period period, Duration renewGracePeriod) {
|
||||
return historyBuilder
|
||||
.setType(HistoryEntry.Type.DOMAIN_RENEW)
|
||||
.setPeriod(period)
|
||||
|
@ -238,7 +238,7 @@ public final class DomainRenewFlow implements TransactionalFlow {
|
|||
|
||||
private void verifyRenewAllowed(
|
||||
Optional<AuthInfo> authInfo,
|
||||
DomainResource existingDomain,
|
||||
DomainBase existingDomain,
|
||||
Renew command) throws EppException {
|
||||
verifyOptionalAuthInfo(authInfo, existingDomain);
|
||||
verifyNoDisallowedStatuses(existingDomain, RENEW_DISALLOWED_STATUSES);
|
||||
|
|
|
@ -48,8 +48,8 @@ import google.registry.model.billing.BillingEvent;
|
|||
import google.registry.model.billing.BillingEvent.OneTime;
|
||||
import google.registry.model.billing.BillingEvent.OneTime.Builder;
|
||||
import google.registry.model.billing.BillingEvent.Reason;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.DomainCommand.Update;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.fee.BaseFee.FeeType;
|
||||
import google.registry.model.domain.fee.Fee;
|
||||
import google.registry.model.domain.fee.FeeTransformResponseExtension;
|
||||
|
@ -134,7 +134,7 @@ public final class DomainRestoreRequestFlow implements TransactionalFlow {
|
|||
verifyRegistrarIsActive(clientId);
|
||||
Update command = (Update) resourceCommand;
|
||||
DateTime now = ofy().getTransactionTime();
|
||||
DomainResource existingDomain = loadAndVerifyExistence(DomainResource.class, targetId, now);
|
||||
DomainBase existingDomain = loadAndVerifyExistence(DomainBase.class, targetId, now);
|
||||
FeesAndCredits feesAndCredits =
|
||||
pricingLogic.getRestorePrice(Registry.get(existingDomain.getTld()), targetId, now);
|
||||
Optional<FeeUpdateCommandExtension> feeUpdate =
|
||||
|
@ -160,7 +160,7 @@ public final class DomainRestoreRequestFlow implements TransactionalFlow {
|
|||
.setAutorenewEndTime(END_OF_TIME)
|
||||
.setParent(historyEntry)
|
||||
.build();
|
||||
DomainResource newDomain =
|
||||
DomainBase newDomain =
|
||||
performRestore(
|
||||
existingDomain, newExpirationTime, autorenewEvent, autorenewPollMessage, now, clientId);
|
||||
updateForeignKeyIndexDeletionTime(newDomain);
|
||||
|
@ -175,7 +175,7 @@ public final class DomainRestoreRequestFlow implements TransactionalFlow {
|
|||
.build();
|
||||
}
|
||||
|
||||
private HistoryEntry buildHistoryEntry(DomainResource existingDomain, DateTime now) {
|
||||
private HistoryEntry buildHistoryEntry(DomainBase existingDomain, DateTime now) {
|
||||
return historyBuilder
|
||||
.setType(HistoryEntry.Type.DOMAIN_RESTORE)
|
||||
.setModificationTime(now)
|
||||
|
@ -189,7 +189,7 @@ public final class DomainRestoreRequestFlow implements TransactionalFlow {
|
|||
|
||||
private void verifyRestoreAllowed(
|
||||
Update command,
|
||||
DomainResource existingDomain,
|
||||
DomainBase existingDomain,
|
||||
Optional<FeeUpdateCommandExtension> feeUpdate,
|
||||
FeesAndCredits feesAndCredits,
|
||||
DateTime now) throws EppException {
|
||||
|
@ -223,8 +223,8 @@ public final class DomainRestoreRequestFlow implements TransactionalFlow {
|
|||
return ImmutableSet.of(restoreEvent, renewEvent);
|
||||
}
|
||||
|
||||
private static DomainResource performRestore(
|
||||
DomainResource existingDomain,
|
||||
private static DomainBase performRestore(
|
||||
DomainBase existingDomain,
|
||||
DateTime newExpirationTime,
|
||||
BillingEvent.Recurring autorenewEvent,
|
||||
PollMessage.Autorenew autorenewPollMessage,
|
||||
|
|
|
@ -26,7 +26,7 @@ import static google.registry.flows.domain.DomainFlowUtils.updateAutorenewRecurr
|
|||
import static google.registry.flows.domain.DomainTransferUtils.createGainingTransferPollMessage;
|
||||
import static google.registry.flows.domain.DomainTransferUtils.createTransferResponse;
|
||||
import static google.registry.model.ResourceTransferUtils.approvePendingTransfer;
|
||||
import static google.registry.model.domain.DomainResource.extendRegistrationWithCap;
|
||||
import static google.registry.model.domain.DomainBase.extendRegistrationWithCap;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import static google.registry.model.reporting.DomainTransactionRecord.TransactionReportField.TRANSFER_SUCCESSFUL;
|
||||
import static google.registry.pricing.PricingEngineProxy.getDomainRenewCost;
|
||||
|
@ -46,7 +46,7 @@ import google.registry.model.ImmutableObject;
|
|||
import google.registry.model.billing.BillingEvent;
|
||||
import google.registry.model.billing.BillingEvent.Flag;
|
||||
import google.registry.model.billing.BillingEvent.Reason;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.metadata.MetadataExtension;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
|
@ -95,7 +95,7 @@ public final class DomainTransferApproveFlow implements TransactionalFlow {
|
|||
|
||||
/**
|
||||
* <p>The logic in this flow, which handles client approvals, very closely parallels the logic in
|
||||
* {@link DomainResource#cloneProjectedAtTime} which handles implicit server approvals.
|
||||
* {@link DomainBase#cloneProjectedAtTime} which handles implicit server approvals.
|
||||
*/
|
||||
@Override
|
||||
public final EppResponse run() throws EppException {
|
||||
|
@ -103,7 +103,7 @@ public final class DomainTransferApproveFlow implements TransactionalFlow {
|
|||
extensionManager.validate();
|
||||
validateClientIsLoggedIn(clientId);
|
||||
DateTime now = ofy().getTransactionTime();
|
||||
DomainResource existingDomain = loadAndVerifyExistence(DomainResource.class, targetId, now);
|
||||
DomainBase existingDomain = loadAndVerifyExistence(DomainBase.class, targetId, now);
|
||||
verifyOptionalAuthInfo(authInfo, existingDomain);
|
||||
verifyHasPendingTransfer(existingDomain);
|
||||
verifyResourceOwnership(clientId, existingDomain);
|
||||
|
@ -173,9 +173,9 @@ public final class DomainTransferApproveFlow implements TransactionalFlow {
|
|||
.setParent(historyEntry)
|
||||
.build();
|
||||
// Construct the post-transfer domain.
|
||||
DomainResource partiallyApprovedDomain =
|
||||
DomainBase partiallyApprovedDomain =
|
||||
approvePendingTransfer(existingDomain, TransferStatus.CLIENT_APPROVED, now);
|
||||
DomainResource newDomain =
|
||||
DomainBase newDomain =
|
||||
partiallyApprovedDomain
|
||||
.asBuilder()
|
||||
// Update the transferredRegistrationExpirationTime here since approvePendingTransfer()
|
||||
|
@ -223,7 +223,7 @@ public final class DomainTransferApproveFlow implements TransactionalFlow {
|
|||
}
|
||||
|
||||
private HistoryEntry buildHistoryEntry(
|
||||
DomainResource existingDomain, Registry registry, DateTime now, String gainingClientId) {
|
||||
DomainBase existingDomain, Registry registry, DateTime now, String gainingClientId) {
|
||||
ImmutableSet<DomainTransactionRecord> cancelingRecords =
|
||||
createCancelingRecords(
|
||||
existingDomain,
|
||||
|
|
|
@ -39,7 +39,7 @@ import google.registry.flows.FlowModule.TargetId;
|
|||
import google.registry.flows.TransactionalFlow;
|
||||
import google.registry.flows.annotations.ReportingSpec;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.metadata.MetadataExtension;
|
||||
import google.registry.model.eppcommon.AuthInfo;
|
||||
import google.registry.model.eppoutput.EppResponse;
|
||||
|
@ -88,7 +88,7 @@ public final class DomainTransferCancelFlow implements TransactionalFlow {
|
|||
extensionManager.validate();
|
||||
validateClientIsLoggedIn(clientId);
|
||||
DateTime now = ofy().getTransactionTime();
|
||||
DomainResource existingDomain = loadAndVerifyExistence(DomainResource.class, targetId, now);
|
||||
DomainBase existingDomain = loadAndVerifyExistence(DomainBase.class, targetId, now);
|
||||
verifyOptionalAuthInfo(authInfo, existingDomain);
|
||||
verifyHasPendingTransfer(existingDomain);
|
||||
verifyTransferInitiator(clientId, existingDomain);
|
||||
|
@ -97,7 +97,7 @@ public final class DomainTransferCancelFlow implements TransactionalFlow {
|
|||
}
|
||||
Registry registry = Registry.get(existingDomain.getTld());
|
||||
HistoryEntry historyEntry = buildHistoryEntry(existingDomain, registry, now);
|
||||
DomainResource newDomain =
|
||||
DomainBase newDomain =
|
||||
denyPendingTransfer(existingDomain, TransferStatus.CLIENT_CANCELLED, now, clientId);
|
||||
ofy().save().<ImmutableObject>entities(
|
||||
newDomain,
|
||||
|
@ -116,7 +116,7 @@ public final class DomainTransferCancelFlow implements TransactionalFlow {
|
|||
}
|
||||
|
||||
private HistoryEntry buildHistoryEntry(
|
||||
DomainResource existingDomain, Registry registry, DateTime now) {
|
||||
DomainBase existingDomain, Registry registry, DateTime now) {
|
||||
ImmutableSet<DomainTransactionRecord> cancelingRecords =
|
||||
createCancelingRecords(
|
||||
existingDomain,
|
||||
|
|
|
@ -18,7 +18,7 @@ import static google.registry.flows.FlowUtils.validateClientIsLoggedIn;
|
|||
import static google.registry.flows.ResourceFlowUtils.loadAndVerifyExistence;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyOptionalAuthInfo;
|
||||
import static google.registry.flows.domain.DomainTransferUtils.createTransferResponse;
|
||||
import static google.registry.model.domain.DomainResource.extendRegistrationWithCap;
|
||||
import static google.registry.model.domain.DomainBase.extendRegistrationWithCap;
|
||||
|
||||
import google.registry.flows.EppException;
|
||||
import google.registry.flows.ExtensionManager;
|
||||
|
@ -28,7 +28,7 @@ import google.registry.flows.FlowModule.TargetId;
|
|||
import google.registry.flows.annotations.ReportingSpec;
|
||||
import google.registry.flows.exceptions.NoTransferHistoryToQueryException;
|
||||
import google.registry.flows.exceptions.NotAuthorizedToViewTransferException;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.eppcommon.AuthInfo;
|
||||
import google.registry.model.eppoutput.EppResponse;
|
||||
import google.registry.model.reporting.IcannReportingTypes.ActivityReportField;
|
||||
|
@ -70,7 +70,7 @@ public final class DomainTransferQueryFlow implements Flow {
|
|||
extensionManager.validate(); // There are no legal extensions for this flow.
|
||||
validateClientIsLoggedIn(clientId);
|
||||
DateTime now = clock.nowUtc();
|
||||
DomainResource domain = loadAndVerifyExistence(DomainResource.class, targetId, now);
|
||||
DomainBase domain = loadAndVerifyExistence(DomainBase.class, targetId, now);
|
||||
verifyOptionalAuthInfo(authInfo, domain);
|
||||
// Most of the fields on the transfer response are required, so there's no way to return valid
|
||||
// XML if the object has never been transferred (and hence the fields aren't populated).
|
||||
|
|
|
@ -41,7 +41,7 @@ import google.registry.flows.FlowModule.TargetId;
|
|||
import google.registry.flows.TransactionalFlow;
|
||||
import google.registry.flows.annotations.ReportingSpec;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.metadata.MetadataExtension;
|
||||
import google.registry.model.eppcommon.AuthInfo;
|
||||
import google.registry.model.eppoutput.EppResponse;
|
||||
|
@ -90,7 +90,7 @@ public final class DomainTransferRejectFlow implements TransactionalFlow {
|
|||
extensionManager.validate();
|
||||
validateClientIsLoggedIn(clientId);
|
||||
DateTime now = ofy().getTransactionTime();
|
||||
DomainResource existingDomain = loadAndVerifyExistence(DomainResource.class, targetId, now);
|
||||
DomainBase existingDomain = loadAndVerifyExistence(DomainBase.class, targetId, now);
|
||||
Registry registry = Registry.get(existingDomain.getTld());
|
||||
HistoryEntry historyEntry = buildHistoryEntry(existingDomain, registry, now);
|
||||
verifyOptionalAuthInfo(authInfo, existingDomain);
|
||||
|
@ -99,7 +99,7 @@ public final class DomainTransferRejectFlow implements TransactionalFlow {
|
|||
if (!isSuperuser) {
|
||||
checkAllowedAccessToTld(clientId, existingDomain.getTld());
|
||||
}
|
||||
DomainResource newDomain =
|
||||
DomainBase newDomain =
|
||||
denyPendingTransfer(existingDomain, TransferStatus.CLIENT_REJECTED, now, clientId);
|
||||
ofy().save().<ImmutableObject>entities(
|
||||
newDomain,
|
||||
|
@ -118,7 +118,7 @@ public final class DomainTransferRejectFlow implements TransactionalFlow {
|
|||
}
|
||||
|
||||
private HistoryEntry buildHistoryEntry(
|
||||
DomainResource existingDomain, Registry registry, DateTime now) {
|
||||
DomainBase existingDomain, Registry registry, DateTime now) {
|
||||
ImmutableSet<DomainTransactionRecord> cancelingRecords =
|
||||
createCancelingRecords(
|
||||
existingDomain,
|
||||
|
|
|
@ -29,7 +29,7 @@ import static google.registry.flows.domain.DomainTransferUtils.createLosingTrans
|
|||
import static google.registry.flows.domain.DomainTransferUtils.createPendingTransferData;
|
||||
import static google.registry.flows.domain.DomainTransferUtils.createTransferResponse;
|
||||
import static google.registry.flows.domain.DomainTransferUtils.createTransferServerApproveEntities;
|
||||
import static google.registry.model.domain.DomainResource.extendRegistrationWithCap;
|
||||
import static google.registry.model.domain.DomainBase.extendRegistrationWithCap;
|
||||
import static google.registry.model.eppoutput.Result.Code.SUCCESS_WITH_ACTION_PENDING;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
|
||||
|
@ -49,8 +49,8 @@ import google.registry.flows.exceptions.InvalidTransferPeriodValueException;
|
|||
import google.registry.flows.exceptions.ObjectAlreadySponsoredException;
|
||||
import google.registry.flows.exceptions.TransferPeriodMustBeOneYearException;
|
||||
import google.registry.flows.exceptions.TransferPeriodZeroAndFeeTransferExtensionException;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.DomainCommand.Transfer;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.Period;
|
||||
import google.registry.model.domain.fee.FeeTransferCommandExtension;
|
||||
import google.registry.model.domain.fee.FeeTransformResponseExtension;
|
||||
|
@ -143,7 +143,7 @@ public final class DomainTransferRequestFlow implements TransactionalFlow {
|
|||
validateClientIsLoggedIn(gainingClientId);
|
||||
verifyRegistrarIsActive(gainingClientId);
|
||||
DateTime now = ofy().getTransactionTime();
|
||||
DomainResource existingDomain = loadAndVerifyExistence(DomainResource.class, targetId, now);
|
||||
DomainBase existingDomain = loadAndVerifyExistence(DomainBase.class, targetId, now);
|
||||
Optional<DomainTransferRequestSuperuserExtension> superuserExtension =
|
||||
eppInput.getSingleExtension(DomainTransferRequestSuperuserExtension.class);
|
||||
Period period =
|
||||
|
@ -182,7 +182,7 @@ public final class DomainTransferRequestFlow implements TransactionalFlow {
|
|||
// See b/19430703#comment17 and https://www.icann.org/news/advisory-2002-06-06-en for the
|
||||
// policy documentation for transfers subsuming autorenews within the autorenew grace period.
|
||||
int extraYears = period.getValue();
|
||||
DomainResource domainAtTransferTime =
|
||||
DomainBase domainAtTransferTime =
|
||||
existingDomain.cloneProjectedAtTime(automaticTransferTime);
|
||||
if (!domainAtTransferTime.getGracePeriodsOfType(GracePeriodStatus.AUTO_RENEW).isEmpty()) {
|
||||
extraYears = 0;
|
||||
|
@ -225,7 +225,7 @@ public final class DomainTransferRequestFlow implements TransactionalFlow {
|
|||
// cloneProjectedAtTime() will replace these old autorenew entities with the server approve ones
|
||||
// that we've created in this flow and stored in pendingTransferData.
|
||||
updateAutorenewRecurrenceEndTime(existingDomain, automaticTransferTime);
|
||||
DomainResource newDomain =
|
||||
DomainBase newDomain =
|
||||
existingDomain
|
||||
.asBuilder()
|
||||
.setTransferData(pendingTransferData)
|
||||
|
@ -248,7 +248,7 @@ public final class DomainTransferRequestFlow implements TransactionalFlow {
|
|||
}
|
||||
|
||||
private void verifyTransferAllowed(
|
||||
DomainResource existingDomain,
|
||||
DomainBase existingDomain,
|
||||
Period period,
|
||||
DateTime now,
|
||||
Optional<DomainTransferRequestSuperuserExtension> superuserExtension)
|
||||
|
@ -310,7 +310,7 @@ public final class DomainTransferRequestFlow implements TransactionalFlow {
|
|||
}
|
||||
|
||||
private HistoryEntry buildHistoryEntry(
|
||||
DomainResource existingDomain, Registry registry, DateTime now, Period period) {
|
||||
DomainBase existingDomain, Registry registry, DateTime now, Period period) {
|
||||
return historyBuilder
|
||||
.setType(HistoryEntry.Type.DOMAIN_TRANSFER_REQUEST)
|
||||
.setOtherClientId(existingDomain.getCurrentSponsorClientId())
|
||||
|
@ -329,7 +329,7 @@ public final class DomainTransferRequestFlow implements TransactionalFlow {
|
|||
}
|
||||
|
||||
private DomainTransferResponse createResponse(
|
||||
Period period, DomainResource existingDomain, DomainResource newDomain, DateTime now) {
|
||||
Period period, DomainBase existingDomain, DomainBase newDomain, DateTime now) {
|
||||
// If the registration were approved this instant, this is what the new expiration would be,
|
||||
// because we cap at 10 years from the moment of approval. This is different than the server
|
||||
// approval new expiration time, which is capped at 10 years from the server approve time.
|
||||
|
|
|
@ -24,7 +24,7 @@ import com.googlecode.objectify.Key;
|
|||
import google.registry.model.billing.BillingEvent;
|
||||
import google.registry.model.billing.BillingEvent.Flag;
|
||||
import google.registry.model.billing.BillingEvent.Reason;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.Period;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
|
@ -106,7 +106,7 @@ public final class DomainTransferUtils {
|
|||
DateTime automaticTransferTime,
|
||||
DateTime serverApproveNewExpirationTime,
|
||||
HistoryEntry historyEntry,
|
||||
DomainResource existingDomain,
|
||||
DomainBase existingDomain,
|
||||
Trid trid,
|
||||
String gainingClientId,
|
||||
Optional<Money> transferCost,
|
||||
|
@ -258,9 +258,9 @@ public final class DomainTransferUtils {
|
|||
DateTime automaticTransferTime,
|
||||
HistoryEntry historyEntry,
|
||||
String targetId,
|
||||
DomainResource existingDomain,
|
||||
DomainBase existingDomain,
|
||||
Optional<Money> transferCost) {
|
||||
DomainResource domainAtTransferTime =
|
||||
DomainBase domainAtTransferTime =
|
||||
existingDomain.cloneProjectedAtTime(automaticTransferTime);
|
||||
GracePeriod autorenewGracePeriod =
|
||||
getOnlyElement(
|
||||
|
|
|
@ -62,10 +62,10 @@ import google.registry.flows.domain.DomainFlowUtils.MissingRegistrantException;
|
|||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.billing.BillingEvent;
|
||||
import google.registry.model.billing.BillingEvent.Reason;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.DomainCommand.Update;
|
||||
import google.registry.model.domain.DomainCommand.Update.AddRemove;
|
||||
import google.registry.model.domain.DomainCommand.Update.Change;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.fee.FeeUpdateCommandExtension;
|
||||
import google.registry.model.domain.metadata.MetadataExtension;
|
||||
import google.registry.model.domain.secdns.SecDnsUpdateExtension;
|
||||
|
@ -162,12 +162,12 @@ public final class DomainUpdateFlow implements TransactionalFlow {
|
|||
validateClientIsLoggedIn(clientId);
|
||||
DateTime now = ofy().getTransactionTime();
|
||||
Update command = cloneAndLinkReferences((Update) resourceCommand, now);
|
||||
DomainResource existingDomain = loadAndVerifyExistence(DomainResource.class, targetId, now);
|
||||
DomainBase existingDomain = loadAndVerifyExistence(DomainBase.class, targetId, now);
|
||||
verifyUpdateAllowed(command, existingDomain, now);
|
||||
flowCustomLogic.afterValidation(
|
||||
AfterValidationParameters.newBuilder().setExistingDomain(existingDomain).build());
|
||||
HistoryEntry historyEntry = buildHistoryEntry(existingDomain, now);
|
||||
DomainResource newDomain = performUpdate(command, existingDomain, now);
|
||||
DomainBase newDomain = performUpdate(command, existingDomain, now);
|
||||
validateNewState(newDomain);
|
||||
dnsQueue.addDomainRefreshTask(targetId);
|
||||
ImmutableSet.Builder<ImmutableObject> entitiesToSave = new ImmutableSet.Builder<>();
|
||||
|
@ -189,7 +189,7 @@ public final class DomainUpdateFlow implements TransactionalFlow {
|
|||
}
|
||||
|
||||
/** Fail if the object doesn't exist or was deleted. */
|
||||
private void verifyUpdateAllowed(Update command, DomainResource existingDomain, DateTime now)
|
||||
private void verifyUpdateAllowed(Update command, DomainBase existingDomain, DateTime now)
|
||||
throws EppException {
|
||||
verifyOptionalAuthInfo(authInfo, existingDomain);
|
||||
AddRemove add = command.getInnerAdd();
|
||||
|
@ -225,7 +225,7 @@ public final class DomainUpdateFlow implements TransactionalFlow {
|
|||
domainName, nullToEmpty(add.getNameserverFullyQualifiedHostNames()));
|
||||
}
|
||||
|
||||
private HistoryEntry buildHistoryEntry(DomainResource existingDomain, DateTime now) {
|
||||
private HistoryEntry buildHistoryEntry(DomainBase existingDomain, DateTime now) {
|
||||
return historyBuilder
|
||||
.setType(HistoryEntry.Type.DOMAIN_UPDATE)
|
||||
.setModificationTime(now)
|
||||
|
@ -233,7 +233,7 @@ public final class DomainUpdateFlow implements TransactionalFlow {
|
|||
.build();
|
||||
}
|
||||
|
||||
private DomainResource performUpdate(Update command, DomainResource domain, DateTime now)
|
||||
private DomainBase performUpdate(Update command, DomainBase domain, DateTime now)
|
||||
throws EppException {
|
||||
AddRemove add = command.getInnerAdd();
|
||||
AddRemove remove = command.getInnerRemove();
|
||||
|
@ -244,7 +244,7 @@ public final class DomainUpdateFlow implements TransactionalFlow {
|
|||
validateRegistrantIsntBeingRemoved(change);
|
||||
Optional<SecDnsUpdateExtension> secDnsUpdate =
|
||||
eppInput.getSingleExtension(SecDnsUpdateExtension.class);
|
||||
DomainResource.Builder domainBuilder =
|
||||
DomainBase.Builder domainBuilder =
|
||||
domain
|
||||
.asBuilder()
|
||||
// Handle the secDNS extension.
|
||||
|
@ -276,7 +276,7 @@ public final class DomainUpdateFlow implements TransactionalFlow {
|
|||
}
|
||||
}
|
||||
|
||||
private void validateNewState(DomainResource newDomain) throws EppException {
|
||||
private void validateNewState(DomainBase newDomain) throws EppException {
|
||||
validateNoDuplicateContacts(newDomain.getContacts());
|
||||
validateRequiredContactsPresent(newDomain.getRegistrant(), newDomain.getContacts());
|
||||
validateDsData(newDomain.getDsData());
|
||||
|
@ -288,8 +288,8 @@ public final class DomainUpdateFlow implements TransactionalFlow {
|
|||
|
||||
/** Some status updates cost money. Bill only once no matter how many of them are changed. */
|
||||
private Optional<BillingEvent.OneTime> createBillingEventForStatusUpdates(
|
||||
DomainResource existingDomain,
|
||||
DomainResource newDomain,
|
||||
DomainBase existingDomain,
|
||||
DomainBase newDomain,
|
||||
HistoryEntry historyEntry,
|
||||
DateTime now) {
|
||||
Optional<MetadataExtension> metadataExtension =
|
||||
|
|
|
@ -38,7 +38,7 @@ import google.registry.flows.FlowModule.TargetId;
|
|||
import google.registry.flows.TransactionalFlow;
|
||||
import google.registry.flows.annotations.ReportingSpec;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.metadata.MetadataExtension;
|
||||
import google.registry.model.eppinput.ResourceCommand;
|
||||
import google.registry.model.eppoutput.CreateData.HostCreateData;
|
||||
|
@ -106,7 +106,7 @@ public final class HostCreateFlow implements TransactionalFlow {
|
|||
// The superordinate domain of the host object if creating an in-bailiwick host, or null if
|
||||
// creating an external host. This is looked up before we actually create the Host object so
|
||||
// we can detect error conditions earlier.
|
||||
Optional<DomainResource> superordinateDomain =
|
||||
Optional<DomainBase> superordinateDomain =
|
||||
lookupSuperordinateDomain(validateHostName(targetId), now);
|
||||
verifySuperordinateDomainNotInPendingDelete(superordinateDomain.orElse(null));
|
||||
verifySuperordinateDomainOwnership(clientId, superordinateDomain.orElse(null));
|
||||
|
|
|
@ -29,7 +29,7 @@ import google.registry.flows.EppException.ParameterValuePolicyErrorException;
|
|||
import google.registry.flows.EppException.ParameterValueRangeErrorException;
|
||||
import google.registry.flows.EppException.ParameterValueSyntaxErrorException;
|
||||
import google.registry.flows.EppException.StatusProhibitsOperationException;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.util.Idn;
|
||||
import java.util.Optional;
|
||||
|
@ -77,8 +77,8 @@ public class HostFlowUtils {
|
|||
}
|
||||
}
|
||||
|
||||
/** Return the {@link DomainResource} this host is subordinate to, or null for external hosts. */
|
||||
public static Optional<DomainResource> lookupSuperordinateDomain(
|
||||
/** Return the {@link DomainBase} this host is subordinate to, or null for external hosts. */
|
||||
public static Optional<DomainBase> lookupSuperordinateDomain(
|
||||
InternetDomainName hostName, DateTime now) throws EppException {
|
||||
Optional<InternetDomainName> tld = findTldForName(hostName);
|
||||
if (!tld.isPresent()) {
|
||||
|
@ -90,8 +90,8 @@ public class HostFlowUtils {
|
|||
hostName.parts().stream()
|
||||
.skip(hostName.parts().size() - (tld.get().parts().size() + 1))
|
||||
.collect(joining("."));
|
||||
Optional<DomainResource> superordinateDomain =
|
||||
loadByForeignKey(DomainResource.class, domainName, now);
|
||||
Optional<DomainBase> superordinateDomain =
|
||||
loadByForeignKey(DomainBase.class, domainName, now);
|
||||
if (!superordinateDomain.isPresent() || !isActive(superordinateDomain.get(), now)) {
|
||||
throw new SuperordinateDomainDoesNotExistException(domainName);
|
||||
}
|
||||
|
@ -101,13 +101,13 @@ public class HostFlowUtils {
|
|||
/** Superordinate domain for this hostname does not exist. */
|
||||
static class SuperordinateDomainDoesNotExistException extends ObjectDoesNotExistException {
|
||||
public SuperordinateDomainDoesNotExistException(String domainName) {
|
||||
super(DomainResource.class, domainName);
|
||||
super(DomainBase.class, domainName);
|
||||
}
|
||||
}
|
||||
|
||||
/** Ensure that the superordinate domain is sponsored by the provided clientId. */
|
||||
static void verifySuperordinateDomainOwnership(
|
||||
String clientId, DomainResource superordinateDomain) throws EppException {
|
||||
String clientId, DomainBase superordinateDomain) throws EppException {
|
||||
if (superordinateDomain != null
|
||||
&& !clientId.equals(superordinateDomain.getCurrentSponsorClientId())) {
|
||||
throw new HostDomainNotOwnedException();
|
||||
|
@ -122,7 +122,7 @@ public class HostFlowUtils {
|
|||
}
|
||||
|
||||
/** Ensure that the superordinate domain is not in pending delete. */
|
||||
static void verifySuperordinateDomainNotInPendingDelete(DomainResource superordinateDomain)
|
||||
static void verifySuperordinateDomainNotInPendingDelete(DomainBase superordinateDomain)
|
||||
throws EppException {
|
||||
if ((superordinateDomain != null)
|
||||
&& superordinateDomain.getStatusValues().contains(StatusValue.PENDING_DELETE)) {
|
||||
|
|
|
@ -28,7 +28,7 @@ import google.registry.flows.Flow;
|
|||
import google.registry.flows.FlowModule.ClientId;
|
||||
import google.registry.flows.FlowModule.TargetId;
|
||||
import google.registry.flows.annotations.ReportingSpec;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.eppoutput.EppResponse;
|
||||
import google.registry.model.host.HostInfoData;
|
||||
|
@ -77,7 +77,7 @@ public final class HostInfoFlow implements Flow {
|
|||
// the client id, last transfer time, and pending transfer status need to be read off of it. If
|
||||
// there is no superordinate domain, the host's own values for these fields will be correct.
|
||||
if (host.isSubordinate()) {
|
||||
DomainResource superordinateDomain =
|
||||
DomainBase superordinateDomain =
|
||||
ofy().load().key(host.getSuperordinateDomain()).now().cloneProjectedAtTime(now);
|
||||
hostInfoDataBuilder
|
||||
.setCurrentSponsorClientId(superordinateDomain.getCurrentSponsorClientId())
|
||||
|
|
|
@ -47,7 +47,7 @@ import google.registry.flows.annotations.ReportingSpec;
|
|||
import google.registry.flows.exceptions.ResourceHasClientUpdateProhibitedException;
|
||||
import google.registry.model.EppResource;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.metadata.MetadataExtension;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.eppinput.ResourceCommand;
|
||||
|
@ -135,11 +135,11 @@ public final class HostUpdateFlow implements TransactionalFlow {
|
|||
boolean isHostRename = suppliedNewHostName != null;
|
||||
String oldHostName = targetId;
|
||||
String newHostName = firstNonNull(suppliedNewHostName, oldHostName);
|
||||
DomainResource oldSuperordinateDomain = existingHost.isSubordinate()
|
||||
DomainBase oldSuperordinateDomain = existingHost.isSubordinate()
|
||||
? ofy().load().key(existingHost.getSuperordinateDomain()).now().cloneProjectedAtTime(now)
|
||||
: null;
|
||||
// Note that lookupSuperordinateDomain calls cloneProjectedAtTime on the domain for us.
|
||||
Optional<DomainResource> newSuperordinateDomain =
|
||||
Optional<DomainBase> newSuperordinateDomain =
|
||||
lookupSuperordinateDomain(validateHostName(newHostName), now);
|
||||
verifySuperordinateDomainNotInPendingDelete(newSuperordinateDomain.orElse(null));
|
||||
EppResource owningResource = firstNonNull(oldSuperordinateDomain, existingHost);
|
||||
|
@ -152,7 +152,7 @@ public final class HostUpdateFlow implements TransactionalFlow {
|
|||
AddRemove remove = command.getInnerRemove();
|
||||
checkSameValuesNotAddedAndRemoved(add.getStatusValues(), remove.getStatusValues());
|
||||
checkSameValuesNotAddedAndRemoved(add.getInetAddresses(), remove.getInetAddresses());
|
||||
Key<DomainResource> newSuperordinateDomainKey =
|
||||
Key<DomainBase> newSuperordinateDomainKey =
|
||||
newSuperordinateDomain.map(Key::create).orElse(null);
|
||||
// If the superordinateDomain field is changing, set the lastSuperordinateChange to now.
|
||||
DateTime lastSuperordinateChange =
|
||||
|
@ -209,7 +209,7 @@ public final class HostUpdateFlow implements TransactionalFlow {
|
|||
private void verifyUpdateAllowed(
|
||||
Update command,
|
||||
HostResource existingHost,
|
||||
DomainResource newSuperordinateDomain,
|
||||
DomainBase newSuperordinateDomain,
|
||||
EppResource owningResource,
|
||||
boolean isHostRename)
|
||||
throws EppException {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue