mirror of
https://github.com/google/nomulus.git
synced 2025-05-20 03:09:33 +02:00
Rename DomainBase -> Domain (#1725)
* Rename DomainBase -> Domain This was a long time coming, but we couldn't do it until we left Datastore, as the Java class name has to match the Datastore entity name. Subsequent PRs will rename ContactResource to Contact and HostResource to Host, so that everything matches the SQL table names (and is shorter!). * Merge branch 'master' into rename-domainbase
This commit is contained in:
parent
344b7c29ae
commit
68c80d3205
226 changed files with 1746 additions and 2630 deletions
|
@ -32,7 +32,7 @@ import google.registry.flows.EppController;
|
|||
import google.registry.flows.EppRequestSource;
|
||||
import google.registry.flows.PasswordOnlyTransportCredentials;
|
||||
import google.registry.flows.StatelessRequestSessionMetadata;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.eppcommon.ProtocolDefinition;
|
||||
import google.registry.model.eppoutput.EppOutput;
|
||||
import google.registry.persistence.transaction.QueryComposer.Comparator;
|
||||
|
@ -128,10 +128,10 @@ public class DeleteExpiredDomainsAction implements Runnable {
|
|||
logger.atInfo().log(
|
||||
"Deleting non-renewing domains with autorenew end times up through %s.", runTime);
|
||||
|
||||
ImmutableList<DomainBase> domainsToDelete =
|
||||
ImmutableList<Domain> domainsToDelete =
|
||||
tm().transact(
|
||||
() ->
|
||||
tm().createQueryComposer(DomainBase.class)
|
||||
tm().createQueryComposer(Domain.class)
|
||||
.where("autorenewEndTime", Comparator.LTE, runTime)
|
||||
.where("deletionTime", Comparator.EQ, END_OF_TIME)
|
||||
.list());
|
||||
|
@ -145,10 +145,9 @@ public class DeleteExpiredDomainsAction implements Runnable {
|
|||
"Found %d domains to delete: %s.",
|
||||
domainsToDelete.size(),
|
||||
String.join(
|
||||
", ",
|
||||
domainsToDelete.stream().map(DomainBase::getDomainName).collect(toImmutableList())));
|
||||
", ", domainsToDelete.stream().map(Domain::getDomainName).collect(toImmutableList())));
|
||||
int successes = 0;
|
||||
for (DomainBase domain : domainsToDelete) {
|
||||
for (Domain domain : domainsToDelete) {
|
||||
if (runDomainDeleteFlow(domain)) {
|
||||
successes++;
|
||||
}
|
||||
|
@ -163,7 +162,7 @@ public class DeleteExpiredDomainsAction implements Runnable {
|
|||
}
|
||||
|
||||
/** Runs the actual domain delete flow and returns whether the deletion was successful. */
|
||||
private boolean runDomainDeleteFlow(DomainBase domain) {
|
||||
private boolean runDomainDeleteFlow(Domain domain) {
|
||||
logger.atInfo().log("Attempting to delete domain '%s'.", domain.getDomainName());
|
||||
// Create a new transaction that the flow's execution will be enlisted in that loads the domain
|
||||
// transactionally. This way we can ensure that nothing else has modified the domain in question
|
||||
|
@ -171,7 +170,7 @@ public class DeleteExpiredDomainsAction implements Runnable {
|
|||
Optional<EppOutput> eppOutput =
|
||||
tm().transact(
|
||||
() -> {
|
||||
DomainBase transDomain = tm().loadByKey(domain.createVKey());
|
||||
Domain transDomain = tm().loadByKey(domain.createVKey());
|
||||
if (!domain.getAutorenewEndTime().isPresent()
|
||||
|| domain.getAutorenewEndTime().get().isAfter(tm().getTransactionTime())) {
|
||||
logger.atSevere().log(
|
||||
|
|
|
@ -30,7 +30,7 @@ import google.registry.flows.poll.PollFlowUtils;
|
|||
import google.registry.model.EppResource;
|
||||
import google.registry.model.EppResourceUtils;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.poll.PollMessage;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
|
@ -129,7 +129,7 @@ public class DeleteLoadTestDataAction implements Runnable {
|
|||
}
|
||||
VKey<HostResource> hostVKey = host.createVKey();
|
||||
// We can remove hosts from linked domains, so we should do so then delete the hosts
|
||||
ImmutableSet<VKey<DomainBase>> linkedDomains =
|
||||
ImmutableSet<VKey<Domain>> linkedDomains =
|
||||
EppResourceUtils.getLinkedDomainKeys(hostVKey, clock.nowUtc(), null);
|
||||
tm().loadByKeys(linkedDomains)
|
||||
.values()
|
||||
|
|
|
@ -37,7 +37,7 @@ import google.registry.config.RegistryEnvironment;
|
|||
import google.registry.dns.DnsQueue;
|
||||
import google.registry.model.CreateAutoTimestamp;
|
||||
import google.registry.model.EppResourceUtils;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.tld.Registry.TldType;
|
||||
import google.registry.request.Action;
|
||||
|
@ -53,8 +53,8 @@ import org.joda.time.DateTime;
|
|||
import org.joda.time.Duration;
|
||||
|
||||
/**
|
||||
* Deletes all prober DomainBases and their subordinate history entries, poll messages, and billing
|
||||
* events, along with their ForeignKeyDomainIndex and EppResourceIndex entities.
|
||||
* Deletes all prober {@link Domain}s and their subordinate history entries, poll messages, and
|
||||
* billing events, along with their ForeignKeyDomainIndex and EppResourceIndex entities.
|
||||
*/
|
||||
@Action(
|
||||
service = Action.Service.BACKEND,
|
||||
|
@ -154,7 +154,7 @@ public class DeleteProberDataAction implements Runnable {
|
|||
// keeping track of which domains to hard-delete (there can be many, so we batch them up)
|
||||
ScrollableResults scrollableResult =
|
||||
jpaTm()
|
||||
.query(DOMAIN_QUERY_STRING, DomainBase.class)
|
||||
.query(DOMAIN_QUERY_STRING, Domain.class)
|
||||
.setParameter("tlds", deletableTlds)
|
||||
.setParameter(
|
||||
"creationTimeCutoff", CreateAutoTimestamp.create(now.minus(DOMAIN_USED_DURATION)))
|
||||
|
@ -166,7 +166,7 @@ public class DeleteProberDataAction implements Runnable {
|
|||
ImmutableList.Builder<String> domainRepoIdsToHardDelete = new ImmutableList.Builder<>();
|
||||
ImmutableList.Builder<String> hostNamesToHardDelete = new ImmutableList.Builder<>();
|
||||
for (int i = 1; scrollableResult.next(); i = (i + 1) % BATCH_SIZE) {
|
||||
DomainBase domain = (DomainBase) scrollableResult.get(0);
|
||||
Domain domain = (Domain) scrollableResult.get(0);
|
||||
processDomain(
|
||||
domain,
|
||||
domainRepoIdsToHardDelete,
|
||||
|
@ -187,7 +187,7 @@ public class DeleteProberDataAction implements Runnable {
|
|||
}
|
||||
|
||||
private void processDomain(
|
||||
DomainBase domain,
|
||||
Domain domain,
|
||||
ImmutableList.Builder<String> domainRepoIdsToHardDelete,
|
||||
ImmutableList.Builder<String> hostNamesToHardDelete,
|
||||
AtomicInteger softDeletedDomains,
|
||||
|
@ -251,8 +251,8 @@ public class DeleteProberDataAction implements Runnable {
|
|||
}
|
||||
|
||||
// Take a DNS queue + admin registrar id as input so that it can be called from the mapper as well
|
||||
private void softDeleteDomain(DomainBase domain) {
|
||||
DomainBase deletedDomain =
|
||||
private void softDeleteDomain(Domain domain) {
|
||||
Domain deletedDomain =
|
||||
domain.asBuilder().setDeletionTime(tm().getTransactionTime()).setStatusValues(null).build();
|
||||
DomainHistory historyEntry =
|
||||
new DomainHistory.Builder()
|
||||
|
|
|
@ -43,7 +43,7 @@ import google.registry.model.billing.BillingEvent.Flag;
|
|||
import google.registry.model.billing.BillingEvent.OneTime;
|
||||
import google.registry.model.billing.BillingEvent.Recurring;
|
||||
import google.registry.model.common.Cursor;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.Period;
|
||||
import google.registry.model.reporting.DomainTransactionRecord;
|
||||
|
@ -253,7 +253,7 @@ public class ExpandRecurringBillingEventsAction implements Runnable {
|
|||
final ImmutableSet<DateTime> billingTimes =
|
||||
getBillingTimesInScope(eventTimes, cursorTime, executeTime, tld);
|
||||
|
||||
VKey<DomainBase> domainKey = VKey.createSql(DomainBase.class, recurring.getDomainRepoId());
|
||||
VKey<Domain> domainKey = VKey.createSql(Domain.class, recurring.getDomainRepoId());
|
||||
Iterable<OneTime> oneTimesForDomain;
|
||||
oneTimesForDomain =
|
||||
tm().createQueryComposer(OneTime.class)
|
||||
|
|
|
@ -27,7 +27,7 @@ import com.google.common.collect.ImmutableSet;
|
|||
import com.google.common.flogger.FluentLogger;
|
||||
import com.google.common.net.MediaType;
|
||||
import google.registry.config.RegistryConfig.Config;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.RegistryLock;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.registrar.Registrar;
|
||||
|
@ -125,7 +125,7 @@ public class RelockDomainAction implements Runnable {
|
|||
|
||||
private void relockDomain() {
|
||||
RegistryLock oldLock = null;
|
||||
DomainBase domain;
|
||||
Domain domain;
|
||||
try {
|
||||
oldLock =
|
||||
RegistryLockDao.getByRevisionId(oldUnlockRevisionId)
|
||||
|
@ -134,7 +134,7 @@ public class RelockDomainAction implements Runnable {
|
|||
new IllegalArgumentException(
|
||||
String.format("Unknown revision ID %d", oldUnlockRevisionId)));
|
||||
domain =
|
||||
tm().loadByKey(VKey.create(DomainBase.class, oldLock.getRepoId()))
|
||||
tm().loadByKey(VKey.create(Domain.class, oldLock.getRepoId()))
|
||||
.cloneProjectedAtTime(tm().getTransactionTime());
|
||||
} catch (Throwable t) {
|
||||
handleTransientFailure(Optional.ofNullable(oldLock), t);
|
||||
|
@ -180,7 +180,7 @@ public class RelockDomainAction implements Runnable {
|
|||
}
|
||||
}
|
||||
|
||||
private void verifyDomainAndLockState(RegistryLock oldLock, DomainBase domain) {
|
||||
private void verifyDomainAndLockState(RegistryLock oldLock, Domain domain) {
|
||||
// Domain shouldn't be deleted or have a pending transfer/delete
|
||||
String domainName = domain.getDomainName();
|
||||
ImmutableSet<StatusValue> statusValues = domain.getStatusValues();
|
||||
|
|
|
@ -20,6 +20,7 @@ import dagger.Lazy;
|
|||
import google.registry.config.CredentialModule;
|
||||
import google.registry.config.RegistryConfig.Config;
|
||||
import google.registry.config.RegistryConfig.ConfigModule;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.persistence.PersistenceModule;
|
||||
import google.registry.persistence.PersistenceModule.BeamBulkQueryJpaTm;
|
||||
import google.registry.persistence.PersistenceModule.BeamJpaTm;
|
||||
|
@ -53,8 +54,7 @@ public interface RegistryPipelineComponent {
|
|||
|
||||
/**
|
||||
* Returns a {@link JpaTransactionManager} optimized for bulk loading multi-level JPA entities
|
||||
* ({@link google.registry.model.domain.DomainBase} and {@link
|
||||
* google.registry.model.domain.DomainHistory}). Please refer to {@link
|
||||
* ({@link Domain} and {@link google.registry.model.domain.DomainHistory}). Please refer to {@link
|
||||
* google.registry.model.bulkquery.BulkQueryEntities} for more information.
|
||||
*/
|
||||
@BeamBulkQueryJpaTm
|
||||
|
|
|
@ -47,7 +47,7 @@ import google.registry.gcs.GcsUtils;
|
|||
import google.registry.model.EppResource;
|
||||
import google.registry.model.contact.ContactHistory;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.host.HostHistory;
|
||||
import google.registry.model.host.HostResource;
|
||||
|
@ -132,7 +132,7 @@ import org.joda.time.DateTime;
|
|||
* that are soft-deleted by watermark. The history is emitted as pairs of (resource repo ID: history
|
||||
* revision ID) from the SQL query.
|
||||
*
|
||||
* <h3>{@link DomainBase}</h3>
|
||||
* <h3>{@link Domain}</h3>
|
||||
*
|
||||
* After the most recent (live) domain resources are loaded from the corresponding history objects,
|
||||
* we marshall them to deposit fragments and emit the (pending deposit: deposit fragment) pairs for
|
||||
|
@ -477,8 +477,8 @@ public class RdePipeline implements Serializable {
|
|||
public void processElement(
|
||||
@Element KV<String, Long> kv, MultiOutputReceiver receiver) {
|
||||
activeDomainCounter.inc();
|
||||
DomainBase domain =
|
||||
(DomainBase)
|
||||
Domain domain =
|
||||
(Domain)
|
||||
loadResourceByHistoryEntryId(
|
||||
DomainHistory.class, kv.getKey(), kv.getValue());
|
||||
pendingDeposits.stream()
|
||||
|
@ -654,8 +654,8 @@ public class RdePipeline implements Serializable {
|
|||
TypeDescriptor.of(DepositFragment.class)))
|
||||
.via(
|
||||
(KV<String, CoGbkResult> kv) -> {
|
||||
DomainBase superordinateDomain =
|
||||
(DomainBase)
|
||||
Domain superordinateDomain =
|
||||
(Domain)
|
||||
loadResourceByHistoryEntryId(
|
||||
DomainHistory.class,
|
||||
kv.getKey(),
|
||||
|
|
|
@ -23,7 +23,7 @@ import google.registry.beam.common.RegistryJpaIO;
|
|||
import google.registry.beam.common.RegistryJpaIO.Read;
|
||||
import google.registry.model.EppResource;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.persistence.PersistenceModule.TransactionIsolationLevel;
|
||||
import google.registry.persistence.transaction.CriteriaQueryBuilder;
|
||||
|
@ -51,7 +51,7 @@ import org.joda.time.DateTime;
|
|||
public class ResaveAllEppResourcesPipeline implements Serializable {
|
||||
|
||||
private static final ImmutableSet<Class<? extends EppResource>> EPP_RESOURCE_CLASSES =
|
||||
ImmutableSet.of(ContactResource.class, DomainBase.class, HostResource.class);
|
||||
ImmutableSet.of(ContactResource.class, Domain.class, HostResource.class);
|
||||
|
||||
/**
|
||||
* There exist three possible situations where we know we'll want to project domains to the
|
||||
|
@ -114,13 +114,13 @@ public class ResaveAllEppResourcesPipeline implements Serializable {
|
|||
* google.registry.model.domain.DomainContent#cloneProjectedAtTime(DateTime)}.
|
||||
*/
|
||||
private void fastResaveDomains(Pipeline pipeline) {
|
||||
Read<DomainBase, DomainBase> read =
|
||||
Read<Domain, Domain> read =
|
||||
RegistryJpaIO.read(
|
||||
DOMAINS_TO_PROJECT_QUERY,
|
||||
ImmutableMap.of("END_OF_TIME", DateTimeUtils.END_OF_TIME),
|
||||
DomainBase.class,
|
||||
Domain.class,
|
||||
d -> d);
|
||||
projectAndResaveResources(pipeline, DomainBase.class, read);
|
||||
projectAndResaveResources(pipeline, Domain.class, read);
|
||||
}
|
||||
|
||||
/** Projects all resources to the current time and saves them. */
|
||||
|
|
|
@ -26,7 +26,7 @@ import google.registry.beam.common.RegistryJpaIO;
|
|||
import google.registry.beam.common.RegistryJpaIO.Read;
|
||||
import google.registry.beam.spec11.SafeBrowsingTransforms.EvaluateSafeBrowsingFn;
|
||||
import google.registry.config.RegistryConfig.ConfigModule;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.reporting.Spec11ThreatMatch;
|
||||
import google.registry.model.reporting.Spec11ThreatMatch.ThreatType;
|
||||
import google.registry.persistence.PersistenceModule.TransactionIsolationLevel;
|
||||
|
@ -127,22 +127,21 @@ public class Spec11Pipeline implements Serializable {
|
|||
@ProcessElement
|
||||
public void processElement(
|
||||
@Element KV<String, String> input, OutputReceiver<DomainNameInfo> output) {
|
||||
DomainBase domainBase =
|
||||
Domain domain =
|
||||
jpaTm()
|
||||
.transact(
|
||||
() ->
|
||||
jpaTm()
|
||||
.loadByKey(
|
||||
VKey.createSql(DomainBase.class, input.getKey())));
|
||||
.loadByKey(VKey.createSql(Domain.class, input.getKey())));
|
||||
String emailAddress = input.getValue();
|
||||
if (emailAddress == null) {
|
||||
emailAddress = "";
|
||||
}
|
||||
DomainNameInfo domainNameInfo =
|
||||
DomainNameInfo.create(
|
||||
domainBase.getDomainName(),
|
||||
domainBase.getRepoId(),
|
||||
domainBase.getCurrentSponsorRegistrarId(),
|
||||
domain.getDomainName(),
|
||||
domain.getRepoId(),
|
||||
domain.getCurrentSponsorRegistrarId(),
|
||||
emailAddress);
|
||||
output.output(domainNameInfo);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ import google.registry.dns.DnsConstants.TargetType;
|
|||
import google.registry.model.EppResource;
|
||||
import google.registry.model.EppResource.ForeignKeyedEppResource;
|
||||
import google.registry.model.annotations.ExternalMessagingName;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.request.Action;
|
||||
import google.registry.request.HttpException.BadRequestException;
|
||||
|
@ -62,7 +62,7 @@ public final class RefreshDnsAction implements Runnable {
|
|||
}
|
||||
switch (type) {
|
||||
case DOMAIN:
|
||||
loadAndVerifyExistence(DomainBase.class, domainOrHostName);
|
||||
loadAndVerifyExistence(Domain.class, domainOrHostName);
|
||||
dnsQueue.addDomainRefreshTask(domainOrHostName);
|
||||
break;
|
||||
case HOST:
|
||||
|
|
|
@ -36,7 +36,7 @@ import google.registry.config.RegistryConfig.Config;
|
|||
import google.registry.dns.writer.BaseDnsWriter;
|
||||
import google.registry.dns.writer.DnsWriter;
|
||||
import google.registry.dns.writer.DnsWriterZone;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.tld.Registries;
|
||||
|
@ -121,13 +121,12 @@ public class CloudDnsWriter extends BaseDnsWriter {
|
|||
String absoluteDomainName = getAbsoluteHostName(domainName);
|
||||
|
||||
// Load the target domain. Note that it can be absent if this domain was just deleted.
|
||||
Optional<DomainBase> domainBase =
|
||||
loadByForeignKey(DomainBase.class, domainName, clock.nowUtc());
|
||||
Optional<Domain> domain = loadByForeignKey(Domain.class, domainName, clock.nowUtc());
|
||||
|
||||
// Return early if no DNS records should be published.
|
||||
// desiredRecordsBuilder is populated with an empty set to indicate that all existing records
|
||||
// should be deleted.
|
||||
if (!domainBase.isPresent() || !domainBase.get().shouldPublishToDns()) {
|
||||
if (!domain.isPresent() || !domain.get().shouldPublishToDns()) {
|
||||
desiredRecords.put(absoluteDomainName, ImmutableSet.of());
|
||||
return;
|
||||
}
|
||||
|
@ -135,7 +134,7 @@ public class CloudDnsWriter extends BaseDnsWriter {
|
|||
ImmutableSet.Builder<ResourceRecordSet> domainRecords = new ImmutableSet.Builder<>();
|
||||
|
||||
// Construct DS records (if any).
|
||||
Set<DelegationSignerData> dsData = domainBase.get().getDsData();
|
||||
Set<DelegationSignerData> dsData = domain.get().getDsData();
|
||||
if (!dsData.isEmpty()) {
|
||||
HashSet<String> dsRrData = new HashSet<>();
|
||||
for (DelegationSignerData ds : dsData) {
|
||||
|
@ -154,8 +153,8 @@ public class CloudDnsWriter extends BaseDnsWriter {
|
|||
}
|
||||
|
||||
// Construct NS records (if any).
|
||||
Set<String> nameserverData = domainBase.get().loadNameserverHostNames();
|
||||
Set<String> subordinateHosts = domainBase.get().getSubordinateHosts();
|
||||
Set<String> nameserverData = domain.get().loadNameserverHostNames();
|
||||
Set<String> subordinateHosts = domain.get().getSubordinateHosts();
|
||||
if (!nameserverData.isEmpty()) {
|
||||
HashSet<String> nsRrData = new HashSet<>();
|
||||
for (String hostName : nameserverData) {
|
||||
|
|
|
@ -27,7 +27,7 @@ import com.google.common.net.InternetDomainName;
|
|||
import google.registry.config.RegistryConfig.Config;
|
||||
import google.registry.dns.writer.BaseDnsWriter;
|
||||
import google.registry.dns.writer.DnsWriterZone;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.tld.Registries;
|
||||
|
@ -127,12 +127,11 @@ public class DnsUpdateWriter extends BaseDnsWriter {
|
|||
* this domain refresh request
|
||||
*/
|
||||
private void publishDomain(String domainName, String requestingHostName) {
|
||||
Optional<DomainBase> domainOptional =
|
||||
loadByForeignKey(DomainBase.class, domainName, clock.nowUtc());
|
||||
Optional<Domain> domainOptional = loadByForeignKey(Domain.class, domainName, clock.nowUtc());
|
||||
update.delete(toAbsoluteName(domainName), Type.ANY);
|
||||
// If the domain is now deleted, then don't update DNS for it.
|
||||
if (domainOptional.isPresent()) {
|
||||
DomainBase domain = domainOptional.get();
|
||||
Domain domain = domainOptional.get();
|
||||
// As long as the domain exists, orphan glues should be cleaned.
|
||||
deleteSubordinateHostAddressSet(domain, requestingHostName, update);
|
||||
if (domain.shouldPublishToDns()) {
|
||||
|
@ -184,7 +183,7 @@ public class DnsUpdateWriter extends BaseDnsWriter {
|
|||
}
|
||||
}
|
||||
|
||||
private RRset makeDelegationSignerSet(DomainBase domain) {
|
||||
private RRset makeDelegationSignerSet(Domain domain) {
|
||||
RRset signerSet = new RRset();
|
||||
for (DelegationSignerData signerData : domain.getDsData()) {
|
||||
DSRecord dsRecord =
|
||||
|
@ -202,7 +201,7 @@ public class DnsUpdateWriter extends BaseDnsWriter {
|
|||
}
|
||||
|
||||
private void deleteSubordinateHostAddressSet(
|
||||
DomainBase domain, String additionalHost, Update update) {
|
||||
Domain domain, String additionalHost, Update update) {
|
||||
for (String hostName :
|
||||
union(
|
||||
domain.getSubordinateHosts(),
|
||||
|
@ -213,7 +212,7 @@ public class DnsUpdateWriter extends BaseDnsWriter {
|
|||
}
|
||||
}
|
||||
|
||||
private void addInBailiwickNameServerSet(DomainBase domain, Update update) {
|
||||
private void addInBailiwickNameServerSet(Domain domain, Update update) {
|
||||
for (String hostName :
|
||||
intersection(domain.loadNameserverHostNames(), domain.getSubordinateHosts())) {
|
||||
Optional<HostResource> host = loadByForeignKey(HostResource.class, hostName, clock.nowUtc());
|
||||
|
@ -223,7 +222,7 @@ public class DnsUpdateWriter extends BaseDnsWriter {
|
|||
}
|
||||
}
|
||||
|
||||
private RRset makeNameServerSet(DomainBase domain) {
|
||||
private RRset makeNameServerSet(Domain domain) {
|
||||
RRset nameServerSet = new RRset();
|
||||
for (String hostName : domain.loadNameserverHostNames()) {
|
||||
NSRecord record =
|
||||
|
|
|
@ -6,22 +6,22 @@
|
|||
<property name="searchName" direction="asc"/>
|
||||
</datastore-index>
|
||||
<!-- For finding domain resources by registrar. -->
|
||||
<datastore-index kind="DomainBase" ancestor="false" source="manual">
|
||||
<datastore-index kind="Domain" ancestor="false" source="manual">
|
||||
<property name="currentSponsorClientId" direction="asc"/>
|
||||
<property name="deletionTime" direction="asc"/>
|
||||
</datastore-index>
|
||||
<!-- For finding domain resources by TLD. -->
|
||||
<datastore-index kind="DomainBase" ancestor="false" source="manual">
|
||||
<datastore-index kind="Domain" ancestor="false" source="manual">
|
||||
<property name="tld" direction="asc"/>
|
||||
<property name="deletionTime" direction="asc"/>
|
||||
</datastore-index>
|
||||
<!-- For finding domain resources by registrar. -->
|
||||
<datastore-index kind="DomainBase" ancestor="false" source="manual">
|
||||
<datastore-index kind="Domain" ancestor="false" source="manual">
|
||||
<property name="currentSponsorClientId" direction="asc"/>
|
||||
<property name="deletionTime" direction="asc"/>
|
||||
</datastore-index>
|
||||
<!-- For finding the most recently created domain resources. -->
|
||||
<datastore-index kind="DomainBase" ancestor="false" source="manual">
|
||||
<datastore-index kind="Domain" ancestor="false" source="manual">
|
||||
<property name="tld" direction="asc"/>
|
||||
<property name="creationTime" direction="desc"/>
|
||||
</datastore-index>
|
||||
|
@ -32,22 +32,22 @@
|
|||
<property name="fullyQualifiedHostName" direction="asc"/>
|
||||
</datastore-index>
|
||||
<!-- For determining the active domains linked to a given contact. -->
|
||||
<datastore-index kind="DomainBase" ancestor="false" source="manual">
|
||||
<datastore-index kind="Domain" ancestor="false" source="manual">
|
||||
<property name="allContacts.contact" direction="asc"/>
|
||||
<property name="deletionTime" direction="asc"/>
|
||||
</datastore-index>
|
||||
<!-- For determining the active domains linked to a given host. -->
|
||||
<datastore-index kind="DomainBase" ancestor="false" source="manual">
|
||||
<datastore-index kind="Domain" ancestor="false" source="manual">
|
||||
<property name="nsHosts" direction="asc"/>
|
||||
<property name="deletionTime" direction="asc"/>
|
||||
</datastore-index>
|
||||
<!-- For deleting expired not-previously-deleted domains. -->
|
||||
<datastore-index kind="DomainBase" ancestor="false" source="manual">
|
||||
<datastore-index kind="Domain" ancestor="false" source="manual">
|
||||
<property name="deletionTime" direction="asc"/>
|
||||
<property name="autorenewEndTime" direction="asc"/>
|
||||
</datastore-index>
|
||||
<!-- For RDAP searches by linked nameserver. -->
|
||||
<datastore-index kind="DomainBase" ancestor="false" source="manual">
|
||||
<datastore-index kind="Domain" ancestor="false" source="manual">
|
||||
<property name="nsHosts" direction="asc"/>
|
||||
<property name="deletionTime" direction="asc"/>
|
||||
</datastore-index>
|
||||
|
@ -74,16 +74,16 @@
|
|||
<property name="modificationTime" direction="asc"/>
|
||||
</datastore-index>
|
||||
<!-- For RDAP. -->
|
||||
<datastore-index kind="DomainBase" ancestor="false" source="manual">
|
||||
<datastore-index kind="Domain" ancestor="false" source="manual">
|
||||
<property name="currentSponsorClientId" direction="asc"/>
|
||||
<property name="fullyQualifiedDomainName" direction="asc"/>
|
||||
</datastore-index>
|
||||
<datastore-index kind="DomainBase" ancestor="false" source="manual">
|
||||
<datastore-index kind="Domain" ancestor="false" source="manual">
|
||||
<property name="currentSponsorClientId" direction="asc"/>
|
||||
<property name="tld" direction="asc"/>
|
||||
<property name="fullyQualifiedDomainName" direction="asc"/>
|
||||
</datastore-index>
|
||||
<datastore-index kind="DomainBase" ancestor="false" source="manual">
|
||||
<datastore-index kind="Domain" ancestor="false" source="manual">
|
||||
<property name="tld" direction="asc"/>
|
||||
<property name="fullyQualifiedDomainName" direction="asc"/>
|
||||
</datastore-index>
|
||||
|
|
|
@ -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.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.index.ForeignKeyIndex;
|
||||
import google.registry.model.tld.Registry;
|
||||
import google.registry.model.tld.label.ReservationType;
|
||||
|
@ -156,8 +156,7 @@ public class CheckApiAction implements Runnable {
|
|||
}
|
||||
|
||||
private boolean checkExists(String domainString, DateTime now) {
|
||||
return !ForeignKeyIndex.loadCached(DomainBase.class, ImmutableList.of(domainString), now)
|
||||
.isEmpty();
|
||||
return !ForeignKeyIndex.loadCached(Domain.class, ImmutableList.of(domainString), now).isEmpty();
|
||||
}
|
||||
|
||||
private Optional<String> checkReserved(InternetDomainName domainName) {
|
||||
|
|
|
@ -39,7 +39,7 @@ import google.registry.model.EppResource;
|
|||
import google.registry.model.EppResource.ForeignKeyedEppResource;
|
||||
import google.registry.model.EppResource.ResourceWithTransferData;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainContent;
|
||||
import google.registry.model.domain.Period;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
|
@ -147,7 +147,7 @@ public final class ResourceFlowUtils {
|
|||
}
|
||||
|
||||
/** Check that the given AuthInfo is either missing or else is valid for the given resource. */
|
||||
public static void verifyOptionalAuthInfo(Optional<AuthInfo> authInfo, DomainBase domain)
|
||||
public static void verifyOptionalAuthInfo(Optional<AuthInfo> authInfo, Domain domain)
|
||||
throws EppException {
|
||||
if (authInfo.isPresent()) {
|
||||
verifyAuthInfo(authInfo.get(), domain);
|
||||
|
@ -155,7 +155,7 @@ public final class ResourceFlowUtils {
|
|||
}
|
||||
|
||||
/** Check that the given {@link AuthInfo} is valid for the given domain. */
|
||||
public static void verifyAuthInfo(AuthInfo authInfo, DomainBase domain) throws EppException {
|
||||
public static void verifyAuthInfo(AuthInfo authInfo, Domain domain) throws EppException {
|
||||
final String authRepoId = authInfo.getPw().getRepoId();
|
||||
String authPassword = authInfo.getPw().getValue();
|
||||
if (authRepoId == null) {
|
||||
|
@ -246,7 +246,7 @@ public final class ResourceFlowUtils {
|
|||
if (period.getValue() == 0) {
|
||||
inAutoRenew = false;
|
||||
}
|
||||
return DomainBase.extendRegistrationWithCap(
|
||||
return Domain.extendRegistrationWithCap(
|
||||
approvalTime,
|
||||
domain.getRegistrationExpirationTime(),
|
||||
period.getValue() - (inAutoRenew ? 1 : 0));
|
||||
|
|
|
@ -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.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.eppinput.EppInput;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseData;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseExtension;
|
||||
|
@ -125,10 +125,9 @@ public class DomainCreateFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
public abstract static class BeforeSaveParameters extends ImmutableObject {
|
||||
|
||||
/**
|
||||
* The new {@link DomainBase} entity that is going to be persisted at the end of the
|
||||
* transaction.
|
||||
* The new {@link Domain} entity that is going to be persisted at the end of the transaction.
|
||||
*/
|
||||
public abstract DomainBase newDomain();
|
||||
public abstract Domain newDomain();
|
||||
|
||||
/**
|
||||
* The new {@link HistoryEntry} entity for the domain's creation that is going to be persisted
|
||||
|
@ -162,7 +161,7 @@ public class DomainCreateFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
@AutoValue.Builder
|
||||
public abstract static class Builder {
|
||||
|
||||
public abstract Builder setNewDomain(DomainBase newDomain);
|
||||
public abstract Builder setNewDomain(Domain 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.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
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 DomainBase existingDomain();
|
||||
public abstract Domain 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(DomainBase existingDomain);
|
||||
public abstract Builder setExistingDomain(Domain existingDomain);
|
||||
|
||||
public abstract AfterValidationParameters build();
|
||||
}
|
||||
|
@ -109,9 +109,9 @@ public class DomainDeleteFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
@AutoValue
|
||||
public abstract static class BeforeSaveParameters extends ImmutableObject {
|
||||
|
||||
public abstract DomainBase existingDomain();
|
||||
public abstract Domain existingDomain();
|
||||
|
||||
public abstract DomainBase newDomain();
|
||||
public abstract Domain 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(DomainBase existingDomain);
|
||||
public abstract Builder setExistingDomain(Domain existingDomain);
|
||||
|
||||
public abstract Builder setNewDomain(DomainBase newDomain);
|
||||
public abstract Builder setNewDomain(Domain 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.DomainInfoFlow;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainInfoData;
|
||||
import google.registry.model.eppinput.EppInput;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseExtension;
|
||||
|
@ -53,8 +53,8 @@ public class DomainInfoFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
/**
|
||||
* A hook that runs before the response is returned.
|
||||
*
|
||||
* <p>This takes the {@link DomainBase} and {@link ResponseExtension}s as input and returns
|
||||
* them, potentially with modifications.
|
||||
* <p>This takes the {@link Domain} and {@link ResponseExtension}s as input and returns them,
|
||||
* potentially with modifications.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public BeforeResponseReturnData beforeResponse(BeforeResponseParameters parameters)
|
||||
|
@ -69,7 +69,7 @@ public class DomainInfoFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
@AutoValue
|
||||
public abstract static class AfterValidationParameters extends ImmutableObject {
|
||||
|
||||
public abstract DomainBase domain();
|
||||
public abstract Domain 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(DomainBase domain);
|
||||
public abstract Builder setDomain(Domain domain);
|
||||
|
||||
public abstract AfterValidationParameters build();
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ public class DomainInfoFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
@AutoValue
|
||||
public abstract static class BeforeResponseParameters extends ImmutableObject {
|
||||
|
||||
public abstract DomainBase domain();
|
||||
public abstract Domain 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(DomainBase domain);
|
||||
public abstract Builder setDomain(Domain 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.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.eppinput.EppInput;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseData;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseExtension;
|
||||
|
@ -68,8 +68,8 @@ public class DomainRenewFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
/**
|
||||
* A hook that runs before the response is returned.
|
||||
*
|
||||
* <p>This takes the {@link DomainBase} and {@link ResponseExtension}s as input and returns
|
||||
* them, potentially with modifications.
|
||||
* <p>This takes the {@link Domain} and {@link ResponseExtension}s as input and returns them,
|
||||
* potentially with modifications.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public BeforeResponseReturnData beforeResponse(BeforeResponseParameters parameters)
|
||||
|
@ -84,7 +84,7 @@ public class DomainRenewFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
@AutoValue
|
||||
public abstract static class AfterValidationParameters extends ImmutableObject {
|
||||
|
||||
public abstract DomainBase existingDomain();
|
||||
public abstract Domain 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(DomainBase existingDomain);
|
||||
public abstract Builder setExistingDomain(Domain 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 DomainBase existingDomain();
|
||||
public abstract Domain existingDomain();
|
||||
|
||||
public abstract DomainBase newDomain();
|
||||
public abstract Domain 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(DomainBase existingDomain);
|
||||
public abstract Builder setExistingDomain(Domain existingDomain);
|
||||
|
||||
public abstract Builder setNewDomain(DomainBase newDomain);
|
||||
public abstract Builder setNewDomain(Domain 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 DomainBase domain();
|
||||
public abstract Domain 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(DomainBase domain);
|
||||
public abstract BeforeResponseParameters.Builder setDomain(Domain 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.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
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 DomainBase existingDomain();
|
||||
public abstract Domain 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(DomainBase existingDomain);
|
||||
public abstract Builder setExistingDomain(Domain existingDomain);
|
||||
|
||||
public abstract AfterValidationParameters build();
|
||||
}
|
||||
|
@ -91,9 +91,9 @@ public class DomainUpdateFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
@AutoValue
|
||||
public abstract static class BeforeSaveParameters extends ImmutableObject {
|
||||
|
||||
public abstract DomainBase existingDomain();
|
||||
public abstract Domain existingDomain();
|
||||
|
||||
public abstract DomainBase newDomain();
|
||||
public abstract Domain 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(DomainBase existingDomain);
|
||||
public abstract Builder setExistingDomain(Domain existingDomain);
|
||||
|
||||
public abstract Builder setNewDomain(DomainBase newDomain);
|
||||
public abstract Builder setNewDomain(Domain newDomain);
|
||||
|
||||
public abstract Builder setHistoryEntry(HistoryEntry historyEntry);
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ import google.registry.flows.domain.token.AllocationTokenDomainCheckResults;
|
|||
import google.registry.flows.domain.token.AllocationTokenFlowUtils;
|
||||
import google.registry.model.EppResource;
|
||||
import google.registry.model.billing.BillingEvent;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainCommand.Check;
|
||||
import google.registry.model.domain.fee.FeeCheckCommandExtension;
|
||||
import google.registry.model.domain.fee.FeeCheckCommandExtensionItem;
|
||||
|
@ -169,8 +169,8 @@ public final class DomainCheckFlow implements Flow {
|
|||
// TODO: Use as of date from fee extension v0.12 instead of now, if specified.
|
||||
.setAsOfDate(now)
|
||||
.build());
|
||||
ImmutableMap<String, ForeignKeyIndex<DomainBase>> existingDomains =
|
||||
ForeignKeyIndex.load(DomainBase.class, domainNames, now);
|
||||
ImmutableMap<String, ForeignKeyIndex<Domain>> existingDomains =
|
||||
ForeignKeyIndex.load(Domain.class, domainNames, now);
|
||||
Optional<AllocationTokenExtension> allocationTokenExtension =
|
||||
eppInput.getSingleExtension(AllocationTokenExtension.class);
|
||||
Optional<AllocationTokenDomainCheckResults> tokenDomainCheckResults =
|
||||
|
@ -227,7 +227,7 @@ public final class DomainCheckFlow implements Flow {
|
|||
|
||||
private Optional<String> getMessageForCheck(
|
||||
InternetDomainName domainName,
|
||||
ImmutableMap<String, ForeignKeyIndex<DomainBase>> existingDomains,
|
||||
ImmutableMap<String, ForeignKeyIndex<Domain>> existingDomains,
|
||||
ImmutableMap<InternetDomainName, String> tokenCheckResults,
|
||||
ImmutableMap<String, TldState> tldStates,
|
||||
Optional<AllocationToken> allocationToken) {
|
||||
|
@ -251,7 +251,7 @@ public final class DomainCheckFlow implements Flow {
|
|||
/** Handle the fee check extension. */
|
||||
private ImmutableList<? extends ResponseExtension> getResponseExtensions(
|
||||
ImmutableMap<String, InternetDomainName> domainNames,
|
||||
ImmutableMap<String, ForeignKeyIndex<DomainBase>> existingDomains,
|
||||
ImmutableMap<String, ForeignKeyIndex<Domain>> existingDomains,
|
||||
ImmutableSet<String> availableDomains,
|
||||
DateTime now,
|
||||
Optional<AllocationToken> allocationToken)
|
||||
|
@ -264,7 +264,7 @@ public final class DomainCheckFlow implements Flow {
|
|||
FeeCheckCommandExtension<?, ?> feeCheck = feeCheckOpt.get();
|
||||
ImmutableList.Builder<FeeCheckResponseExtensionItem> responseItems =
|
||||
new ImmutableList.Builder<>();
|
||||
ImmutableMap<String, DomainBase> domainObjs =
|
||||
ImmutableMap<String, Domain> domainObjs =
|
||||
loadDomainsForRestoreChecks(feeCheck, domainNames, existingDomains);
|
||||
ImmutableMap<String, BillingEvent.Recurring> recurrences =
|
||||
loadRecurrencesForDomains(domainObjs);
|
||||
|
@ -272,12 +272,12 @@ public final class DomainCheckFlow implements Flow {
|
|||
for (FeeCheckCommandExtensionItem feeCheckItem : feeCheck.getItems()) {
|
||||
for (String domainName : getDomainNamesToCheckForFee(feeCheckItem, domainNames.keySet())) {
|
||||
FeeCheckResponseExtensionItem.Builder<?> builder = feeCheckItem.createResponseBuilder();
|
||||
Optional<DomainBase> domainBase = Optional.ofNullable(domainObjs.get(domainName));
|
||||
Optional<Domain> domain = Optional.ofNullable(domainObjs.get(domainName));
|
||||
handleFeeRequest(
|
||||
feeCheckItem,
|
||||
builder,
|
||||
domainNames.get(domainName),
|
||||
domainBase,
|
||||
domain,
|
||||
feeCheck.getCurrency(),
|
||||
now,
|
||||
pricingLogic,
|
||||
|
@ -301,10 +301,10 @@ public final class DomainCheckFlow implements Flow {
|
|||
* nicer in Cloud SQL when we can SELECT just the fields we want rather than having to load the
|
||||
* entire entity.
|
||||
*/
|
||||
private ImmutableMap<String, DomainBase> loadDomainsForRestoreChecks(
|
||||
private ImmutableMap<String, Domain> loadDomainsForRestoreChecks(
|
||||
FeeCheckCommandExtension<?, ?> feeCheck,
|
||||
ImmutableMap<String, InternetDomainName> domainNames,
|
||||
ImmutableMap<String, ForeignKeyIndex<DomainBase>> existingDomains) {
|
||||
ImmutableMap<String, ForeignKeyIndex<Domain>> existingDomains) {
|
||||
ImmutableList<String> restoreCheckDomains;
|
||||
if (feeCheck instanceof FeeCheckCommandExtensionV06) {
|
||||
// The V06 fee extension supports specifying the command fees to check on a per-domain basis.
|
||||
|
@ -326,25 +326,25 @@ public final class DomainCheckFlow implements Flow {
|
|||
}
|
||||
|
||||
// Filter down to just domains we know exist and then use the EppResource cache to load them.
|
||||
ImmutableMap<String, VKey<DomainBase>> existingDomainsToLoad =
|
||||
ImmutableMap<String, VKey<Domain>> existingDomainsToLoad =
|
||||
restoreCheckDomains.stream()
|
||||
.filter(existingDomains::containsKey)
|
||||
.collect(toImmutableMap(d -> d, d -> existingDomains.get(d).getResourceKey()));
|
||||
ImmutableMap<VKey<? extends EppResource>, EppResource> loadedDomains =
|
||||
EppResource.loadCached(ImmutableList.copyOf(existingDomainsToLoad.values()));
|
||||
return ImmutableMap.copyOf(
|
||||
Maps.transformEntries(existingDomainsToLoad, (k, v) -> (DomainBase) loadedDomains.get(v)));
|
||||
Maps.transformEntries(existingDomainsToLoad, (k, v) -> (Domain) loadedDomains.get(v)));
|
||||
}
|
||||
|
||||
private ImmutableMap<String, BillingEvent.Recurring> loadRecurrencesForDomains(
|
||||
ImmutableMap<String, DomainBase> domainObjs) {
|
||||
ImmutableMap<String, Domain> domainObjs) {
|
||||
return tm().transact(
|
||||
() -> {
|
||||
ImmutableMap<VKey<? extends BillingEvent.Recurring>, BillingEvent.Recurring>
|
||||
recurrences =
|
||||
tm().loadByKeys(
|
||||
domainObjs.values().stream()
|
||||
.map(DomainBase::getAutorenewBillingEvent)
|
||||
.map(Domain::getAutorenewBillingEvent)
|
||||
.collect(toImmutableSet()));
|
||||
return ImmutableMap.copyOf(
|
||||
Maps.transformValues(
|
||||
|
|
|
@ -83,7 +83,7 @@ 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.billing.BillingEvent.RenewalPriceBehavior;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainCommand;
|
||||
import google.registry.model.domain.DomainCommand.Create;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
|
@ -247,7 +247,7 @@ public final class DomainCreateFlow implements TransactionalFlow {
|
|||
verifyUnitIsYears(period);
|
||||
int years = period.getValue();
|
||||
validateRegistrationPeriod(years);
|
||||
verifyResourceDoesNotExist(DomainBase.class, targetId, now, registrarId);
|
||||
verifyResourceDoesNotExist(Domain.class, targetId, now, registrarId);
|
||||
// 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);
|
||||
|
@ -368,8 +368,8 @@ public final class DomainCreateFlow implements TransactionalFlow {
|
|||
reservationTypes.contains(NAME_COLLISION)
|
||||
? ImmutableSet.of(SERVER_HOLD)
|
||||
: ImmutableSet.of();
|
||||
DomainBase domain =
|
||||
new DomainBase.Builder()
|
||||
Domain domain =
|
||||
new Domain.Builder()
|
||||
.setCreationRegistrarId(registrarId)
|
||||
.setPersistedCurrentSponsorRegistrarId(registrarId)
|
||||
.setRepoId(repoId)
|
||||
|
@ -530,7 +530,7 @@ public final class DomainCreateFlow implements TransactionalFlow {
|
|||
}
|
||||
|
||||
private DomainHistory buildDomainHistory(
|
||||
DomainBase domain, Registry registry, DateTime now, Period period, Duration addGracePeriod) {
|
||||
Domain domain, Registry registry, DateTime now, Period period, Duration addGracePeriod) {
|
||||
// We ignore prober transactions
|
||||
if (registry.getTldType() == TldType.REAL) {
|
||||
historyBuilder
|
||||
|
@ -645,13 +645,12 @@ public final class DomainCreateFlow implements TransactionalFlow {
|
|||
.build();
|
||||
}
|
||||
|
||||
private void enqueueTasks(
|
||||
DomainBase newDomain, boolean hasSignedMarks, boolean hasClaimsNotice) {
|
||||
private void enqueueTasks(Domain newDomain, boolean hasSignedMarks, boolean hasClaimsNotice) {
|
||||
if (newDomain.shouldPublishToDns()) {
|
||||
dnsQueue.addDomainRefreshTask(newDomain.getDomainName());
|
||||
}
|
||||
if (hasClaimsNotice || hasSignedMarks) {
|
||||
LordnTaskUtils.enqueueDomainBaseTask(newDomain);
|
||||
LordnTaskUtils.enqueueDomainTask(newDomain);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ 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.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.DomainHistory.DomainHistoryId;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
|
@ -146,13 +146,13 @@ public final class DomainDeleteFlow implements TransactionalFlow {
|
|||
extensionManager.validate();
|
||||
DateTime now = tm().getTransactionTime();
|
||||
// Loads the target resource if it exists
|
||||
DomainBase existingDomain = loadAndVerifyExistence(DomainBase.class, targetId, now);
|
||||
Domain existingDomain = loadAndVerifyExistence(Domain.class, targetId, now);
|
||||
Registry registry = Registry.get(existingDomain.getTld());
|
||||
verifyDeleteAllowed(existingDomain, registry, now);
|
||||
flowCustomLogic.afterValidation(
|
||||
AfterValidationParameters.newBuilder().setExistingDomain(existingDomain).build());
|
||||
ImmutableSet.Builder<ImmutableObject> entitiesToSave = new ImmutableSet.Builder<>();
|
||||
DomainBase.Builder builder;
|
||||
Domain.Builder builder;
|
||||
if (existingDomain.getStatusValues().contains(StatusValue.PENDING_TRANSFER)) {
|
||||
builder =
|
||||
denyPendingTransfer(existingDomain, TransferStatus.SERVER_CANCELLED, now, registrarId)
|
||||
|
@ -253,7 +253,7 @@ public final class DomainDeleteFlow implements TransactionalFlow {
|
|||
}
|
||||
builder.setRegistrationExpirationTime(newExpirationTime);
|
||||
|
||||
DomainBase newDomain = builder.build();
|
||||
Domain newDomain = builder.build();
|
||||
DomainHistory domainHistory =
|
||||
buildDomainHistory(newDomain, registry, now, durationUntilDelete, inAddGracePeriod);
|
||||
updateForeignKeyIndexDeletionTime(newDomain);
|
||||
|
@ -294,7 +294,7 @@ public final class DomainDeleteFlow implements TransactionalFlow {
|
|||
.build();
|
||||
}
|
||||
|
||||
private void verifyDeleteAllowed(DomainBase existingDomain, Registry registry, DateTime now)
|
||||
private void verifyDeleteAllowed(Domain existingDomain, Registry registry, DateTime now)
|
||||
throws EppException {
|
||||
verifyNoDisallowedStatuses(existingDomain, DISALLOWED_STATUSES);
|
||||
verifyOptionalAuthInfo(authInfo, existingDomain);
|
||||
|
@ -309,7 +309,7 @@ public final class DomainDeleteFlow implements TransactionalFlow {
|
|||
}
|
||||
|
||||
private DomainHistory buildDomainHistory(
|
||||
DomainBase domain,
|
||||
Domain domain,
|
||||
Registry registry,
|
||||
DateTime now,
|
||||
Duration durationUntilDelete,
|
||||
|
@ -342,7 +342,7 @@ public final class DomainDeleteFlow implements TransactionalFlow {
|
|||
}
|
||||
|
||||
private PollMessage.OneTime createDeletePollMessage(
|
||||
DomainBase existingDomain, Key<DomainHistory> domainHistoryKey, DateTime deletionTime) {
|
||||
Domain existingDomain, Key<DomainHistory> domainHistoryKey, DateTime deletionTime) {
|
||||
Optional<MetadataExtension> metadataExtension =
|
||||
eppInput.getSingleExtension(MetadataExtension.class);
|
||||
boolean hasMetadataMessage =
|
||||
|
@ -367,7 +367,7 @@ public final class DomainDeleteFlow implements TransactionalFlow {
|
|||
}
|
||||
|
||||
private PollMessage.OneTime createImmediateDeletePollMessage(
|
||||
DomainBase existingDomain,
|
||||
Domain existingDomain,
|
||||
Key<DomainHistory> domainHistoryKey,
|
||||
DateTime now,
|
||||
DateTime deletionTime) {
|
||||
|
@ -389,7 +389,7 @@ public final class DomainDeleteFlow implements TransactionalFlow {
|
|||
|
||||
@Nullable
|
||||
private ImmutableList<FeeTransformResponseExtension> getResponseExtensions(
|
||||
BillingEvent.Recurring recurringBillingEvent, DomainBase existingDomain, DateTime now) {
|
||||
BillingEvent.Recurring recurringBillingEvent, Domain existingDomain, DateTime now) {
|
||||
FeeTransformResponseExtension.Builder feeResponseBuilder = getDeleteResponseBuilder();
|
||||
if (feeResponseBuilder == null) {
|
||||
return ImmutableList.of();
|
||||
|
|
|
@ -25,7 +25,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.DomainBase.MAX_REGISTRATION_YEARS;
|
||||
import static google.registry.model.domain.Domain.MAX_REGISTRATION_YEARS;
|
||||
import static google.registry.model.tld.Registries.findTldForName;
|
||||
import static google.registry.model.tld.Registries.getTlds;
|
||||
import static google.registry.model.tld.Registry.TldState.GENERAL_AVAILABILITY;
|
||||
|
@ -82,7 +82,7 @@ import google.registry.model.billing.BillingEvent.Recurring;
|
|||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DesignatedContact;
|
||||
import google.registry.model.domain.DesignatedContact.Type;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainCommand.Create;
|
||||
import google.registry.model.domain.DomainCommand.CreateOrUpdate;
|
||||
import google.registry.model.domain.DomainCommand.InvalidReferencesException;
|
||||
|
@ -553,7 +553,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(DomainBase domain) {
|
||||
public static BillingEvent.Recurring.Builder newAutorenewBillingEvent(Domain domain) {
|
||||
return new BillingEvent.Recurring.Builder()
|
||||
.setReason(Reason.RENEW)
|
||||
.setFlags(ImmutableSet.of(Flag.AUTO_RENEW))
|
||||
|
@ -566,7 +566,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(DomainBase domain) {
|
||||
public static PollMessage.Autorenew.Builder newAutorenewPollMessage(Domain domain) {
|
||||
return new PollMessage.Autorenew.Builder()
|
||||
.setTargetId(domain.getDomainName())
|
||||
.setRegistrarId(domain.getCurrentSponsorRegistrarId())
|
||||
|
@ -583,7 +583,7 @@ public class DomainFlowUtils {
|
|||
*
|
||||
* <p>Returns the new autorenew recurring billing event.
|
||||
*/
|
||||
public static Recurring updateAutorenewRecurrenceEndTime(DomainBase domain, DateTime newEndTime) {
|
||||
public static Recurring updateAutorenewRecurrenceEndTime(Domain domain, DateTime newEndTime) {
|
||||
Optional<PollMessage.Autorenew> autorenewPollMessage =
|
||||
tm().loadByKeyIfPresent(domain.getAutorenewPollMessage());
|
||||
|
||||
|
@ -628,7 +628,7 @@ public class DomainFlowUtils {
|
|||
FeeQueryCommandExtensionItem feeRequest,
|
||||
FeeQueryResponseExtensionItem.Builder<?, ?> builder,
|
||||
InternetDomainName domainName,
|
||||
Optional<DomainBase> domain,
|
||||
Optional<Domain> domain,
|
||||
@Nullable CurrencyUnit topLevelCurrency,
|
||||
DateTime currentDate,
|
||||
DomainPricingLogic pricingLogic,
|
||||
|
@ -878,7 +878,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 DomainBase#MAX_REGISTRATION_YEARS}) from "now".
|
||||
* years (e.g. {@link Domain#MAX_REGISTRATION_YEARS}) from "now".
|
||||
*
|
||||
* @throws ExceedsMaxRegistrationYearsException if the new registration period is too long
|
||||
*/
|
||||
|
@ -891,7 +891,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 DomainBase#MAX_REGISTRATION_YEARS}).
|
||||
* years (e.g. {@link Domain#MAX_REGISTRATION_YEARS}).
|
||||
*
|
||||
* @throws ExceedsMaxRegistrationYearsException if the new registration period is too long
|
||||
*/
|
||||
|
@ -947,7 +947,7 @@ public class DomainFlowUtils {
|
|||
}
|
||||
|
||||
/** If a domain "clientUpdateProhibited" set, updates must clear it or fail. */
|
||||
static void verifyClientUpdateNotProhibited(Update command, DomainBase existingResource)
|
||||
static void verifyClientUpdateNotProhibited(Update command, Domain existingResource)
|
||||
throws ResourceHasClientUpdateProhibitedException {
|
||||
if (existingResource.getStatusValues().contains(StatusValue.CLIENT_UPDATE_PROHIBITED)
|
||||
&& !command
|
||||
|
@ -1120,13 +1120,13 @@ public class DomainFlowUtils {
|
|||
* the most recent HistoryEntry that fits the above criteria, with negated reportAmounts.
|
||||
*/
|
||||
static ImmutableSet<DomainTransactionRecord> createCancelingRecords(
|
||||
DomainBase domainBase,
|
||||
Domain domain,
|
||||
final DateTime now,
|
||||
Duration maxSearchPeriod,
|
||||
final ImmutableSet<TransactionReportField> cancelableFields) {
|
||||
|
||||
List<? extends HistoryEntry> recentHistoryEntries =
|
||||
findRecentHistoryEntries(domainBase, now, maxSearchPeriod);
|
||||
findRecentHistoryEntries(domain, now, maxSearchPeriod);
|
||||
Optional<? extends HistoryEntry> entryToCancel =
|
||||
Streams.findLast(
|
||||
recentHistoryEntries.stream()
|
||||
|
@ -1165,14 +1165,14 @@ public class DomainFlowUtils {
|
|||
}
|
||||
|
||||
private static List<? extends HistoryEntry> findRecentHistoryEntries(
|
||||
DomainBase domainBase, DateTime now, Duration maxSearchPeriod) {
|
||||
Domain domain, DateTime now, Duration maxSearchPeriod) {
|
||||
return jpaTm()
|
||||
.query(
|
||||
"FROM DomainHistory WHERE modificationTime >= :beginning AND domainRepoId = "
|
||||
+ ":repoId ORDER BY modificationTime ASC",
|
||||
DomainHistory.class)
|
||||
.setParameter("beginning", now.minus(maxSearchPeriod))
|
||||
.setParameter("repoId", domainBase.getRepoId())
|
||||
.setParameter("repoId", domain.getRepoId())
|
||||
.getResultList();
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ 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.Domain;
|
||||
import google.registry.model.domain.DomainCommand.Info;
|
||||
import google.registry.model.domain.DomainCommand.Info.HostsRequest;
|
||||
import google.registry.model.domain.DomainInfoData;
|
||||
|
@ -96,8 +96,8 @@ public final class DomainInfoFlow implements Flow {
|
|||
validateRegistrarIsLoggedIn(registrarId);
|
||||
extensionManager.validate();
|
||||
DateTime now = clock.nowUtc();
|
||||
DomainBase domain = verifyExistence(
|
||||
DomainBase.class, targetId, loadByForeignKey(DomainBase.class, targetId, now));
|
||||
Domain domain =
|
||||
verifyExistence(Domain.class, targetId, loadByForeignKey(Domain.class, targetId, now));
|
||||
verifyOptionalAuthInfo(authInfo, domain);
|
||||
flowCustomLogic.afterValidation(
|
||||
AfterValidationParameters.newBuilder().setDomain(domain).build());
|
||||
|
@ -142,8 +142,8 @@ public final class DomainInfoFlow implements Flow {
|
|||
.build();
|
||||
}
|
||||
|
||||
private ImmutableList<ResponseExtension> getDomainResponseExtensions(
|
||||
DomainBase domain, DateTime now) throws EppException {
|
||||
private ImmutableList<ResponseExtension> getDomainResponseExtensions(Domain domain, DateTime now)
|
||||
throws EppException {
|
||||
ImmutableList.Builder<ResponseExtension> extensions = new ImmutableList.Builder<>();
|
||||
addSecDnsExtensionIfPresent(extensions, domain.getDsData());
|
||||
ImmutableSet<GracePeriodStatus> gracePeriodStatuses = domain.getGracePeriodStatuses();
|
||||
|
|
|
@ -57,7 +57,7 @@ import google.registry.model.billing.BillingEvent;
|
|||
import google.registry.model.billing.BillingEvent.OneTime;
|
||||
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.Domain;
|
||||
import google.registry.model.domain.DomainCommand.Renew;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.DomainHistory.DomainHistoryId;
|
||||
|
@ -166,7 +166,7 @@ public final class DomainRenewFlow implements TransactionalFlow {
|
|||
DateTime now = tm().getTransactionTime();
|
||||
Renew command = (Renew) resourceCommand;
|
||||
// Loads the target resource if it exists
|
||||
DomainBase existingDomain = loadAndVerifyExistence(DomainBase.class, targetId, now);
|
||||
Domain existingDomain = loadAndVerifyExistence(Domain.class, targetId, now);
|
||||
Optional<AllocationToken> allocationToken =
|
||||
allocationTokenFlowUtils.verifyAllocationTokenIfPresent(
|
||||
existingDomain,
|
||||
|
@ -223,7 +223,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);
|
||||
DomainBase newDomain =
|
||||
Domain newDomain =
|
||||
existingDomain
|
||||
.asBuilder()
|
||||
.setLastEppUpdateTime(now)
|
||||
|
@ -275,7 +275,7 @@ public final class DomainRenewFlow implements TransactionalFlow {
|
|||
}
|
||||
|
||||
private DomainHistory buildDomainHistory(
|
||||
DomainBase newDomain, DateTime now, Period period, Duration renewGracePeriod) {
|
||||
Domain newDomain, DateTime now, Period period, Duration renewGracePeriod) {
|
||||
Optional<MetadataExtension> metadataExtensionOpt =
|
||||
eppInput.getSingleExtension(MetadataExtension.class);
|
||||
if (metadataExtensionOpt.isPresent()) {
|
||||
|
@ -299,10 +299,8 @@ public final class DomainRenewFlow implements TransactionalFlow {
|
|||
.build();
|
||||
}
|
||||
|
||||
private void verifyRenewAllowed(
|
||||
Optional<AuthInfo> authInfo,
|
||||
DomainBase existingDomain,
|
||||
Renew command) throws EppException {
|
||||
private void verifyRenewAllowed(Optional<AuthInfo> authInfo, Domain existingDomain, Renew command)
|
||||
throws EppException {
|
||||
verifyOptionalAuthInfo(authInfo, existingDomain);
|
||||
verifyNoDisallowedStatuses(existingDomain, RENEW_DISALLOWED_STATUSES);
|
||||
if (!isSuperuser) {
|
||||
|
|
|
@ -50,7 +50,7 @@ import google.registry.model.ImmutableObject;
|
|||
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.Domain;
|
||||
import google.registry.model.domain.DomainCommand.Update;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.DomainHistory.DomainHistoryId;
|
||||
|
@ -140,7 +140,7 @@ public final class DomainRestoreRequestFlow implements TransactionalFlow {
|
|||
extensionManager.validate();
|
||||
Update command = (Update) resourceCommand;
|
||||
DateTime now = tm().getTransactionTime();
|
||||
DomainBase existingDomain = loadAndVerifyExistence(DomainBase.class, targetId, now);
|
||||
Domain existingDomain = loadAndVerifyExistence(Domain.class, targetId, now);
|
||||
boolean isExpired = existingDomain.getRegistrationExpirationTime().isBefore(now);
|
||||
FeesAndCredits feesAndCredits =
|
||||
pricingLogic.getRestorePrice(
|
||||
|
@ -180,7 +180,7 @@ public final class DomainRestoreRequestFlow implements TransactionalFlow {
|
|||
new DomainHistoryId(
|
||||
domainHistoryKey.getParent().getName(), domainHistoryKey.getId()))
|
||||
.build();
|
||||
DomainBase newDomain =
|
||||
Domain newDomain =
|
||||
performRestore(
|
||||
existingDomain,
|
||||
newExpirationTime,
|
||||
|
@ -199,7 +199,7 @@ public final class DomainRestoreRequestFlow implements TransactionalFlow {
|
|||
.build();
|
||||
}
|
||||
|
||||
private DomainHistory buildDomainHistory(DomainBase newDomain, DateTime now) {
|
||||
private DomainHistory buildDomainHistory(Domain newDomain, DateTime now) {
|
||||
return historyBuilder
|
||||
.setType(DOMAIN_RESTORE)
|
||||
.setDomain(newDomain)
|
||||
|
@ -212,10 +212,11 @@ public final class DomainRestoreRequestFlow implements TransactionalFlow {
|
|||
|
||||
private void verifyRestoreAllowed(
|
||||
Update command,
|
||||
DomainBase existingDomain,
|
||||
Domain existingDomain,
|
||||
Optional<FeeUpdateCommandExtension> feeUpdate,
|
||||
FeesAndCredits feesAndCredits,
|
||||
DateTime now) throws EppException {
|
||||
DateTime now)
|
||||
throws EppException {
|
||||
verifyOptionalAuthInfo(authInfo, existingDomain);
|
||||
if (!isSuperuser) {
|
||||
verifyResourceOwnership(registrarId, existingDomain);
|
||||
|
@ -235,8 +236,8 @@ public final class DomainRestoreRequestFlow implements TransactionalFlow {
|
|||
validateFeeChallenge(targetId, now, feeUpdate, feesAndCredits);
|
||||
}
|
||||
|
||||
private static DomainBase performRestore(
|
||||
DomainBase existingDomain,
|
||||
private static Domain performRestore(
|
||||
Domain existingDomain,
|
||||
DateTime newExpirationTime,
|
||||
BillingEvent.Recurring autorenewEvent,
|
||||
PollMessage.Autorenew autorenewPollMessage,
|
||||
|
|
|
@ -49,7 +49,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.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.DomainHistory.DomainHistoryId;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
|
@ -100,7 +100,7 @@ public final class DomainTransferApproveFlow implements TransactionalFlow {
|
|||
|
||||
/**
|
||||
* The logic in this flow, which handles client approvals, very closely parallels the logic in
|
||||
* {@link DomainBase#cloneProjectedAtTime} which handles implicit server approvals.
|
||||
* {@link Domain#cloneProjectedAtTime} which handles implicit server approvals.
|
||||
*/
|
||||
@Override
|
||||
public EppResponse run() throws EppException {
|
||||
|
@ -108,7 +108,7 @@ public final class DomainTransferApproveFlow implements TransactionalFlow {
|
|||
validateRegistrarIsLoggedIn(registrarId);
|
||||
extensionManager.validate();
|
||||
DateTime now = tm().getTransactionTime();
|
||||
DomainBase existingDomain = loadAndVerifyExistence(DomainBase.class, targetId, now);
|
||||
Domain existingDomain = loadAndVerifyExistence(Domain.class, targetId, now);
|
||||
verifyOptionalAuthInfo(authInfo, existingDomain);
|
||||
verifyHasPendingTransfer(existingDomain);
|
||||
verifyResourceOwnership(registrarId, existingDomain);
|
||||
|
@ -190,9 +190,9 @@ public final class DomainTransferApproveFlow implements TransactionalFlow {
|
|||
domainHistoryKey.getParent().getName(), domainHistoryKey.getId()))
|
||||
.build();
|
||||
// Construct the post-transfer domain.
|
||||
DomainBase partiallyApprovedDomain =
|
||||
Domain partiallyApprovedDomain =
|
||||
approvePendingTransfer(existingDomain, TransferStatus.CLIENT_APPROVED, now);
|
||||
DomainBase newDomain =
|
||||
Domain newDomain =
|
||||
partiallyApprovedDomain
|
||||
.asBuilder()
|
||||
// Update the transferredRegistrationExpirationTime here since approvePendingTransfer()
|
||||
|
@ -246,7 +246,7 @@ public final class DomainTransferApproveFlow implements TransactionalFlow {
|
|||
}
|
||||
|
||||
private DomainHistory buildDomainHistory(
|
||||
DomainBase newDomain, Registry registry, DateTime now, String gainingRegistrarId) {
|
||||
Domain newDomain, Registry registry, DateTime now, String gainingRegistrarId) {
|
||||
ImmutableSet<DomainTransactionRecord> cancelingRecords =
|
||||
createCancelingRecords(
|
||||
newDomain,
|
||||
|
|
|
@ -40,7 +40,7 @@ import google.registry.flows.FlowModule.Superuser;
|
|||
import google.registry.flows.FlowModule.TargetId;
|
||||
import google.registry.flows.TransactionalFlow;
|
||||
import google.registry.flows.annotations.ReportingSpec;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.metadata.MetadataExtension;
|
||||
import google.registry.model.eppcommon.AuthInfo;
|
||||
|
@ -90,7 +90,7 @@ public final class DomainTransferCancelFlow implements TransactionalFlow {
|
|||
validateRegistrarIsLoggedIn(registrarId);
|
||||
extensionManager.validate();
|
||||
DateTime now = tm().getTransactionTime();
|
||||
DomainBase existingDomain = loadAndVerifyExistence(DomainBase.class, targetId, now);
|
||||
Domain existingDomain = loadAndVerifyExistence(Domain.class, targetId, now);
|
||||
verifyOptionalAuthInfo(authInfo, existingDomain);
|
||||
verifyHasPendingTransfer(existingDomain);
|
||||
verifyTransferInitiator(registrarId, existingDomain);
|
||||
|
@ -104,7 +104,7 @@ public final class DomainTransferCancelFlow implements TransactionalFlow {
|
|||
.setId(domainHistoryKey.getId())
|
||||
.setOtherRegistrarId(existingDomain.getTransferData().getLosingRegistrarId());
|
||||
|
||||
DomainBase newDomain =
|
||||
Domain newDomain =
|
||||
denyPendingTransfer(existingDomain, TransferStatus.CLIENT_CANCELLED, now, registrarId);
|
||||
DomainHistory domainHistory = buildDomainHistory(newDomain, registry, now);
|
||||
tm().putAll(
|
||||
|
@ -123,7 +123,7 @@ public final class DomainTransferCancelFlow implements TransactionalFlow {
|
|||
.build();
|
||||
}
|
||||
|
||||
private DomainHistory buildDomainHistory(DomainBase newDomain, Registry registry, DateTime now) {
|
||||
private DomainHistory buildDomainHistory(Domain newDomain, Registry registry, DateTime now) {
|
||||
ImmutableSet<DomainTransactionRecord> cancelingRecords =
|
||||
createCancelingRecords(
|
||||
newDomain,
|
||||
|
|
|
@ -28,7 +28,7 @@ import google.registry.flows.ResourceFlowUtils;
|
|||
import google.registry.flows.annotations.ReportingSpec;
|
||||
import google.registry.flows.exceptions.NoTransferHistoryToQueryException;
|
||||
import google.registry.flows.exceptions.NotAuthorizedToViewTransferException;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.eppcommon.AuthInfo;
|
||||
import google.registry.model.eppoutput.EppResponse;
|
||||
import google.registry.model.reporting.IcannReportingTypes.ActivityReportField;
|
||||
|
@ -71,7 +71,7 @@ public final class DomainTransferQueryFlow implements Flow {
|
|||
validateRegistrarIsLoggedIn(registrarId);
|
||||
extensionManager.validate(); // There are no legal extensions for this flow.
|
||||
DateTime now = clock.nowUtc();
|
||||
DomainBase domain = loadAndVerifyExistence(DomainBase.class, targetId, now);
|
||||
Domain domain = loadAndVerifyExistence(Domain.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).
|
||||
|
|
|
@ -42,7 +42,7 @@ import google.registry.flows.FlowModule.Superuser;
|
|||
import google.registry.flows.FlowModule.TargetId;
|
||||
import google.registry.flows.TransactionalFlow;
|
||||
import google.registry.flows.annotations.ReportingSpec;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.metadata.MetadataExtension;
|
||||
import google.registry.model.eppcommon.AuthInfo;
|
||||
|
@ -92,7 +92,7 @@ public final class DomainTransferRejectFlow implements TransactionalFlow {
|
|||
validateRegistrarIsLoggedIn(registrarId);
|
||||
extensionManager.validate();
|
||||
DateTime now = tm().getTransactionTime();
|
||||
DomainBase existingDomain = loadAndVerifyExistence(DomainBase.class, targetId, now);
|
||||
Domain existingDomain = loadAndVerifyExistence(Domain.class, targetId, now);
|
||||
Registry registry = Registry.get(existingDomain.getTld());
|
||||
Key<DomainHistory> domainHistoryKey = createHistoryKey(existingDomain, DomainHistory.class);
|
||||
historyBuilder
|
||||
|
@ -105,7 +105,7 @@ public final class DomainTransferRejectFlow implements TransactionalFlow {
|
|||
if (!isSuperuser) {
|
||||
checkAllowedAccessToTld(registrarId, existingDomain.getTld());
|
||||
}
|
||||
DomainBase newDomain =
|
||||
Domain newDomain =
|
||||
denyPendingTransfer(existingDomain, TransferStatus.CLIENT_REJECTED, now, registrarId);
|
||||
DomainHistory domainHistory = buildDomainHistory(newDomain, registry, now);
|
||||
tm().putAll(
|
||||
|
@ -124,7 +124,7 @@ public final class DomainTransferRejectFlow implements TransactionalFlow {
|
|||
.build();
|
||||
}
|
||||
|
||||
private DomainHistory buildDomainHistory(DomainBase newDomain, Registry registry, DateTime now) {
|
||||
private DomainHistory buildDomainHistory(Domain newDomain, Registry registry, DateTime now) {
|
||||
ImmutableSet<DomainTransactionRecord> cancelingRecords =
|
||||
createCancelingRecords(
|
||||
newDomain,
|
||||
|
|
|
@ -52,7 +52,7 @@ 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.Domain;
|
||||
import google.registry.model.domain.DomainCommand.Transfer;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.Period;
|
||||
|
@ -149,7 +149,7 @@ public final class DomainTransferRequestFlow implements TransactionalFlow {
|
|||
verifyRegistrarIsActive(gainingClientId);
|
||||
extensionManager.validate();
|
||||
DateTime now = tm().getTransactionTime();
|
||||
DomainBase existingDomain = loadAndVerifyExistence(DomainBase.class, targetId, now);
|
||||
Domain existingDomain = loadAndVerifyExistence(Domain.class, targetId, now);
|
||||
Optional<DomainTransferRequestSuperuserExtension> superuserExtension =
|
||||
eppInput.getSingleExtension(DomainTransferRequestSuperuserExtension.class);
|
||||
Period period =
|
||||
|
@ -190,7 +190,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.
|
||||
DomainBase domainAtTransferTime = existingDomain.cloneProjectedAtTime(automaticTransferTime);
|
||||
Domain domainAtTransferTime = existingDomain.cloneProjectedAtTime(automaticTransferTime);
|
||||
// The new expiration time if there is a server approval.
|
||||
DateTime serverApproveNewExpirationTime =
|
||||
computeExDateForApprovalTime(domainAtTransferTime, automaticTransferTime, period);
|
||||
|
@ -231,7 +231,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);
|
||||
DomainBase newDomain =
|
||||
Domain newDomain =
|
||||
existingDomain
|
||||
.asBuilder()
|
||||
.setTransferData(pendingTransferData)
|
||||
|
@ -255,7 +255,7 @@ public final class DomainTransferRequestFlow implements TransactionalFlow {
|
|||
}
|
||||
|
||||
private void verifyTransferAllowed(
|
||||
DomainBase existingDomain,
|
||||
Domain existingDomain,
|
||||
Period period,
|
||||
DateTime now,
|
||||
Optional<DomainTransferRequestSuperuserExtension> superuserExtension)
|
||||
|
@ -320,7 +320,7 @@ public final class DomainTransferRequestFlow implements TransactionalFlow {
|
|||
}
|
||||
|
||||
private DomainHistory buildDomainHistory(
|
||||
DomainBase newDomain, Registry registry, DateTime now, Period period) {
|
||||
Domain newDomain, Registry registry, DateTime now, Period period) {
|
||||
return historyBuilder
|
||||
.setType(DOMAIN_TRANSFER_REQUEST)
|
||||
.setPeriod(period)
|
||||
|
@ -337,7 +337,7 @@ public final class DomainTransferRequestFlow implements TransactionalFlow {
|
|||
}
|
||||
|
||||
private DomainTransferResponse createResponse(
|
||||
Period period, DomainBase existingDomain, DomainBase newDomain, DateTime now) {
|
||||
Period period, Domain existingDomain, Domain 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.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.DomainHistory.DomainHistoryId;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
|
@ -109,7 +109,7 @@ public final class DomainTransferUtils {
|
|||
DateTime automaticTransferTime,
|
||||
DateTime serverApproveNewExpirationTime,
|
||||
Key<DomainHistory> domainHistoryKey,
|
||||
DomainBase existingDomain,
|
||||
Domain existingDomain,
|
||||
Trid trid,
|
||||
String gainingRegistrarId,
|
||||
Optional<Money> transferCost,
|
||||
|
@ -276,10 +276,9 @@ public final class DomainTransferUtils {
|
|||
DateTime now,
|
||||
Key<DomainHistory> domainHistoryKey,
|
||||
String targetId,
|
||||
DomainBase existingDomain,
|
||||
Domain existingDomain,
|
||||
Optional<Money> transferCost) {
|
||||
DomainBase domainAtTransferTime =
|
||||
existingDomain.cloneProjectedAtTime(automaticTransferTime);
|
||||
Domain domainAtTransferTime = existingDomain.cloneProjectedAtTime(automaticTransferTime);
|
||||
GracePeriod autorenewGracePeriod =
|
||||
getOnlyElement(
|
||||
domainAtTransferTime.getGracePeriodsOfType(GracePeriodStatus.AUTO_RENEW), null);
|
||||
|
|
|
@ -67,7 +67,7 @@ import google.registry.model.ImmutableObject;
|
|||
import google.registry.model.billing.BillingEvent;
|
||||
import google.registry.model.billing.BillingEvent.Reason;
|
||||
import google.registry.model.domain.DesignatedContact;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainCommand.Update;
|
||||
import google.registry.model.domain.DomainCommand.Update.AddRemove;
|
||||
import google.registry.model.domain.DomainCommand.Update.Change;
|
||||
|
@ -173,11 +173,11 @@ public final class DomainUpdateFlow implements TransactionalFlow {
|
|||
extensionManager.validate();
|
||||
DateTime now = tm().getTransactionTime();
|
||||
Update command = cloneAndLinkReferences((Update) resourceCommand, now);
|
||||
DomainBase existingDomain = loadAndVerifyExistence(DomainBase.class, targetId, now);
|
||||
Domain existingDomain = loadAndVerifyExistence(Domain.class, targetId, now);
|
||||
verifyUpdateAllowed(command, existingDomain, now);
|
||||
flowCustomLogic.afterValidation(
|
||||
AfterValidationParameters.newBuilder().setExistingDomain(existingDomain).build());
|
||||
DomainBase newDomain = performUpdate(command, existingDomain, now);
|
||||
Domain newDomain = performUpdate(command, existingDomain, now);
|
||||
DomainHistory domainHistory =
|
||||
historyBuilder.setType(DOMAIN_UPDATE).setDomain(newDomain).build();
|
||||
validateNewState(newDomain);
|
||||
|
@ -204,7 +204,7 @@ public final class DomainUpdateFlow implements TransactionalFlow {
|
|||
}
|
||||
|
||||
/** Fail if the object doesn't exist or was deleted. */
|
||||
private void verifyUpdateAllowed(Update command, DomainBase existingDomain, DateTime now)
|
||||
private void verifyUpdateAllowed(Update command, Domain existingDomain, DateTime now)
|
||||
throws EppException {
|
||||
verifyOptionalAuthInfo(authInfo, existingDomain);
|
||||
AddRemove add = command.getInnerAdd();
|
||||
|
@ -233,8 +233,7 @@ public final class DomainUpdateFlow implements TransactionalFlow {
|
|||
tld, add.getNameserverFullyQualifiedHostNames());
|
||||
}
|
||||
|
||||
private DomainBase performUpdate(Update command, DomainBase domain, DateTime now)
|
||||
throws EppException {
|
||||
private Domain performUpdate(Update command, Domain domain, DateTime now) throws EppException {
|
||||
AddRemove add = command.getInnerAdd();
|
||||
AddRemove remove = command.getInnerRemove();
|
||||
checkSameValuesNotAddedAndRemoved(add.getNameservers(), remove.getNameservers());
|
||||
|
@ -251,7 +250,7 @@ public final class DomainUpdateFlow implements TransactionalFlow {
|
|||
Sets.union(Sets.difference(domain.getContacts(), remove.getContacts()), add.getContacts());
|
||||
validateNoDuplicateContacts(newContacts);
|
||||
|
||||
DomainBase.Builder domainBuilder =
|
||||
Domain.Builder domainBuilder =
|
||||
domain
|
||||
.asBuilder()
|
||||
// Handle the secDNS extension. As dsData in secDnsUpdate is read from EPP input and
|
||||
|
@ -293,7 +292,7 @@ public final class DomainUpdateFlow implements TransactionalFlow {
|
|||
}
|
||||
}
|
||||
|
||||
private void validateNewState(DomainBase newDomain) throws EppException {
|
||||
private void validateNewState(Domain newDomain) throws EppException {
|
||||
validateRequiredContactsPresent(newDomain.getRegistrant(), newDomain.getContacts());
|
||||
validateDsData(newDomain.getDsData());
|
||||
validateNameserversCountForTld(
|
||||
|
@ -304,7 +303,7 @@ 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(
|
||||
DomainBase existingDomain, DomainBase newDomain, DomainHistory historyEntry, DateTime now) {
|
||||
Domain existingDomain, Domain newDomain, DomainHistory historyEntry, DateTime now) {
|
||||
Optional<MetadataExtension> metadataExtension =
|
||||
eppInput.getSingleExtension(MetadataExtension.class);
|
||||
if (metadataExtension.isPresent() && metadataExtension.get().getRequestedByRegistrar()) {
|
||||
|
@ -330,7 +329,7 @@ public final class DomainUpdateFlow implements TransactionalFlow {
|
|||
|
||||
/** Enqueues a poll message iff a superuser is adding/removing server statuses. */
|
||||
private Optional<PollMessage.OneTime> createPollMessageForServerStatusUpdates(
|
||||
DomainBase existingDomain, DomainBase newDomain, DomainHistory historyEntry, DateTime now) {
|
||||
Domain existingDomain, Domain newDomain, DomainHistory historyEntry, DateTime now) {
|
||||
if (registrarId.equals(existingDomain.getPersistedCurrentSponsorRegistrarId())) {
|
||||
// Don't send a poll message when a superuser registrar is updating its own domain.
|
||||
return Optional.empty();
|
||||
|
|
|
@ -19,7 +19,7 @@ import com.google.common.collect.ImmutableMap;
|
|||
import com.google.common.collect.Maps;
|
||||
import com.google.common.net.InternetDomainName;
|
||||
import google.registry.flows.EppException;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainCommand;
|
||||
import google.registry.model.domain.token.AllocationToken;
|
||||
import google.registry.model.tld.Registry;
|
||||
|
@ -46,7 +46,7 @@ public class AllocationTokenCustomLogic {
|
|||
|
||||
/** Performs additional custom logic for validating a token on an existing domain. */
|
||||
public AllocationToken validateToken(
|
||||
DomainBase domain, AllocationToken token, Registry registry, String registrarId, DateTime now)
|
||||
Domain domain, AllocationToken token, Registry registry, String registrarId, DateTime now)
|
||||
throws EppException {
|
||||
// Do nothing.
|
||||
return token;
|
||||
|
|
|
@ -26,7 +26,7 @@ import google.registry.flows.EppException;
|
|||
import google.registry.flows.EppException.AssociationProhibitsOperationException;
|
||||
import google.registry.flows.EppException.AuthorizationErrorException;
|
||||
import google.registry.flows.EppException.StatusProhibitsOperationException;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainCommand;
|
||||
import google.registry.model.domain.token.AllocationToken;
|
||||
import google.registry.model.domain.token.AllocationToken.TokenStatus;
|
||||
|
@ -171,7 +171,7 @@ public class AllocationTokenFlowUtils {
|
|||
|
||||
/** Verifies and returns the allocation token if one is specified, otherwise does nothing. */
|
||||
public Optional<AllocationToken> verifyAllocationTokenIfPresent(
|
||||
DomainBase existingDomain,
|
||||
Domain existingDomain,
|
||||
Registry registry,
|
||||
String registrarId,
|
||||
DateTime now,
|
||||
|
|
|
@ -41,7 +41,7 @@ import google.registry.flows.annotations.ReportingSpec;
|
|||
import google.registry.flows.exceptions.ResourceAlreadyExistsForThisClientException;
|
||||
import google.registry.flows.exceptions.ResourceCreateContentionException;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.metadata.MetadataExtension;
|
||||
import google.registry.model.eppinput.ResourceCommand;
|
||||
import google.registry.model.eppoutput.CreateData.HostCreateData;
|
||||
|
@ -109,7 +109,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<DomainBase> superordinateDomain =
|
||||
Optional<Domain> superordinateDomain =
|
||||
lookupSuperordinateDomain(validateHostName(targetId), now);
|
||||
verifySuperordinateDomainNotInPendingDelete(superordinateDomain.orElse(null));
|
||||
verifySuperordinateDomainOwnership(registrarId, superordinateDomain.orElse(null));
|
||||
|
@ -128,7 +128,7 @@ public final class HostCreateFlow implements TransactionalFlow {
|
|||
.setHostName(targetId)
|
||||
.setInetAddresses(command.getInetAddresses())
|
||||
.setRepoId(createRepoId(allocateId(), roidSuffix))
|
||||
.setSuperordinateDomain(superordinateDomain.map(DomainBase::createVKey).orElse(null))
|
||||
.setSuperordinateDomain(superordinateDomain.map(Domain::createVKey).orElse(null))
|
||||
.build();
|
||||
historyBuilder.setType(HOST_CREATE).setHost(newHost);
|
||||
ImmutableSet<ImmutableObject> entitiesToSave =
|
||||
|
|
|
@ -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.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
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 DomainBase} this host is subordinate to, or null for external hosts. */
|
||||
public static Optional<DomainBase> lookupSuperordinateDomain(
|
||||
/** Return the {@link Domain} this host is subordinate to, or null for external hosts. */
|
||||
public static Optional<Domain> lookupSuperordinateDomain(
|
||||
InternetDomainName hostName, DateTime now) throws EppException {
|
||||
Optional<InternetDomainName> tld = findTldForName(hostName);
|
||||
if (!tld.isPresent()) {
|
||||
|
@ -90,8 +90,7 @@ public class HostFlowUtils {
|
|||
hostName.parts().stream()
|
||||
.skip(hostName.parts().size() - (tld.get().parts().size() + 1))
|
||||
.collect(joining("."));
|
||||
Optional<DomainBase> superordinateDomain =
|
||||
loadByForeignKey(DomainBase.class, domainName, now);
|
||||
Optional<Domain> superordinateDomain = loadByForeignKey(Domain.class, domainName, now);
|
||||
if (!superordinateDomain.isPresent() || !isActive(superordinateDomain.get(), now)) {
|
||||
throw new SuperordinateDomainDoesNotExistException(domainName);
|
||||
}
|
||||
|
@ -101,12 +100,12 @@ public class HostFlowUtils {
|
|||
/** Superordinate domain for this hostname does not exist. */
|
||||
static class SuperordinateDomainDoesNotExistException extends ObjectDoesNotExistException {
|
||||
public SuperordinateDomainDoesNotExistException(String domainName) {
|
||||
super(DomainBase.class, domainName);
|
||||
super(Domain.class, domainName);
|
||||
}
|
||||
}
|
||||
|
||||
/** Ensure that the superordinate domain is sponsored by the provided registrar ID. */
|
||||
static void verifySuperordinateDomainOwnership(String registrarId, DomainBase superordinateDomain)
|
||||
static void verifySuperordinateDomainOwnership(String registrarId, Domain superordinateDomain)
|
||||
throws EppException {
|
||||
if (superordinateDomain != null
|
||||
&& !registrarId.equals(superordinateDomain.getCurrentSponsorRegistrarId())) {
|
||||
|
@ -122,7 +121,7 @@ public class HostFlowUtils {
|
|||
}
|
||||
|
||||
/** Ensure that the superordinate domain is not in pending delete. */
|
||||
static void verifySuperordinateDomainNotInPendingDelete(DomainBase superordinateDomain)
|
||||
static void verifySuperordinateDomainNotInPendingDelete(Domain superordinateDomain)
|
||||
throws EppException {
|
||||
if ((superordinateDomain != null)
|
||||
&& superordinateDomain.getStatusValues().contains(StatusValue.PENDING_DELETE)) {
|
||||
|
|
|
@ -27,7 +27,7 @@ import google.registry.flows.Flow;
|
|||
import google.registry.flows.FlowModule.RegistrarId;
|
||||
import google.registry.flows.FlowModule.TargetId;
|
||||
import google.registry.flows.annotations.ReportingSpec;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.eppoutput.EppResponse;
|
||||
import google.registry.model.host.HostInfoData;
|
||||
|
@ -76,7 +76,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()) {
|
||||
DomainBase superordinateDomain =
|
||||
Domain superordinateDomain =
|
||||
tm().transact(
|
||||
() -> tm().loadByKey(host.getSuperordinateDomain()).cloneProjectedAtTime(now));
|
||||
hostInfoDataBuilder
|
||||
|
|
|
@ -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.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.metadata.MetadataExtension;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.eppinput.ResourceCommand;
|
||||
|
@ -137,12 +137,12 @@ public final class HostUpdateFlow implements TransactionalFlow {
|
|||
boolean isHostRename = suppliedNewHostName != null;
|
||||
String oldHostName = targetId;
|
||||
String newHostName = firstNonNull(suppliedNewHostName, oldHostName);
|
||||
DomainBase oldSuperordinateDomain =
|
||||
Domain oldSuperordinateDomain =
|
||||
existingHost.isSubordinate()
|
||||
? tm().loadByKey(existingHost.getSuperordinateDomain()).cloneProjectedAtTime(now)
|
||||
: null;
|
||||
// Note that lookupSuperordinateDomain calls cloneProjectedAtTime on the domain for us.
|
||||
Optional<DomainBase> newSuperordinateDomain =
|
||||
Optional<Domain> newSuperordinateDomain =
|
||||
lookupSuperordinateDomain(validateHostName(newHostName), now);
|
||||
verifySuperordinateDomainNotInPendingDelete(newSuperordinateDomain.orElse(null));
|
||||
EppResource owningResource = firstNonNull(oldSuperordinateDomain, existingHost);
|
||||
|
@ -155,8 +155,8 @@ public final class HostUpdateFlow implements TransactionalFlow {
|
|||
AddRemove remove = command.getInnerRemove();
|
||||
checkSameValuesNotAddedAndRemoved(add.getStatusValues(), remove.getStatusValues());
|
||||
checkSameValuesNotAddedAndRemoved(add.getInetAddresses(), remove.getInetAddresses());
|
||||
VKey<DomainBase> newSuperordinateDomainKey =
|
||||
newSuperordinateDomain.map(DomainBase::createVKey).orElse(null);
|
||||
VKey<Domain> newSuperordinateDomainKey =
|
||||
newSuperordinateDomain.map(Domain::createVKey).orElse(null);
|
||||
// If the superordinateDomain field is changing, set the lastSuperordinateChange to now.
|
||||
DateTime lastSuperordinateChange =
|
||||
Objects.equals(newSuperordinateDomainKey, existingHost.getSuperordinateDomain())
|
||||
|
@ -211,10 +211,10 @@ public final class HostUpdateFlow implements TransactionalFlow {
|
|||
private void verifyUpdateAllowed(
|
||||
Update command,
|
||||
HostResource existingHost,
|
||||
DomainBase newSuperordinateDomain,
|
||||
Domain newSuperordinateDomain,
|
||||
EppResource owningResource,
|
||||
boolean isHostRename)
|
||||
throws EppException {
|
||||
throws EppException {
|
||||
if (!isSuperuser) {
|
||||
// Verify that the host belongs to this registrar, either directly or because it is currently
|
||||
// subordinate to a domain owned by this registrar.
|
||||
|
|
|
@ -20,7 +20,7 @@ import google.registry.model.common.EntityGroupRoot;
|
|||
import google.registry.model.common.GaeUserIdConverter;
|
||||
import google.registry.model.contact.ContactHistory;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.token.AllocationToken;
|
||||
import google.registry.model.host.HostHistory;
|
||||
|
@ -45,7 +45,7 @@ public final class EntityClasses {
|
|||
AllocationToken.class,
|
||||
ContactHistory.class,
|
||||
ContactResource.class,
|
||||
DomainBase.class,
|
||||
Domain.class,
|
||||
DomainHistory.class,
|
||||
EntityGroupRoot.class,
|
||||
EppResourceIndex.class,
|
||||
|
|
|
@ -33,7 +33,7 @@ import google.registry.model.EppResource.BuilderWithTransferData;
|
|||
import google.registry.model.EppResource.ForeignKeyedEppResource;
|
||||
import google.registry.model.EppResource.ResourceWithTransferData;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.index.ForeignKeyIndex;
|
||||
|
@ -342,7 +342,7 @@ public final class EppResourceUtils {
|
|||
* @param now the logical time of the check
|
||||
* @param limit the maximum number of returned keys, unlimited if null
|
||||
*/
|
||||
public static ImmutableSet<VKey<DomainBase>> getLinkedDomainKeys(
|
||||
public static ImmutableSet<VKey<Domain>> getLinkedDomainKeys(
|
||||
VKey<? extends EppResource> key, DateTime now, @Nullable Integer limit) {
|
||||
checkArgument(
|
||||
key.getKind().equals(ContactResource.class) || key.getKind().equals(HostResource.class),
|
||||
|
@ -350,16 +350,16 @@ public final class EppResourceUtils {
|
|||
key);
|
||||
boolean isContactKey = key.getKind().equals(ContactResource.class);
|
||||
if (tm().isOfy()) {
|
||||
com.googlecode.objectify.cmd.Query<DomainBase> query =
|
||||
com.googlecode.objectify.cmd.Query<Domain> query =
|
||||
auditedOfy()
|
||||
.load()
|
||||
.type(DomainBase.class)
|
||||
.type(Domain.class)
|
||||
.filter(isContactKey ? "allContacts.contact" : "nsHosts", key.getOfyKey())
|
||||
.filter("deletionTime >", now);
|
||||
if (limit != null) {
|
||||
query.limit(limit);
|
||||
}
|
||||
return query.keys().list().stream().map(DomainBase::createVKey).collect(toImmutableSet());
|
||||
return query.keys().list().stream().map(Domain::createVKey).collect(toImmutableSet());
|
||||
} else {
|
||||
return tm().transact(
|
||||
() -> {
|
||||
|
@ -382,16 +382,15 @@ public final class EppResourceUtils {
|
|||
query.setMaxResults(limit);
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
ImmutableSet<VKey<DomainBase>> domainBaseKeySet =
|
||||
(ImmutableSet<VKey<DomainBase>>)
|
||||
ImmutableSet<VKey<Domain>> domainKeySet =
|
||||
(ImmutableSet<VKey<Domain>>)
|
||||
query
|
||||
.getResultStream()
|
||||
.map(
|
||||
repoId ->
|
||||
DomainBase.createVKey(
|
||||
Key.create(DomainBase.class, (String) repoId)))
|
||||
Domain.createVKey(Key.create(Domain.class, (String) repoId)))
|
||||
.collect(toImmutableSet());
|
||||
return domainBaseKeySet;
|
||||
return domainKeySet;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ import google.registry.model.EppResource.BuilderWithTransferData;
|
|||
import google.registry.model.EppResource.ForeignKeyedEppResource;
|
||||
import google.registry.model.EppResource.ResourceWithTransferData;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
import google.registry.model.index.ForeignKeyIndex;
|
||||
|
@ -101,7 +101,7 @@ public final class ResourceTransferUtils {
|
|||
}
|
||||
|
||||
private static void assertIsContactOrDomain(EppResource eppResource) {
|
||||
checkState(eppResource instanceof ContactResource || eppResource instanceof DomainBase);
|
||||
checkState(eppResource instanceof ContactResource || eppResource instanceof Domain);
|
||||
}
|
||||
|
||||
/** Update the relevant {@link ForeignKeyIndex} to cache the new deletion time. */
|
||||
|
|
|
@ -19,7 +19,7 @@ import static com.google.common.collect.ImmutableSet.toImmutableSet;
|
|||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainContent;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
|
@ -33,14 +33,14 @@ import google.registry.persistence.transaction.JpaTransactionManager;
|
|||
|
||||
/**
|
||||
* Utilities for managing an alternative JPA entity model optimized for bulk loading multi-level
|
||||
* entities such as {@link DomainBase} and {@link DomainHistory}.
|
||||
* entities such as {@link Domain} and {@link DomainHistory}.
|
||||
*
|
||||
* <p>In a bulk query for a multi-level JPA entity type, the JPA framework only generates a bulk
|
||||
* query (SELECT * FROM table) for the base table. Then, for each row in the base table, additional
|
||||
* queries are issued to load associated rows in child tables. This can be very slow when an entity
|
||||
* type has multiple child tables.
|
||||
*
|
||||
* <p>We have defined an alternative entity model for {@code DomainBase} and {@code DomainHistory},
|
||||
* <p>We have defined an alternative entity model for {@link Domain} and {@link DomainHistory},
|
||||
* where the base table as well as the child tables are mapped to single-level entity types. The
|
||||
* idea is to load each of these types using a bulk query, and assemble them into the target type in
|
||||
* memory in a pipeline. The main use case is Datastore-Cloud SQL validation during the Registry
|
||||
|
@ -53,8 +53,8 @@ public class BulkQueryEntities {
|
|||
*/
|
||||
public static final ImmutableMap<String, String> JPA_ENTITIES_REPLACEMENTS =
|
||||
ImmutableMap.of(
|
||||
DomainBase.class.getCanonicalName(),
|
||||
DomainBaseLite.class.getCanonicalName(),
|
||||
Domain.class.getCanonicalName(),
|
||||
DomainLite.class.getCanonicalName(),
|
||||
DomainHistory.class.getCanonicalName(),
|
||||
DomainHistoryLite.class.getCanonicalName());
|
||||
|
||||
|
@ -64,18 +64,18 @@ public class BulkQueryEntities {
|
|||
ImmutableList.of(
|
||||
DomainHost.class.getCanonicalName(), DomainHistoryHost.class.getCanonicalName());
|
||||
|
||||
public static DomainBase assembleDomainBase(
|
||||
DomainBaseLite domainBaseLite,
|
||||
public static Domain assembleDomain(
|
||||
DomainLite domainLite,
|
||||
ImmutableSet<GracePeriod> gracePeriods,
|
||||
ImmutableSet<DelegationSignerData> delegationSignerData,
|
||||
ImmutableSet<VKey<HostResource>> nsHosts) {
|
||||
DomainBase.Builder builder = new DomainBase.Builder();
|
||||
builder.copyFrom(domainBaseLite);
|
||||
Domain.Builder builder = new Domain.Builder();
|
||||
builder.copyFrom(domainLite);
|
||||
builder.setGracePeriods(gracePeriods);
|
||||
builder.setDsData(delegationSignerData);
|
||||
builder.setNameservers(nsHosts);
|
||||
// Restore the original update timestamp (this gets cleared when we set nameservers or DS data).
|
||||
builder.setUpdateTimestamp(domainBaseLite.getUpdateTimestamp());
|
||||
builder.setUpdateTimestamp(domainLite.getUpdateTimestamp());
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
package google.registry.model.bulkquery;
|
||||
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainContent;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.DomainHistory.DomainHistoryId;
|
||||
|
@ -49,7 +49,7 @@ import javax.persistence.PostLoad;
|
|||
@IdClass(DomainHistoryId.class)
|
||||
public class DomainHistoryLite extends HistoryEntry {
|
||||
|
||||
// Store DomainContent instead of DomainBase so we don't pick up its @Id
|
||||
// Store DomainContent instead of Domain so we don't pick up its @Id
|
||||
// Nullable for the sake of pre-Registry-3.0 history objects
|
||||
@Nullable DomainContent domainContent;
|
||||
|
||||
|
@ -64,7 +64,7 @@ public class DomainHistoryLite extends HistoryEntry {
|
|||
/** This method is private because it is only used by Hibernate. */
|
||||
@SuppressWarnings("unused")
|
||||
private void setDomainRepoId(String domainRepoId) {
|
||||
parent = Key.create(DomainBase.class, domainRepoId);
|
||||
parent = Key.create(Domain.class, domainRepoId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -101,9 +101,9 @@ public class DomainHistoryLite extends HistoryEntry {
|
|||
return super.getId();
|
||||
}
|
||||
|
||||
/** The key to the {@link DomainBase} this is based off of. */
|
||||
public VKey<DomainBase> getParentVKey() {
|
||||
return VKey.create(DomainBase.class, getDomainRepoId());
|
||||
/** The key to the {@link Domain} this is based off of. */
|
||||
public VKey<Domain> getParentVKey() {
|
||||
return VKey.create(Domain.class, getDomainRepoId());
|
||||
}
|
||||
|
||||
public DomainHistoryId getDomainHistoryId() {
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
package google.registry.model.bulkquery;
|
||||
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainContent;
|
||||
import google.registry.persistence.VKey;
|
||||
import google.registry.persistence.WithStringVKey;
|
||||
|
@ -23,17 +23,17 @@ import javax.persistence.AccessType;
|
|||
import javax.persistence.Entity;
|
||||
|
||||
/**
|
||||
* A 'light' version of {@link DomainBase} with only base table ("Domain") attributes, which allows
|
||||
* fast bulk loading. They are used in in-memory assembly of {@code DomainBase} instances along with
|
||||
* A 'light' version of {@link Domain} with only base table ("Domain") attributes, which allows fast
|
||||
* bulk loading. They are used in in-memory assembly of {@code Domain} instances along with
|
||||
* bulk-loaded child entities ({@code GracePeriod} etc). The in-memory assembly achieves much higher
|
||||
* performance than loading {@code DomainBase} directly.
|
||||
* performance than loading {@code Domain} directly.
|
||||
*
|
||||
* <p>Please refer to {@link BulkQueryEntities} for more information.
|
||||
*/
|
||||
@Entity(name = "Domain")
|
||||
@WithStringVKey
|
||||
@Access(AccessType.FIELD)
|
||||
public class DomainBaseLite extends DomainContent {
|
||||
public class DomainLite extends DomainContent {
|
||||
|
||||
@Override
|
||||
@javax.persistence.Id
|
||||
|
@ -42,7 +42,7 @@ public class DomainBaseLite extends DomainContent {
|
|||
return super.getRepoId();
|
||||
}
|
||||
|
||||
public static VKey<DomainBaseLite> createVKey(String repoId) {
|
||||
return VKey.createSql(DomainBaseLite.class, repoId);
|
||||
public static VKey<DomainLite> createVKey(String repoId) {
|
||||
return VKey.createSql(DomainLite.class, repoId);
|
||||
}
|
||||
}
|
|
@ -43,15 +43,11 @@ import org.joda.time.DateTime;
|
|||
/**
|
||||
* A persistable domain resource including mutable and non-mutable fields.
|
||||
*
|
||||
* <p>For historical reasons, the name of this entity is "DomainBase". Ideally it would be
|
||||
* "DomainResource" for linguistic parallelism with the other {@link EppResource} entity classes,
|
||||
* but that would necessitate a complex data migration which isn't worth it.
|
||||
*
|
||||
* @see <a href="https://tools.ietf.org/html/rfc5731">RFC 5731</a>
|
||||
*/
|
||||
@ReportedOn
|
||||
@com.googlecode.objectify.annotation.Entity
|
||||
@Entity(name = "Domain")
|
||||
@Entity
|
||||
@Table(
|
||||
name = "Domain",
|
||||
indexes = {
|
||||
|
@ -73,7 +69,7 @@ import org.joda.time.DateTime;
|
|||
@WithStringVKey
|
||||
@ExternalMessagingName("domain")
|
||||
@Access(AccessType.FIELD)
|
||||
public class DomainBase extends DomainContent implements ForeignKeyedEppResource {
|
||||
public class Domain extends DomainContent implements ForeignKeyedEppResource {
|
||||
|
||||
@Override
|
||||
@javax.persistence.Id
|
||||
|
@ -157,17 +153,17 @@ public class DomainBase extends DomainContent implements ForeignKeyedEppResource
|
|||
}
|
||||
|
||||
@Override
|
||||
public VKey<DomainBase> createVKey() {
|
||||
return VKey.create(DomainBase.class, getRepoId(), Key.create(this));
|
||||
public VKey<Domain> createVKey() {
|
||||
return VKey.create(Domain.class, getRepoId(), Key.create(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
public DomainBase cloneProjectedAtTime(final DateTime now) {
|
||||
public Domain cloneProjectedAtTime(final DateTime now) {
|
||||
return cloneDomainProjectedAtTime(this, now);
|
||||
}
|
||||
|
||||
public static VKey<DomainBase> createVKey(Key<DomainBase> key) {
|
||||
return VKey.create(DomainBase.class, key.getName(), key);
|
||||
public static VKey<Domain> createVKey(Key<Domain> key) {
|
||||
return VKey.create(Domain.class, key.getName(), key);
|
||||
}
|
||||
|
||||
/** An override of {@link EppResource#asBuilder} with tighter typing. */
|
||||
|
@ -176,12 +172,12 @@ public class DomainBase extends DomainContent implements ForeignKeyedEppResource
|
|||
return new Builder(clone(this));
|
||||
}
|
||||
|
||||
/** A builder for constructing {@link DomainBase}, since it is immutable. */
|
||||
public static class Builder extends DomainContent.Builder<DomainBase, Builder> {
|
||||
/** A builder for constructing {@link Domain}, since it is immutable. */
|
||||
public static class Builder extends DomainContent.Builder<Domain, Builder> {
|
||||
|
||||
public Builder() {}
|
||||
|
||||
Builder(DomainBase instance) {
|
||||
Builder(Domain instance) {
|
||||
super(instance);
|
||||
}
|
||||
|
|
@ -54,7 +54,7 @@ import javax.xml.bind.annotation.XmlValue;
|
|||
import org.joda.time.DateTime;
|
||||
import org.joda.time.LocalDate;
|
||||
|
||||
/** A collection of {@link DomainBase} commands. */
|
||||
/** A collection of {@link Domain} commands. */
|
||||
public class DomainCommand {
|
||||
|
||||
/** The default validity period (if not specified) is 1 year for all operations. */
|
||||
|
@ -72,7 +72,7 @@ public class DomainCommand {
|
|||
|
||||
/** The fields on "chgType" from <a href="http://tools.ietf.org/html/rfc5731">RFC5731</a>. */
|
||||
@XmlTransient
|
||||
public static class DomainCreateOrChange<B extends DomainBase.Builder> extends ImmutableObject
|
||||
public static class DomainCreateOrChange<B extends Domain.Builder> extends ImmutableObject
|
||||
implements ResourceCreateOrChange<B> {
|
||||
|
||||
/** The contactId of the registrant who registered this domain. */
|
||||
|
@ -100,7 +100,7 @@ public class DomainCommand {
|
|||
}
|
||||
|
||||
/**
|
||||
* A create command for a {@link DomainBase}, mapping "createType" from <a
|
||||
* A create command for a {@link Domain}, mapping "createType" from <a
|
||||
* href="http://tools.ietf.org/html/rfc5731">RFC5731</a>.
|
||||
*/
|
||||
@XmlRootElement
|
||||
|
@ -113,7 +113,7 @@ public class DomainCommand {
|
|||
"foreignKeyedDesignatedContacts",
|
||||
"authInfo"
|
||||
})
|
||||
public static class Create extends DomainCreateOrChange<DomainBase.Builder>
|
||||
public static class Create extends DomainCreateOrChange<Domain.Builder>
|
||||
implements CreateOrUpdate<Create> {
|
||||
|
||||
/** Fully qualified domain name, which serves as a unique identifier for this domain. */
|
||||
|
@ -196,11 +196,11 @@ public class DomainCommand {
|
|||
}
|
||||
}
|
||||
|
||||
/** A delete command for a {@link DomainBase}. */
|
||||
/** A delete command for a {@link Domain}. */
|
||||
@XmlRootElement
|
||||
public static class Delete extends AbstractSingleResourceCommand {}
|
||||
|
||||
/** An info request for a {@link DomainBase}. */
|
||||
/** An info request for a {@link Domain}. */
|
||||
@XmlRootElement
|
||||
public static class Info extends ImmutableObject implements SingleResourceCommand {
|
||||
|
||||
|
@ -259,11 +259,11 @@ public class DomainCommand {
|
|||
}
|
||||
}
|
||||
|
||||
/** A check request for {@link DomainBase}. */
|
||||
/** A check request for {@link Domain}. */
|
||||
@XmlRootElement
|
||||
public static class Check extends ResourceCheck {}
|
||||
|
||||
/** A renew command for a {@link DomainBase}. */
|
||||
/** A renew command for a {@link Domain}. */
|
||||
@XmlRootElement
|
||||
public static class Renew extends AbstractSingleResourceCommand {
|
||||
@XmlElement(name = "curExpDate")
|
||||
|
@ -281,7 +281,7 @@ public class DomainCommand {
|
|||
}
|
||||
}
|
||||
|
||||
/** A transfer operation for a {@link DomainBase}. */
|
||||
/** A transfer operation for a {@link Domain}. */
|
||||
@XmlRootElement
|
||||
public static class Transfer extends AbstractSingleResourceCommand {
|
||||
/** The period to extend this domain's registration upon completion of the transfer. */
|
||||
|
@ -300,11 +300,10 @@ public class DomainCommand {
|
|||
}
|
||||
}
|
||||
|
||||
/** An update to a {@link DomainBase}. */
|
||||
/** An update to a {@link Domain}. */
|
||||
@XmlRootElement
|
||||
@XmlType(propOrder = {"targetId", "innerAdd", "innerRemove", "innerChange"})
|
||||
public static class Update
|
||||
extends ResourceUpdate<Update.AddRemove, DomainBase.Builder, Update.Change>
|
||||
public static class Update extends ResourceUpdate<Update.AddRemove, Domain.Builder, Update.Change>
|
||||
implements CreateOrUpdate<Update> {
|
||||
|
||||
@XmlElement(name = "chg")
|
||||
|
@ -383,7 +382,7 @@ public class DomainCommand {
|
|||
|
||||
/** The inner change type on a domain update command. */
|
||||
@XmlType(propOrder = {"registrantContactId", "authInfo"})
|
||||
public static class Change extends DomainCreateOrChange<DomainBase.Builder> {
|
||||
public static class Change extends DomainCreateOrChange<Domain.Builder> {
|
||||
/** Creates a copy of this {@link Change} with hard links to hosts and contacts. */
|
||||
Change cloneAndLinkReferences(DateTime now) throws InvalidReferencesException {
|
||||
Change clone = clone(this);
|
||||
|
|
|
@ -91,11 +91,6 @@ import org.joda.time.Interval;
|
|||
* foreign-keyed fields can refer to the proper parent entity's ID, whether we're storing this in
|
||||
* the DB itself or as part of another entity.
|
||||
*
|
||||
* <p>For historical reasons, the name of this class is "DomainContent". Ideally it would be
|
||||
* "DomainBase" for parallelism with the other {@link EppResource} entity classes, but because that
|
||||
* name is already taken by {@link DomainBase} (also for historical reasons), we can't use it. Once
|
||||
* we are no longer on Datastore, we can rename the classes.
|
||||
*
|
||||
* @see <a href="https://tools.ietf.org/html/rfc5731">RFC 5731</a>
|
||||
*/
|
||||
@MappedSuperclass
|
||||
|
@ -294,7 +289,7 @@ public class DomainContent extends EppResource
|
|||
return Optional.ofNullable(dnsRefreshRequestTime);
|
||||
}
|
||||
|
||||
public static <T> VKey<T> restoreOfyFrom(Key<DomainBase> domainKey, VKey<T> key, Long historyId) {
|
||||
public static <T> VKey<T> restoreOfyFrom(Key<Domain> domainKey, VKey<T> key, Long historyId) {
|
||||
if (historyId == null) {
|
||||
// This is a legacy key (or a null key, in which case this works too)
|
||||
return VKey.restoreOfyFrom(key, EntityGroupRoot.class, "per-tld");
|
||||
|
@ -707,10 +702,10 @@ public class DomainContent extends EppResource
|
|||
}
|
||||
|
||||
@Override
|
||||
public VKey<DomainBase> createVKey() {
|
||||
public VKey<Domain> createVKey() {
|
||||
throw new UnsupportedOperationException(
|
||||
"DomainContent is not an actual persisted entity you can create a key to;"
|
||||
+ " use DomainBase instead");
|
||||
+ " use Domain instead");
|
||||
}
|
||||
|
||||
/** Predicate to determine if a given {@link DesignatedContact} is the registrant. */
|
||||
|
@ -723,7 +718,7 @@ public class DomainContent extends EppResource
|
|||
return new Builder<>(clone(this));
|
||||
}
|
||||
|
||||
/** A builder for constructing {@link DomainBase}, since it is immutable. */
|
||||
/** A builder for constructing {@link Domain}, since it is immutable. */
|
||||
public static class Builder<T extends DomainContent, B extends Builder<T, B>>
|
||||
extends EppResource.Builder<T, B> implements BuilderWithTransferData<DomainTransferData, B> {
|
||||
|
||||
|
@ -740,7 +735,7 @@ public class DomainContent extends EppResource
|
|||
if (DomainTransferData.EMPTY.equals(getInstance().transferData)) {
|
||||
setTransferData(null);
|
||||
}
|
||||
// A DomainBase has status INACTIVE if there are no nameservers.
|
||||
// A Domain has status INACTIVE if there are no nameservers.
|
||||
if (getInstance().getNameservers().isEmpty()) {
|
||||
addStatusValue(StatusValue.INACTIVE);
|
||||
} else { // There are nameservers, so make sure INACTIVE isn't there.
|
||||
|
|
|
@ -80,7 +80,7 @@ import org.hibernate.Hibernate;
|
|||
@IdClass(DomainHistoryId.class)
|
||||
public class DomainHistory extends HistoryEntry {
|
||||
|
||||
// Store DomainContent instead of DomainBase so we don't pick up its @Id
|
||||
// Store DomainContent instead of Domain so we don't pick up its @Id
|
||||
// Nullable for the sake of pre-Registry-3.0 history objects
|
||||
@DoNotCompare @Nullable DomainContent domainContent;
|
||||
|
||||
|
@ -95,7 +95,7 @@ public class DomainHistory extends HistoryEntry {
|
|||
/** This method is private because it is only used by Hibernate. */
|
||||
@SuppressWarnings("unused")
|
||||
private void setDomainRepoId(String domainRepoId) {
|
||||
parent = Key.create(DomainBase.class, domainRepoId);
|
||||
parent = Key.create(Domain.class, domainRepoId);
|
||||
}
|
||||
|
||||
// We could have reused domainContent.nsHosts here, but Hibernate throws a weird exception after
|
||||
|
@ -241,9 +241,9 @@ public class DomainHistory extends HistoryEntry {
|
|||
return Optional.ofNullable(domainContent);
|
||||
}
|
||||
|
||||
/** The key to the {@link DomainBase} this is based off of. */
|
||||
public VKey<DomainBase> getParentVKey() {
|
||||
return VKey.create(DomainBase.class, getDomainRepoId());
|
||||
/** The key to the {@link Domain} this is based off of. */
|
||||
public VKey<Domain> getParentVKey() {
|
||||
return VKey.create(Domain.class, getDomainRepoId());
|
||||
}
|
||||
|
||||
public Set<GracePeriodHistory> getGracePeriodHistories() {
|
||||
|
@ -260,7 +260,7 @@ public class DomainHistory extends HistoryEntry {
|
|||
@Override
|
||||
public Optional<? extends EppResource> getResourceAtPointInTime() {
|
||||
return getDomainContent()
|
||||
.map(domainContent -> new DomainBase.Builder().copyFrom(domainContent).build());
|
||||
.map(domainContent -> new Domain.Builder().copyFrom(domainContent).build());
|
||||
}
|
||||
|
||||
@PostLoad
|
||||
|
@ -377,20 +377,20 @@ public class DomainHistory extends HistoryEntry {
|
|||
if (domainContent == null) {
|
||||
return this;
|
||||
}
|
||||
// TODO(b/203609982): if actual type of domainContent is DomainBase, convert to DomainContent
|
||||
// Note: a DomainHistory fetched by JPA has DomainContent in this field. Allowing DomainBase
|
||||
// TODO(b/203609982): if actual type of domainContent is Domain, convert to DomainContent
|
||||
// Note: a DomainHistory fetched by JPA has DomainContent in this field. Allowing Domain
|
||||
// in the setter makes equality checks messy.
|
||||
getInstance().domainContent = domainContent;
|
||||
if (domainContent instanceof DomainBase) {
|
||||
if (domainContent instanceof Domain) {
|
||||
super.setParent(domainContent);
|
||||
} else {
|
||||
super.setParent(Key.create(DomainBase.class, domainContent.getRepoId()));
|
||||
super.setParent(Key.create(Domain.class, domainContent.getRepoId()));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setDomainRepoId(String domainRepoId) {
|
||||
getInstance().parent = Key.create(DomainBase.class, domainRepoId);
|
||||
getInstance().parent = Key.create(Domain.class, domainRepoId);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -37,8 +37,8 @@ import org.joda.time.DateTime;
|
|||
/**
|
||||
* A domain grace period with an expiration time.
|
||||
*
|
||||
* <p>When a grace period expires, it is lazily removed from the {@link DomainBase} the next time
|
||||
* the resource is loaded from Datastore.
|
||||
* <p>When a grace period expires, it is lazily removed from the {@link Domain} the next time the
|
||||
* resource is loaded from Datastore.
|
||||
*/
|
||||
@Embed
|
||||
@Entity
|
||||
|
|
|
@ -22,7 +22,7 @@ import com.google.common.collect.ImmutableSet;
|
|||
import google.registry.model.EppResource;
|
||||
import google.registry.model.contact.ContactBase;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainContent;
|
||||
import google.registry.model.host.HostBase;
|
||||
import google.registry.model.host.HostResource;
|
||||
|
@ -133,11 +133,11 @@ public enum StatusValue implements EppEnum {
|
|||
ContactBase.class,
|
||||
ContactResource.class,
|
||||
DomainContent.class,
|
||||
DomainBase.class,
|
||||
Domain.class,
|
||||
HostBase.class,
|
||||
HostResource.class),
|
||||
NONE,
|
||||
DOMAINS(DomainContent.class, DomainBase.class);
|
||||
DOMAINS(DomainContent.class, Domain.class);
|
||||
|
||||
private final ImmutableSet<Class<? extends EppResource>> classes;
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ import com.googlecode.objectify.annotation.IgnoreSave;
|
|||
import com.googlecode.objectify.annotation.Index;
|
||||
import com.googlecode.objectify.condition.IfNull;
|
||||
import google.registry.model.EppResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.transfer.TransferData;
|
||||
import google.registry.persistence.VKey;
|
||||
import java.net.InetAddress;
|
||||
|
@ -76,7 +76,7 @@ public class HostBase extends EppResource {
|
|||
@Index
|
||||
@IgnoreSave(IfNull.class)
|
||||
@DoNotHydrate
|
||||
VKey<DomainBase> superordinateDomain;
|
||||
VKey<Domain> superordinateDomain;
|
||||
|
||||
/**
|
||||
* The time that this resource was last transferred.
|
||||
|
@ -98,7 +98,7 @@ public class HostBase extends EppResource {
|
|||
return fullyQualifiedHostName;
|
||||
}
|
||||
|
||||
public VKey<DomainBase> getSuperordinateDomain() {
|
||||
public VKey<Domain> getSuperordinateDomain() {
|
||||
return superordinateDomain;
|
||||
}
|
||||
|
||||
|
@ -155,7 +155,7 @@ public class HostBase extends EppResource {
|
|||
* {@link #superordinateDomain} field. Passing it as a parameter allows the caller to control
|
||||
* the degree of consistency used to load it.
|
||||
*/
|
||||
public DateTime computeLastTransferTime(@Nullable DomainBase superordinateDomain) {
|
||||
public DateTime computeLastTransferTime(@Nullable Domain superordinateDomain) {
|
||||
if (!isSubordinate()) {
|
||||
checkArgument(superordinateDomain == null);
|
||||
return getLastTransferTime();
|
||||
|
@ -222,7 +222,7 @@ public class HostBase extends EppResource {
|
|||
ImmutableSet.copyOf(difference(getInstance().getInetAddresses(), inetAddresses)));
|
||||
}
|
||||
|
||||
public B setSuperordinateDomain(VKey<DomainBase> superordinateDomain) {
|
||||
public B setSuperordinateDomain(VKey<Domain> superordinateDomain) {
|
||||
getInstance().superordinateDomain = superordinateDomain;
|
||||
return thisCastToDerived();
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ import google.registry.model.EppResource;
|
|||
import google.registry.model.annotations.DeleteAfterMigration;
|
||||
import google.registry.model.annotations.ReportedOn;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.persistence.VKey;
|
||||
import google.registry.persistence.transaction.CriteriaQueryBuilder;
|
||||
|
@ -75,10 +75,10 @@ public abstract class ForeignKeyIndex<E extends EppResource> extends BackupGroup
|
|||
@Entity
|
||||
public static class ForeignKeyContactIndex extends ForeignKeyIndex<ContactResource> {}
|
||||
|
||||
/** The {@link ForeignKeyIndex} type for {@link DomainBase} entities. */
|
||||
/** The {@link ForeignKeyIndex} type for {@link Domain} entities. */
|
||||
@ReportedOn
|
||||
@Entity
|
||||
public static class ForeignKeyDomainIndex extends ForeignKeyIndex<DomainBase> {}
|
||||
public static class ForeignKeyDomainIndex extends ForeignKeyIndex<Domain> {}
|
||||
|
||||
/** The {@link ForeignKeyIndex} type for {@link HostResource} entities. */
|
||||
@ReportedOn
|
||||
|
@ -90,14 +90,14 @@ public abstract class ForeignKeyIndex<E extends EppResource> extends BackupGroup
|
|||
RESOURCE_CLASS_TO_FKI_CLASS =
|
||||
ImmutableBiMap.of(
|
||||
ContactResource.class, ForeignKeyContactIndex.class,
|
||||
DomainBase.class, ForeignKeyDomainIndex.class,
|
||||
Domain.class, ForeignKeyDomainIndex.class,
|
||||
HostResource.class, ForeignKeyHostIndex.class);
|
||||
|
||||
private static final ImmutableMap<Class<? extends EppResource>, String>
|
||||
RESOURCE_CLASS_TO_FKI_PROPERTY =
|
||||
ImmutableMap.of(
|
||||
ContactResource.class, "contactId",
|
||||
DomainBase.class, "fullyQualifiedDomainName",
|
||||
Domain.class, "fullyQualifiedDomainName",
|
||||
HostResource.class, "fullyQualifiedHostName");
|
||||
|
||||
@Id String foreignKey;
|
||||
|
|
|
@ -33,7 +33,7 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
|||
* via Objectify.
|
||||
*
|
||||
* <p>All first class entities are represented as a resource class - {@link
|
||||
* google.registry.model.domain.DomainBase}, {@link google.registry.model.host.HostResource}, {@link
|
||||
* google.registry.model.domain.Domain}, {@link google.registry.model.host.HostResource}, {@link
|
||||
* google.registry.model.contact.ContactResource}, and {@link
|
||||
* google.registry.model.registrar.Registrar}. Resource objects are written in a single shared
|
||||
* entity group per TLD. All commands that operate on those entities are grouped in a "Command"
|
||||
|
|
|
@ -35,7 +35,7 @@ import google.registry.model.annotations.ReportedOn;
|
|||
import google.registry.model.contact.ContactHistory;
|
||||
import google.registry.model.contact.ContactHistory.ContactHistoryId;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.DomainHistory.DomainHistoryId;
|
||||
import google.registry.model.domain.DomainRenewData;
|
||||
|
@ -103,7 +103,7 @@ public abstract class PollMessage extends ImmutableObject
|
|||
|
||||
/** Indicates the type of entity the poll message is for. */
|
||||
public enum Type {
|
||||
DOMAIN(1L, DomainBase.class),
|
||||
DOMAIN(1L, Domain.class),
|
||||
CONTACT(2L, ContactResource.class),
|
||||
HOST(3L, HostResource.class);
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ import google.registry.model.contact.ContactBase;
|
|||
import google.registry.model.contact.ContactHistory;
|
||||
import google.registry.model.contact.ContactHistory.ContactHistoryId;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainContent;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.DomainHistory.DomainHistoryId;
|
||||
|
@ -386,7 +386,7 @@ public class HistoryEntry extends ImmutableObject implements Buildable, UnsafeSe
|
|||
String parentKind = getParent().getKind();
|
||||
final HistoryEntry resultEntity;
|
||||
// can't use a switch statement since we're calling getKind()
|
||||
if (parentKind.equals(getKind(DomainBase.class))) {
|
||||
if (parentKind.equals(getKind(Domain.class))) {
|
||||
resultEntity =
|
||||
new DomainHistory.Builder().copyFrom(this).setDomainRepoId(parent.getName()).build();
|
||||
} else if (parentKind.equals(getKind(HostResource.class))) {
|
||||
|
@ -408,7 +408,7 @@ public class HistoryEntry extends ImmutableObject implements Buildable, UnsafeSe
|
|||
long id = key.getId();
|
||||
Key<EppResource> parent = key.getParent();
|
||||
String parentKind = parent.getKind();
|
||||
if (parentKind.equals(getKind(DomainBase.class))) {
|
||||
if (parentKind.equals(getKind(Domain.class))) {
|
||||
return VKey.create(
|
||||
DomainHistory.class,
|
||||
new DomainHistoryId(repoId, id),
|
||||
|
|
|
@ -27,7 +27,7 @@ import com.google.common.collect.Streams;
|
|||
import google.registry.model.EppResource;
|
||||
import google.registry.model.contact.ContactHistory;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.host.HostHistory;
|
||||
import google.registry.model.host.HostResource;
|
||||
|
@ -53,7 +53,7 @@ public class HistoryEntryDao {
|
|||
ImmutableMap.of(
|
||||
ContactResource.class,
|
||||
ContactHistory.class,
|
||||
DomainBase.class,
|
||||
Domain.class,
|
||||
DomainHistory.class,
|
||||
HostResource.class,
|
||||
HostHistory.class);
|
||||
|
|
|
@ -17,16 +17,16 @@ package google.registry.persistence;
|
|||
import static google.registry.util.PreconditionsUtils.checkArgumentNotNull;
|
||||
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.DomainHistory.DomainHistoryId;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import java.io.Serializable;
|
||||
import javax.persistence.Embeddable;
|
||||
|
||||
/** {@link VKey} for {@link HistoryEntry} which parent is {@link DomainBase}. */
|
||||
/** {@link VKey} for {@link HistoryEntry} which parent is {@link Domain}. */
|
||||
@Embeddable
|
||||
public class DomainHistoryVKey extends EppHistoryVKey<HistoryEntry, DomainBase> {
|
||||
public class DomainHistoryVKey extends EppHistoryVKey<HistoryEntry, Domain> {
|
||||
|
||||
// Hibernate requires a default constructor
|
||||
private DomainHistoryVKey() {}
|
||||
|
@ -52,6 +52,6 @@ public class DomainHistoryVKey extends EppHistoryVKey<HistoryEntry, DomainBase>
|
|||
return VKey.create(
|
||||
DomainHistory.class,
|
||||
createSqlKey(),
|
||||
Key.create(Key.create(DomainBase.class, repoId), DomainHistory.class, historyRevisionId));
|
||||
Key.create(Key.create(Domain.class, repoId), DomainHistory.class, historyRevisionId));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ public abstract class EppHistoryVKey<K, E extends EppResource> extends Immutable
|
|||
* Creates the kind path for the given ofyKey}.
|
||||
*
|
||||
* <p>The kind path is a string including all kind names(delimited by slash) of a hierarchical
|
||||
* {@link Key}, e.g., the kind path for BillingEvent.OneTime is "DomainBase/HistoryEntry/OneTime".
|
||||
* {@link Key}, e.g., the kind path for BillingEvent.OneTime is "Domain/HistoryEntry/OneTime".
|
||||
*/
|
||||
@Nullable
|
||||
public static String createKindPath(@Nullable Key<?> ofyKey) {
|
||||
|
|
|
@ -177,10 +177,10 @@ public class VKey<T> extends ImmutableObject implements Serializable {
|
|||
* kind of the ancestor key and the value is either a String or a Long.
|
||||
*
|
||||
* <p>For example, to restore the objectify key for
|
||||
* DomainBase("COM-1234")/HistoryEntry(123)/PollEvent(567), one might use:
|
||||
* Domain("COM-1234")/HistoryEntry(123)/PollEvent(567), one might use:
|
||||
*
|
||||
* <pre>{@code
|
||||
* pollEvent.restoreOfy(DomainBase.class, "COM-1234", HistoryEntry.class, 567)
|
||||
* pollEvent.restoreOfy(Domain.class, "COM-1234", HistoryEntry.class, 567)
|
||||
* }</pre>
|
||||
*
|
||||
* <p>The final key id or name is obtained from the SQL key. It is assumed that this value must be
|
||||
|
|
|
@ -21,7 +21,7 @@ import static google.registry.request.Action.Method.HEAD;
|
|||
import static google.registry.util.DateTimeUtils.START_OF_TIME;
|
||||
|
||||
import google.registry.flows.EppException;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.rdap.RdapJsonFormatter.OutputDataType;
|
||||
import google.registry.rdap.RdapMetrics.EndpointType;
|
||||
import google.registry.rdap.RdapObjectClasses.RdapDomain;
|
||||
|
@ -59,12 +59,12 @@ public class RdapDomainAction extends RdapActionBase {
|
|||
pathSearchString, getHumanReadableObjectTypeName(), e.getMessage()));
|
||||
}
|
||||
// The query string is not used; the RDAP syntax is /rdap/domain/mydomain.com.
|
||||
Optional<DomainBase> domainBase =
|
||||
Optional<Domain> domain =
|
||||
loadByForeignKey(
|
||||
DomainBase.class,
|
||||
Domain.class,
|
||||
pathSearchString,
|
||||
shouldIncludeDeleted() ? START_OF_TIME : rdapJsonFormatter.getRequestTime());
|
||||
if (!domainBase.isPresent() || !isAuthorized(domainBase.get())) {
|
||||
if (!domain.isPresent() || !isAuthorized(domain.get())) {
|
||||
// RFC7480 5.3 - if the server wishes to respond that it doesn't have data satisfying the
|
||||
// query, it MUST reply with 404 response code.
|
||||
//
|
||||
|
@ -72,6 +72,6 @@ public class RdapDomainAction extends RdapActionBase {
|
|||
// exists but we don't want to show it to you", because we DON'T wish to say that.
|
||||
throw new NotFoundException(pathSearchString + " not found");
|
||||
}
|
||||
return rdapJsonFormatter.createRdapDomain(domainBase.get(), OutputDataType.FULL);
|
||||
return rdapJsonFormatter.createRdapDomain(domain.get(), OutputDataType.FULL);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ import com.google.common.flogger.FluentLogger;
|
|||
import com.google.common.net.InetAddresses;
|
||||
import com.google.common.primitives.Booleans;
|
||||
import com.googlecode.objectify.cmd.Query;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.persistence.VKey;
|
||||
import google.registry.persistence.transaction.CriteriaQueryBuilder;
|
||||
|
@ -187,10 +187,10 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
|
|||
/** Searches for domains by domain name without a wildcard or interest in deleted entries. */
|
||||
private DomainSearchResponse searchByDomainNameWithoutWildcard(
|
||||
final RdapSearchPattern partialStringQuery) {
|
||||
Optional<DomainBase> domainBase =
|
||||
loadByForeignKey(DomainBase.class, partialStringQuery.getInitialString(), getRequestTime());
|
||||
Optional<Domain> domain =
|
||||
loadByForeignKey(Domain.class, partialStringQuery.getInitialString(), getRequestTime());
|
||||
return makeSearchResults(
|
||||
shouldBeVisible(domainBase) ? ImmutableList.of(domainBase.get()) : ImmutableList.of());
|
||||
shouldBeVisible(domain) ? ImmutableList.of(domain.get()) : ImmutableList.of());
|
||||
}
|
||||
|
||||
/** Searches for domains by domain name with an initial string, wildcard and possible suffix. */
|
||||
|
@ -206,12 +206,12 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
|
|||
// domains directly, rather than the foreign keys, because then we have an index on TLD if we
|
||||
// need it.
|
||||
int querySizeLimit = RESULT_SET_SIZE_SCALING_FACTOR * rdapResultSetMaxSize;
|
||||
RdapResultSet<DomainBase> resultSet;
|
||||
RdapResultSet<Domain> resultSet;
|
||||
if (tm().isOfy()) {
|
||||
Query<DomainBase> query =
|
||||
Query<Domain> query =
|
||||
auditedOfy()
|
||||
.load()
|
||||
.type(DomainBase.class)
|
||||
.type(Domain.class)
|
||||
.filter("fullyQualifiedDomainName <", partialStringQuery.getNextInitialString())
|
||||
.filter("fullyQualifiedDomainName >=", partialStringQuery.getInitialString());
|
||||
if (cursorString.isPresent()) {
|
||||
|
@ -230,8 +230,8 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
|
|||
() -> {
|
||||
CriteriaBuilder criteriaBuilder =
|
||||
replicaJpaTm().getEntityManager().getCriteriaBuilder();
|
||||
CriteriaQueryBuilder<DomainBase> queryBuilder =
|
||||
CriteriaQueryBuilder.create(replicaJpaTm(), DomainBase.class)
|
||||
CriteriaQueryBuilder<Domain> queryBuilder =
|
||||
CriteriaQueryBuilder.create(replicaJpaTm(), Domain.class)
|
||||
.where(
|
||||
"fullyQualifiedDomainName",
|
||||
criteriaBuilder::like,
|
||||
|
@ -262,9 +262,9 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
|
|||
// searchByDomainNameWithInitialString, unable to perform an inequality query on deletion time.
|
||||
// Don't use queryItems, because it doesn't handle pending deletes.
|
||||
int querySizeLimit = RESULT_SET_SIZE_SCALING_FACTOR * rdapResultSetMaxSize;
|
||||
RdapResultSet<DomainBase> resultSet;
|
||||
RdapResultSet<Domain> resultSet;
|
||||
if (tm().isOfy()) {
|
||||
Query<DomainBase> query = auditedOfy().load().type(DomainBase.class).filter("tld", tld);
|
||||
Query<Domain> query = auditedOfy().load().type(Domain.class).filter("tld", tld);
|
||||
if (cursorString.isPresent()) {
|
||||
query = query.filter("fullyQualifiedDomainName >", cursorString.get());
|
||||
}
|
||||
|
@ -275,9 +275,9 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
|
|||
replicaJpaTm()
|
||||
.transact(
|
||||
() -> {
|
||||
CriteriaQueryBuilder<DomainBase> builder =
|
||||
CriteriaQueryBuilder<Domain> builder =
|
||||
queryItemsSql(
|
||||
DomainBase.class,
|
||||
Domain.class,
|
||||
"tld",
|
||||
tld,
|
||||
Optional.of("fullyQualifiedDomainName"),
|
||||
|
@ -414,9 +414,9 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
|
|||
// The suffix must be a domain that we manage. That way, we can look up the domain and search
|
||||
// through the subordinate hosts. This is more efficient, and lets us permit wildcard searches
|
||||
// with no initial string.
|
||||
DomainBase domainBase =
|
||||
Domain domain =
|
||||
loadByForeignKey(
|
||||
DomainBase.class,
|
||||
Domain.class,
|
||||
partialStringQuery.getSuffix(),
|
||||
shouldIncludeDeleted() ? START_OF_TIME : getRequestTime())
|
||||
.orElseThrow(
|
||||
|
@ -426,7 +426,7 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
|
|||
+ "must be a domain defined in the system"));
|
||||
Optional<String> desiredRegistrar = getDesiredRegistrar();
|
||||
ImmutableList.Builder<VKey<HostResource>> builder = new ImmutableList.Builder<>();
|
||||
for (String fqhn : ImmutableSortedSet.copyOf(domainBase.getSubordinateHosts())) {
|
||||
for (String fqhn : ImmutableSortedSet.copyOf(domain.getSubordinateHosts())) {
|
||||
// We can't just check that the host name starts with the initial query string, because
|
||||
// then the query ns.exam*.example.com would match against nameserver ns.example.com.
|
||||
if (partialStringQuery.matches(fqhn)) {
|
||||
|
@ -542,19 +542,19 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
|
|||
// We must break the query up into chunks, because the in operator is limited to 30 subqueries.
|
||||
// Since it is possible for the same domain to show up more than once in our result list (if
|
||||
// we do a wildcard nameserver search that returns multiple nameservers used by the same
|
||||
// domain), we must create a set of resulting {@link DomainBase} objects. Use a sorted set,
|
||||
// domain), we must create a set of resulting {@link Domain} objects. Use a sorted set,
|
||||
// and fetch all domains, to make sure that we can return the first domains in alphabetical
|
||||
// order.
|
||||
ImmutableSortedSet.Builder<DomainBase> domainSetBuilder =
|
||||
ImmutableSortedSet.orderedBy(Comparator.comparing(DomainBase::getDomainName));
|
||||
ImmutableSortedSet.Builder<Domain> domainSetBuilder =
|
||||
ImmutableSortedSet.orderedBy(Comparator.comparing(Domain::getDomainName));
|
||||
int numHostKeysSearched = 0;
|
||||
for (List<VKey<HostResource>> chunk : Iterables.partition(hostKeys, 30)) {
|
||||
numHostKeysSearched += chunk.size();
|
||||
if (tm().isOfy()) {
|
||||
Query<DomainBase> query =
|
||||
Query<Domain> query =
|
||||
auditedOfy()
|
||||
.load()
|
||||
.type(DomainBase.class)
|
||||
.type(Domain.class)
|
||||
.filter(
|
||||
"nsHosts in", chunk.stream().map(VKey::getOfyKey).collect(toImmutableSet()));
|
||||
if (!shouldIncludeDeleted()) {
|
||||
|
@ -564,7 +564,7 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
|
|||
} else if (cursorString.isPresent()) {
|
||||
query = query.filter("fullyQualifiedDomainName >", cursorString.get());
|
||||
}
|
||||
Stream<DomainBase> stream = Streams.stream(query).filter(this::isAuthorized);
|
||||
Stream<Domain> stream = Streams.stream(query).filter(this::isAuthorized);
|
||||
if (cursorString.isPresent()) {
|
||||
stream =
|
||||
stream.filter(domain -> (domain.getDomainName().compareTo(cursorString.get()) > 0));
|
||||
|
@ -575,8 +575,8 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
|
|||
.transact(
|
||||
() -> {
|
||||
for (VKey<HostResource> hostKey : hostKeys) {
|
||||
CriteriaQueryBuilder<DomainBase> queryBuilder =
|
||||
CriteriaQueryBuilder.create(replicaJpaTm(), DomainBase.class)
|
||||
CriteriaQueryBuilder<Domain> queryBuilder =
|
||||
CriteriaQueryBuilder.create(replicaJpaTm(), Domain.class)
|
||||
.whereFieldContains("nsHosts", hostKey)
|
||||
.orderByAsc("fullyQualifiedDomainName");
|
||||
CriteriaBuilder criteriaBuilder =
|
||||
|
@ -606,7 +606,7 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
|
|||
});
|
||||
}
|
||||
}
|
||||
List<DomainBase> domains = domainSetBuilder.build().asList();
|
||||
List<Domain> domains = domainSetBuilder.build().asList();
|
||||
metricInformationBuilder.setNumHostsRetrieved(numHostKeysSearched);
|
||||
// If everything that we found will fit in the result, check whether there might have been
|
||||
// more results that got dropped because the first stage limit on number of nameservers. If
|
||||
|
@ -620,13 +620,13 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
|
|||
}
|
||||
|
||||
/** Output JSON for a list of domains, with no incompleteness warnings. */
|
||||
private DomainSearchResponse makeSearchResults(List<DomainBase> domains) {
|
||||
private DomainSearchResponse makeSearchResults(List<Domain> domains) {
|
||||
return makeSearchResults(
|
||||
domains, IncompletenessWarningType.COMPLETE, Optional.of((long) domains.size()));
|
||||
}
|
||||
|
||||
/** Output JSON from data in an {@link RdapResultSet} object. */
|
||||
private DomainSearchResponse makeSearchResults(RdapResultSet<DomainBase> resultSet) {
|
||||
private DomainSearchResponse makeSearchResults(RdapResultSet<Domain> resultSet) {
|
||||
return makeSearchResults(
|
||||
resultSet.resources(),
|
||||
resultSet.incompletenessWarningType(),
|
||||
|
@ -641,7 +641,7 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
|
|||
* maximum number of nameservers in the first stage query.
|
||||
*/
|
||||
private DomainSearchResponse makeSearchResults(
|
||||
List<DomainBase> domains,
|
||||
List<Domain> domains,
|
||||
IncompletenessWarningType incompletenessWarningType,
|
||||
Optional<Long> numDomainsRetrieved) {
|
||||
numDomainsRetrieved.ifPresent(metricInformationBuilder::setNumDomainsRetrieved);
|
||||
|
@ -650,7 +650,7 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
|
|||
DomainSearchResponse.Builder builder =
|
||||
DomainSearchResponse.builder().setIncompletenessWarningType(incompletenessWarningType);
|
||||
Optional<String> newCursor = Optional.empty();
|
||||
for (DomainBase domain : Iterables.limit(domains, rdapResultSetMaxSize)) {
|
||||
for (Domain domain : Iterables.limit(domains, rdapResultSetMaxSize)) {
|
||||
newCursor = Optional.of(domain.getDomainName());
|
||||
builder
|
||||
.domainSearchResultsBuilder()
|
||||
|
|
|
@ -45,7 +45,7 @@ import google.registry.model.contact.ContactResource;
|
|||
import google.registry.model.contact.PostalInfo;
|
||||
import google.registry.model.domain.DesignatedContact;
|
||||
import google.registry.model.domain.DesignatedContact.Type;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.eppcommon.Address;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.host.HostResource;
|
||||
|
@ -267,7 +267,7 @@ public class RdapJsonFormatter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates a JSON object for a {@link DomainBase}.
|
||||
* Creates a JSON object for a {@link Domain}.
|
||||
*
|
||||
* <p>NOTE that domain searches aren't in the spec yet - they're in the RFC 9082 that describes
|
||||
* the query format, but they aren't in the RDAP Technical Implementation Guide 15feb19, meaning
|
||||
|
@ -276,20 +276,20 @@ public class RdapJsonFormatter {
|
|||
* <p>We're implementing domain searches anyway, BUT we won't have the response for searches
|
||||
* conform to the RDAP Response Profile.
|
||||
*
|
||||
* @param domainBase the domain resource object from which the JSON object should be created
|
||||
* @param domain the domain resource object from which the JSON object should be created
|
||||
* @param outputDataType whether to generate FULL or SUMMARY data. Domains are never INTERNAL.
|
||||
*/
|
||||
RdapDomain createRdapDomain(DomainBase domainBase, OutputDataType outputDataType) {
|
||||
RdapDomain createRdapDomain(Domain domain, OutputDataType outputDataType) {
|
||||
RdapDomain.Builder builder = RdapDomain.builder();
|
||||
builder.linksBuilder().add(makeSelfLink("domain", domainBase.getDomainName()));
|
||||
builder.linksBuilder().add(makeSelfLink("domain", domain.getDomainName()));
|
||||
if (outputDataType != OutputDataType.FULL) {
|
||||
builder.remarksBuilder().add(RdapIcannStandardInformation.SUMMARY_DATA_REMARK);
|
||||
}
|
||||
// RDAP Response Profile 15feb19 section 2.1 discusses the domain name.
|
||||
builder.setLdhName(domainBase.getDomainName());
|
||||
builder.setLdhName(domain.getDomainName());
|
||||
// RDAP Response Profile 15feb19 section 2.2:
|
||||
// The domain handle MUST be the ROID
|
||||
builder.setHandle(domainBase.getRepoId());
|
||||
builder.setHandle(domain.getRepoId());
|
||||
// If this is a summary (search result) - we'll return now. Since there's no requirement for
|
||||
// domain searches at all, having the name, handle, and self link is enough.
|
||||
if (outputDataType == OutputDataType.SUMMARY) {
|
||||
|
@ -304,12 +304,12 @@ public class RdapJsonFormatter {
|
|||
Event.builder()
|
||||
.setEventAction(EventAction.REGISTRATION)
|
||||
.setEventActor(
|
||||
Optional.ofNullable(domainBase.getCreationRegistrarId()).orElse("(none)"))
|
||||
.setEventDate(domainBase.getCreationTime())
|
||||
Optional.ofNullable(domain.getCreationRegistrarId()).orElse("(none)"))
|
||||
.setEventDate(domain.getCreationTime())
|
||||
.build(),
|
||||
Event.builder()
|
||||
.setEventAction(EventAction.EXPIRATION)
|
||||
.setEventDate(domainBase.getRegistrationExpirationTime())
|
||||
.setEventDate(domain.getRegistrationExpirationTime())
|
||||
.build(),
|
||||
Event.builder()
|
||||
.setEventAction(EventAction.LAST_UPDATE_OF_RDAP_DATABASE)
|
||||
|
@ -317,18 +317,18 @@ public class RdapJsonFormatter {
|
|||
.build());
|
||||
// RDAP Response Profile 15feb19 section 2.3.2 discusses optional events. We add some of those
|
||||
// here. We also add a few others we find interesting.
|
||||
builder.eventsBuilder().addAll(makeOptionalEvents(domainBase));
|
||||
builder.eventsBuilder().addAll(makeOptionalEvents(domain));
|
||||
// RDAP Response Profile 15feb19 section 2.4.1:
|
||||
// The domain object in the RDAP response MUST contain an entity with the Registrar role.
|
||||
//
|
||||
// See {@link createRdapRegistrarEntity} for details of section 2.4 conformance
|
||||
Registrar registrar =
|
||||
Registrar.loadRequiredRegistrarCached(domainBase.getCurrentSponsorRegistrarId());
|
||||
Registrar.loadRequiredRegistrarCached(domain.getCurrentSponsorRegistrarId());
|
||||
builder.entitiesBuilder().add(createRdapRegistrarEntity(registrar, OutputDataType.INTERNAL));
|
||||
// RDAP Technical Implementation Guide 3.2: must have link to the registrar's RDAP URL for this
|
||||
// domain, with rel=related.
|
||||
for (String registrarRdapBase : registrar.getRdapBaseUrls()) {
|
||||
String href = makeServerRelativeUrl(registrarRdapBase, "domain", domainBase.getDomainName());
|
||||
String href = makeServerRelativeUrl(registrarRdapBase, "domain", domain.getDomainName());
|
||||
builder
|
||||
.linksBuilder()
|
||||
.add(
|
||||
|
@ -342,14 +342,14 @@ public class RdapJsonFormatter {
|
|||
// makeStatusValueList should in theory always contain one of either "active" or "inactive".
|
||||
ImmutableSet<RdapStatus> status =
|
||||
makeStatusValueList(
|
||||
domainBase.getStatusValues(),
|
||||
domain.getStatusValues(),
|
||||
false, // isRedacted
|
||||
domainBase.getDeletionTime().isBefore(getRequestTime()));
|
||||
domain.getDeletionTime().isBefore(getRequestTime()));
|
||||
builder.statusBuilder().addAll(status);
|
||||
if (status.isEmpty()) {
|
||||
logger.atWarning().log(
|
||||
"Domain %s (ROID %s) doesn't have any status.",
|
||||
domainBase.getDomainName(), domainBase.getRepoId());
|
||||
domain.getDomainName(), domain.getRepoId());
|
||||
}
|
||||
// RDAP Response Profile 2.6.3, must have a notice about statuses. That is in {@link
|
||||
// RdapIcannStandardInformation#domainBoilerplateNotices}
|
||||
|
@ -357,11 +357,10 @@ public class RdapJsonFormatter {
|
|||
// Kick off the database loads of the nameservers that we will need, so it can load
|
||||
// asynchronously while we load and process the contacts.
|
||||
ImmutableSet<HostResource> loadedHosts =
|
||||
tm().transact(
|
||||
() -> ImmutableSet.copyOf(tm().loadByKeys(domainBase.getNameservers()).values()));
|
||||
tm().transact(() -> ImmutableSet.copyOf(tm().loadByKeys(domain.getNameservers()).values()));
|
||||
// Load the registrant and other contacts and add them to the data.
|
||||
ImmutableMap<VKey<? extends ContactResource>, ContactResource> loadedContacts =
|
||||
tm().transact(() -> tm().loadByKeysIfPresent(domainBase.getReferencedContacts()));
|
||||
tm().transact(() -> tm().loadByKeysIfPresent(domain.getReferencedContacts()));
|
||||
// RDAP Response Profile 2.7.3, A domain MUST have the REGISTRANT, ADMIN, TECH roles and MAY
|
||||
// have others. We also add the BILLING.
|
||||
//
|
||||
|
@ -371,8 +370,8 @@ public class RdapJsonFormatter {
|
|||
// the GDPR redaction is handled in createRdapContactEntity
|
||||
ImmutableSetMultimap<VKey<ContactResource>, Type> contactsToRoles =
|
||||
Streams.concat(
|
||||
domainBase.getContacts().stream(),
|
||||
Stream.of(DesignatedContact.create(Type.REGISTRANT, domainBase.getRegistrant())))
|
||||
domain.getContacts().stream(),
|
||||
Stream.of(DesignatedContact.create(Type.REGISTRANT, domain.getRegistrant())))
|
||||
.sorted(DESIGNATED_CONTACT_ORDERING)
|
||||
.collect(
|
||||
toImmutableSetMultimap(
|
||||
|
@ -404,7 +403,7 @@ public class RdapJsonFormatter {
|
|||
//
|
||||
// TODO(b/133310221): get the zoneSigned value from the config files.
|
||||
SecureDns.Builder secureDnsBuilder = SecureDns.builder().setZoneSigned(true);
|
||||
domainBase.getDsData().forEach(secureDnsBuilder::addDsData);
|
||||
domain.getDsData().forEach(secureDnsBuilder::addDsData);
|
||||
builder.setSecureDns(secureDnsBuilder.build());
|
||||
|
||||
return builder.build();
|
||||
|
|
|
@ -27,7 +27,7 @@ import com.google.common.collect.Iterables;
|
|||
import com.google.common.net.InetAddresses;
|
||||
import com.google.common.primitives.Booleans;
|
||||
import com.googlecode.objectify.cmd.Query;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.persistence.transaction.CriteriaQueryBuilder;
|
||||
import google.registry.rdap.RdapJsonFormatter.OutputDataType;
|
||||
|
@ -176,9 +176,9 @@ public class RdapNameserverSearchAction extends RdapSearchActionBase {
|
|||
/** Searches for nameservers by name using the superordinate domain as a suffix. */
|
||||
private NameserverSearchResponse searchByNameUsingSuperordinateDomain(
|
||||
RdapSearchPattern partialStringQuery) {
|
||||
Optional<DomainBase> domainBase =
|
||||
loadByForeignKey(DomainBase.class, partialStringQuery.getSuffix(), getRequestTime());
|
||||
if (!domainBase.isPresent()) {
|
||||
Optional<Domain> domain =
|
||||
loadByForeignKey(Domain.class, partialStringQuery.getSuffix(), getRequestTime());
|
||||
if (!domain.isPresent()) {
|
||||
// Don't allow wildcards with suffixes which are not domains we manage. That would risk a
|
||||
// table scan in many easily foreseeable cases. The user might ask for ns*.zombo.com,
|
||||
// forcing us to query for all hosts beginning with ns, then filter for those ending in
|
||||
|
@ -188,7 +188,7 @@ public class RdapNameserverSearchAction extends RdapSearchActionBase {
|
|||
"A suffix after a wildcard in a nameserver lookup must be an in-bailiwick domain");
|
||||
}
|
||||
List<HostResource> hostList = new ArrayList<>();
|
||||
for (String fqhn : ImmutableSortedSet.copyOf(domainBase.get().getSubordinateHosts())) {
|
||||
for (String fqhn : ImmutableSortedSet.copyOf(domain.get().getSubordinateHosts())) {
|
||||
if (cursorString.isPresent() && (fqhn.compareTo(cursorString.get()) <= 0)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -208,7 +208,7 @@ public class RdapNameserverSearchAction extends RdapSearchActionBase {
|
|||
return makeSearchResults(
|
||||
hostList,
|
||||
IncompletenessWarningType.COMPLETE,
|
||||
domainBase.get().getSubordinateHosts().size(),
|
||||
domain.get().getSubordinateHosts().size(),
|
||||
CursorType.NAME);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import com.google.common.collect.ImmutableSet;
|
|||
import com.google.common.flogger.FluentLogger;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DesignatedContact;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
|
@ -46,18 +46,18 @@ import google.registry.xjc.rgp.XjcRgpStatusValueType;
|
|||
import google.registry.xjc.secdns.XjcSecdnsDsDataType;
|
||||
import google.registry.xjc.secdns.XjcSecdnsDsOrKeyType;
|
||||
|
||||
/** Utility class that turns {@link DomainBase} as {@link XjcRdeDomainElement}. */
|
||||
final class DomainBaseToXjcConverter {
|
||||
/** Utility class that turns {@link Domain} as {@link XjcRdeDomainElement}. */
|
||||
final class DomainToXjcConverter {
|
||||
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
/** Converts {@link DomainBase} to {@link XjcRdeDomainElement}. */
|
||||
static XjcRdeDomainElement convert(DomainBase domain, RdeMode mode) {
|
||||
/** Converts {@link Domain} to {@link XjcRdeDomainElement}. */
|
||||
static XjcRdeDomainElement convert(Domain domain, RdeMode mode) {
|
||||
return new XjcRdeDomainElement(convertDomain(domain, mode));
|
||||
}
|
||||
|
||||
/** Converts {@link DomainBase} to {@link XjcRdeDomain}. */
|
||||
static XjcRdeDomain convertDomain(DomainBase model, RdeMode mode) {
|
||||
/** Converts {@link Domain} to {@link XjcRdeDomain}. */
|
||||
static XjcRdeDomain convertDomain(Domain model, RdeMode mode) {
|
||||
XjcRdeDomain bean = new XjcRdeDomain();
|
||||
|
||||
// o A <name> element that contains the fully qualified name of the
|
||||
|
@ -252,7 +252,7 @@ final class DomainBaseToXjcConverter {
|
|||
return bean;
|
||||
}
|
||||
|
||||
private static boolean hasGainingAndLosingRegistrars(DomainBase model) {
|
||||
private static boolean hasGainingAndLosingRegistrars(Domain model) {
|
||||
return !Strings.isNullOrEmpty(model.getTransferData().getGainingRegistrarId())
|
||||
&& !Strings.isNullOrEmpty(model.getTransferData().getLosingRegistrarId());
|
||||
}
|
||||
|
@ -315,5 +315,5 @@ final class DomainBaseToXjcConverter {
|
|||
return bean;
|
||||
}
|
||||
|
||||
private DomainBaseToXjcConverter() {}
|
||||
private DomainToXjcConverter() {}
|
||||
}
|
|
@ -17,7 +17,7 @@ package google.registry.rde;
|
|||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
|
||||
import com.google.common.net.InetAddresses;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.xjc.host.XjcHostAddrType;
|
||||
|
@ -34,7 +34,7 @@ import org.joda.time.DateTime;
|
|||
final class HostResourceToXjcConverter {
|
||||
|
||||
/** Converts a subordinate {@link HostResource} to {@link XjcRdeHostElement}. */
|
||||
static XjcRdeHostElement convertSubordinate(HostResource host, DomainBase superordinateDomain) {
|
||||
static XjcRdeHostElement convertSubordinate(HostResource host, Domain superordinateDomain) {
|
||||
checkArgument(superordinateDomain.createVKey().equals(host.getSuperordinateDomain()));
|
||||
return new XjcRdeHostElement(convertSubordinateHost(host, superordinateDomain));
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ final class HostResourceToXjcConverter {
|
|||
}
|
||||
|
||||
/** Converts {@link HostResource} to {@link XjcRdeHost}. */
|
||||
static XjcRdeHost convertSubordinateHost(HostResource model, DomainBase superordinateDomain) {
|
||||
static XjcRdeHost convertSubordinateHost(HostResource model, Domain superordinateDomain) {
|
||||
XjcRdeHost bean =
|
||||
convertHostCommon(
|
||||
model,
|
||||
|
|
|
@ -21,7 +21,7 @@ import com.google.auto.value.AutoValue;
|
|||
import com.google.common.collect.ImmutableMap;
|
||||
import google.registry.model.EppResource;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.rde.RdeMode;
|
||||
import java.util.HashMap;
|
||||
|
@ -62,8 +62,8 @@ public class RdeFragmenter {
|
|||
return result;
|
||||
}
|
||||
resourcesFound++;
|
||||
if (resource instanceof DomainBase) {
|
||||
result = Optional.of(marshaller.marshalDomain((DomainBase) resource, mode));
|
||||
if (resource instanceof Domain) {
|
||||
result = Optional.of(marshaller.marshalDomain((Domain) resource, mode));
|
||||
cache.put(WatermarkModePair.create(watermark, mode), result);
|
||||
return result;
|
||||
} else if (resource instanceof ContactResource) {
|
||||
|
|
|
@ -21,7 +21,7 @@ import com.google.common.flogger.FluentLogger;
|
|||
import com.googlecode.objectify.Key;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.rde.RdeMode;
|
||||
import google.registry.model.registrar.Registrar;
|
||||
|
@ -123,15 +123,14 @@ public final class RdeMarshaller implements Serializable {
|
|||
ContactResourceToXjcConverter.convert(contact));
|
||||
}
|
||||
|
||||
/** Turns {@link DomainBase} object into an XML fragment. */
|
||||
public DepositFragment marshalDomain(DomainBase domain, RdeMode mode) {
|
||||
return marshalResource(RdeResourceType.DOMAIN, domain,
|
||||
DomainBaseToXjcConverter.convert(domain, mode));
|
||||
/** Turns {@link Domain} object into an XML fragment. */
|
||||
public DepositFragment marshalDomain(Domain domain, RdeMode mode) {
|
||||
return marshalResource(
|
||||
RdeResourceType.DOMAIN, domain, DomainToXjcConverter.convert(domain, mode));
|
||||
}
|
||||
|
||||
/** Turns {@link HostResource} object into an XML fragment. */
|
||||
public DepositFragment marshalSubordinateHost(
|
||||
HostResource host, DomainBase superordinateDomain) {
|
||||
public DepositFragment marshalSubordinateHost(HostResource host, Domain superordinateDomain) {
|
||||
return marshalResource(RdeResourceType.HOST, host,
|
||||
HostResourceToXjcConverter.convertSubordinate(host, superordinateDomain));
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ import google.registry.keyring.api.KeyModule.Key;
|
|||
import google.registry.model.common.Cursor;
|
||||
import google.registry.model.common.Cursor.CursorType;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.index.EppResourceIndex;
|
||||
import google.registry.model.rde.RdeMode;
|
||||
|
@ -83,7 +83,7 @@ import org.joda.time.Duration;
|
|||
* account for things like pending transfer.
|
||||
*
|
||||
* <p>Only {@link ContactResource}s and {@link HostResource}s that are referenced by an included
|
||||
* {@link DomainBase} will be included in the corresponding pending deposit.
|
||||
* {@link Domain} will be included in the corresponding pending deposit.
|
||||
*
|
||||
* <p>{@link Registrar} entities, both active and inactive, are included in all deposits. They are
|
||||
* not rewinded point-in-time.
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
|
||||
package google.registry.reporting.icann;
|
||||
|
||||
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
||||
import static google.registry.reporting.icann.IcannReportingModule.DATASTORE_EXPORT_DATA_SET;
|
||||
import static google.registry.reporting.icann.IcannReportingModule.ICANN_REPORTING_DATA_SET;
|
||||
import static google.registry.reporting.icann.QueryBuilderUtils.getQueryFromFile;
|
||||
import static google.registry.reporting.icann.QueryBuilderUtils.getTableName;
|
||||
|
@ -72,180 +70,72 @@ public final class TransactionsReportingQueryBuilder implements QueryBuilder {
|
|||
DateTime latestReportTime = earliestReportTime.plusMonths(1).minusMillis(1);
|
||||
|
||||
ImmutableMap.Builder<String, String> queriesBuilder = ImmutableMap.builder();
|
||||
String registrarIanaIdQuery;
|
||||
if (tm().isOfy()) {
|
||||
registrarIanaIdQuery =
|
||||
SqlTemplate.create(getQueryFromFile("registrar_iana_id.sql"))
|
||||
.put("PROJECT_ID", projectId)
|
||||
.put("DATASTORE_EXPORT_DATA_SET", DATASTORE_EXPORT_DATA_SET)
|
||||
.put("REGISTRAR_TABLE", "Registrar")
|
||||
.build();
|
||||
} else {
|
||||
registrarIanaIdQuery =
|
||||
SqlTemplate.create(getQueryFromFile("cloud_sql_registrar_iana_id.sql"))
|
||||
.put("PROJECT_ID", projectId)
|
||||
.build();
|
||||
}
|
||||
String registrarIanaIdQuery =
|
||||
SqlTemplate.create(getQueryFromFile("cloud_sql_registrar_iana_id.sql"))
|
||||
.put("PROJECT_ID", projectId)
|
||||
.build();
|
||||
queriesBuilder.put(getTableName(REGISTRAR_IANA_ID, yearMonth), registrarIanaIdQuery);
|
||||
|
||||
String totalDomainsQuery;
|
||||
if (tm().isOfy()) {
|
||||
totalDomainsQuery =
|
||||
SqlTemplate.create(getQueryFromFile("total_domains.sql"))
|
||||
.put("PROJECT_ID", projectId)
|
||||
.put("DATASTORE_EXPORT_DATA_SET", DATASTORE_EXPORT_DATA_SET)
|
||||
.put("DOMAINBASE_TABLE", "DomainBase")
|
||||
.put("REGISTRAR_TABLE", "Registrar")
|
||||
.build();
|
||||
} else {
|
||||
totalDomainsQuery =
|
||||
SqlTemplate.create(getQueryFromFile("cloud_sql_total_domains.sql"))
|
||||
.put("PROJECT_ID", projectId)
|
||||
.build();
|
||||
}
|
||||
String totalDomainsQuery =
|
||||
SqlTemplate.create(getQueryFromFile("cloud_sql_total_domains.sql"))
|
||||
.put("PROJECT_ID", projectId)
|
||||
.build();
|
||||
queriesBuilder.put(getTableName(TOTAL_DOMAINS, yearMonth), totalDomainsQuery);
|
||||
|
||||
DateTimeFormatter timestampFormatter = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
String totalNameserversQuery;
|
||||
if (tm().isOfy()) {
|
||||
totalNameserversQuery =
|
||||
SqlTemplate.create(getQueryFromFile("total_nameservers.sql"))
|
||||
.put("PROJECT_ID", projectId)
|
||||
.put("DATASTORE_EXPORT_DATA_SET", DATASTORE_EXPORT_DATA_SET)
|
||||
.put("HOSTRESOURCE_TABLE", "HostResource")
|
||||
.put("DOMAINBASE_TABLE", "DomainBase")
|
||||
.put("REGISTRAR_TABLE", "Registrar")
|
||||
.put("LATEST_REPORT_TIME", timestampFormatter.print(latestReportTime))
|
||||
.build();
|
||||
} else {
|
||||
totalNameserversQuery =
|
||||
SqlTemplate.create(getQueryFromFile("cloud_sql_total_nameservers.sql"))
|
||||
.put("PROJECT_ID", projectId)
|
||||
.put("LATEST_REPORT_TIME", timestampFormatter.print(latestReportTime))
|
||||
.build();
|
||||
}
|
||||
String totalNameserversQuery =
|
||||
SqlTemplate.create(getQueryFromFile("cloud_sql_total_nameservers.sql"))
|
||||
.put("PROJECT_ID", projectId)
|
||||
.put("LATEST_REPORT_TIME", timestampFormatter.print(latestReportTime))
|
||||
.build();
|
||||
queriesBuilder.put(getTableName(TOTAL_NAMESERVERS, yearMonth), totalNameserversQuery);
|
||||
|
||||
String transactionCountsQuery;
|
||||
if (tm().isOfy()) {
|
||||
transactionCountsQuery =
|
||||
SqlTemplate.create(getQueryFromFile("transaction_counts.sql"))
|
||||
.put("PROJECT_ID", projectId)
|
||||
.put("DATASTORE_EXPORT_DATA_SET", DATASTORE_EXPORT_DATA_SET)
|
||||
.put("REGISTRAR_TABLE", "Registrar")
|
||||
.put("HISTORYENTRY_TABLE", "HistoryEntry")
|
||||
.put("EARLIEST_REPORT_TIME", timestampFormatter.print(earliestReportTime))
|
||||
.put("LATEST_REPORT_TIME", timestampFormatter.print(latestReportTime))
|
||||
.put("CLIENT_ID", "clientId")
|
||||
.put("OTHER_CLIENT_ID", "otherClientId")
|
||||
.put("TRANSFER_SUCCESS_FIELD", "TRANSFER_GAINING_SUCCESSFUL")
|
||||
.put("TRANSFER_NACKED_FIELD", "TRANSFER_GAINING_NACKED")
|
||||
.put("DEFAULT_FIELD", "field")
|
||||
.build();
|
||||
} else {
|
||||
transactionCountsQuery =
|
||||
SqlTemplate.create(getQueryFromFile("cloud_sql_transaction_counts.sql"))
|
||||
.put("PROJECT_ID", projectId)
|
||||
.put("EARLIEST_REPORT_TIME", timestampFormatter.print(earliestReportTime))
|
||||
.put("LATEST_REPORT_TIME", timestampFormatter.print(latestReportTime))
|
||||
.build();
|
||||
}
|
||||
String transactionCountsQuery =
|
||||
SqlTemplate.create(getQueryFromFile("cloud_sql_transaction_counts.sql"))
|
||||
.put("PROJECT_ID", projectId)
|
||||
.put("EARLIEST_REPORT_TIME", timestampFormatter.print(earliestReportTime))
|
||||
.put("LATEST_REPORT_TIME", timestampFormatter.print(latestReportTime))
|
||||
.build();
|
||||
queriesBuilder.put(getTableName(TRANSACTION_COUNTS, yearMonth), transactionCountsQuery);
|
||||
|
||||
String transactionTransferLosingQuery;
|
||||
if (tm().isOfy()) {
|
||||
transactionTransferLosingQuery =
|
||||
SqlTemplate.create(getQueryFromFile("transaction_counts.sql"))
|
||||
.put("PROJECT_ID", projectId)
|
||||
.put("DATASTORE_EXPORT_DATA_SET", DATASTORE_EXPORT_DATA_SET)
|
||||
.put("REGISTRAR_TABLE", "Registrar")
|
||||
.put("HISTORYENTRY_TABLE", "HistoryEntry")
|
||||
.put("EARLIEST_REPORT_TIME", timestampFormatter.print(earliestReportTime))
|
||||
.put("LATEST_REPORT_TIME", timestampFormatter.print(latestReportTime))
|
||||
// Roles are reversed for losing queries
|
||||
.put("CLIENT_ID", "otherClientId")
|
||||
.put("OTHER_CLIENT_ID", "clientId")
|
||||
.put("TRANSFER_SUCCESS_FIELD", "TRANSFER_LOSING_SUCCESSFUL")
|
||||
.put("TRANSFER_NACKED_FIELD", "TRANSFER_LOSING_NACKED")
|
||||
.put("DEFAULT_FIELD", "NULL")
|
||||
.build();
|
||||
} else {
|
||||
transactionTransferLosingQuery =
|
||||
SqlTemplate.create(getQueryFromFile("cloud_sql_transaction_transfer_losing.sql"))
|
||||
.put("PROJECT_ID", projectId)
|
||||
.put("EARLIEST_REPORT_TIME", timestampFormatter.print(earliestReportTime))
|
||||
.put("LATEST_REPORT_TIME", timestampFormatter.print(latestReportTime))
|
||||
.build();
|
||||
}
|
||||
String transactionTransferLosingQuery =
|
||||
SqlTemplate.create(getQueryFromFile("cloud_sql_transaction_transfer_losing.sql"))
|
||||
.put("PROJECT_ID", projectId)
|
||||
.put("EARLIEST_REPORT_TIME", timestampFormatter.print(earliestReportTime))
|
||||
.put("LATEST_REPORT_TIME", timestampFormatter.print(latestReportTime))
|
||||
.build();
|
||||
queriesBuilder.put(
|
||||
getTableName(TRANSACTION_TRANSFER_LOSING, yearMonth), transactionTransferLosingQuery);
|
||||
|
||||
// App Engine log table suffixes use YYYYMMDD format
|
||||
DateTimeFormatter logTableFormatter = DateTimeFormat.forPattern("yyyyMMdd");
|
||||
String attemptedAddsQuery;
|
||||
if (tm().isOfy()) {
|
||||
attemptedAddsQuery =
|
||||
SqlTemplate.create(getQueryFromFile("attempted_adds.sql"))
|
||||
.put("PROJECT_ID", projectId)
|
||||
.put("DATASTORE_EXPORT_DATA_SET", DATASTORE_EXPORT_DATA_SET)
|
||||
.put("REGISTRAR_TABLE", "Registrar")
|
||||
.put("APPENGINE_LOGS_DATA_SET", "appengine_logs")
|
||||
.put("REQUEST_TABLE", "appengine_googleapis_com_request_log_")
|
||||
.put("FIRST_DAY_OF_MONTH", logTableFormatter.print(earliestReportTime))
|
||||
.put("LAST_DAY_OF_MONTH", logTableFormatter.print(latestReportTime))
|
||||
// All metadata logs for reporting come from google.registry.flows.FlowReporter.
|
||||
.put(
|
||||
"METADATA_LOG_PREFIX",
|
||||
"google.registry.flows.FlowReporter recordToLogs: FLOW-LOG-SIGNATURE-METADATA")
|
||||
.build();
|
||||
} else {
|
||||
attemptedAddsQuery =
|
||||
SqlTemplate.create(getQueryFromFile("cloud_sql_attempted_adds.sql"))
|
||||
.put("PROJECT_ID", projectId)
|
||||
.put("APPENGINE_LOGS_DATA_SET", "appengine_logs")
|
||||
.put("REQUEST_TABLE", "appengine_googleapis_com_request_log_")
|
||||
.put("FIRST_DAY_OF_MONTH", logTableFormatter.print(earliestReportTime))
|
||||
.put("LAST_DAY_OF_MONTH", logTableFormatter.print(latestReportTime))
|
||||
// All metadata logs for reporting come from google.registry.flows.FlowReporter.
|
||||
.put(
|
||||
"METADATA_LOG_PREFIX",
|
||||
"google.registry.flows.FlowReporter recordToLogs: FLOW-LOG-SIGNATURE-METADATA")
|
||||
.build();
|
||||
}
|
||||
String attemptedAddsQuery =
|
||||
SqlTemplate.create(getQueryFromFile("cloud_sql_attempted_adds.sql"))
|
||||
.put("PROJECT_ID", projectId)
|
||||
.put("APPENGINE_LOGS_DATA_SET", "appengine_logs")
|
||||
.put("REQUEST_TABLE", "appengine_googleapis_com_request_log_")
|
||||
.put("FIRST_DAY_OF_MONTH", logTableFormatter.print(earliestReportTime))
|
||||
.put("LAST_DAY_OF_MONTH", logTableFormatter.print(latestReportTime))
|
||||
// All metadata logs for reporting come from google.registry.flows.FlowReporter.
|
||||
.put(
|
||||
"METADATA_LOG_PREFIX",
|
||||
"google.registry.flows.FlowReporter recordToLogs: FLOW-LOG-SIGNATURE-METADATA")
|
||||
.build();
|
||||
queriesBuilder.put(getTableName(ATTEMPTED_ADDS, yearMonth), attemptedAddsQuery);
|
||||
|
||||
String aggregateQuery;
|
||||
if (tm().isOfy()) {
|
||||
aggregateQuery =
|
||||
SqlTemplate.create(getQueryFromFile("transactions_report_aggregation.sql"))
|
||||
.put("PROJECT_ID", projectId)
|
||||
.put("DATASTORE_EXPORT_DATA_SET", DATASTORE_EXPORT_DATA_SET)
|
||||
.put("REGISTRY_TABLE", "Registry")
|
||||
.put("ICANN_REPORTING_DATA_SET", icannReportingDataSet)
|
||||
.put("REGISTRAR_IANA_ID_TABLE", getTableName(REGISTRAR_IANA_ID, yearMonth))
|
||||
.put("TOTAL_DOMAINS_TABLE", getTableName(TOTAL_DOMAINS, yearMonth))
|
||||
.put("TOTAL_NAMESERVERS_TABLE", getTableName(TOTAL_NAMESERVERS, yearMonth))
|
||||
.put("TRANSACTION_COUNTS_TABLE", getTableName(TRANSACTION_COUNTS, yearMonth))
|
||||
.put(
|
||||
"TRANSACTION_TRANSFER_LOSING_TABLE",
|
||||
getTableName(TRANSACTION_TRANSFER_LOSING, yearMonth))
|
||||
.put("ATTEMPTED_ADDS_TABLE", getTableName(ATTEMPTED_ADDS, yearMonth))
|
||||
.build();
|
||||
} else {
|
||||
aggregateQuery =
|
||||
SqlTemplate.create(getQueryFromFile("cloud_sql_transactions_report_aggregation.sql"))
|
||||
.put("PROJECT_ID", projectId)
|
||||
.put("ICANN_REPORTING_DATA_SET", icannReportingDataSet)
|
||||
.put("REGISTRAR_IANA_ID_TABLE", getTableName(REGISTRAR_IANA_ID, yearMonth))
|
||||
.put("TOTAL_DOMAINS_TABLE", getTableName(TOTAL_DOMAINS, yearMonth))
|
||||
.put("TOTAL_NAMESERVERS_TABLE", getTableName(TOTAL_NAMESERVERS, yearMonth))
|
||||
.put("TRANSACTION_COUNTS_TABLE", getTableName(TRANSACTION_COUNTS, yearMonth))
|
||||
.put(
|
||||
"TRANSACTION_TRANSFER_LOSING_TABLE",
|
||||
getTableName(TRANSACTION_TRANSFER_LOSING, yearMonth))
|
||||
.put("ATTEMPTED_ADDS_TABLE", getTableName(ATTEMPTED_ADDS, yearMonth))
|
||||
.build();
|
||||
}
|
||||
String aggregateQuery =
|
||||
SqlTemplate.create(getQueryFromFile("cloud_sql_transactions_report_aggregation.sql"))
|
||||
.put("PROJECT_ID", projectId)
|
||||
.put("ICANN_REPORTING_DATA_SET", icannReportingDataSet)
|
||||
.put("REGISTRAR_IANA_ID_TABLE", getTableName(REGISTRAR_IANA_ID, yearMonth))
|
||||
.put("TOTAL_DOMAINS_TABLE", getTableName(TOTAL_DOMAINS, yearMonth))
|
||||
.put("TOTAL_NAMESERVERS_TABLE", getTableName(TOTAL_NAMESERVERS, yearMonth))
|
||||
.put("TRANSACTION_COUNTS_TABLE", getTableName(TRANSACTION_COUNTS, yearMonth))
|
||||
.put(
|
||||
"TRANSACTION_TRANSFER_LOSING_TABLE",
|
||||
getTableName(TRANSACTION_TRANSFER_LOSING, yearMonth))
|
||||
.put("ATTEMPTED_ADDS_TABLE", getTableName(ATTEMPTED_ADDS, yearMonth))
|
||||
.build();
|
||||
queriesBuilder.put(getTableName(TRANSACTIONS_REPORT_AGGREGATION, yearMonth), aggregateQuery);
|
||||
|
||||
return queriesBuilder.build();
|
||||
|
|
|
@ -1,73 +0,0 @@
|
|||
#standardSQL
|
||||
-- Copyright 2017 The Nomulus Authors. All Rights Reserved.
|
||||
--
|
||||
-- Licensed under the Apache License, Version 2.0 (the "License");
|
||||
-- you may not use this file except in compliance with the License.
|
||||
-- You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing, software
|
||||
-- distributed under the License is distributed on an "AS IS" BASIS,
|
||||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
-- See the License for the specific language governing permissions and
|
||||
-- limitations under the License.
|
||||
|
||||
-- Determine the number of attempted adds each registrar made.
|
||||
|
||||
-- Since the specification requests all 'attempted' adds, we regex the
|
||||
-- monthly App Engine logs, searching for all create commands and associating
|
||||
-- them with their corresponding registrars.
|
||||
|
||||
-- Example log generated by FlowReporter in App Engine logs:
|
||||
--google.registry.flows.FlowReporter
|
||||
-- recordToLogs: FLOW-LOG-SIGNATURE-METADATA:
|
||||
--{"serverTrid":"oNwL2J2eRya7bh7c9oHIzg==-2360a","clientId":"ipmirror"
|
||||
-- ,"commandType":"hello", "resourceType":"","flowClassName":"HelloFlow"
|
||||
-- ,"targetId":"","targetIds":[],"tld":"",
|
||||
-- "tlds":[],"icannActivityReportField":""}
|
||||
|
||||
-- This outer select just converts the registrar's clientId to their name.
|
||||
SELECT
|
||||
tld,
|
||||
registrar_table.registrarName AS registrar_name,
|
||||
'ATTEMPTED_ADDS' AS metricName,
|
||||
count AS metricValue
|
||||
FROM (
|
||||
SELECT
|
||||
JSON_EXTRACT_SCALAR(json, '$.tld') AS tld,
|
||||
JSON_EXTRACT_SCALAR(json, '$.clientId') AS clientId,
|
||||
COUNT(json) AS count
|
||||
FROM (
|
||||
-- Extract JSON metadata package from monthly logs
|
||||
SELECT
|
||||
REGEXP_EXTRACT(logMessages, r'FLOW-LOG-SIGNATURE-METADATA: (.*)\n?$')
|
||||
AS json
|
||||
FROM (
|
||||
SELECT
|
||||
protoPayload.resource AS requestPath,
|
||||
ARRAY(
|
||||
SELECT logMessage
|
||||
FROM UNNEST(protoPayload.line)) AS logMessage
|
||||
FROM
|
||||
`%PROJECT_ID%.%APPENGINE_LOGS_DATA_SET%.%REQUEST_TABLE%*`
|
||||
WHERE _TABLE_SUFFIX
|
||||
BETWEEN '%FIRST_DAY_OF_MONTH%'
|
||||
AND '%LAST_DAY_OF_MONTH%')
|
||||
JOIN UNNEST(logMessage) AS logMessages
|
||||
-- Look for metadata logs from epp and registrar console requests
|
||||
WHERE requestPath IN ('/_dr/epp', '/_dr/epptool', '/registrar-xhr')
|
||||
AND STARTS_WITH(logMessages, "%METADATA_LOG_PREFIX%")
|
||||
-- Look for domain creates
|
||||
AND REGEXP_CONTAINS(
|
||||
logMessages, r'"commandType":"create","resourceType":"domain"')
|
||||
-- Filter prober data
|
||||
AND NOT REGEXP_CONTAINS(
|
||||
logMessages, r'"prober-[a-z]{2}-((any)|(canary))"') )
|
||||
GROUP BY tld, clientId ) AS logs_table
|
||||
JOIN
|
||||
`%PROJECT_ID%.%DATASTORE_EXPORT_DATA_SET%.%REGISTRAR_TABLE%`
|
||||
AS registrar_table
|
||||
ON logs_table.clientId = registrar_table.__key__.name
|
||||
ORDER BY tld, registrar_name
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
#standardSQL
|
||||
-- Copyright 2017 The Nomulus Authors. All Rights Reserved.
|
||||
--
|
||||
-- Licensed under the Apache License, Version 2.0 (the "License");
|
||||
-- you may not use this file except in compliance with the License.
|
||||
-- You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing, software
|
||||
-- distributed under the License is distributed on an "AS IS" BASIS,
|
||||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
-- See the License for the specific language governing permissions and
|
||||
-- limitations under the License.
|
||||
|
||||
-- Gather a list of all tld-registrar pairs, with their IANA IDs.
|
||||
|
||||
-- This establishes which registrars will appear in the reports.
|
||||
|
||||
SELECT
|
||||
allowed_tlds AS tld,
|
||||
registrarName AS registrar_name,
|
||||
ianaIdentifier AS iana_id
|
||||
FROM
|
||||
`%PROJECT_ID%.%DATASTORE_EXPORT_DATA_SET%.%REGISTRAR_TABLE%`,
|
||||
UNNEST(allowedTlds) as allowed_tlds
|
||||
WHERE (type = 'REAL' OR type = 'INTERNAL')
|
||||
-- Filter out prober data
|
||||
AND NOT ENDS_WITH(allowed_tlds, ".test")
|
||||
ORDER BY tld, registrarName
|
|
@ -1,37 +0,0 @@
|
|||
#standardSQL
|
||||
-- Copyright 2017 The Nomulus Authors. All Rights Reserved.
|
||||
--
|
||||
-- Licensed under the Apache License, Version 2.0 (the "License");
|
||||
-- you may not use this file except in compliance with the License.
|
||||
-- You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing, software
|
||||
-- distributed under the License is distributed on an "AS IS" BASIS,
|
||||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
-- See the License for the specific language governing permissions and
|
||||
-- limitations under the License.
|
||||
|
||||
-- Determine the number of domains each registrar sponsors per tld.
|
||||
|
||||
-- This is just the number of fullyQualifiedDomainNames under each
|
||||
-- tld-registrar pair.
|
||||
|
||||
SELECT
|
||||
tld,
|
||||
registrarName as registrar_name,
|
||||
'TOTAL_DOMAINS' as metricName,
|
||||
COUNT(fullyQualifiedDomainName) as metricValue
|
||||
FROM
|
||||
`%PROJECT_ID%.%DATASTORE_EXPORT_DATA_SET%.%DOMAINBASE_TABLE%`
|
||||
AS domain_table
|
||||
JOIN
|
||||
`%PROJECT_ID%.%DATASTORE_EXPORT_DATA_SET%.%REGISTRAR_TABLE%`
|
||||
AS registrar_table
|
||||
ON
|
||||
currentSponsorClientId = registrar_table.__key__.name
|
||||
WHERE
|
||||
registrar_table.type = 'REAL' OR registrar_table.type = 'INTERNAL'
|
||||
GROUP BY tld, registrarName
|
||||
ORDER BY tld, registrarName
|
|
@ -1,55 +0,0 @@
|
|||
#standardSQL
|
||||
-- Copyright 2017 The Nomulus Authors. All Rights Reserved.
|
||||
--
|
||||
-- Licensed under the Apache License, Version 2.0 (the "License");
|
||||
-- you may not use this file except in compliance with the License.
|
||||
-- You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing, software
|
||||
-- distributed under the License is distributed on an "AS IS" BASIS,
|
||||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
-- See the License for the specific language governing permissions and
|
||||
-- limitations under the License.
|
||||
|
||||
-- Determine the number of referenced nameservers for a registrar's domains.
|
||||
|
||||
-- We count the number of unique hosts under each tld-registrar combo by
|
||||
-- collecting all domains' listed hosts that were still valid at the
|
||||
-- end of the reporting month.
|
||||
|
||||
SELECT
|
||||
tld,
|
||||
registrarName AS registrar_name,
|
||||
'TOTAL_NAMESERVERS' AS metricName,
|
||||
COUNT(fullyQualifiedHostName) AS metricValue
|
||||
FROM
|
||||
`%PROJECT_ID%.%DATASTORE_EXPORT_DATA_SET%.%HOSTRESOURCE_TABLE%` AS host_table
|
||||
JOIN (
|
||||
SELECT
|
||||
__key__.name AS clientId,
|
||||
registrarName
|
||||
FROM
|
||||
`%PROJECT_ID%.%DATASTORE_EXPORT_DATA_SET%.%REGISTRAR_TABLE%`
|
||||
WHERE
|
||||
type = 'REAL'
|
||||
OR type = 'INTERNAL') AS registrar_table
|
||||
ON
|
||||
currentSponsorClientId = registrar_table.clientId
|
||||
JOIN (
|
||||
SELECT
|
||||
tld,
|
||||
hosts.name AS referencedHostName
|
||||
FROM
|
||||
`%PROJECT_ID%.%DATASTORE_EXPORT_DATA_SET%.%DOMAINBASE_TABLE%`,
|
||||
UNNEST(nsHosts) AS hosts
|
||||
WHERE creationTime <= TIMESTAMP("%LATEST_REPORT_TIME%")
|
||||
AND deletionTime > TIMESTAMP("%LATEST_REPORT_TIME%") ) AS domain_table
|
||||
ON
|
||||
host_table.__key__.name = domain_table.referencedHostName
|
||||
WHERE creationTime <= TIMESTAMP("%LATEST_REPORT_TIME%")
|
||||
AND deletionTime > TIMESTAMP("%LATEST_REPORT_TIME%")
|
||||
GROUP BY tld, registrarName
|
||||
ORDER BY tld, registrarName
|
||||
|
|
@ -1,85 +0,0 @@
|
|||
#standardSQL
|
||||
-- Copyright 2017 The Nomulus Authors. All Rights Reserved.
|
||||
--
|
||||
-- Licensed under the Apache License, Version 2.0 (the "License");
|
||||
-- you may not use this file except in compliance with the License.
|
||||
-- You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing, software
|
||||
-- distributed under the License is distributed on an "AS IS" BASIS,
|
||||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
-- See the License for the specific language governing permissions and
|
||||
-- limitations under the License.
|
||||
|
||||
-- Counts the number of mutating transactions each registrar made.
|
||||
|
||||
-- We populate the fields through explicit logging of
|
||||
-- DomainTransactionRecords, which contain all necessary information for
|
||||
-- reporting (such as reporting time, report field, report amount, etc.
|
||||
|
||||
-- A special note on transfers: we only record 'TRANSFER_SUCCESSFUL' or
|
||||
-- 'TRANSFER_NACKED', and we can infer the gaining and losing parties
|
||||
-- from the enclosing HistoryEntry's clientId and otherClientId
|
||||
-- respectively. This query templates the client ID, field for transfer
|
||||
-- success, field for transfer nacks and default field. This allows us to
|
||||
-- create one query for TRANSFER_GAINING and the other report fields,
|
||||
-- and one query for TRANSFER_LOSING fields from the same template.
|
||||
|
||||
-- This outer select just converts the registrar's clientId to their name.
|
||||
SELECT
|
||||
tld,
|
||||
registrar_table.registrarName AS registrar_name,
|
||||
metricName,
|
||||
metricValue
|
||||
FROM (
|
||||
SELECT
|
||||
tld,
|
||||
clientId,
|
||||
CASE
|
||||
WHEN field = 'TRANSFER_SUCCESSFUL' THEN '%TRANSFER_SUCCESS_FIELD%'
|
||||
WHEN field = 'TRANSFER_NACKED' THEN '%TRANSFER_NACKED_FIELD%'
|
||||
ELSE %DEFAULT_FIELD%
|
||||
END AS metricName,
|
||||
SUM(amount) AS metricValue
|
||||
FROM (
|
||||
SELECT
|
||||
CASE
|
||||
-- Explicit transfer acks (approve) and nacks (reject) are done
|
||||
-- by the opposing registrar. Thus, for these specific actions,
|
||||
-- we swap the 'otherClientId' with the 'clientId' to properly
|
||||
-- account for this reversal.
|
||||
WHEN (entries.type = 'DOMAIN_TRANSFER_APPROVE'
|
||||
OR entries.type = 'DOMAIN_TRANSFER_REJECT')
|
||||
THEN entries.%OTHER_CLIENT_ID%
|
||||
ELSE entries.%CLIENT_ID%
|
||||
END AS clientId,
|
||||
entries.domainTransactionRecords.tld[SAFE_OFFSET(index)] AS tld,
|
||||
entries.domainTransactionRecords.reportingTime[SAFE_OFFSET(index)]
|
||||
AS reportingTime,
|
||||
entries.domainTransactionRecords.reportField[SAFE_OFFSET(index)]
|
||||
AS field,
|
||||
entries.domainTransactionRecords.reportAmount[SAFE_OFFSET(index)]
|
||||
AS amount
|
||||
FROM
|
||||
`%PROJECT_ID%.%DATASTORE_EXPORT_DATA_SET%.%HISTORYENTRY_TABLE%`
|
||||
AS entries,
|
||||
-- This allows us to 'loop' through the arrays in parallel by index
|
||||
UNNEST(GENERATE_ARRAY(0, ARRAY_LENGTH(
|
||||
entries.domainTransactionRecords.tld) - 1)) AS index
|
||||
-- Ignore null entries
|
||||
WHERE entries.domainTransactionRecords IS NOT NULL )
|
||||
-- Only look at this month's data
|
||||
WHERE reportingTime
|
||||
BETWEEN TIMESTAMP('%EARLIEST_REPORT_TIME%')
|
||||
AND TIMESTAMP('%LATEST_REPORT_TIME%')
|
||||
GROUP BY
|
||||
tld,
|
||||
clientId,
|
||||
field ) AS counts_table
|
||||
JOIN
|
||||
`%PROJECT_ID%.%DATASTORE_EXPORT_DATA_SET%.%REGISTRAR_TABLE%`
|
||||
AS registrar_table
|
||||
ON
|
||||
counts_table.clientId = registrar_table.__key__.name
|
|
@ -1,100 +0,0 @@
|
|||
#standardSQL
|
||||
-- Copyright 2017 The Nomulus Authors. All Rights Reserved.
|
||||
--
|
||||
-- Licensed under the Apache License, Version 2.0 (the "License");
|
||||
-- you may not use this file except in compliance with the License.
|
||||
-- You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing, software
|
||||
-- distributed under the License is distributed on an "AS IS" BASIS,
|
||||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
-- See the License for the specific language governing permissions and
|
||||
-- limitations under the License.
|
||||
|
||||
-- Construct the transaction reports' rows from the intermediary data views.
|
||||
|
||||
-- This query pulls from all intermediary tables to create the activity
|
||||
-- report csv, via a table transpose and sum over all activity report fields.
|
||||
|
||||
SELECT
|
||||
registrars.tld as tld,
|
||||
-- Surround registrar names with quotes to handle names containing a comma.
|
||||
FORMAT("\"%s\"", registrars.registrar_name) as registrar_name,
|
||||
registrars.iana_id as iana_id,
|
||||
SUM(IF(metrics.metricName = 'TOTAL_DOMAINS', metrics.metricValue, 0)) AS total_domains,
|
||||
SUM(IF(metrics.metricName = 'TOTAL_NAMESERVERS', metrics.metricValue, 0)) AS total_nameservers,
|
||||
SUM(IF(metrics.metricName = 'NET_ADDS_1_YR', metrics.metricValue, 0)) AS net_adds_1_yr,
|
||||
SUM(IF(metrics.metricName = 'NET_ADDS_2_YR', metrics.metricValue, 0)) AS net_adds_2_yr,
|
||||
SUM(IF(metrics.metricName = 'NET_ADDS_3_YR', metrics.metricValue, 0)) AS net_adds_3_yr,
|
||||
SUM(IF(metrics.metricName = 'NET_ADDS_4_YR', metrics.metricValue, 0)) AS net_adds_4_yr,
|
||||
SUM(IF(metrics.metricName = 'NET_ADDS_5_YR', metrics.metricValue, 0)) AS net_adds_5_yr,
|
||||
SUM(IF(metrics.metricName = 'NET_ADDS_6_YR', metrics.metricValue, 0)) AS net_adds_6_yr,
|
||||
SUM(IF(metrics.metricName = 'NET_ADDS_7_YR', metrics.metricValue, 0)) AS net_adds_7_yr,
|
||||
SUM(IF(metrics.metricName = 'NET_ADDS_8_YR', metrics.metricValue, 0)) AS net_adds_8_yr,
|
||||
SUM(IF(metrics.metricName = 'NET_ADDS_9_YR', metrics.metricValue, 0)) AS net_adds_9_yr,
|
||||
SUM(IF(metrics.metricName = 'NET_ADDS_10_Yr', metrics.metricValue, 0)) AS net_adds_10_yr,
|
||||
SUM(IF(metrics.metricName = 'NET_RENEWS_1_YR', metrics.metricValue, 0)) AS net_renews_1_yr,
|
||||
SUM(IF(metrics.metricName = 'NET_RENEWS_2_YR', metrics.metricValue, 0)) AS net_renews_2_yr,
|
||||
SUM(IF(metrics.metricName = 'NET_RENEWS_3_YR', metrics.metricValue, 0)) AS net_renews_3_yr,
|
||||
SUM(IF(metrics.metricName = 'NET_RENEWS_4_YR', metrics.metricValue, 0)) AS net_renews_4_yr,
|
||||
SUM(IF(metrics.metricName = 'NET_RENEWS_5_YR', metrics.metricValue, 0)) AS net_renews_5_yr,
|
||||
SUM(IF(metrics.metricName = 'NET_RENEWS_6_YR', metrics.metricValue, 0)) AS net_renews_6_yr,
|
||||
SUM(IF(metrics.metricName = 'NET_RENEWS_7_YR', metrics.metricValue, 0)) AS net_renews_7_yr,
|
||||
SUM(IF(metrics.metricName = 'NET_RENEWS_8_YR', metrics.metricValue, 0)) AS net_renews_8_yr,
|
||||
SUM(IF(metrics.metricName = 'NET_RENEWS_9_YR', metrics.metricValue, 0)) AS net_renews_9_yr,
|
||||
SUM(IF(metrics.metricName = 'NET_RENEWS_10_YR', metrics.metricValue, 0)) AS net_renews_10_yr,
|
||||
SUM(IF(metrics.metricName = 'TRANSFER_GAINING_SUCCESSFUL', metrics.metricValue, 0)) AS transfer_gaining_successful,
|
||||
SUM(IF(metrics.metricName = 'TRANSFER_GAINING_NACKED', metrics.metricValue, 0)) AS transfer_gaining_nacked,
|
||||
SUM(IF(metrics.metricName = 'TRANSFER_LOSING_SUCCESSFUL', metrics.metricValue, 0)) AS transfer_losing_successful,
|
||||
SUM(IF(metrics.metricName = 'TRANSFER_LOSING_NACKED', metrics.metricValue, 0)) AS transfer_losing_nacked,
|
||||
-- We don't interact with transfer disputes
|
||||
0 AS transfer_disputed_won,
|
||||
0 AS transfer_disputed_lost,
|
||||
0 AS transfer_disputed_nodecision,
|
||||
SUM(IF(metrics.metricName = 'DELETED_DOMAINS_GRACE', metrics.metricValue, 0)) AS deleted_domains_grace,
|
||||
SUM(IF(metrics.metricName = 'DELETED_DOMAINS_NOGRACE', metrics.metricValue, 0)) AS deleted_domains_nograce,
|
||||
SUM(IF(metrics.metricName = 'RESTORED_DOMAINS', metrics.metricValue, 0)) AS restored_domains,
|
||||
-- We don't require restore reports
|
||||
0 AS restored_noreport,
|
||||
-- We don't enforce AGP limits right now
|
||||
0 AS agp_exemption_requests,
|
||||
0 AS agp_exemptions_granted,
|
||||
0 AS agp_exempted_domains,
|
||||
SUM(IF(metrics.metricName = 'ATTEMPTED_ADDS', metrics.metricValue, 0)) AS attempted_adds
|
||||
FROM
|
||||
-- Only produce reports for real TLDs
|
||||
(SELECT tldStr AS tld
|
||||
FROM `%PROJECT_ID%.%DATASTORE_EXPORT_DATA_SET%.%REGISTRY_TABLE%`
|
||||
WHERE tldType = 'REAL') AS registries
|
||||
JOIN
|
||||
(SELECT *
|
||||
FROM `%PROJECT_ID%.%ICANN_REPORTING_DATA_SET%.%REGISTRAR_IANA_ID_TABLE%`)
|
||||
AS registrars
|
||||
ON registries.tld = registrars.tld
|
||||
-- We LEFT JOIN to produce reports even if the registrar made no transactions
|
||||
LEFT OUTER JOIN (
|
||||
-- Gather all intermediary data views
|
||||
SELECT *
|
||||
FROM `%PROJECT_ID%.%ICANN_REPORTING_DATA_SET%.%TOTAL_DOMAINS_TABLE%`
|
||||
UNION ALL
|
||||
SELECT *
|
||||
FROM `%PROJECT_ID%.%ICANN_REPORTING_DATA_SET%.%TOTAL_NAMESERVERS_TABLE%`
|
||||
UNION ALL
|
||||
SELECT *
|
||||
FROM `%PROJECT_ID%.%ICANN_REPORTING_DATA_SET%.%TRANSACTION_COUNTS_TABLE%`
|
||||
UNION ALL
|
||||
SELECT *
|
||||
FROM `%PROJECT_ID%.%ICANN_REPORTING_DATA_SET%.%TRANSACTION_TRANSFER_LOSING_TABLE%`
|
||||
UNION ALL
|
||||
SELECT *
|
||||
FROM `%PROJECT_ID%.%ICANN_REPORTING_DATA_SET%.%ATTEMPTED_ADDS_TABLE%` ) AS metrics
|
||||
-- Join on tld and registrar name
|
||||
ON registrars.tld = metrics.tld
|
||||
AND registrars.registrar_name = metrics.registrar_name
|
||||
GROUP BY
|
||||
tld, registrar_name, iana_id
|
||||
ORDER BY
|
||||
tld, registrar_name
|
||||
|
|
@ -31,7 +31,7 @@ import com.google.template.soy.tofu.SoyTofu;
|
|||
import com.google.template.soy.tofu.SoyTofu.Renderer;
|
||||
import google.registry.beam.spec11.ThreatMatch;
|
||||
import google.registry.config.RegistryConfig.Config;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.registrar.Registrar;
|
||||
import google.registry.model.registrar.RegistrarPoc;
|
||||
import google.registry.reporting.spec11.soy.Spec11EmailSoyInfo;
|
||||
|
@ -136,13 +136,13 @@ public class Spec11EmailUtils {
|
|||
.filter(
|
||||
threatMatch ->
|
||||
tm()
|
||||
.createQueryComposer(DomainBase.class)
|
||||
.createQueryComposer(Domain.class)
|
||||
.where(
|
||||
"fullyQualifiedDomainName",
|
||||
Comparator.EQ,
|
||||
threatMatch.fullyQualifiedDomainName())
|
||||
.stream()
|
||||
.anyMatch(DomainBase::shouldPublishToDns))
|
||||
.anyMatch(Domain::shouldPublishToDns))
|
||||
.collect(toImmutableList());
|
||||
});
|
||||
return RegistrarThreatMatches.create(registrarThreatMatches.clientId(), filteredMatches);
|
||||
|
|
|
@ -21,14 +21,14 @@ import static google.registry.persistence.transaction.TransactionManagerFactory.
|
|||
import com.google.appengine.api.taskqueue.TaskOptions;
|
||||
import com.google.appengine.api.taskqueue.TaskOptions.Method;
|
||||
import com.google.common.base.Joiner;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.registrar.Registrar;
|
||||
import java.util.Optional;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
/**
|
||||
* Helper methods for creating tasks containing CSV line data in the lordn-sunrise and lordn-claims
|
||||
* queues based on DomainBase changes.
|
||||
* queues based on {@link Domain} changes.
|
||||
*
|
||||
* <p>Note that, per the <a href="https://tools.ietf.org/html/draft-ietf-regext-tmch-func-spec-04">
|
||||
* TMCH RFC</a>, while the application-datetime data is optional (which we never send because there
|
||||
|
@ -43,12 +43,10 @@ public final class LordnTaskUtils {
|
|||
public static final String COLUMNS_SUNRISE = "roid,domain-name,SMD-id,registrar-id,"
|
||||
+ "registration-datetime,application-datetime";
|
||||
|
||||
/**
|
||||
* Enqueues a task in the LORDN queue representing a line of CSV for LORDN export.
|
||||
*/
|
||||
public static void enqueueDomainBaseTask(DomainBase domain) {
|
||||
/** Enqueues a task in the LORDN queue representing a line of CSV for LORDN export. */
|
||||
public static void enqueueDomainTask(Domain domain) {
|
||||
tm().assertInTransaction();
|
||||
// This method needs to use ofy transactionTime as the DomainBase's creationTime because
|
||||
// This method needs to use ofy transactionTime as the Domain's creationTime because
|
||||
// CreationTime isn't yet populated when this method is called during the resource flow.
|
||||
String tld = domain.getTld();
|
||||
if (domain.getLaunchNotice() == null) {
|
||||
|
@ -65,7 +63,7 @@ public final class LordnTaskUtils {
|
|||
}
|
||||
|
||||
/** Returns the corresponding CSV LORDN line for a sunrise domain. */
|
||||
public static String getCsvLineForSunriseDomain(DomainBase domain, DateTime transactionTime) {
|
||||
public static String getCsvLineForSunriseDomain(Domain domain, DateTime transactionTime) {
|
||||
return Joiner.on(',')
|
||||
.join(
|
||||
domain.getRepoId(),
|
||||
|
@ -76,7 +74,7 @@ public final class LordnTaskUtils {
|
|||
}
|
||||
|
||||
/** Returns the corresponding CSV LORDN line for a claims domain. */
|
||||
public static String getCsvLineForClaimsDomain(DomainBase domain, DateTime transactionTime) {
|
||||
public static String getCsvLineForClaimsDomain(Domain domain, DateTime transactionTime) {
|
||||
return Joiner.on(',')
|
||||
.join(
|
||||
domain.getRepoId(),
|
||||
|
|
|
@ -20,7 +20,7 @@ import com.google.common.base.Ascii;
|
|||
import com.google.common.base.Strings;
|
||||
import google.registry.model.EppResource;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.index.ForeignKeyIndex;
|
||||
import google.registry.persistence.VKey;
|
||||
|
@ -33,7 +33,7 @@ class CommandUtilities {
|
|||
public enum ResourceType {
|
||||
CONTACT(ContactResource.class),
|
||||
HOST(HostResource.class),
|
||||
DOMAIN(DomainBase.class);
|
||||
DOMAIN(Domain.class);
|
||||
|
||||
private final Class<? extends EppResource> clazz;
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import static google.registry.persistence.transaction.TransactionManagerFactory.
|
|||
|
||||
import com.beust.jcommander.Parameter;
|
||||
import com.beust.jcommander.Parameters;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.util.Clock;
|
||||
import java.util.List;
|
||||
import javax.inject.Inject;
|
||||
|
@ -48,7 +48,7 @@ final class CountDomainsCommand implements CommandWithRemoteApi {
|
|||
private long getCountForTld(String tld, DateTime now) {
|
||||
return tm().transact(
|
||||
() ->
|
||||
tm().createQueryComposer(DomainBase.class)
|
||||
tm().createQueryComposer(Domain.class)
|
||||
.where("tld", Comparator.EQ, tld)
|
||||
.where("deletionTime", Comparator.GT, now)
|
||||
.count());
|
||||
|
|
|
@ -19,7 +19,7 @@ import static google.registry.persistence.transaction.TransactionManagerFactory.
|
|||
|
||||
import com.beust.jcommander.Parameter;
|
||||
import com.beust.jcommander.Parameters;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.registrar.Registrar;
|
||||
import google.registry.model.tld.Registry;
|
||||
import google.registry.model.tld.Registry.TldType;
|
||||
|
@ -79,7 +79,7 @@ final class DeleteTldCommand extends ConfirmingCommand implements CommandWithRem
|
|||
private boolean tldContainsDomains(String tld) {
|
||||
return tm().transact(
|
||||
() ->
|
||||
tm().createQueryComposer(DomainBase.class)
|
||||
tm().createQueryComposer(Domain.class)
|
||||
.where("tld", Comparator.EQ, tld)
|
||||
.first()
|
||||
.isPresent());
|
||||
|
|
|
@ -28,7 +28,7 @@ import google.registry.batch.RelockDomainAction;
|
|||
import google.registry.config.RegistryConfig.Config;
|
||||
import google.registry.model.billing.BillingEvent;
|
||||
import google.registry.model.billing.BillingEvent.Reason;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.RegistryLock;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
|
@ -252,11 +252,11 @@ public final class DomainLockUtils {
|
|||
private RegistryLock.Builder createLockBuilder(
|
||||
String domainName, String registrarId, @Nullable String registrarPocId, boolean isAdmin) {
|
||||
DateTime now = jpaTm().getTransactionTime();
|
||||
DomainBase domainBase = getDomain(domainName, registrarId, now);
|
||||
verifyDomainNotLocked(domainBase, isAdmin);
|
||||
Domain domain = getDomain(domainName, registrarId, now);
|
||||
verifyDomainNotLocked(domain, isAdmin);
|
||||
|
||||
// Multiple pending actions are not allowed for non-admins
|
||||
RegistryLockDao.getMostRecentByRepoId(domainBase.getRepoId())
|
||||
RegistryLockDao.getMostRecentByRepoId(domain.getRepoId())
|
||||
.ifPresent(
|
||||
previousLock ->
|
||||
checkArgument(
|
||||
|
@ -268,7 +268,7 @@ public final class DomainLockUtils {
|
|||
return new RegistryLock.Builder()
|
||||
.setVerificationCode(stringGenerator.createString(VERIFICATION_CODE_LENGTH))
|
||||
.setDomainName(domainName)
|
||||
.setRepoId(domainBase.getRepoId())
|
||||
.setRepoId(domain.getRepoId())
|
||||
.setRegistrarId(registrarId)
|
||||
.setRegistrarPocId(registrarPocId)
|
||||
.isSuperuser(isAdmin);
|
||||
|
@ -277,11 +277,11 @@ public final class DomainLockUtils {
|
|||
private RegistryLock.Builder createUnlockBuilder(
|
||||
String domainName, String registrarId, boolean isAdmin, Optional<Duration> relockDuration) {
|
||||
DateTime now = jpaTm().getTransactionTime();
|
||||
DomainBase domainBase = getDomain(domainName, registrarId, now);
|
||||
Domain domain = getDomain(domainName, registrarId, now);
|
||||
Optional<RegistryLock> lockOptional =
|
||||
RegistryLockDao.getMostRecentVerifiedLockByRepoId(domainBase.getRepoId());
|
||||
RegistryLockDao.getMostRecentVerifiedLockByRepoId(domain.getRepoId());
|
||||
|
||||
verifyDomainLocked(domainBase, isAdmin);
|
||||
verifyDomainLocked(domain, isAdmin);
|
||||
|
||||
RegistryLock.Builder newLockBuilder;
|
||||
if (isAdmin) {
|
||||
|
@ -293,7 +293,7 @@ public final class DomainLockUtils {
|
|||
.map(RegistryLock::asBuilder)
|
||||
.orElse(
|
||||
new RegistryLock.Builder()
|
||||
.setRepoId(domainBase.getRepoId())
|
||||
.setRepoId(domain.getRepoId())
|
||||
.setDomainName(domainName)
|
||||
.setLockCompletionTime(now)
|
||||
.setRegistrarId(registrarId));
|
||||
|
@ -325,24 +325,23 @@ public final class DomainLockUtils {
|
|||
.setRegistrarId(registrarId);
|
||||
}
|
||||
|
||||
private static void verifyDomainNotLocked(DomainBase domainBase, boolean isAdmin) {
|
||||
private static void verifyDomainNotLocked(Domain domain, boolean isAdmin) {
|
||||
checkArgument(
|
||||
isAdmin || !domainBase.getStatusValues().containsAll(REGISTRY_LOCK_STATUSES),
|
||||
isAdmin || !domain.getStatusValues().containsAll(REGISTRY_LOCK_STATUSES),
|
||||
"Domain %s is already locked",
|
||||
domainBase.getDomainName());
|
||||
domain.getDomainName());
|
||||
}
|
||||
|
||||
private static void verifyDomainLocked(DomainBase domainBase, boolean isAdmin) {
|
||||
private static void verifyDomainLocked(Domain domain, boolean isAdmin) {
|
||||
checkArgument(
|
||||
isAdmin
|
||||
|| !Sets.intersection(domainBase.getStatusValues(), REGISTRY_LOCK_STATUSES).isEmpty(),
|
||||
isAdmin || !Sets.intersection(domain.getStatusValues(), REGISTRY_LOCK_STATUSES).isEmpty(),
|
||||
"Domain %s is already unlocked",
|
||||
domainBase.getDomainName());
|
||||
domain.getDomainName());
|
||||
}
|
||||
|
||||
private DomainBase getDomain(String domainName, String registrarId, DateTime now) {
|
||||
DomainBase domain =
|
||||
loadByForeignKeyCached(DomainBase.class, domainName, now)
|
||||
private Domain getDomain(String domainName, String registrarId, DateTime now) {
|
||||
Domain domain =
|
||||
loadByForeignKeyCached(Domain.class, domainName, now)
|
||||
.orElseThrow(() -> new IllegalArgumentException("Domain doesn't exist"));
|
||||
// The user must have specified either the correct registrar ID or the admin registrar ID
|
||||
checkArgument(
|
||||
|
@ -363,10 +362,10 @@ public final class DomainLockUtils {
|
|||
}
|
||||
|
||||
private void applyLockStatuses(RegistryLock lock, DateTime lockTime, boolean isAdmin) {
|
||||
DomainBase domain = getDomain(lock.getDomainName(), lock.getRegistrarId(), lockTime);
|
||||
Domain domain = getDomain(lock.getDomainName(), lock.getRegistrarId(), lockTime);
|
||||
verifyDomainNotLocked(domain, isAdmin);
|
||||
|
||||
DomainBase newDomain =
|
||||
Domain newDomain =
|
||||
domain
|
||||
.asBuilder()
|
||||
.setStatusValues(
|
||||
|
@ -376,10 +375,10 @@ public final class DomainLockUtils {
|
|||
}
|
||||
|
||||
private void removeLockStatuses(RegistryLock lock, boolean isAdmin, DateTime unlockTime) {
|
||||
DomainBase domain = getDomain(lock.getDomainName(), lock.getRegistrarId(), unlockTime);
|
||||
Domain domain = getDomain(lock.getDomainName(), lock.getRegistrarId(), unlockTime);
|
||||
verifyDomainLocked(domain, isAdmin);
|
||||
|
||||
DomainBase newDomain =
|
||||
Domain newDomain =
|
||||
domain
|
||||
.asBuilder()
|
||||
.setStatusValues(
|
||||
|
@ -389,8 +388,7 @@ public final class DomainLockUtils {
|
|||
saveEntities(newDomain, lock, unlockTime, false);
|
||||
}
|
||||
|
||||
private static void saveEntities(
|
||||
DomainBase domain, RegistryLock lock, DateTime now, boolean isLock) {
|
||||
private static void saveEntities(Domain domain, RegistryLock lock, DateTime now, boolean isLock) {
|
||||
String reason =
|
||||
String.format(
|
||||
"%s of a domain through a RegistryLock operation", isLock ? "Lock" : "Unlock");
|
||||
|
|
|
@ -25,7 +25,7 @@ import com.beust.jcommander.Parameters;
|
|||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Streams;
|
||||
import google.registry.config.RegistryConfig.Config;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.poll.PollMessage;
|
||||
import google.registry.model.registrar.Registrar;
|
||||
|
@ -85,11 +85,11 @@ class EnqueuePollMessageCommand extends MutatingCommand {
|
|||
!sendToAll || isNullOrEmpty(clientIds), "Cannot specify both --all and --clients");
|
||||
tm().transact(
|
||||
() -> {
|
||||
Optional<DomainBase> domainOpt =
|
||||
loadByForeignKey(DomainBase.class, domainName, tm().getTransactionTime());
|
||||
Optional<Domain> domainOpt =
|
||||
loadByForeignKey(Domain.class, domainName, tm().getTransactionTime());
|
||||
checkArgument(
|
||||
domainOpt.isPresent(), "Domain %s doesn't exist or isn't active", domainName);
|
||||
DomainBase domain = domainOpt.get();
|
||||
Domain domain = domainOpt.get();
|
||||
ImmutableList<String> registrarIds;
|
||||
if (sendToAll) {
|
||||
registrarIds =
|
||||
|
|
|
@ -25,7 +25,7 @@ import com.beust.jcommander.Parameter;
|
|||
import com.beust.jcommander.Parameters;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.persistence.transaction.QueryComposer.Comparator;
|
||||
import google.registry.tools.params.PathParameter;
|
||||
|
@ -73,13 +73,13 @@ final class GenerateDnsReportCommand implements CommandWithRemoteApi {
|
|||
String generate() {
|
||||
result.append("[\n");
|
||||
|
||||
List<DomainBase> domains =
|
||||
List<Domain> domains =
|
||||
tm().transact(
|
||||
() ->
|
||||
tm().createQueryComposer(DomainBase.class)
|
||||
tm().createQueryComposer(Domain.class)
|
||||
.where("tld", Comparator.EQ, tld)
|
||||
.list());
|
||||
for (DomainBase domain : domains) {
|
||||
for (Domain domain : domains) {
|
||||
// Skip deleted domains and domains that don't get published to DNS.
|
||||
if (isBeforeOrAt(domain.getDeletionTime(), now) || !domain.shouldPublishToDns()) {
|
||||
continue;
|
||||
|
@ -100,7 +100,7 @@ final class GenerateDnsReportCommand implements CommandWithRemoteApi {
|
|||
return result.append("\n]\n").toString();
|
||||
}
|
||||
|
||||
private void write(DomainBase domain) {
|
||||
private void write(Domain domain) {
|
||||
ImmutableList<String> nameservers =
|
||||
ImmutableList.sortedCopyOf(domain.loadNameserverHostNames());
|
||||
ImmutableList<Map<String, ?>> dsData =
|
||||
|
|
|
@ -21,7 +21,7 @@ import static java.nio.charset.StandardCharsets.UTF_8;
|
|||
import com.beust.jcommander.Parameter;
|
||||
import com.beust.jcommander.Parameters;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.tmch.LordnTaskUtils;
|
||||
import google.registry.tools.params.PathParameter;
|
||||
import google.registry.util.Clock;
|
||||
|
@ -65,7 +65,7 @@ final class GenerateLordnCommand implements CommandWithRemoteApi {
|
|||
tm().transact(
|
||||
() ->
|
||||
tm()
|
||||
.createQueryComposer(DomainBase.class)
|
||||
.createQueryComposer(Domain.class)
|
||||
.where("tld", Comparator.EQ, tld)
|
||||
.orderBy("repoId")
|
||||
.stream()
|
||||
|
@ -91,7 +91,7 @@ final class GenerateLordnCommand implements CommandWithRemoteApi {
|
|||
private static void processDomain(
|
||||
ImmutableList.Builder<String> claimsCsv,
|
||||
ImmutableList.Builder<String> sunriseCsv,
|
||||
DomainBase domain) {
|
||||
Domain domain) {
|
||||
String status = " ";
|
||||
if (domain.getLaunchNotice() == null && domain.getSmdId() != null) {
|
||||
sunriseCsv.add(LordnTaskUtils.getCsvLineForSunriseDomain(domain, domain.getCreationTime()));
|
||||
|
|
|
@ -23,7 +23,7 @@ import com.google.common.collect.ImmutableList;
|
|||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.token.AllocationToken;
|
||||
import google.registry.persistence.VKey;
|
||||
import java.util.Collection;
|
||||
|
@ -55,7 +55,7 @@ final class GetAllocationTokenCommand implements CommandWithRemoteApi {
|
|||
.forEach((k, v) -> builder.put(k.getSqlKey().toString(), v)));
|
||||
}
|
||||
ImmutableMap<String, AllocationToken> loadedTokens = builder.build();
|
||||
ImmutableMap<VKey<DomainBase>, DomainBase> domains =
|
||||
ImmutableMap<VKey<Domain>, Domain> domains =
|
||||
tm().transact(() -> loadRedeemedDomains(loadedTokens.values()));
|
||||
|
||||
for (String token : mainParameters) {
|
||||
|
@ -65,10 +65,10 @@ final class GetAllocationTokenCommand implements CommandWithRemoteApi {
|
|||
if (!loadedToken.getRedemptionHistoryEntry().isPresent()) {
|
||||
System.out.printf("Token %s was not redeemed.\n", token);
|
||||
} else {
|
||||
Key<DomainBase> domainOfyKey =
|
||||
Key<Domain> domainOfyKey =
|
||||
loadedToken.getRedemptionHistoryEntry().get().getOfyKey().getParent();
|
||||
DomainBase domain =
|
||||
domains.get(VKey.create(DomainBase.class, domainOfyKey.getName(), domainOfyKey));
|
||||
Domain domain =
|
||||
domains.get(VKey.create(Domain.class, domainOfyKey.getName(), domainOfyKey));
|
||||
if (domain == null) {
|
||||
System.out.printf("ERROR: Token %s was redeemed but domain can't be loaded.\n", token);
|
||||
} else {
|
||||
|
@ -85,22 +85,21 @@ final class GetAllocationTokenCommand implements CommandWithRemoteApi {
|
|||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private static ImmutableMap<VKey<DomainBase>, DomainBase> loadRedeemedDomains(
|
||||
private static ImmutableMap<VKey<Domain>, Domain> loadRedeemedDomains(
|
||||
Collection<AllocationToken> tokens) {
|
||||
ImmutableList<VKey<DomainBase>> domainKeys =
|
||||
ImmutableList<VKey<Domain>> domainKeys =
|
||||
tokens.stream()
|
||||
.map(AllocationToken::getRedemptionHistoryEntry)
|
||||
.filter(Optional::isPresent)
|
||||
.map(Optional::get)
|
||||
.map(key -> tm().loadByKey(key))
|
||||
.map(he -> (Key<DomainBase>) he.getParent())
|
||||
.map(key -> VKey.create(DomainBase.class, key.getName(), key))
|
||||
.map(he -> (Key<Domain>) he.getParent())
|
||||
.map(key -> VKey.create(Domain.class, key.getName(), key))
|
||||
.collect(toImmutableList());
|
||||
ImmutableMap.Builder<VKey<DomainBase>, DomainBase> domainsBuilder =
|
||||
new ImmutableMap.Builder<>();
|
||||
for (List<VKey<DomainBase>> keys : Lists.partition(domainKeys, BATCH_SIZE)) {
|
||||
ImmutableMap.Builder<VKey<Domain>, Domain> domainsBuilder = new ImmutableMap.Builder<>();
|
||||
for (List<VKey<Domain>> keys : Lists.partition(domainKeys, BATCH_SIZE)) {
|
||||
tm().loadByKeys(ImmutableList.copyOf(keys))
|
||||
.forEach((k, v) -> domainsBuilder.put((VKey<DomainBase>) k, v));
|
||||
.forEach((k, v) -> domainsBuilder.put((VKey<Domain>) k, v));
|
||||
}
|
||||
return domainsBuilder.build();
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ import static google.registry.model.EppResourceUtils.loadByForeignKey;
|
|||
|
||||
import com.beust.jcommander.Parameter;
|
||||
import com.beust.jcommander.Parameters;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.util.DomainNameUtils;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -38,7 +38,7 @@ final class GetDomainCommand extends GetEppResourceCommand {
|
|||
printResource(
|
||||
"Domain",
|
||||
canonicalDomain,
|
||||
loadByForeignKey(DomainBase.class, canonicalDomain, readTimestamp));
|
||||
loadByForeignKey(Domain.class, canonicalDomain, readTimestamp));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ import com.beust.jcommander.Parameter;
|
|||
import com.beust.jcommander.Parameters;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.template.soy.data.SoyMapData;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.tools.soy.DomainRenewSoyInfo;
|
||||
import google.registry.util.Clock;
|
||||
import java.util.List;
|
||||
|
@ -77,11 +77,10 @@ final class RenewDomainCommand extends MutatingEppToolCommand {
|
|||
checkArgument(period < 10, "Cannot renew domains for 10 or more years");
|
||||
DateTime now = clock.nowUtc();
|
||||
for (String domainName : mainParameters) {
|
||||
Optional<DomainBase> domainOptional =
|
||||
loadByForeignKey(DomainBase.class, domainName, now);
|
||||
Optional<Domain> domainOptional = loadByForeignKey(Domain.class, domainName, now);
|
||||
checkArgumentPresent(domainOptional, "Domain '%s' does not exist or is deleted", domainName);
|
||||
setSoyTemplate(DomainRenewSoyInfo.getInstance(), DomainRenewSoyInfo.RENEWDOMAIN);
|
||||
DomainBase domain = domainOptional.get();
|
||||
Domain domain = domainOptional.get();
|
||||
|
||||
SoyMapData soyMapData =
|
||||
new SoyMapData(
|
||||
|
|
|
@ -32,7 +32,7 @@ import com.google.common.collect.ImmutableSet;
|
|||
import com.google.common.collect.ImmutableSortedSet;
|
||||
import com.google.template.soy.data.SoyListData;
|
||||
import com.google.template.soy.data.SoyMapData;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.host.HostResource;
|
||||
|
@ -126,9 +126,9 @@ final class UniformRapidSuspensionCommand extends MutatingEppToolCommand {
|
|||
ImmutableList<String> newCanonicalHosts =
|
||||
newHosts.stream().map(DomainNameUtils::canonicalizeHostname).collect(toImmutableList());
|
||||
ImmutableSet<String> newHostsSet = ImmutableSet.copyOf(newCanonicalHosts);
|
||||
Optional<DomainBase> domainOpt = loadByForeignKey(DomainBase.class, domainName, now);
|
||||
Optional<Domain> domainOpt = loadByForeignKey(Domain.class, domainName, now);
|
||||
checkArgumentPresent(domainOpt, "Domain '%s' does not exist or is deleted", domainName);
|
||||
DomainBase domain = domainOpt.get();
|
||||
Domain domain = domainOpt.get();
|
||||
Set<String> missingHosts =
|
||||
difference(newHostsSet, checkResourcesExist(HostResource.class, newCanonicalHosts, now));
|
||||
checkArgument(missingHosts.isEmpty(), "Hosts do not exist: %s", missingHosts);
|
||||
|
@ -202,7 +202,7 @@ final class UniformRapidSuspensionCommand extends MutatingEppToolCommand {
|
|||
Boolean.toString(undo)));
|
||||
}
|
||||
|
||||
private ImmutableSortedSet<String> getExistingNameservers(DomainBase domain) {
|
||||
private ImmutableSortedSet<String> getExistingNameservers(Domain domain) {
|
||||
ImmutableSortedSet.Builder<String> nameservers = ImmutableSortedSet.naturalOrder();
|
||||
for (HostResource host :
|
||||
tm().transact(() -> tm().loadByKeys(domain.getNameservers()).values())) {
|
||||
|
@ -211,7 +211,7 @@ final class UniformRapidSuspensionCommand extends MutatingEppToolCommand {
|
|||
return nameservers.build();
|
||||
}
|
||||
|
||||
private ImmutableSortedSet<String> getExistingLocks(DomainBase domain) {
|
||||
private ImmutableSortedSet<String> getExistingLocks(Domain domain) {
|
||||
ImmutableSortedSet.Builder<String> locks = ImmutableSortedSet.naturalOrder();
|
||||
for (StatusValue lock : domain.getStatusValues()) {
|
||||
if (URS_LOCKS.contains(lock.getXmlName())) {
|
||||
|
@ -221,7 +221,7 @@ final class UniformRapidSuspensionCommand extends MutatingEppToolCommand {
|
|||
return locks.build();
|
||||
}
|
||||
|
||||
private boolean hasClientHold(DomainBase domain) {
|
||||
private boolean hasClientHold(Domain domain) {
|
||||
for (StatusValue status : domain.getStatusValues()) {
|
||||
if (status == StatusValue.CLIENT_HOLD) {
|
||||
return true;
|
||||
|
@ -230,7 +230,7 @@ final class UniformRapidSuspensionCommand extends MutatingEppToolCommand {
|
|||
return false;
|
||||
}
|
||||
|
||||
private ImmutableList<ImmutableMap<String, Object>> getExistingDsData(DomainBase domain) {
|
||||
private ImmutableList<ImmutableMap<String, Object>> getExistingDsData(Domain domain) {
|
||||
ImmutableList.Builder<ImmutableMap<String, Object>> dsDataJsons = new ImmutableList.Builder();
|
||||
HexBinaryAdapter hexBinaryAdapter = new HexBinaryAdapter();
|
||||
for (DelegationSignerData dsData : domain.getDsData()) {
|
||||
|
|
|
@ -32,7 +32,7 @@ import com.google.common.collect.ImmutableMultimap;
|
|||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Sets;
|
||||
import google.registry.model.billing.BillingEvent;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.Period;
|
||||
import google.registry.model.domain.Period.Unit;
|
||||
|
@ -87,11 +87,11 @@ class UnrenewDomainCommand extends ConfirmingCommand implements CommandWithRemot
|
|||
new ImmutableMap.Builder<>();
|
||||
|
||||
for (String domainName : mainParameters) {
|
||||
if (ForeignKeyIndex.load(DomainBase.class, domainName, START_OF_TIME) == null) {
|
||||
if (ForeignKeyIndex.load(Domain.class, domainName, START_OF_TIME) == null) {
|
||||
domainsNonexistentBuilder.add(domainName);
|
||||
continue;
|
||||
}
|
||||
Optional<DomainBase> domain = loadByForeignKey(DomainBase.class, domainName, now);
|
||||
Optional<Domain> domain = loadByForeignKey(Domain.class, domainName, now);
|
||||
if (!domain.isPresent()
|
||||
|| domain.get().getStatusValues().contains(StatusValue.PENDING_DELETE)) {
|
||||
domainsDeletingBuilder.add(domainName);
|
||||
|
@ -139,7 +139,7 @@ class UnrenewDomainCommand extends ConfirmingCommand implements CommandWithRemot
|
|||
StringBuilder resultBuilder = new StringBuilder();
|
||||
DateTime now = clock.nowUtc();
|
||||
for (String domainName : mainParameters) {
|
||||
DomainBase domain = loadByForeignKey(DomainBase.class, domainName, now).get();
|
||||
Domain domain = loadByForeignKey(Domain.class, domainName, now).get();
|
||||
DateTime previousTime = domain.getRegistrationExpirationTime();
|
||||
DateTime newTime = leapSafeSubtractYears(previousTime, period);
|
||||
resultBuilder.append(
|
||||
|
@ -162,8 +162,7 @@ class UnrenewDomainCommand extends ConfirmingCommand implements CommandWithRemot
|
|||
private void unrenewDomain(String domainName) {
|
||||
tm().assertInTransaction();
|
||||
DateTime now = tm().getTransactionTime();
|
||||
Optional<DomainBase> domainOptional =
|
||||
loadByForeignKey(DomainBase.class, domainName, now);
|
||||
Optional<Domain> domainOptional = loadByForeignKey(Domain.class, domainName, now);
|
||||
// Transactional sanity checks on the off chance that something changed between init() running
|
||||
// and here.
|
||||
checkState(
|
||||
|
@ -171,7 +170,7 @@ class UnrenewDomainCommand extends ConfirmingCommand implements CommandWithRemot
|
|||
&& !domainOptional.get().getStatusValues().contains(StatusValue.PENDING_DELETE),
|
||||
"Domain %s was deleted or is pending deletion",
|
||||
domainName);
|
||||
DomainBase domain = domainOptional.get();
|
||||
Domain domain = domainOptional.get();
|
||||
checkState(
|
||||
Sets.intersection(domain.getStatusValues(), DISALLOWED_STATUSES).isEmpty(),
|
||||
"Domain %s has prohibited status values",
|
||||
|
@ -217,7 +216,7 @@ class UnrenewDomainCommand extends ConfirmingCommand implements CommandWithRemot
|
|||
.build();
|
||||
// End the old autorenew billing event and poll message now.
|
||||
updateAutorenewRecurrenceEndTime(domain, now);
|
||||
DomainBase newDomain =
|
||||
Domain newDomain =
|
||||
domain
|
||||
.asBuilder()
|
||||
.setRegistrationExpirationTime(newExpirationTime)
|
||||
|
|
|
@ -32,7 +32,7 @@ import com.google.common.collect.Sets;
|
|||
import com.google.common.flogger.FluentLogger;
|
||||
import com.google.template.soy.data.SoyMapData;
|
||||
import google.registry.model.domain.DesignatedContact;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.GracePeriodBase;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.tools.params.NameserversParameter;
|
||||
|
@ -183,21 +183,21 @@ final class UpdateDomainCommand extends CreateOrUpdateDomainCommand {
|
|||
|
||||
ImmutableSet.Builder<String> autorenewGracePeriodWarningDomains = new ImmutableSet.Builder<>();
|
||||
DateTime now = clock.nowUtc();
|
||||
for (String domain : domains) {
|
||||
Optional<DomainBase> domainOptional = loadByForeignKey(DomainBase.class, domain, now);
|
||||
checkArgumentPresent(domainOptional, "Domain '%s' does not exist or is deleted", domain);
|
||||
DomainBase domainBase = domainOptional.get();
|
||||
for (String domainName : domains) {
|
||||
Optional<Domain> domainOptional = loadByForeignKey(Domain.class, domainName, now);
|
||||
checkArgumentPresent(domainOptional, "Domain '%s' does not exist or is deleted", domainName);
|
||||
Domain domain = domainOptional.get();
|
||||
checkArgument(
|
||||
!domainBase.getStatusValues().contains(SERVER_UPDATE_PROHIBITED),
|
||||
!domain.getStatusValues().contains(SERVER_UPDATE_PROHIBITED),
|
||||
"The domain '%s' has status SERVER_UPDATE_PROHIBITED. Verify that you are allowed "
|
||||
+ "to make updates, and if so, use the domain_unlock command to enable updates.",
|
||||
domain);
|
||||
domainName);
|
||||
checkArgument(
|
||||
!domainBase.getStatusValues().contains(PENDING_DELETE) || forceInPendingDelete,
|
||||
!domain.getStatusValues().contains(PENDING_DELETE) || forceInPendingDelete,
|
||||
"The domain '%s' has status PENDING_DELETE. Verify that you really are intending to "
|
||||
+ "update a domain in pending delete (this is uncommon), and if so, pass the "
|
||||
+ "--force_in_pending_delete parameter to allow this update.",
|
||||
domain);
|
||||
domainName);
|
||||
|
||||
// Use TreeSets so that the results are always in the same order (this makes testing easier).
|
||||
Set<String> addAdminsThisDomain = new TreeSet<>(addAdmins);
|
||||
|
@ -211,7 +211,7 @@ final class UpdateDomainCommand extends CreateOrUpdateDomainCommand {
|
|||
|
||||
if (!nameservers.isEmpty() || !admins.isEmpty() || !techs.isEmpty() || !statuses.isEmpty()) {
|
||||
if (!nameservers.isEmpty()) {
|
||||
ImmutableSortedSet<String> existingNameservers = domainBase.loadNameserverHostNames();
|
||||
ImmutableSortedSet<String> existingNameservers = domain.loadNameserverHostNames();
|
||||
populateAddRemoveLists(
|
||||
ImmutableSet.copyOf(nameservers),
|
||||
existingNameservers,
|
||||
|
@ -224,13 +224,13 @@ final class UpdateDomainCommand extends CreateOrUpdateDomainCommand {
|
|||
checkArgument(
|
||||
numNameservers <= 13,
|
||||
"The resulting nameservers count for domain %s would be more than 13",
|
||||
domain);
|
||||
domainName);
|
||||
}
|
||||
if (!admins.isEmpty() || !techs.isEmpty()) {
|
||||
ImmutableSet<String> existingAdmins =
|
||||
getContactsOfType(domainBase, DesignatedContact.Type.ADMIN);
|
||||
getContactsOfType(domain, DesignatedContact.Type.ADMIN);
|
||||
ImmutableSet<String> existingTechs =
|
||||
getContactsOfType(domainBase, DesignatedContact.Type.TECH);
|
||||
getContactsOfType(domain, DesignatedContact.Type.TECH);
|
||||
|
||||
if (!admins.isEmpty()) {
|
||||
populateAddRemoveLists(
|
||||
|
@ -249,7 +249,7 @@ final class UpdateDomainCommand extends CreateOrUpdateDomainCommand {
|
|||
}
|
||||
if (!statuses.isEmpty()) {
|
||||
Set<String> currentStatusValues = new HashSet<>();
|
||||
for (StatusValue statusValue : domainBase.getStatusValues()) {
|
||||
for (StatusValue statusValue : domain.getStatusValues()) {
|
||||
currentStatusValues.add(statusValue.getXmlName());
|
||||
}
|
||||
populateAddRemoveLists(
|
||||
|
@ -280,24 +280,24 @@ final class UpdateDomainCommand extends CreateOrUpdateDomainCommand {
|
|||
|| clearDsRecords);
|
||||
|
||||
if (!add && !remove && !change && !secDns && autorenews == null) {
|
||||
logger.atInfo().log("No changes need to be made to domain '%s'.", domain);
|
||||
logger.atInfo().log("No changes need to be made to domain '%s'.", domainName);
|
||||
continue;
|
||||
}
|
||||
|
||||
// If autorenew is being turned off and this domain is already in the autorenew grace period,
|
||||
// then we want to warn the user that they might want to delete it instead.
|
||||
if (Boolean.FALSE.equals(autorenews)) {
|
||||
if (domainBase.getGracePeriods().stream()
|
||||
if (domain.getGracePeriods().stream()
|
||||
.map(GracePeriodBase::getType)
|
||||
.anyMatch(isEqual(AUTO_RENEW))) {
|
||||
autorenewGracePeriodWarningDomains.add(domain);
|
||||
autorenewGracePeriodWarningDomains.add(domainName);
|
||||
}
|
||||
}
|
||||
|
||||
setSoyTemplate(DomainUpdateSoyInfo.getInstance(), DomainUpdateSoyInfo.DOMAINUPDATE);
|
||||
SoyMapData soyMapData =
|
||||
new SoyMapData(
|
||||
"domain", domain,
|
||||
"domain", domainName,
|
||||
"add", add,
|
||||
"addNameservers", addNameserversThisDomain,
|
||||
"addAdmins", addAdminsThisDomain,
|
||||
|
@ -341,11 +341,10 @@ final class UpdateDomainCommand extends CreateOrUpdateDomainCommand {
|
|||
removeSet.addAll(Sets.difference(oldSet, targetSet));
|
||||
}
|
||||
|
||||
ImmutableSet<String> getContactsOfType(
|
||||
DomainBase domainBase, final DesignatedContact.Type contactType) {
|
||||
ImmutableSet<String> getContactsOfType(Domain domain, final DesignatedContact.Type contactType) {
|
||||
return tm().transact(
|
||||
() ->
|
||||
domainBase.getContacts().stream()
|
||||
domain.getContacts().stream()
|
||||
.filter(contact -> contact.getType().equals(contactType))
|
||||
.map(contact -> tm().loadByKey(contact.getContactKey()).getContactId())
|
||||
.collect(toImmutableSet()));
|
||||
|
|
|
@ -16,13 +16,13 @@ package google.registry.tools.params;
|
|||
|
||||
import google.registry.model.EppResource;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.host.HostResource;
|
||||
|
||||
/** Enum to make it easy for a command to accept a flag that specifies an EppResource subclass. */
|
||||
public enum EppResourceTypeParameter {
|
||||
CONTACT(ContactResource.class),
|
||||
DOMAIN(DomainBase.class),
|
||||
DOMAIN(Domain.class),
|
||||
HOST(HostResource.class);
|
||||
|
||||
private final Class<? extends EppResource> type;
|
||||
|
|
|
@ -29,7 +29,7 @@ import com.google.common.collect.ImmutableSet;
|
|||
import com.google.common.flogger.FluentLogger;
|
||||
import google.registry.config.RegistryConfig.Config;
|
||||
import google.registry.gcs.GcsUtils;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.request.Action;
|
||||
|
@ -168,7 +168,7 @@ public class GenerateZoneFilesAction implements Runnable, JsonActionRunner.JsonA
|
|||
.setCacheMode(CacheMode.IGNORE)
|
||||
.scroll(ScrollMode.FORWARD_ONLY);
|
||||
for (int i = 1; scrollableResults.next(); i = (i + 1) % BATCH_SIZE) {
|
||||
DomainBase domain = (DomainBase) scrollableResults.get(0);
|
||||
Domain domain = (Domain) scrollableResults.get(0);
|
||||
populateStanzasForDomain(domain, exportTime, result);
|
||||
if (i == 0) {
|
||||
jpaTm().getEntityManager().flush();
|
||||
|
@ -179,7 +179,7 @@ public class GenerateZoneFilesAction implements Runnable, JsonActionRunner.JsonA
|
|||
}
|
||||
|
||||
private void populateStanzasForDomain(
|
||||
DomainBase domain, DateTime exportTime, ImmutableList.Builder<String> result) {
|
||||
Domain domain, DateTime exportTime, ImmutableList.Builder<String> result) {
|
||||
domain = loadAtPointInTime(domain, exportTime);
|
||||
// A null means the domain was deleted (or not created) at this time.
|
||||
if (domain == null || !domain.shouldPublishToDns()) {
|
||||
|
@ -193,7 +193,7 @@ public class GenerateZoneFilesAction implements Runnable, JsonActionRunner.JsonA
|
|||
}
|
||||
|
||||
private void populateStanzasForSubordinateHosts(
|
||||
DomainBase domain, DateTime exportTime, ImmutableList.Builder<String> result) {
|
||||
Domain domain, DateTime exportTime, ImmutableList.Builder<String> result) {
|
||||
ImmutableSet<String> subordinateHosts = domain.getSubordinateHosts();
|
||||
if (!subordinateHosts.isEmpty()) {
|
||||
for (HostResource unprojectedHost : tm().loadByKeys(domain.getNameservers()).values()) {
|
||||
|
@ -229,7 +229,7 @@ public class GenerateZoneFilesAction implements Runnable, JsonActionRunner.JsonA
|
|||
* }
|
||||
* </pre>
|
||||
*/
|
||||
private String domainStanza(DomainBase domain, DateTime exportTime) {
|
||||
private String domainStanza(Domain domain, DateTime exportTime) {
|
||||
StringBuilder result = new StringBuilder();
|
||||
String domainLabel = stripTld(domain.getDomainName(), domain.getTld());
|
||||
for (HostResource nameserver : tm().loadByKeys(domain.getNameservers()).values()) {
|
||||
|
|
|
@ -31,7 +31,7 @@ import com.google.common.collect.ImmutableSet;
|
|||
import com.google.common.collect.Lists;
|
||||
import google.registry.model.EppResource;
|
||||
import google.registry.model.EppResourceUtils;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.request.Action;
|
||||
import google.registry.request.Parameter;
|
||||
import google.registry.request.auth.Auth;
|
||||
|
@ -47,7 +47,7 @@ import org.joda.time.DateTime;
|
|||
path = ListDomainsAction.PATH,
|
||||
method = {GET, POST},
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public final class ListDomainsAction extends ListObjectsAction<DomainBase> {
|
||||
public final class ListDomainsAction extends ListObjectsAction<Domain> {
|
||||
|
||||
/** An App Engine limitation on how many subqueries can be used in a single query. */
|
||||
@VisibleForTesting @NonFinalForTesting static int maxNumSubqueries = 30;
|
||||
|
@ -73,22 +73,22 @@ public final class ListDomainsAction extends ListObjectsAction<DomainBase> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ImmutableSet<DomainBase> loadObjects() {
|
||||
public ImmutableSet<Domain> loadObjects() {
|
||||
checkArgument(!tlds.isEmpty(), "Must specify TLDs to query");
|
||||
assertTldsExist(tlds);
|
||||
ImmutableList<DomainBase> domains = tm().isOfy() ? loadDomainsOfy() : loadDomainsSql();
|
||||
ImmutableList<Domain> domains = tm().isOfy() ? loadDomainsOfy() : loadDomainsSql();
|
||||
return ImmutableSet.copyOf(domains.reverse());
|
||||
}
|
||||
|
||||
private ImmutableList<DomainBase> loadDomainsOfy() {
|
||||
private ImmutableList<Domain> loadDomainsOfy() {
|
||||
DateTime now = clock.nowUtc();
|
||||
ImmutableList.Builder<DomainBase> domainsBuilder = new ImmutableList.Builder<>();
|
||||
ImmutableList.Builder<Domain> domainsBuilder = new ImmutableList.Builder<>();
|
||||
// Combine the batches together by sorting all domains together with newest first, applying the
|
||||
// limit, and then reversing for display order.
|
||||
for (List<String> tldsBatch : Lists.partition(tlds.asList(), maxNumSubqueries)) {
|
||||
auditedOfy()
|
||||
.load()
|
||||
.type(DomainBase.class)
|
||||
.type(Domain.class)
|
||||
.filter("tld in", tldsBatch)
|
||||
// Get the N most recently created domains (requires ordering in descending order).
|
||||
.order("-creationTime")
|
||||
|
@ -107,7 +107,7 @@ public final class ListDomainsAction extends ListObjectsAction<DomainBase> {
|
|||
.collect(toImmutableList());
|
||||
}
|
||||
|
||||
private ImmutableList<DomainBase> loadDomainsSql() {
|
||||
private ImmutableList<Domain> loadDomainsSql() {
|
||||
return jpaTm()
|
||||
.transact(
|
||||
() ->
|
||||
|
@ -115,7 +115,7 @@ public final class ListDomainsAction extends ListObjectsAction<DomainBase> {
|
|||
.query(
|
||||
"FROM Domain WHERE tld IN (:tlds) AND deletionTime > "
|
||||
+ "current_timestamp() ORDER BY creationTime DESC",
|
||||
DomainBase.class)
|
||||
Domain.class)
|
||||
.setParameter("tlds", tlds)
|
||||
.setMaxResults(limit)
|
||||
.getResultStream()
|
||||
|
|
|
@ -18,7 +18,7 @@ import static google.registry.model.EppResourceUtils.loadByForeignKey;
|
|||
import static google.registry.model.EppResourceUtils.loadByForeignKeyCached;
|
||||
|
||||
import com.google.common.net.InternetDomainName;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import java.util.Optional;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
|
@ -42,10 +42,10 @@ public class DomainLookupCommand extends DomainOrHostLookupCommand {
|
|||
|
||||
@Override
|
||||
protected Optional<WhoisResponse> getResponse(InternetDomainName domainName, DateTime now) {
|
||||
Optional<DomainBase> domainResource =
|
||||
Optional<Domain> domainResource =
|
||||
cached
|
||||
? loadByForeignKeyCached(DomainBase.class, domainName.toString(), now)
|
||||
: loadByForeignKey(DomainBase.class, domainName.toString(), now);
|
||||
? loadByForeignKeyCached(Domain.class, domainName.toString(), now)
|
||||
: loadByForeignKey(Domain.class, domainName.toString(), now);
|
||||
return domainResource.map(
|
||||
domain -> new DomainWhoisResponse(domain, fullOutput, whoisRedactedEmailText, now));
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ import google.registry.model.contact.ContactResource;
|
|||
import google.registry.model.contact.PostalInfo;
|
||||
import google.registry.model.domain.DesignatedContact;
|
||||
import google.registry.model.domain.DesignatedContact.Type;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.registrar.Registrar;
|
||||
|
@ -54,7 +54,7 @@ final class DomainWhoisResponse extends WhoisResponseImpl {
|
|||
"For more information on Whois status codes, please visit https://icann.org/epp\r\n";
|
||||
|
||||
/** Domain which was the target of this WHOIS command. */
|
||||
private final DomainBase domain;
|
||||
private final Domain domain;
|
||||
|
||||
/** Whether the full WHOIS output is to be displayed. */
|
||||
private final boolean fullOutput;
|
||||
|
@ -62,9 +62,9 @@ final class DomainWhoisResponse extends WhoisResponseImpl {
|
|||
/** When fullOutput is false, the text to display for the registrant's email fields. */
|
||||
private final String whoisRedactedEmailText;
|
||||
|
||||
/** Creates new WHOIS domain response on the given domain. */
|
||||
/** Creates new WHOIS domain response on the given domain. */
|
||||
DomainWhoisResponse(
|
||||
DomainBase domain, boolean fullOutput, String whoisRedactedEmailText, DateTime timestamp) {
|
||||
Domain domain, boolean fullOutput, String whoisRedactedEmailText, DateTime timestamp) {
|
||||
super(timestamp);
|
||||
this.domain = checkNotNull(domain, "domain");
|
||||
this.fullOutput = fullOutput;
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
<class>google.registry.model.common.DatabaseMigrationStateSchedule</class>
|
||||
<class>google.registry.model.contact.ContactHistory</class>
|
||||
<class>google.registry.model.contact.ContactResource</class>
|
||||
<class>google.registry.model.domain.DomainBase</class>
|
||||
<class>google.registry.model.domain.Domain</class>
|
||||
<class>google.registry.model.domain.DomainHistory</class>
|
||||
<class>google.registry.model.domain.GracePeriod</class>
|
||||
<class>google.registry.model.domain.GracePeriod$GracePeriodHistory</class>
|
||||
|
@ -102,7 +102,7 @@
|
|||
<class>google.registry.model.billing.VKeyConverter_OneTime</class>
|
||||
<class>google.registry.model.billing.VKeyConverter_Recurring</class>
|
||||
<class>google.registry.model.contact.VKeyConverter_ContactResource</class>
|
||||
<class>google.registry.model.domain.VKeyConverter_DomainBase</class>
|
||||
<class>google.registry.model.domain.VKeyConverter_Domain</class>
|
||||
<class>google.registry.model.domain.token.VKeyConverter_AllocationToken</class>
|
||||
<class>google.registry.model.host.VKeyConverter_HostResource</class>
|
||||
<class>google.registry.model.poll.VKeyConverter_Autorenew</class>
|
||||
|
|
|
@ -21,7 +21,6 @@ import static google.registry.model.reporting.HistoryEntry.Type.DOMAIN_CREATE;
|
|||
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
||||
import static google.registry.testing.DatabaseHelper.createTld;
|
||||
import static google.registry.testing.DatabaseHelper.loadByEntity;
|
||||
import static google.registry.testing.DatabaseHelper.newDomainBase;
|
||||
import static google.registry.testing.DatabaseHelper.persistActiveDomain;
|
||||
import static google.registry.testing.DatabaseHelper.persistResource;
|
||||
import static google.registry.util.DateTimeUtils.END_OF_TIME;
|
||||
|
@ -33,13 +32,14 @@ import google.registry.flows.EppTestComponent.FakesAndMocksModule;
|
|||
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.DomainBase;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.ofy.Ofy;
|
||||
import google.registry.model.poll.PollMessage;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.persistence.transaction.QueryComposer.Comparator;
|
||||
import google.registry.testing.AppEngineExtension;
|
||||
import google.registry.testing.DatabaseHelper;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.FakeLockHandler;
|
||||
import google.registry.testing.FakeResponse;
|
||||
|
@ -82,21 +82,21 @@ class DeleteExpiredDomainsActionTest {
|
|||
@Test
|
||||
void test_deletesOnlyExpiredDomain() {
|
||||
// A normal, active autorenewing domain that shouldn't be touched.
|
||||
DomainBase activeDomain = persistActiveDomain("foo.tld");
|
||||
Domain activeDomain = persistActiveDomain("foo.tld");
|
||||
|
||||
// A non-autorenewing domain that is already pending delete and shouldn't be touched.
|
||||
DomainBase alreadyDeletedDomain =
|
||||
Domain alreadyDeletedDomain =
|
||||
persistResource(
|
||||
newDomainBase("bar.tld")
|
||||
DatabaseHelper.newDomain("bar.tld")
|
||||
.asBuilder()
|
||||
.setAutorenewEndTime(Optional.of(clock.nowUtc().minusDays(10)))
|
||||
.setDeletionTime(clock.nowUtc().plusDays(17))
|
||||
.build());
|
||||
|
||||
// A non-autorenewing domain that hasn't reached its expiration time and shouldn't be touched.
|
||||
DomainBase notYetExpiredDomain =
|
||||
Domain notYetExpiredDomain =
|
||||
persistResource(
|
||||
newDomainBase("baz.tld")
|
||||
DatabaseHelper.newDomain("baz.tld")
|
||||
.asBuilder()
|
||||
.setAutorenewEndTime(Optional.of(clock.nowUtc().plusDays(15)))
|
||||
.build());
|
||||
|
@ -104,7 +104,7 @@ class DeleteExpiredDomainsActionTest {
|
|||
// A non-autorenewing domain that is past its expiration time and should be deleted.
|
||||
// (This is the only one that needs a full set of subsidiary resources, for the delete flow to
|
||||
// to operate on.)
|
||||
DomainBase pendingExpirationDomain = persistNonAutorenewingDomain("fizz.tld");
|
||||
Domain pendingExpirationDomain = persistNonAutorenewingDomain("fizz.tld");
|
||||
|
||||
assertThat(loadByEntity(pendingExpirationDomain).getStatusValues())
|
||||
.doesNotContain(PENDING_DELETE);
|
||||
|
@ -114,21 +114,21 @@ class DeleteExpiredDomainsActionTest {
|
|||
clock.advanceOneMilli();
|
||||
action.run();
|
||||
|
||||
DomainBase reloadedActiveDomain = loadByEntity(activeDomain);
|
||||
Domain reloadedActiveDomain = loadByEntity(activeDomain);
|
||||
assertThat(reloadedActiveDomain).isEqualTo(activeDomain);
|
||||
assertThat(reloadedActiveDomain.getStatusValues()).doesNotContain(PENDING_DELETE);
|
||||
assertThat(loadByEntity(alreadyDeletedDomain)).isEqualTo(alreadyDeletedDomain);
|
||||
assertThat(loadByEntity(notYetExpiredDomain)).isEqualTo(notYetExpiredDomain);
|
||||
DomainBase reloadedExpiredDomain = loadByEntity(pendingExpirationDomain);
|
||||
Domain reloadedExpiredDomain = loadByEntity(pendingExpirationDomain);
|
||||
assertThat(reloadedExpiredDomain.getStatusValues()).contains(PENDING_DELETE);
|
||||
assertThat(reloadedExpiredDomain.getDeletionTime()).isEqualTo(clock.nowUtc().plusDays(35));
|
||||
}
|
||||
|
||||
@Test
|
||||
void test_deletesThreeDomainsInOneRun() throws Exception {
|
||||
DomainBase domain1 = persistNonAutorenewingDomain("ecck1.tld");
|
||||
DomainBase domain2 = persistNonAutorenewingDomain("veee2.tld");
|
||||
DomainBase domain3 = persistNonAutorenewingDomain("tarm3.tld");
|
||||
Domain domain1 = persistNonAutorenewingDomain("ecck1.tld");
|
||||
Domain domain2 = persistNonAutorenewingDomain("veee2.tld");
|
||||
Domain domain3 = persistNonAutorenewingDomain("tarm3.tld");
|
||||
|
||||
// action.run() executes an ancestor-less query which is subject to eventual consistency (it
|
||||
// uses an index that is updated asynchronously). For a deterministic test outcome, we busy
|
||||
|
@ -139,10 +139,10 @@ class DeleteExpiredDomainsActionTest {
|
|||
tm().transact(
|
||||
() ->
|
||||
tm()
|
||||
.createQueryComposer(DomainBase.class)
|
||||
.createQueryComposer(Domain.class)
|
||||
.where("autorenewEndTime", Comparator.LTE, clock.nowUtc())
|
||||
.stream()
|
||||
.map(DomainBase::getDomainName)
|
||||
.map(Domain::getDomainName)
|
||||
.collect(toImmutableSet()));
|
||||
if (matchingDomains.containsAll(ImmutableSet.of("ecck1.tld", "veee2.tld", "tarm3.tld"))) {
|
||||
break;
|
||||
|
@ -164,8 +164,8 @@ class DeleteExpiredDomainsActionTest {
|
|||
assertThat(loadByEntity(domain3).getStatusValues()).contains(PENDING_DELETE);
|
||||
}
|
||||
|
||||
private DomainBase persistNonAutorenewingDomain(String domainName) {
|
||||
DomainBase pendingExpirationDomain = persistActiveDomain(domainName);
|
||||
private Domain persistNonAutorenewingDomain(String domainName) {
|
||||
Domain pendingExpirationDomain = persistActiveDomain(domainName);
|
||||
DomainHistory createHistoryEntry =
|
||||
persistResource(
|
||||
new DomainHistory.Builder()
|
||||
|
|
|
@ -22,7 +22,6 @@ import static google.registry.persistence.transaction.TransactionManagerFactory.
|
|||
import static google.registry.testing.DatabaseHelper.createTld;
|
||||
import static google.registry.testing.DatabaseHelper.loadByEntitiesIfPresent;
|
||||
import static google.registry.testing.DatabaseHelper.loadByEntity;
|
||||
import static google.registry.testing.DatabaseHelper.newDomainBase;
|
||||
import static google.registry.testing.DatabaseHelper.persistActiveDomain;
|
||||
import static google.registry.testing.DatabaseHelper.persistActiveHost;
|
||||
import static google.registry.testing.DatabaseHelper.persistDeletedDomain;
|
||||
|
@ -42,7 +41,7 @@ import google.registry.dns.DnsQueue;
|
|||
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.Domain;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.index.EppResourceIndex;
|
||||
import google.registry.model.index.ForeignKeyIndex;
|
||||
|
@ -51,6 +50,7 @@ import google.registry.model.reporting.HistoryEntry;
|
|||
import google.registry.model.tld.Registry;
|
||||
import google.registry.model.tld.Registry.TldType;
|
||||
import google.registry.testing.AppEngineExtension;
|
||||
import google.registry.testing.DatabaseHelper;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.SystemPropertyExtension;
|
||||
import java.util.Optional;
|
||||
|
@ -173,7 +173,7 @@ class DeleteProberDataActionTest {
|
|||
|
||||
@Test
|
||||
void testSuccess_doesntDeleteNicDomainForProbers() throws Exception {
|
||||
DomainBase nic = persistActiveDomain("nic.ib-any.test");
|
||||
Domain nic = persistActiveDomain("nic.ib-any.test");
|
||||
Set<ImmutableObject> ibEntities = persistLotsOfDomains("ib-any.test");
|
||||
action.run();
|
||||
assertAllAbsent(ibEntities);
|
||||
|
@ -192,32 +192,32 @@ class DeleteProberDataActionTest {
|
|||
|
||||
@Test
|
||||
void testSuccess_activeDomain_isSoftDeleted() throws Exception {
|
||||
DomainBase domain =
|
||||
Domain domain =
|
||||
persistResource(
|
||||
newDomainBase("blah.ib-any.test")
|
||||
DatabaseHelper.newDomain("blah.ib-any.test")
|
||||
.asBuilder()
|
||||
.setCreationTimeForTest(DateTime.now(UTC).minusYears(1))
|
||||
.build());
|
||||
action.run();
|
||||
DateTime timeAfterDeletion = DateTime.now(UTC);
|
||||
assertThat(loadByForeignKey(DomainBase.class, "blah.ib-any.test", timeAfterDeletion)).isEmpty();
|
||||
assertThat(loadByForeignKey(Domain.class, "blah.ib-any.test", timeAfterDeletion)).isEmpty();
|
||||
assertThat(loadByEntity(domain).getDeletionTime()).isLessThan(timeAfterDeletion);
|
||||
assertDnsTasksEnqueued("blah.ib-any.test");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSuccess_activeDomain_doubleMapSoftDeletes() throws Exception {
|
||||
DomainBase domain = persistResource(
|
||||
newDomainBase("blah.ib-any.test")
|
||||
.asBuilder()
|
||||
.setCreationTimeForTest(DateTime.now(UTC).minusYears(1))
|
||||
.build());
|
||||
Domain domain =
|
||||
persistResource(
|
||||
DatabaseHelper.newDomain("blah.ib-any.test")
|
||||
.asBuilder()
|
||||
.setCreationTimeForTest(DateTime.now(UTC).minusYears(1))
|
||||
.build());
|
||||
action.run();
|
||||
DateTime timeAfterDeletion = DateTime.now(UTC);
|
||||
resetAction();
|
||||
action.run();
|
||||
assertThat(loadByForeignKey(DomainBase.class, "blah.ib-any.test", timeAfterDeletion))
|
||||
.isEmpty();
|
||||
assertThat(loadByForeignKey(Domain.class, "blah.ib-any.test", timeAfterDeletion)).isEmpty();
|
||||
assertThat(loadByEntity(domain).getDeletionTime()).isLessThan(timeAfterDeletion);
|
||||
assertDnsTasksEnqueued("blah.ib-any.test");
|
||||
}
|
||||
|
@ -225,22 +225,21 @@ class DeleteProberDataActionTest {
|
|||
@Test
|
||||
void test_recentlyCreatedDomain_isntDeletedYet() throws Exception {
|
||||
persistResource(
|
||||
newDomainBase("blah.ib-any.test")
|
||||
DatabaseHelper.newDomain("blah.ib-any.test")
|
||||
.asBuilder()
|
||||
.setCreationTimeForTest(DateTime.now(UTC).minusSeconds(1))
|
||||
.build());
|
||||
action.run();
|
||||
Optional<DomainBase> domain =
|
||||
loadByForeignKey(DomainBase.class, "blah.ib-any.test", DateTime.now(UTC));
|
||||
Optional<Domain> domain = loadByForeignKey(Domain.class, "blah.ib-any.test", DateTime.now(UTC));
|
||||
assertThat(domain).isPresent();
|
||||
assertThat(domain.get().getDeletionTime()).isEqualTo(END_OF_TIME);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testDryRun_doesntSoftDeleteData() throws Exception {
|
||||
DomainBase domain =
|
||||
Domain domain =
|
||||
persistResource(
|
||||
newDomainBase("blah.ib-any.test")
|
||||
DatabaseHelper.newDomain("blah.ib-any.test")
|
||||
.asBuilder()
|
||||
.setCreationTimeForTest(DateTime.now(UTC).minusYears(1))
|
||||
.build());
|
||||
|
@ -252,11 +251,11 @@ class DeleteProberDataActionTest {
|
|||
@Test
|
||||
void test_domainWithSubordinateHosts_isSkipped() throws Exception {
|
||||
persistActiveHost("ns1.blah.ib-any.test");
|
||||
DomainBase nakedDomain =
|
||||
Domain nakedDomain =
|
||||
persistDeletedDomain("todelete.ib-any.test", DateTime.now(UTC).minusYears(1));
|
||||
DomainBase domainWithSubord =
|
||||
Domain domainWithSubord =
|
||||
persistDomainAsDeleted(
|
||||
newDomainBase("blah.ib-any.test")
|
||||
DatabaseHelper.newDomain("blah.ib-any.test")
|
||||
.asBuilder()
|
||||
.setSubordinateHosts(ImmutableSet.of("ns1.blah.ib-any.test"))
|
||||
.build(),
|
||||
|
@ -270,7 +269,7 @@ class DeleteProberDataActionTest {
|
|||
@Test
|
||||
void testFailure_registryAdminClientId_isRequiredForSoftDeletion() {
|
||||
persistResource(
|
||||
newDomainBase("blah.ib-any.test")
|
||||
DatabaseHelper.newDomain("blah.ib-any.test")
|
||||
.asBuilder()
|
||||
.setCreationTimeForTest(DateTime.now(UTC).minusYears(1))
|
||||
.build());
|
||||
|
@ -284,7 +283,7 @@ class DeleteProberDataActionTest {
|
|||
* along with the ForeignKeyIndex and EppResourceIndex.
|
||||
*/
|
||||
private static Set<ImmutableObject> persistDomainAndDescendants(String fqdn) {
|
||||
DomainBase domain = persistDeletedDomain(fqdn, DELETION_TIME);
|
||||
Domain domain = persistDeletedDomain(fqdn, DELETION_TIME);
|
||||
DomainHistory historyEntry =
|
||||
persistSimpleResource(
|
||||
new DomainHistory.Builder()
|
||||
|
@ -321,7 +320,7 @@ class DeleteProberDataActionTest {
|
|||
.add(pollMessage);
|
||||
if (tm().isOfy()) {
|
||||
builder
|
||||
.add(ForeignKeyIndex.load(DomainBase.class, fqdn, START_OF_TIME))
|
||||
.add(ForeignKeyIndex.load(Domain.class, fqdn, START_OF_TIME))
|
||||
.add(loadByEntity(EppResourceIndex.create(Key.create(domain))));
|
||||
}
|
||||
return builder.build();
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue