mirror of
https://github.com/google/nomulus.git
synced 2025-07-09 12:43:24 +02:00
Switch from using raw HistoryEntries to typed subclasses thereof (#1150)
HistoryEntry is used to record all histories (contact, domain, host) in Datastore. In SQL it is now split into three subclasses (and thus tables): ContactHistory, DomainHistory and HostHistory. Its builder is genericized as a result which led to a lot of compiler warnings for the use of a raw HistoryEntry in the existing code base. This PR cleans things up by replacing all the explicit use of raw HistoryEntry with the corresponding subclass and also adds some guardrails to prevent the use of raw HistoryEntry accidentally. Note that because DomainHistory includes nsHosts and gracePeriodHistory, both of which are assigned a roid from ofy when built, the assigned roids for resources after history entries are built are incremented compared to when only HistoryEntrys are built (before this PR) in RdapDomainSearchActionTest. Also added a convenient tm().updateAll() varargs method. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/google/nomulus/1150) <!-- Reviewable:end -->
This commit is contained in:
parent
f7dca7fa96
commit
02eb7cfcc3
42 changed files with 380 additions and 229 deletions
|
@ -370,11 +370,10 @@ public class DeleteContactsAndHostsAction implements Runnable {
|
||||||
: "it was transferred prior to deletion");
|
: "it was transferred prior to deletion");
|
||||||
|
|
||||||
HistoryEntry historyEntry =
|
HistoryEntry historyEntry =
|
||||||
new HistoryEntry.Builder()
|
HistoryEntry.createBuilderForResource(resource)
|
||||||
.setClientId(deletionRequest.requestingClientId())
|
.setClientId(deletionRequest.requestingClientId())
|
||||||
.setModificationTime(now)
|
.setModificationTime(now)
|
||||||
.setType(getHistoryEntryType(resource, deleteAllowed))
|
.setType(getHistoryEntryType(resource, deleteAllowed))
|
||||||
.setParent(deletionRequest.key())
|
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
PollMessage.OneTime pollMessage =
|
PollMessage.OneTime pollMessage =
|
||||||
|
@ -409,7 +408,9 @@ public class DeleteContactsAndHostsAction implements Runnable {
|
||||||
} else {
|
} else {
|
||||||
resourceToSave = resource.asBuilder().removeStatusValue(PENDING_DELETE).build();
|
resourceToSave = resource.asBuilder().removeStatusValue(PENDING_DELETE).build();
|
||||||
}
|
}
|
||||||
auditedOfy().save().<ImmutableObject>entities(resourceToSave, historyEntry, pollMessage);
|
auditedOfy()
|
||||||
|
.save()
|
||||||
|
.<ImmutableObject>entities(resourceToSave, historyEntry.asHistoryEntry(), pollMessage);
|
||||||
return DeletionResult.create(
|
return DeletionResult.create(
|
||||||
deleteAllowed ? Type.DELETED : Type.NOT_DELETED, pollMessageText);
|
deleteAllowed ? Type.DELETED : Type.NOT_DELETED, pollMessageText);
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,11 +44,11 @@ import google.registry.mapreduce.MapreduceRunner;
|
||||||
import google.registry.mapreduce.inputs.EppResourceInputs;
|
import google.registry.mapreduce.inputs.EppResourceInputs;
|
||||||
import google.registry.model.EppResourceUtils;
|
import google.registry.model.EppResourceUtils;
|
||||||
import google.registry.model.domain.DomainBase;
|
import google.registry.model.domain.DomainBase;
|
||||||
|
import google.registry.model.domain.DomainHistory;
|
||||||
import google.registry.model.index.EppResourceIndex;
|
import google.registry.model.index.EppResourceIndex;
|
||||||
import google.registry.model.index.ForeignKeyIndex;
|
import google.registry.model.index.ForeignKeyIndex;
|
||||||
import google.registry.model.registry.Registry;
|
import google.registry.model.registry.Registry;
|
||||||
import google.registry.model.registry.Registry.TldType;
|
import google.registry.model.registry.Registry.TldType;
|
||||||
import google.registry.model.reporting.HistoryEntry;
|
|
||||||
import google.registry.request.Action;
|
import google.registry.request.Action;
|
||||||
import google.registry.request.Parameter;
|
import google.registry.request.Parameter;
|
||||||
import google.registry.request.Response;
|
import google.registry.request.Response;
|
||||||
|
@ -253,9 +253,9 @@ public class DeleteProberDataAction implements Runnable {
|
||||||
.setDeletionTime(tm().getTransactionTime())
|
.setDeletionTime(tm().getTransactionTime())
|
||||||
.setStatusValues(null)
|
.setStatusValues(null)
|
||||||
.build();
|
.build();
|
||||||
HistoryEntry historyEntry =
|
DomainHistory historyEntry =
|
||||||
new HistoryEntry.Builder()
|
new DomainHistory.Builder()
|
||||||
.setParent(domain)
|
.setDomain(domain)
|
||||||
.setType(DOMAIN_DELETE)
|
.setType(DOMAIN_DELETE)
|
||||||
.setModificationTime(tm().getTransactionTime())
|
.setModificationTime(tm().getTransactionTime())
|
||||||
.setBySuperuser(true)
|
.setBySuperuser(true)
|
||||||
|
@ -263,11 +263,9 @@ public class DeleteProberDataAction implements Runnable {
|
||||||
.setClientId(registryAdminClientId)
|
.setClientId(registryAdminClientId)
|
||||||
.build();
|
.build();
|
||||||
// Note that we don't bother handling grace periods, billing events, pending
|
// Note that we don't bother handling grace periods, billing events, pending
|
||||||
// transfers,
|
// transfers, poll messages, or auto-renews because these will all be hard-deleted
|
||||||
// poll messages, or auto-renews because these will all be hard-deleted the next
|
// the next time the mapreduce runs anyway.
|
||||||
// time the
|
tm().putAll(deletedDomain, historyEntry);
|
||||||
// mapreduce runs anyway.
|
|
||||||
auditedOfy().save().entities(deletedDomain, historyEntry);
|
|
||||||
updateForeignKeyIndexDeletionTime(deletedDomain);
|
updateForeignKeyIndexDeletionTime(deletedDomain);
|
||||||
dnsQueue.addDomainRefreshTask(deletedDomain.getDomainName());
|
dnsQueue.addDomainRefreshTask(deletedDomain.getDomainName());
|
||||||
});
|
});
|
||||||
|
|
|
@ -49,6 +49,7 @@ import google.registry.model.billing.BillingEvent.OneTime;
|
||||||
import google.registry.model.billing.BillingEvent.Recurring;
|
import google.registry.model.billing.BillingEvent.Recurring;
|
||||||
import google.registry.model.common.Cursor;
|
import google.registry.model.common.Cursor;
|
||||||
import google.registry.model.domain.DomainBase;
|
import google.registry.model.domain.DomainBase;
|
||||||
|
import google.registry.model.domain.DomainHistory;
|
||||||
import google.registry.model.domain.Period;
|
import google.registry.model.domain.Period;
|
||||||
import google.registry.model.registry.Registry;
|
import google.registry.model.registry.Registry;
|
||||||
import google.registry.model.reporting.DomainTransactionRecord;
|
import google.registry.model.reporting.DomainTransactionRecord;
|
||||||
|
@ -188,12 +189,14 @@ public class ExpandRecurringBillingEventsAction implements Runnable {
|
||||||
// an event persisted.
|
// an event persisted.
|
||||||
for (DateTime billingTime : difference(billingTimes, existingBillingTimes)) {
|
for (DateTime billingTime : difference(billingTimes, existingBillingTimes)) {
|
||||||
// Construct a new HistoryEntry that parents over the OneTime
|
// Construct a new HistoryEntry that parents over the OneTime
|
||||||
HistoryEntry historyEntry =
|
DomainHistory historyEntry =
|
||||||
new HistoryEntry.Builder()
|
new DomainHistory.Builder()
|
||||||
.setBySuperuser(false)
|
.setBySuperuser(false)
|
||||||
.setClientId(recurring.getClientId())
|
.setClientId(recurring.getClientId())
|
||||||
.setModificationTime(tm().getTransactionTime())
|
.setModificationTime(tm().getTransactionTime())
|
||||||
.setParent(domainKey)
|
// TODO (jianglai): modify this to use setDomain instead when
|
||||||
|
// converting this action to be SQL-aware.
|
||||||
|
.setDomainRepoId(domainKey.getName())
|
||||||
.setPeriod(Period.create(1, YEARS))
|
.setPeriod(Period.create(1, YEARS))
|
||||||
.setReason(
|
.setReason(
|
||||||
"Domain autorenewal by ExpandRecurringBillingEventsAction")
|
"Domain autorenewal by ExpandRecurringBillingEventsAction")
|
||||||
|
|
|
@ -213,50 +213,78 @@ public class FlowModule {
|
||||||
return Strings.nullToEmpty(((Poll) eppInput.getCommandWrapper().getCommand()).getMessageId());
|
return Strings.nullToEmpty(((Poll) eppInput.getCommandWrapper().getCommand()).getMessageId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static <B extends HistoryEntry.Builder<? extends HistoryEntry, ?>>
|
||||||
|
B makeHistoryEntryBuilder(
|
||||||
|
B builder,
|
||||||
|
Trid trid,
|
||||||
|
byte[] inputXmlBytes,
|
||||||
|
boolean isSuperuser,
|
||||||
|
String clientId,
|
||||||
|
EppInput eppInput) {
|
||||||
|
builder
|
||||||
|
.setTrid(trid)
|
||||||
|
.setXmlBytes(inputXmlBytes)
|
||||||
|
.setBySuperuser(isSuperuser)
|
||||||
|
.setClientId(clientId);
|
||||||
|
Optional<MetadataExtension> metadataExtension =
|
||||||
|
eppInput.getSingleExtension(MetadataExtension.class);
|
||||||
|
metadataExtension.ifPresent(
|
||||||
|
extension ->
|
||||||
|
builder
|
||||||
|
.setReason(extension.getReason())
|
||||||
|
.setRequestedByRegistrar(extension.getRequestedByRegistrar()));
|
||||||
|
return builder;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides a partially filled in {@link HistoryEntry} builder.
|
* Provides a partially filled in {@link ContactHistory.Builder}
|
||||||
*
|
*
|
||||||
* <p>This is not marked with {@link FlowScope} so that each retry gets a fresh one. Otherwise,
|
* <p>This is not marked with {@link FlowScope} so that each retry gets a fresh one. Otherwise,
|
||||||
* the fact that the builder is one-use would cause NPEs.
|
* the fact that the builder is one-use would cause NPEs.
|
||||||
*/
|
*/
|
||||||
@Provides
|
@Provides
|
||||||
static HistoryEntry.Builder provideHistoryEntryBuilder(
|
static ContactHistory.Builder provideContactHistoryBuilder(
|
||||||
Trid trid,
|
Trid trid,
|
||||||
@InputXml byte[] inputXmlBytes,
|
@InputXml byte[] inputXmlBytes,
|
||||||
@Superuser boolean isSuperuser,
|
@Superuser boolean isSuperuser,
|
||||||
@ClientId String clientId,
|
@ClientId String clientId,
|
||||||
EppInput eppInput) {
|
EppInput eppInput) {
|
||||||
HistoryEntry.Builder historyBuilder =
|
return makeHistoryEntryBuilder(
|
||||||
new HistoryEntry.Builder()
|
new ContactHistory.Builder(), trid, inputXmlBytes, isSuperuser, clientId, eppInput);
|
||||||
.setTrid(trid)
|
|
||||||
.setXmlBytes(inputXmlBytes)
|
|
||||||
.setBySuperuser(isSuperuser)
|
|
||||||
.setClientId(clientId);
|
|
||||||
Optional<MetadataExtension> metadataExtension =
|
|
||||||
eppInput.getSingleExtension(MetadataExtension.class);
|
|
||||||
metadataExtension.ifPresent(
|
|
||||||
extension ->
|
|
||||||
historyBuilder
|
|
||||||
.setReason(extension.getReason())
|
|
||||||
.setRequestedByRegistrar(extension.getRequestedByRegistrar()));
|
|
||||||
return historyBuilder;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides a partially filled in {@link HostHistory.Builder}
|
||||||
|
*
|
||||||
|
* <p>This is not marked with {@link FlowScope} so that each retry gets a fresh one. Otherwise,
|
||||||
|
* the fact that the builder is one-use would cause NPEs.
|
||||||
|
*/
|
||||||
@Provides
|
@Provides
|
||||||
static ContactHistory.Builder provideContactHistoryBuilder(
|
static HostHistory.Builder provideHostHistoryBuilder(
|
||||||
HistoryEntry.Builder historyEntryBuilder) {
|
Trid trid,
|
||||||
return new ContactHistory.Builder().copyFrom(historyEntryBuilder);
|
@InputXml byte[] inputXmlBytes,
|
||||||
|
@Superuser boolean isSuperuser,
|
||||||
|
@ClientId String clientId,
|
||||||
|
EppInput eppInput) {
|
||||||
|
return makeHistoryEntryBuilder(
|
||||||
|
new HostHistory.Builder(), trid, inputXmlBytes, isSuperuser, clientId, eppInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides a partially filled in {@link DomainHistory.Builder}
|
||||||
|
*
|
||||||
|
* <p>This is not marked with {@link FlowScope} so that each retry gets a fresh one. Otherwise,
|
||||||
|
* the fact that the builder is one-use would cause NPEs.
|
||||||
|
*/
|
||||||
@Provides
|
@Provides
|
||||||
static DomainHistory.Builder provideDomainHistoryBuilder(
|
static DomainHistory.Builder provideDomainHistoryBuilder(
|
||||||
HistoryEntry.Builder historyEntryBuilder) {
|
Trid trid,
|
||||||
return new DomainHistory.Builder().copyFrom(historyEntryBuilder);
|
@InputXml byte[] inputXmlBytes,
|
||||||
}
|
@Superuser boolean isSuperuser,
|
||||||
|
@ClientId String clientId,
|
||||||
@Provides
|
EppInput eppInput) {
|
||||||
static HostHistory.Builder provideHostHistoryBuilder(HistoryEntry.Builder historyEntryBuilder) {
|
return makeHistoryEntryBuilder(
|
||||||
return new HostHistory.Builder().copyFrom(historyEntryBuilder);
|
new DomainHistory.Builder(), trid, inputXmlBytes, isSuperuser, clientId, eppInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -41,6 +41,11 @@ import javax.persistence.PostLoad;
|
||||||
* <p>In addition to the general history fields (e.g. action time, registrar ID) we also persist a
|
* <p>In addition to the general history fields (e.g. action time, registrar ID) we also persist a
|
||||||
* copy of the contact entity at this point in time. We persist a raw {@link ContactBase} so that
|
* copy of the contact entity at this point in time. We persist a raw {@link ContactBase} so that
|
||||||
* the foreign-keyed fields in that class can refer to this object.
|
* the foreign-keyed fields in that class can refer to this object.
|
||||||
|
*
|
||||||
|
* <p>This class is only marked as a Datastore entity subclass and registered with Objectify so that
|
||||||
|
* when building it its ID can be auto-populated by Objectify. It is converted to its superclass
|
||||||
|
* {@link HistoryEntry} when persisted to Datastore using {@link
|
||||||
|
* google.registry.persistence.transaction.TransactionManager}.
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@javax.persistence.Table(
|
@javax.persistence.Table(
|
||||||
|
|
|
@ -21,7 +21,6 @@ import static google.registry.util.CollectionUtils.nullToEmptyImmutableCopy;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.googlecode.objectify.Key;
|
import com.googlecode.objectify.Key;
|
||||||
import com.googlecode.objectify.annotation.EntitySubclass;
|
import com.googlecode.objectify.annotation.EntitySubclass;
|
||||||
import com.googlecode.objectify.annotation.Ignore;
|
|
||||||
import google.registry.model.ImmutableObject;
|
import google.registry.model.ImmutableObject;
|
||||||
import google.registry.model.domain.DomainHistory.DomainHistoryId;
|
import google.registry.model.domain.DomainHistory.DomainHistoryId;
|
||||||
import google.registry.model.domain.GracePeriod.GracePeriodHistory;
|
import google.registry.model.domain.GracePeriod.GracePeriodHistory;
|
||||||
|
@ -62,6 +61,11 @@ import javax.persistence.Table;
|
||||||
* <p>In addition to the general history fields (e.g. action time, registrar ID) we also persist a
|
* <p>In addition to the general history fields (e.g. action time, registrar ID) we also persist a
|
||||||
* copy of the domain entity at this point in time. We persist a raw {@link DomainContent} so that
|
* copy of the domain entity at this point in time. We persist a raw {@link DomainContent} so that
|
||||||
* the foreign-keyed fields in that class can refer to this object.
|
* the foreign-keyed fields in that class can refer to this object.
|
||||||
|
*
|
||||||
|
* <p>This class is only marked as a Datastore entity subclass and registered with Objectify so that
|
||||||
|
* when building it its ID can be auto-populated by Objectify. It is converted to its superclass
|
||||||
|
* {@link HistoryEntry} when persisted to Datastore using {@link
|
||||||
|
* google.registry.persistence.transaction.TransactionManager}.
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(
|
@Table(
|
||||||
|
@ -97,7 +101,6 @@ public class DomainHistory extends HistoryEntry implements SqlEntity {
|
||||||
// We could have reused domainContent.nsHosts here, but Hibernate throws a weird exception after
|
// We could have reused domainContent.nsHosts here, but Hibernate throws a weird exception after
|
||||||
// we change to use a composite primary key.
|
// we change to use a composite primary key.
|
||||||
// TODO(b/166776754): Investigate if we can reuse domainContent.nsHosts for storing host keys.
|
// TODO(b/166776754): Investigate if we can reuse domainContent.nsHosts for storing host keys.
|
||||||
@Ignore
|
|
||||||
@ElementCollection
|
@ElementCollection
|
||||||
@JoinTable(
|
@JoinTable(
|
||||||
name = "DomainHistoryHost",
|
name = "DomainHistoryHost",
|
||||||
|
@ -111,7 +114,6 @@ public class DomainHistory extends HistoryEntry implements SqlEntity {
|
||||||
@Column(name = "host_repo_id")
|
@Column(name = "host_repo_id")
|
||||||
Set<VKey<HostResource>> nsHosts;
|
Set<VKey<HostResource>> nsHosts;
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@OneToMany(
|
@OneToMany(
|
||||||
cascade = {CascadeType.ALL},
|
cascade = {CascadeType.ALL},
|
||||||
fetch = FetchType.EAGER,
|
fetch = FetchType.EAGER,
|
||||||
|
@ -131,7 +133,6 @@ public class DomainHistory extends HistoryEntry implements SqlEntity {
|
||||||
// HashSet rather than ImmutableSet so that Hibernate can fill them out lazily on request
|
// HashSet rather than ImmutableSet so that Hibernate can fill them out lazily on request
|
||||||
Set<DomainDsDataHistory> dsDataHistories = new HashSet<>();
|
Set<DomainDsDataHistory> dsDataHistories = new HashSet<>();
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@OneToMany(
|
@OneToMany(
|
||||||
cascade = {CascadeType.ALL},
|
cascade = {CascadeType.ALL},
|
||||||
fetch = FetchType.EAGER,
|
fetch = FetchType.EAGER,
|
||||||
|
|
|
@ -41,6 +41,11 @@ import javax.persistence.PostLoad;
|
||||||
* <p>In addition to the general history fields (e.g. action time, registrar ID) we also persist a
|
* <p>In addition to the general history fields (e.g. action time, registrar ID) we also persist a
|
||||||
* copy of the host entity at this point in time. We persist a raw {@link HostBase} so that the
|
* copy of the host entity at this point in time. We persist a raw {@link HostBase} so that the
|
||||||
* foreign-keyed fields in that class can refer to this object.
|
* foreign-keyed fields in that class can refer to this object.
|
||||||
|
*
|
||||||
|
* <p>This class is only marked as a Datastore entity subclass and registered with Objectify so that
|
||||||
|
* when building it its ID can be auto-populated by Objectify. It is converted to its superclass
|
||||||
|
* {@link HistoryEntry} when persisted to Datastore using {@link
|
||||||
|
* google.registry.persistence.transaction.TransactionManager}.
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@javax.persistence.Table(
|
@javax.persistence.Table(
|
||||||
|
|
|
@ -173,6 +173,11 @@ public class DatastoreTransactionManager implements TransactionManager {
|
||||||
putAll(entities);
|
putAll(entities);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateAll(Object... entities) {
|
||||||
|
updateAll(ImmutableList.of(entities));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateWithoutBackup(Object entity) {
|
public void updateWithoutBackup(Object entity) {
|
||||||
putWithoutBackup(entity);
|
putWithoutBackup(entity);
|
||||||
|
|
|
@ -32,14 +32,17 @@ import google.registry.model.Buildable;
|
||||||
import google.registry.model.EppResource;
|
import google.registry.model.EppResource;
|
||||||
import google.registry.model.ImmutableObject;
|
import google.registry.model.ImmutableObject;
|
||||||
import google.registry.model.annotations.ReportedOn;
|
import google.registry.model.annotations.ReportedOn;
|
||||||
|
import google.registry.model.contact.ContactBase;
|
||||||
import google.registry.model.contact.ContactHistory;
|
import google.registry.model.contact.ContactHistory;
|
||||||
import google.registry.model.contact.ContactHistory.ContactHistoryId;
|
import google.registry.model.contact.ContactHistory.ContactHistoryId;
|
||||||
import google.registry.model.contact.ContactResource;
|
import google.registry.model.contact.ContactResource;
|
||||||
import google.registry.model.domain.DomainBase;
|
import google.registry.model.domain.DomainBase;
|
||||||
|
import google.registry.model.domain.DomainContent;
|
||||||
import google.registry.model.domain.DomainHistory;
|
import google.registry.model.domain.DomainHistory;
|
||||||
import google.registry.model.domain.DomainHistory.DomainHistoryId;
|
import google.registry.model.domain.DomainHistory.DomainHistoryId;
|
||||||
import google.registry.model.domain.Period;
|
import google.registry.model.domain.Period;
|
||||||
import google.registry.model.eppcommon.Trid;
|
import google.registry.model.eppcommon.Trid;
|
||||||
|
import google.registry.model.host.HostBase;
|
||||||
import google.registry.model.host.HostHistory;
|
import google.registry.model.host.HostHistory;
|
||||||
import google.registry.model.host.HostHistory.HostHistoryId;
|
import google.registry.model.host.HostHistory.HostHistoryId;
|
||||||
import google.registry.model.host.HostResource;
|
import google.registry.model.host.HostResource;
|
||||||
|
@ -60,7 +63,21 @@ import javax.persistence.MappedSuperclass;
|
||||||
import javax.persistence.Transient;
|
import javax.persistence.Transient;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
|
|
||||||
/** A record of an EPP command that mutated a resource. */
|
/**
|
||||||
|
* A record of an EPP command that mutated a resource.
|
||||||
|
*
|
||||||
|
* <p>Due to historical reasons this class is persisted only to Datastore. It has three subclasses
|
||||||
|
* that include the parent resource itself which are persisted to Cloud SQL. During migration this
|
||||||
|
* class cannot be made abstract in order for the class to be persisted and loaded to and from
|
||||||
|
* Datastore. However it should never be used directly in the Java code itself. When it is loaded
|
||||||
|
* from Datastore it should be converted to a subclass for handling and when a new history entry is
|
||||||
|
* built it should always be a subclass, which is automatically converted to HistoryEntry when
|
||||||
|
* persisting to Datastore.
|
||||||
|
*
|
||||||
|
* <p>Some care has been taken to make it close to impossible to use this class directly, but the
|
||||||
|
* user should still exercise caution. After the migration is complete this class will be made
|
||||||
|
* abstract.
|
||||||
|
*/
|
||||||
@ReportedOn
|
@ReportedOn
|
||||||
@Entity
|
@Entity
|
||||||
@MappedSuperclass
|
@MappedSuperclass
|
||||||
|
@ -203,6 +220,12 @@ public class HistoryEntry extends ImmutableObject implements Buildable, Datastor
|
||||||
@ImmutableObject.EmptySetToNull
|
@ImmutableObject.EmptySetToNull
|
||||||
protected Set<DomainTransactionRecord> domainTransactionRecords;
|
protected Set<DomainTransactionRecord> domainTransactionRecords;
|
||||||
|
|
||||||
|
// Make it impossible to instantiate a HistoryEntry explicitly. One should only instantiate a
|
||||||
|
// subtype of HistoryEntry.
|
||||||
|
protected HistoryEntry() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
public long getId() {
|
public long getId() {
|
||||||
// For some reason, Hibernate throws NPE during some initialization phase if we don't deal with
|
// For some reason, Hibernate throws NPE during some initialization phase if we don't deal with
|
||||||
// the null case. Setting the id to 0L when it is null should be fine because 0L for primitive
|
// the null case. Setting the id to 0L when it is null should be fine because 0L for primitive
|
||||||
|
@ -285,13 +308,50 @@ public class HistoryEntry extends ImmutableObject implements Buildable, Datastor
|
||||||
domainTransactionRecords == null ? null : ImmutableSet.copyOf(domainTransactionRecords);
|
domainTransactionRecords == null ? null : ImmutableSet.copyOf(domainTransactionRecords);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Throws an error when trying to get a builder from a bare {@link HistoryEntry}.
|
||||||
|
*
|
||||||
|
* <p>This method only exists to satisfy the requirement that the {@link HistoryEntry} is NOT
|
||||||
|
* abstract, it should never be called directly and all three of the subclass of {@link
|
||||||
|
* HistoryEntry} implements it.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder asBuilder() {
|
public Builder<? extends HistoryEntry, ?> asBuilder() {
|
||||||
return new Builder(clone(this));
|
throw new UnsupportedOperationException(
|
||||||
|
"You should never attempt to build a HistoryEntry from a raw HistoryEntry. A raw "
|
||||||
|
+ "HistoryEntry should only exist internally when persisting to datastore. If you need "
|
||||||
|
+ "to build from a raw HistoryEntry, use "
|
||||||
|
+ "{Contact,Host,Domain}History.Builder.copyFrom(HistoryEntry) instead.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clones and returns a {@code HistoryEntry} objec
|
||||||
|
*
|
||||||
|
* <p>This is useful when converting a subclass to the base class to persist to Datastore.
|
||||||
|
*/
|
||||||
public HistoryEntry asHistoryEntry() {
|
public HistoryEntry asHistoryEntry() {
|
||||||
return new Builder().copyFrom(this).build();
|
HistoryEntry historyEntry = new HistoryEntry();
|
||||||
|
copy(this, historyEntry);
|
||||||
|
return historyEntry;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static void copy(HistoryEntry src, HistoryEntry dst) {
|
||||||
|
dst.id = src.id;
|
||||||
|
dst.parent = src.parent;
|
||||||
|
dst.type = src.type;
|
||||||
|
dst.period = src.period;
|
||||||
|
dst.xmlBytes = src.xmlBytes;
|
||||||
|
dst.modificationTime = src.modificationTime;
|
||||||
|
dst.clientId = src.clientId;
|
||||||
|
dst.otherClientId = src.otherClientId;
|
||||||
|
dst.trid = src.trid;
|
||||||
|
dst.bySuperuser = src.bySuperuser;
|
||||||
|
dst.reason = src.reason;
|
||||||
|
dst.requestedByRegistrar = src.requestedByRegistrar;
|
||||||
|
dst.domainTransactionRecords =
|
||||||
|
src.domainTransactionRecords == null
|
||||||
|
? null
|
||||||
|
: ImmutableSet.copyOf(src.domainTransactionRecords);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@ -349,33 +409,18 @@ public class HistoryEntry extends ImmutableObject implements Buildable, Datastor
|
||||||
}
|
}
|
||||||
|
|
||||||
/** A builder for {@link HistoryEntry} since it is immutable */
|
/** A builder for {@link HistoryEntry} since it is immutable */
|
||||||
public static class Builder<T extends HistoryEntry, B extends Builder<?, ?>>
|
public abstract static class Builder<T extends HistoryEntry, B extends Builder<?, ?>>
|
||||||
extends GenericBuilder<T, B> {
|
extends GenericBuilder<T, B> {
|
||||||
public Builder() {}
|
protected Builder() {}
|
||||||
|
|
||||||
public Builder(T instance) {
|
protected Builder(T instance) {
|
||||||
super(instance);
|
super(instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Used to fill out the fields in this object from an object which may not be exactly the same
|
// Used to fill out the fields in this object from an object which may not be exactly the same
|
||||||
// as the class T, where both classes still subclass HistoryEntry
|
// as the class T, where both classes still subclass HistoryEntry
|
||||||
public B copyFrom(HistoryEntry historyEntry) {
|
public B copyFrom(HistoryEntry historyEntry) {
|
||||||
setId(historyEntry.id);
|
copy(historyEntry, getInstance());
|
||||||
setParent(historyEntry.parent);
|
|
||||||
setType(historyEntry.type);
|
|
||||||
setPeriod(historyEntry.period);
|
|
||||||
setXmlBytes(historyEntry.xmlBytes);
|
|
||||||
setModificationTime(historyEntry.modificationTime);
|
|
||||||
setClientId(historyEntry.clientId);
|
|
||||||
setOtherClientId(historyEntry.otherClientId);
|
|
||||||
setTrid(historyEntry.trid);
|
|
||||||
setBySuperuser(historyEntry.bySuperuser);
|
|
||||||
setReason(historyEntry.reason);
|
|
||||||
setRequestedByRegistrar(historyEntry.requestedByRegistrar);
|
|
||||||
setDomainTransactionRecords(
|
|
||||||
historyEntry.domainTransactionRecords == null
|
|
||||||
? null
|
|
||||||
: ImmutableSet.copyOf(historyEntry.domainTransactionRecords));
|
|
||||||
return thisCastToDerived();
|
return thisCastToDerived();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -400,13 +445,13 @@ public class HistoryEntry extends ImmutableObject implements Buildable, Datastor
|
||||||
return thisCastToDerived();
|
return thisCastToDerived();
|
||||||
}
|
}
|
||||||
|
|
||||||
public B setParent(EppResource parent) {
|
protected B setParent(EppResource parent) {
|
||||||
getInstance().parent = Key.create(parent);
|
getInstance().parent = Key.create(parent);
|
||||||
return thisCastToDerived();
|
return thisCastToDerived();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Until we move completely to SQL, override this in subclasses (e.g. HostHistory) to set VKeys
|
// Until we move completely to SQL, override this in subclasses (e.g. HostHistory) to set VKeys
|
||||||
public B setParent(Key<? extends EppResource> parent) {
|
protected B setParent(Key<? extends EppResource> parent) {
|
||||||
getInstance().parent = parent;
|
getInstance().parent = parent;
|
||||||
return thisCastToDerived();
|
return thisCastToDerived();
|
||||||
}
|
}
|
||||||
|
@ -467,4 +512,19 @@ public class HistoryEntry extends ImmutableObject implements Buildable, Datastor
|
||||||
return thisCastToDerived();
|
return thisCastToDerived();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static <E extends EppResource>
|
||||||
|
HistoryEntry.Builder<? extends HistoryEntry, ?> createBuilderForResource(E parent) {
|
||||||
|
if (parent instanceof DomainContent) {
|
||||||
|
return new DomainHistory.Builder().setDomain((DomainContent) parent);
|
||||||
|
} else if (parent instanceof ContactBase) {
|
||||||
|
return new ContactHistory.Builder().setContact((ContactBase) parent);
|
||||||
|
} else if (parent instanceof HostBase) {
|
||||||
|
return new HostHistory.Builder().setHost((HostBase) parent);
|
||||||
|
} else {
|
||||||
|
throw new IllegalStateException(
|
||||||
|
String.format(
|
||||||
|
"Class %s does not have an associated HistoryEntry", parent.getClass().getName()));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -350,6 +350,11 @@ public class JpaTransactionManagerImpl implements JpaTransactionManager {
|
||||||
entities.forEach(this::update);
|
entities.forEach(this::update);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateAll(Object... entities) {
|
||||||
|
updateAll(ImmutableList.of(entities));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateWithoutBackup(Object entity) {
|
public void updateWithoutBackup(Object entity) {
|
||||||
update(entity);
|
update(entity);
|
||||||
|
|
|
@ -159,6 +159,9 @@ public interface TransactionManager {
|
||||||
/** Updates all entities in the database, throws exception if any entity does not exist. */
|
/** Updates all entities in the database, throws exception if any entity does not exist. */
|
||||||
void updateAll(ImmutableCollection<?> entities);
|
void updateAll(ImmutableCollection<?> entities);
|
||||||
|
|
||||||
|
/** Updates all entities in the database, throws exception if any entity does not exist. */
|
||||||
|
void updateAll(Object... entities);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates an entity in the database without writing commit logs if the underlying database is
|
* Updates an entity in the database without writing commit logs if the underlying database is
|
||||||
* Datastore.
|
* Datastore.
|
||||||
|
|
|
@ -22,7 +22,6 @@ import static google.registry.tools.LockOrUnlockDomainCommand.REGISTRY_LOCK_STAT
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import com.googlecode.objectify.Key;
|
|
||||||
import google.registry.batch.AsyncTaskEnqueuer;
|
import google.registry.batch.AsyncTaskEnqueuer;
|
||||||
import google.registry.config.RegistryConfig.Config;
|
import google.registry.config.RegistryConfig.Config;
|
||||||
import google.registry.model.billing.BillingEvent;
|
import google.registry.model.billing.BillingEvent;
|
||||||
|
@ -370,7 +369,7 @@ public final class DomainLockUtils {
|
||||||
.setRequestedByRegistrar(!lock.isSuperuser())
|
.setRequestedByRegistrar(!lock.isSuperuser())
|
||||||
.setType(HistoryEntry.Type.DOMAIN_UPDATE)
|
.setType(HistoryEntry.Type.DOMAIN_UPDATE)
|
||||||
.setModificationTime(now)
|
.setModificationTime(now)
|
||||||
.setParent(Key.create(domain))
|
.setDomain(domain)
|
||||||
.setReason(reason)
|
.setReason(reason)
|
||||||
.build();
|
.build();
|
||||||
tm().update(domain);
|
tm().update(domain);
|
||||||
|
|
|
@ -185,7 +185,7 @@ class UnrenewDomainCommand extends ConfirmingCommand implements CommandWithRemot
|
||||||
leapSafeSubtractYears(domain.getRegistrationExpirationTime(), period);
|
leapSafeSubtractYears(domain.getRegistrationExpirationTime(), period);
|
||||||
DomainHistory domainHistory =
|
DomainHistory domainHistory =
|
||||||
new DomainHistory.Builder()
|
new DomainHistory.Builder()
|
||||||
.setParent(domain)
|
.setDomain(domain)
|
||||||
.setModificationTime(now)
|
.setModificationTime(now)
|
||||||
.setBySuperuser(true)
|
.setBySuperuser(true)
|
||||||
.setType(Type.SYNTHETIC)
|
.setType(Type.SYNTHETIC)
|
||||||
|
|
|
@ -113,12 +113,11 @@ public class CreateSyntheticHistoryEntriesAction implements Runnable {
|
||||||
() -> {
|
() -> {
|
||||||
EppResource eppResource = ofy().load().key(resourceKey).now();
|
EppResource eppResource = ofy().load().key(resourceKey).now();
|
||||||
tm().put(
|
tm().put(
|
||||||
new HistoryEntry.Builder<>()
|
HistoryEntry.createBuilderForResource(eppResource)
|
||||||
.setClientId(registryAdminRegistrarId)
|
.setClientId(registryAdminRegistrarId)
|
||||||
.setBySuperuser(true)
|
.setBySuperuser(true)
|
||||||
.setRequestedByRegistrar(false)
|
.setRequestedByRegistrar(false)
|
||||||
.setModificationTime(tm().getTransactionTime())
|
.setModificationTime(tm().getTransactionTime())
|
||||||
.setParent(eppResource)
|
|
||||||
.setReason(
|
.setReason(
|
||||||
"Backfill EppResource history objects during Cloud SQL migration")
|
"Backfill EppResource history objects during Cloud SQL migration")
|
||||||
.setType(HistoryEntry.Type.SYNTHETIC)
|
.setType(HistoryEntry.Type.SYNTHETIC)
|
||||||
|
|
|
@ -33,6 +33,7 @@ import google.registry.model.billing.BillingEvent;
|
||||||
import google.registry.model.billing.BillingEvent.Flag;
|
import google.registry.model.billing.BillingEvent.Flag;
|
||||||
import google.registry.model.billing.BillingEvent.Reason;
|
import google.registry.model.billing.BillingEvent.Reason;
|
||||||
import google.registry.model.domain.DomainBase;
|
import google.registry.model.domain.DomainBase;
|
||||||
|
import google.registry.model.domain.DomainHistory;
|
||||||
import google.registry.model.ofy.Ofy;
|
import google.registry.model.ofy.Ofy;
|
||||||
import google.registry.model.poll.PollMessage;
|
import google.registry.model.poll.PollMessage;
|
||||||
import google.registry.model.reporting.HistoryEntry;
|
import google.registry.model.reporting.HistoryEntry;
|
||||||
|
@ -166,9 +167,9 @@ class DeleteExpiredDomainsActionTest {
|
||||||
DomainBase pendingExpirationDomain = persistActiveDomain(domainName);
|
DomainBase pendingExpirationDomain = persistActiveDomain(domainName);
|
||||||
HistoryEntry createHistoryEntry =
|
HistoryEntry createHistoryEntry =
|
||||||
persistResource(
|
persistResource(
|
||||||
new HistoryEntry.Builder()
|
new DomainHistory.Builder()
|
||||||
.setType(DOMAIN_CREATE)
|
.setType(DOMAIN_CREATE)
|
||||||
.setParent(pendingExpirationDomain)
|
.setDomain(pendingExpirationDomain)
|
||||||
.setModificationTime(clock.nowUtc().minusMonths(9))
|
.setModificationTime(clock.nowUtc().minusMonths(9))
|
||||||
.setClientId(pendingExpirationDomain.getCreationClientId())
|
.setClientId(pendingExpirationDomain.getCreationClientId())
|
||||||
.build());
|
.build());
|
||||||
|
|
|
@ -39,6 +39,7 @@ import google.registry.model.ImmutableObject;
|
||||||
import google.registry.model.billing.BillingEvent;
|
import google.registry.model.billing.BillingEvent;
|
||||||
import google.registry.model.billing.BillingEvent.Reason;
|
import google.registry.model.billing.BillingEvent.Reason;
|
||||||
import google.registry.model.domain.DomainBase;
|
import google.registry.model.domain.DomainBase;
|
||||||
|
import google.registry.model.domain.DomainHistory;
|
||||||
import google.registry.model.index.EppResourceIndex;
|
import google.registry.model.index.EppResourceIndex;
|
||||||
import google.registry.model.index.ForeignKeyIndex;
|
import google.registry.model.index.ForeignKeyIndex;
|
||||||
import google.registry.model.poll.PollMessage;
|
import google.registry.model.poll.PollMessage;
|
||||||
|
@ -281,8 +282,8 @@ class DeleteProberDataActionTest extends MapreduceTestCase<DeleteProberDataActio
|
||||||
DomainBase domain = persistDeletedDomain(fqdn, DELETION_TIME);
|
DomainBase domain = persistDeletedDomain(fqdn, DELETION_TIME);
|
||||||
HistoryEntry historyEntry =
|
HistoryEntry historyEntry =
|
||||||
persistSimpleResource(
|
persistSimpleResource(
|
||||||
new HistoryEntry.Builder()
|
new DomainHistory.Builder()
|
||||||
.setParent(domain)
|
.setDomain(domain)
|
||||||
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
||||||
.setClientId("TheRegistrar")
|
.setClientId("TheRegistrar")
|
||||||
.setModificationTime(DELETION_TIME.minusYears(3))
|
.setModificationTime(DELETION_TIME.minusYears(3))
|
||||||
|
|
|
@ -45,6 +45,7 @@ import google.registry.model.billing.BillingEvent.OneTime;
|
||||||
import google.registry.model.billing.BillingEvent.Reason;
|
import google.registry.model.billing.BillingEvent.Reason;
|
||||||
import google.registry.model.common.Cursor;
|
import google.registry.model.common.Cursor;
|
||||||
import google.registry.model.domain.DomainBase;
|
import google.registry.model.domain.DomainBase;
|
||||||
|
import google.registry.model.domain.DomainHistory;
|
||||||
import google.registry.model.domain.Period;
|
import google.registry.model.domain.Period;
|
||||||
import google.registry.model.ofy.Ofy;
|
import google.registry.model.ofy.Ofy;
|
||||||
import google.registry.model.registry.Registry;
|
import google.registry.model.registry.Registry;
|
||||||
|
@ -93,11 +94,11 @@ public class ExpandRecurringBillingEventsActionTest
|
||||||
.build());
|
.build());
|
||||||
historyEntry =
|
historyEntry =
|
||||||
persistResource(
|
persistResource(
|
||||||
new HistoryEntry.Builder()
|
new DomainHistory.Builder()
|
||||||
.setClientId(domain.getCreationClientId())
|
.setClientId(domain.getCreationClientId())
|
||||||
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
||||||
.setModificationTime(DateTime.parse("1999-01-05T00:00:00Z"))
|
.setModificationTime(DateTime.parse("1999-01-05T00:00:00Z"))
|
||||||
.setParent(domain)
|
.setDomain(domain)
|
||||||
.build());
|
.build());
|
||||||
recurring =
|
recurring =
|
||||||
new BillingEvent.Recurring.Builder()
|
new BillingEvent.Recurring.Builder()
|
||||||
|
@ -188,8 +189,8 @@ public class ExpandRecurringBillingEventsActionTest
|
||||||
DomainBase deletedDomain = persistDeletedDomain("deleted.tld", deletionTime);
|
DomainBase deletedDomain = persistDeletedDomain("deleted.tld", deletionTime);
|
||||||
historyEntry =
|
historyEntry =
|
||||||
persistResource(
|
persistResource(
|
||||||
new HistoryEntry.Builder()
|
new DomainHistory.Builder()
|
||||||
.setParent(deletedDomain)
|
.setDomain(deletedDomain)
|
||||||
.setClientId(deletedDomain.getCreationClientId())
|
.setClientId(deletedDomain.getCreationClientId())
|
||||||
.setModificationTime(deletedDomain.getCreationTime())
|
.setModificationTime(deletedDomain.getCreationTime())
|
||||||
.setType(DOMAIN_CREATE)
|
.setType(DOMAIN_CREATE)
|
||||||
|
|
|
@ -32,6 +32,7 @@ import google.registry.model.contact.ContactResource;
|
||||||
import google.registry.model.domain.DesignatedContact;
|
import google.registry.model.domain.DesignatedContact;
|
||||||
import google.registry.model.domain.DomainAuthInfo;
|
import google.registry.model.domain.DomainAuthInfo;
|
||||||
import google.registry.model.domain.DomainBase;
|
import google.registry.model.domain.DomainBase;
|
||||||
|
import google.registry.model.domain.DomainHistory;
|
||||||
import google.registry.model.domain.GracePeriod;
|
import google.registry.model.domain.GracePeriod;
|
||||||
import google.registry.model.domain.launch.LaunchNotice;
|
import google.registry.model.domain.launch.LaunchNotice;
|
||||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||||
|
@ -102,8 +103,8 @@ public class DomainBaseUtilTest {
|
||||||
Key<HistoryEntry> historyEntryKey =
|
Key<HistoryEntry> historyEntryKey =
|
||||||
Key.create(
|
Key.create(
|
||||||
persistResource(
|
persistResource(
|
||||||
new HistoryEntry.Builder()
|
new DomainHistory.Builder()
|
||||||
.setParent(domainKey)
|
.setDomainRepoId(domainKey.getName())
|
||||||
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
||||||
.setClientId("TheRegistrar")
|
.setClientId("TheRegistrar")
|
||||||
.setModificationTime(fakeClock.nowUtc().minusYears(1))
|
.setModificationTime(fakeClock.nowUtc().minusYears(1))
|
||||||
|
|
|
@ -38,6 +38,7 @@ import google.registry.model.contact.ContactResource;
|
||||||
import google.registry.model.domain.DesignatedContact;
|
import google.registry.model.domain.DesignatedContact;
|
||||||
import google.registry.model.domain.DomainAuthInfo;
|
import google.registry.model.domain.DomainAuthInfo;
|
||||||
import google.registry.model.domain.DomainBase;
|
import google.registry.model.domain.DomainBase;
|
||||||
|
import google.registry.model.domain.DomainHistory;
|
||||||
import google.registry.model.domain.GracePeriod;
|
import google.registry.model.domain.GracePeriod;
|
||||||
import google.registry.model.domain.launch.LaunchNotice;
|
import google.registry.model.domain.launch.LaunchNotice;
|
||||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||||
|
@ -178,8 +179,8 @@ class InitSqlPipelineTest {
|
||||||
.build());
|
.build());
|
||||||
historyEntry =
|
historyEntry =
|
||||||
persistResource(
|
persistResource(
|
||||||
new HistoryEntry.Builder()
|
new DomainHistory.Builder()
|
||||||
.setParent(domainKey)
|
.setDomainRepoId(domainKey.getName())
|
||||||
.setModificationTime(fakeClock.nowUtc())
|
.setModificationTime(fakeClock.nowUtc())
|
||||||
.setClientId(registrar1.getClientId())
|
.setClientId(registrar1.getClientId())
|
||||||
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
||||||
|
|
|
@ -84,6 +84,7 @@ import google.registry.model.billing.BillingEvent.Flag;
|
||||||
import google.registry.model.billing.BillingEvent.Reason;
|
import google.registry.model.billing.BillingEvent.Reason;
|
||||||
import google.registry.model.contact.ContactResource;
|
import google.registry.model.contact.ContactResource;
|
||||||
import google.registry.model.domain.DomainBase;
|
import google.registry.model.domain.DomainBase;
|
||||||
|
import google.registry.model.domain.DomainHistory;
|
||||||
import google.registry.model.domain.GracePeriod;
|
import google.registry.model.domain.GracePeriod;
|
||||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||||
import google.registry.model.eppcommon.ProtocolDefinition.ServiceExtension;
|
import google.registry.model.eppcommon.ProtocolDefinition.ServiceExtension;
|
||||||
|
@ -121,7 +122,7 @@ class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow, Domain
|
||||||
final ReplayExtension replayExtension = ReplayExtension.createWithCompare(clock);
|
final ReplayExtension replayExtension = ReplayExtension.createWithCompare(clock);
|
||||||
|
|
||||||
private DomainBase domain;
|
private DomainBase domain;
|
||||||
private HistoryEntry earlierHistoryEntry;
|
private DomainHistory earlierHistoryEntry;
|
||||||
|
|
||||||
private static final DateTime TIME_BEFORE_FLOW = DateTime.parse("2000-06-06T22:00:00.0Z");
|
private static final DateTime TIME_BEFORE_FLOW = DateTime.parse("2000-06-06T22:00:00.0Z");
|
||||||
private static final DateTime A_MONTH_AGO = TIME_BEFORE_FLOW.minusMonths(1);
|
private static final DateTime A_MONTH_AGO = TIME_BEFORE_FLOW.minusMonths(1);
|
||||||
|
@ -175,9 +176,9 @@ class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow, Domain
|
||||||
.build());
|
.build());
|
||||||
earlierHistoryEntry =
|
earlierHistoryEntry =
|
||||||
persistResource(
|
persistResource(
|
||||||
new HistoryEntry.Builder()
|
new DomainHistory.Builder()
|
||||||
.setType(DOMAIN_CREATE)
|
.setType(DOMAIN_CREATE)
|
||||||
.setParent(domain)
|
.setDomain(domain)
|
||||||
.setModificationTime(clock.nowUtc())
|
.setModificationTime(clock.nowUtc())
|
||||||
.setClientId(domain.getCreationClientId())
|
.setClientId(domain.getCreationClientId())
|
||||||
.build());
|
.build());
|
||||||
|
@ -1111,9 +1112,9 @@ class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow, Domain
|
||||||
DomainTransactionRecord.create("tld", TIME_BEFORE_FLOW.plusDays(2), NET_ADDS_10_YR, 1);
|
DomainTransactionRecord.create("tld", TIME_BEFORE_FLOW.plusDays(2), NET_ADDS_10_YR, 1);
|
||||||
// Create a HistoryEntry with a later modification time
|
// Create a HistoryEntry with a later modification time
|
||||||
persistResource(
|
persistResource(
|
||||||
new HistoryEntry.Builder()
|
new DomainHistory.Builder()
|
||||||
.setType(DOMAIN_CREATE)
|
.setType(DOMAIN_CREATE)
|
||||||
.setParent(domain)
|
.setDomain(domain)
|
||||||
.setModificationTime(TIME_BEFORE_FLOW.minusDays(1))
|
.setModificationTime(TIME_BEFORE_FLOW.minusDays(1))
|
||||||
.setClientId("TheRegistrar")
|
.setClientId("TheRegistrar")
|
||||||
.setDomainTransactionRecords(ImmutableSet.of(existingRecord))
|
.setDomainTransactionRecords(ImmutableSet.of(existingRecord))
|
||||||
|
|
|
@ -54,6 +54,7 @@ import google.registry.model.domain.DesignatedContact;
|
||||||
import google.registry.model.domain.DesignatedContact.Type;
|
import google.registry.model.domain.DesignatedContact.Type;
|
||||||
import google.registry.model.domain.DomainAuthInfo;
|
import google.registry.model.domain.DomainAuthInfo;
|
||||||
import google.registry.model.domain.DomainBase;
|
import google.registry.model.domain.DomainBase;
|
||||||
|
import google.registry.model.domain.DomainHistory;
|
||||||
import google.registry.model.domain.GracePeriod;
|
import google.registry.model.domain.GracePeriod;
|
||||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||||
|
@ -362,8 +363,8 @@ class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, DomainBase
|
||||||
persistTestEntities(false);
|
persistTestEntities(false);
|
||||||
HistoryEntry historyEntry =
|
HistoryEntry historyEntry =
|
||||||
persistResource(
|
persistResource(
|
||||||
new HistoryEntry.Builder()
|
new DomainHistory.Builder()
|
||||||
.setParent(domain)
|
.setDomain(domain)
|
||||||
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
||||||
.setModificationTime(clock.nowUtc())
|
.setModificationTime(clock.nowUtc())
|
||||||
.setClientId(domain.getCreationClientId())
|
.setClientId(domain.getCreationClientId())
|
||||||
|
|
|
@ -127,7 +127,7 @@ class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, DomainBa
|
||||||
try {
|
try {
|
||||||
DomainHistory historyEntryDomainCreate =
|
DomainHistory historyEntryDomainCreate =
|
||||||
new DomainHistory.Builder()
|
new DomainHistory.Builder()
|
||||||
.setParent(domain)
|
.setDomain(domain)
|
||||||
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
||||||
.setModificationTime(clock.nowUtc())
|
.setModificationTime(clock.nowUtc())
|
||||||
.setClientId(domain.getCreationClientId())
|
.setClientId(domain.getCreationClientId())
|
||||||
|
|
|
@ -61,6 +61,7 @@ import google.registry.model.billing.BillingEvent;
|
||||||
import google.registry.model.billing.BillingEvent.Flag;
|
import google.registry.model.billing.BillingEvent.Flag;
|
||||||
import google.registry.model.billing.BillingEvent.Reason;
|
import google.registry.model.billing.BillingEvent.Reason;
|
||||||
import google.registry.model.domain.DomainBase;
|
import google.registry.model.domain.DomainBase;
|
||||||
|
import google.registry.model.domain.DomainHistory;
|
||||||
import google.registry.model.domain.GracePeriod;
|
import google.registry.model.domain.GracePeriod;
|
||||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||||
import google.registry.model.eppcommon.StatusValue;
|
import google.registry.model.eppcommon.StatusValue;
|
||||||
|
@ -113,11 +114,11 @@ class DomainRestoreRequestFlowTest
|
||||||
DomainBase domain = persistResource(newDomainBase(getUniqueIdFromCommand()));
|
DomainBase domain = persistResource(newDomainBase(getUniqueIdFromCommand()));
|
||||||
HistoryEntry historyEntry =
|
HistoryEntry historyEntry =
|
||||||
persistResource(
|
persistResource(
|
||||||
new HistoryEntry.Builder()
|
new DomainHistory.Builder()
|
||||||
.setType(HistoryEntry.Type.DOMAIN_DELETE)
|
.setType(HistoryEntry.Type.DOMAIN_DELETE)
|
||||||
.setModificationTime(clock.nowUtc())
|
.setModificationTime(clock.nowUtc())
|
||||||
.setClientId(domain.getCurrentSponsorClientId())
|
.setClientId(domain.getCurrentSponsorClientId())
|
||||||
.setParent(domain)
|
.setDomain(domain)
|
||||||
.build());
|
.build());
|
||||||
persistResource(
|
persistResource(
|
||||||
domain
|
domain
|
||||||
|
|
|
@ -55,6 +55,7 @@ import google.registry.model.billing.BillingEvent.Recurring;
|
||||||
import google.registry.model.contact.ContactAuthInfo;
|
import google.registry.model.contact.ContactAuthInfo;
|
||||||
import google.registry.model.domain.DomainAuthInfo;
|
import google.registry.model.domain.DomainAuthInfo;
|
||||||
import google.registry.model.domain.DomainBase;
|
import google.registry.model.domain.DomainBase;
|
||||||
|
import google.registry.model.domain.DomainHistory;
|
||||||
import google.registry.model.domain.GracePeriod;
|
import google.registry.model.domain.GracePeriod;
|
||||||
import google.registry.model.domain.Period;
|
import google.registry.model.domain.Period;
|
||||||
import google.registry.model.domain.Period.Unit;
|
import google.registry.model.domain.Period.Unit;
|
||||||
|
@ -603,9 +604,9 @@ class DomainTransferApproveFlowTest
|
||||||
DomainTransactionRecord notCancellableRecord =
|
DomainTransactionRecord notCancellableRecord =
|
||||||
DomainTransactionRecord.create("tld", clock.nowUtc().plusDays(1), NET_ADDS_4_YR, 5);
|
DomainTransactionRecord.create("tld", clock.nowUtc().plusDays(1), NET_ADDS_4_YR, 5);
|
||||||
persistResource(
|
persistResource(
|
||||||
new HistoryEntry.Builder()
|
new DomainHistory.Builder()
|
||||||
.setType(DOMAIN_TRANSFER_REQUEST)
|
.setType(DOMAIN_TRANSFER_REQUEST)
|
||||||
.setParent(domain)
|
.setDomain(domain)
|
||||||
.setModificationTime(clock.nowUtc().minusDays(4))
|
.setModificationTime(clock.nowUtc().minusDays(4))
|
||||||
.setClientId("TheRegistrar")
|
.setClientId("TheRegistrar")
|
||||||
.setDomainTransactionRecords(
|
.setDomainTransactionRecords(
|
||||||
|
|
|
@ -45,6 +45,7 @@ import google.registry.flows.exceptions.NotPendingTransferException;
|
||||||
import google.registry.model.contact.ContactAuthInfo;
|
import google.registry.model.contact.ContactAuthInfo;
|
||||||
import google.registry.model.domain.DomainAuthInfo;
|
import google.registry.model.domain.DomainAuthInfo;
|
||||||
import google.registry.model.domain.DomainBase;
|
import google.registry.model.domain.DomainBase;
|
||||||
|
import google.registry.model.domain.DomainHistory;
|
||||||
import google.registry.model.domain.GracePeriod;
|
import google.registry.model.domain.GracePeriod;
|
||||||
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
||||||
import google.registry.model.eppcommon.Trid;
|
import google.registry.model.eppcommon.Trid;
|
||||||
|
@ -367,9 +368,9 @@ class DomainTransferRejectFlowTest
|
||||||
DomainTransactionRecord notCancellableRecord =
|
DomainTransactionRecord notCancellableRecord =
|
||||||
DomainTransactionRecord.create("tld", clock.nowUtc().plusDays(1), NET_RENEWS_3_YR, 5);
|
DomainTransactionRecord.create("tld", clock.nowUtc().plusDays(1), NET_RENEWS_3_YR, 5);
|
||||||
persistResource(
|
persistResource(
|
||||||
new HistoryEntry.Builder()
|
new DomainHistory.Builder()
|
||||||
.setType(DOMAIN_TRANSFER_REQUEST)
|
.setType(DOMAIN_TRANSFER_REQUEST)
|
||||||
.setParent(domain)
|
.setDomain(domain)
|
||||||
.setModificationTime(clock.nowUtc().minusDays(4))
|
.setModificationTime(clock.nowUtc().minusDays(4))
|
||||||
.setClientId("TheRegistrar")
|
.setClientId("TheRegistrar")
|
||||||
.setDomainTransactionRecords(
|
.setDomainTransactionRecords(
|
||||||
|
|
|
@ -84,6 +84,7 @@ import google.registry.model.contact.ContactResource;
|
||||||
import google.registry.model.domain.DesignatedContact;
|
import google.registry.model.domain.DesignatedContact;
|
||||||
import google.registry.model.domain.DesignatedContact.Type;
|
import google.registry.model.domain.DesignatedContact.Type;
|
||||||
import google.registry.model.domain.DomainBase;
|
import google.registry.model.domain.DomainBase;
|
||||||
|
import google.registry.model.domain.DomainHistory;
|
||||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||||
import google.registry.model.eppcommon.StatusValue;
|
import google.registry.model.eppcommon.StatusValue;
|
||||||
import google.registry.model.host.HostResource;
|
import google.registry.model.host.HostResource;
|
||||||
|
@ -153,11 +154,11 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||||
.setNameservers(ImmutableSet.of(host.createVKey()))
|
.setNameservers(ImmutableSet.of(host.createVKey()))
|
||||||
.build());
|
.build());
|
||||||
persistResource(
|
persistResource(
|
||||||
new HistoryEntry.Builder()
|
new DomainHistory.Builder()
|
||||||
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
||||||
.setModificationTime(clock.nowUtc())
|
.setModificationTime(clock.nowUtc())
|
||||||
.setClientId(domain.getCreationClientId())
|
.setClientId(domain.getCreationClientId())
|
||||||
.setParent(domain)
|
.setDomain(domain)
|
||||||
.build());
|
.build());
|
||||||
clock.advanceOneMilli();
|
clock.advanceOneMilli();
|
||||||
return domain;
|
return domain;
|
||||||
|
@ -177,11 +178,11 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||||
.setNameservers(ImmutableSet.of(host.createVKey()))
|
.setNameservers(ImmutableSet.of(host.createVKey()))
|
||||||
.build());
|
.build());
|
||||||
persistResource(
|
persistResource(
|
||||||
new HistoryEntry.Builder()
|
new DomainHistory.Builder()
|
||||||
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
||||||
.setModificationTime(clock.nowUtc())
|
.setModificationTime(clock.nowUtc())
|
||||||
.setClientId(domain.getCreationClientId())
|
.setClientId(domain.getCreationClientId())
|
||||||
.setParent(domain)
|
.setDomain(domain)
|
||||||
.build());
|
.build());
|
||||||
clock.advanceOneMilli();
|
clock.advanceOneMilli();
|
||||||
return domain;
|
return domain;
|
||||||
|
|
|
@ -28,9 +28,11 @@ import com.google.common.collect.ImmutableList;
|
||||||
import google.registry.flows.EppException;
|
import google.registry.flows.EppException;
|
||||||
import google.registry.flows.FlowTestCase;
|
import google.registry.flows.FlowTestCase;
|
||||||
import google.registry.flows.poll.PollRequestFlow.UnexpectedMessageIdException;
|
import google.registry.flows.poll.PollRequestFlow.UnexpectedMessageIdException;
|
||||||
|
import google.registry.model.contact.ContactHistory;
|
||||||
import google.registry.model.contact.ContactResource;
|
import google.registry.model.contact.ContactResource;
|
||||||
import google.registry.model.domain.DomainBase;
|
import google.registry.model.domain.DomainBase;
|
||||||
import google.registry.model.eppcommon.Trid;
|
import google.registry.model.eppcommon.Trid;
|
||||||
|
import google.registry.model.host.HostHistory;
|
||||||
import google.registry.model.host.HostResource;
|
import google.registry.model.host.HostResource;
|
||||||
import google.registry.model.poll.PendingActionNotificationResponse.DomainPendingActionNotificationResponse;
|
import google.registry.model.poll.PendingActionNotificationResponse.DomainPendingActionNotificationResponse;
|
||||||
import google.registry.model.poll.PollMessage;
|
import google.registry.model.poll.PollMessage;
|
||||||
|
@ -210,11 +212,11 @@ class PollRequestFlowTest extends FlowTestCase<PollRequestFlow> {
|
||||||
// response data block is produced in the poll message.
|
// response data block is produced in the poll message.
|
||||||
HistoryEntry historyEntry =
|
HistoryEntry historyEntry =
|
||||||
persistResource(
|
persistResource(
|
||||||
new HistoryEntry.Builder()
|
new ContactHistory.Builder()
|
||||||
.setClientId("NewRegistrar")
|
.setClientId("NewRegistrar")
|
||||||
.setModificationTime(clock.nowUtc().minusDays(1))
|
.setModificationTime(clock.nowUtc().minusDays(1))
|
||||||
.setType(HistoryEntry.Type.CONTACT_DELETE)
|
.setType(HistoryEntry.Type.CONTACT_DELETE)
|
||||||
.setParent(contact)
|
.setContact(contact)
|
||||||
.build());
|
.build());
|
||||||
persistResource(
|
persistResource(
|
||||||
new PollMessage.OneTime.Builder()
|
new PollMessage.OneTime.Builder()
|
||||||
|
@ -233,11 +235,11 @@ class PollRequestFlowTest extends FlowTestCase<PollRequestFlow> {
|
||||||
// response data block is produced in the poll message.
|
// response data block is produced in the poll message.
|
||||||
HistoryEntry historyEntry =
|
HistoryEntry historyEntry =
|
||||||
persistResource(
|
persistResource(
|
||||||
new HistoryEntry.Builder()
|
new HostHistory.Builder()
|
||||||
.setClientId("NewRegistrar")
|
.setClientId("NewRegistrar")
|
||||||
.setModificationTime(clock.nowUtc().minusDays(1))
|
.setModificationTime(clock.nowUtc().minusDays(1))
|
||||||
.setType(HistoryEntry.Type.HOST_DELETE)
|
.setType(HistoryEntry.Type.HOST_DELETE)
|
||||||
.setParent(host)
|
.setHost(host)
|
||||||
.build());
|
.build());
|
||||||
persistResource(
|
persistResource(
|
||||||
new PollMessage.OneTime.Builder()
|
new PollMessage.OneTime.Builder()
|
||||||
|
|
|
@ -441,7 +441,6 @@ public class DomainBaseSqlTest {
|
||||||
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
||||||
.setPeriod(Period.create(1, Period.Unit.YEARS))
|
.setPeriod(Period.create(1, Period.Unit.YEARS))
|
||||||
.setModificationTime(DateTime.now(UTC))
|
.setModificationTime(DateTime.now(UTC))
|
||||||
.setParent(Key.create(DomainBase.class, "4-COM"))
|
|
||||||
.setDomainRepoId("4-COM")
|
.setDomainRepoId("4-COM")
|
||||||
.setClientId("registrar1")
|
.setClientId("registrar1")
|
||||||
// These are non-null, but I don't think some tests set them.
|
// These are non-null, but I don't think some tests set them.
|
||||||
|
@ -572,7 +571,6 @@ public class DomainBaseSqlTest {
|
||||||
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
||||||
.setPeriod(Period.create(1, Period.Unit.YEARS))
|
.setPeriod(Period.create(1, Period.Unit.YEARS))
|
||||||
.setModificationTime(DateTime.now(UTC))
|
.setModificationTime(DateTime.now(UTC))
|
||||||
.setParent(Key.create(DomainBase.class, "4-COM"))
|
|
||||||
.setDomainRepoId("4-COM")
|
.setDomainRepoId("4-COM")
|
||||||
.setClientId("registrar1")
|
.setClientId("registrar1")
|
||||||
// These are non-null, but I don't think some tests set them.
|
// These are non-null, but I don't think some tests set them.
|
||||||
|
|
|
@ -100,8 +100,8 @@ public class DomainBaseTest extends EntityTestCase {
|
||||||
historyEntryKey =
|
historyEntryKey =
|
||||||
Key.create(
|
Key.create(
|
||||||
persistResource(
|
persistResource(
|
||||||
new HistoryEntry.Builder()
|
new DomainHistory.Builder()
|
||||||
.setParent(domainKey.getOfyKey())
|
.setDomainRepoId(domainKey.getOfyKey().getName())
|
||||||
.setModificationTime(fakeClock.nowUtc())
|
.setModificationTime(fakeClock.nowUtc())
|
||||||
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
||||||
.setClientId("aregistrar")
|
.setClientId("aregistrar")
|
||||||
|
@ -364,8 +364,8 @@ public class DomainBaseTest extends EntityTestCase {
|
||||||
|
|
||||||
private void doExpiredTransferTest(DateTime oldExpirationTime) {
|
private void doExpiredTransferTest(DateTime oldExpirationTime) {
|
||||||
HistoryEntry historyEntry =
|
HistoryEntry historyEntry =
|
||||||
new HistoryEntry.Builder()
|
new DomainHistory.Builder()
|
||||||
.setParent(domain)
|
.setDomain(domain)
|
||||||
.setModificationTime(fakeClock.nowUtc())
|
.setModificationTime(fakeClock.nowUtc())
|
||||||
.setClientId(domain.getCurrentSponsorClientId())
|
.setClientId(domain.getCurrentSponsorClientId())
|
||||||
.setType(HistoryEntry.Type.DOMAIN_TRANSFER_REQUEST)
|
.setType(HistoryEntry.Type.DOMAIN_TRANSFER_REQUEST)
|
||||||
|
|
|
@ -207,9 +207,8 @@ public class LegacyHistoryObjectTest extends EntityTestCase {
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
private HistoryEntry.Builder historyEntryBuilderFor(EppResource parent) {
|
private HistoryEntry.Builder<?, ?> historyEntryBuilderFor(EppResource parent) {
|
||||||
return new HistoryEntry.Builder()
|
return HistoryEntry.createBuilderForResource(parent)
|
||||||
.setParent(parent)
|
|
||||||
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
||||||
.setXmlBytes("<xml></xml>".getBytes(UTF_8))
|
.setXmlBytes("<xml></xml>".getBytes(UTF_8))
|
||||||
.setModificationTime(fakeClock.nowUtc())
|
.setModificationTime(fakeClock.nowUtc())
|
||||||
|
|
|
@ -17,6 +17,7 @@ package google.registry.model.ofy;
|
||||||
import static com.google.appengine.api.datastore.DatastoreServiceFactory.getDatastoreService;
|
import static com.google.appengine.api.datastore.DatastoreServiceFactory.getDatastoreService;
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
|
import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
|
||||||
|
import static google.registry.model.ImmutableObjectSubject.assertAboutImmutableObjects;
|
||||||
import static google.registry.model.common.EntityGroupRoot.getCrossTldKey;
|
import static google.registry.model.common.EntityGroupRoot.getCrossTldKey;
|
||||||
import static google.registry.model.ofy.ObjectifyService.auditedOfy;
|
import static google.registry.model.ofy.ObjectifyService.auditedOfy;
|
||||||
import static google.registry.model.ofy.Ofy.getBaseEntityClassFromEntityOrKey;
|
import static google.registry.model.ofy.Ofy.getBaseEntityClassFromEntityOrKey;
|
||||||
|
@ -40,6 +41,7 @@ import com.googlecode.objectify.annotation.OnLoad;
|
||||||
import com.googlecode.objectify.annotation.OnSave;
|
import com.googlecode.objectify.annotation.OnSave;
|
||||||
import com.googlecode.objectify.annotation.Parent;
|
import com.googlecode.objectify.annotation.Parent;
|
||||||
import google.registry.model.ImmutableObject;
|
import google.registry.model.ImmutableObject;
|
||||||
|
import google.registry.model.contact.ContactHistory;
|
||||||
import google.registry.model.contact.ContactResource;
|
import google.registry.model.contact.ContactResource;
|
||||||
import google.registry.model.domain.DomainBase;
|
import google.registry.model.domain.DomainBase;
|
||||||
import google.registry.model.eppcommon.Trid;
|
import google.registry.model.eppcommon.Trid;
|
||||||
|
@ -70,11 +72,11 @@ public class OfyTest {
|
||||||
void beforeEach() {
|
void beforeEach() {
|
||||||
createTld("tld");
|
createTld("tld");
|
||||||
someObject =
|
someObject =
|
||||||
new HistoryEntry.Builder()
|
new ContactHistory.Builder()
|
||||||
.setClientId("clientid")
|
.setClientId("clientid")
|
||||||
.setModificationTime(START_OF_TIME)
|
.setModificationTime(START_OF_TIME)
|
||||||
.setType(HistoryEntry.Type.CONTACT_CREATE)
|
.setType(HistoryEntry.Type.CONTACT_CREATE)
|
||||||
.setParent(persistActiveContact("parentContact"))
|
.setContact(persistActiveContact("parentContact"))
|
||||||
.setTrid(Trid.create("client", "server"))
|
.setTrid(Trid.create("client", "server"))
|
||||||
.setXmlBytes("<xml></xml>".getBytes(UTF_8))
|
.setXmlBytes("<xml></xml>".getBytes(UTF_8))
|
||||||
.build();
|
.build();
|
||||||
|
@ -99,7 +101,8 @@ public class OfyTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testBackupGroupRootTimestampsMustIncreaseOnSave() {
|
void testBackupGroupRootTimestampsMustIncreaseOnSave() {
|
||||||
doBackupGroupRootTimestampInversionTest(() -> auditedOfy().save().entity(someObject));
|
doBackupGroupRootTimestampInversionTest(
|
||||||
|
() -> auditedOfy().save().entity(someObject.asHistoryEntry()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -115,8 +118,8 @@ public class OfyTest {
|
||||||
() ->
|
() ->
|
||||||
tm().transact(
|
tm().transact(
|
||||||
() -> {
|
() -> {
|
||||||
auditedOfy().save().entity(someObject);
|
auditedOfy().save().entity(someObject.asHistoryEntry());
|
||||||
auditedOfy().save().entity(someObject);
|
auditedOfy().save().entity(someObject.asHistoryEntry());
|
||||||
}));
|
}));
|
||||||
assertThat(thrown).hasMessageThat().contains("Multiple entries with same key");
|
assertThat(thrown).hasMessageThat().contains("Multiple entries with same key");
|
||||||
}
|
}
|
||||||
|
@ -143,7 +146,7 @@ public class OfyTest {
|
||||||
() ->
|
() ->
|
||||||
tm().transact(
|
tm().transact(
|
||||||
() -> {
|
() -> {
|
||||||
auditedOfy().save().entity(someObject);
|
auditedOfy().save().entity(someObject.asHistoryEntry());
|
||||||
auditedOfy().delete().entity(someObject);
|
auditedOfy().delete().entity(someObject);
|
||||||
}));
|
}));
|
||||||
assertThat(thrown).hasMessageThat().contains("Multiple entries with same key");
|
assertThat(thrown).hasMessageThat().contains("Multiple entries with same key");
|
||||||
|
@ -158,7 +161,7 @@ public class OfyTest {
|
||||||
tm().transact(
|
tm().transact(
|
||||||
() -> {
|
() -> {
|
||||||
auditedOfy().delete().entity(someObject);
|
auditedOfy().delete().entity(someObject);
|
||||||
auditedOfy().save().entity(someObject);
|
auditedOfy().save().entity(someObject.asHistoryEntry());
|
||||||
}));
|
}));
|
||||||
assertThat(thrown).hasMessageThat().contains("Multiple entries with same key");
|
assertThat(thrown).hasMessageThat().contains("Multiple entries with same key");
|
||||||
}
|
}
|
||||||
|
@ -288,7 +291,7 @@ public class OfyTest {
|
||||||
public Integer get() {
|
public Integer get() {
|
||||||
// There will be something in the manifest now, but it won't be committed if
|
// There will be something in the manifest now, but it won't be committed if
|
||||||
// we throw.
|
// we throw.
|
||||||
auditedOfy().save().entity(someObject);
|
auditedOfy().save().entity(someObject.asHistoryEntry());
|
||||||
count++;
|
count++;
|
||||||
if (count == 3) {
|
if (count == 3) {
|
||||||
return count;
|
return count;
|
||||||
|
@ -310,7 +313,7 @@ public class OfyTest {
|
||||||
public Void get() {
|
public Void get() {
|
||||||
if (firstCallToVrun) {
|
if (firstCallToVrun) {
|
||||||
firstCallToVrun = false;
|
firstCallToVrun = false;
|
||||||
auditedOfy().save().entity(someObject);
|
auditedOfy().save().entity(someObject.asHistoryEntry());
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
fail("Shouldn't have retried.");
|
fail("Shouldn't have retried.");
|
||||||
|
@ -409,24 +412,26 @@ public class OfyTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void test_doWithFreshSessionCache() {
|
void test_doWithFreshSessionCache() {
|
||||||
auditedOfy().saveWithoutBackup().entity(someObject).now();
|
auditedOfy().saveWithoutBackup().entity(someObject.asHistoryEntry()).now();
|
||||||
final HistoryEntry modifiedObject =
|
final HistoryEntry modifiedObject =
|
||||||
someObject.asBuilder().setModificationTime(END_OF_TIME).build();
|
someObject.asBuilder().setModificationTime(END_OF_TIME).build();
|
||||||
// Mutate the saved objected, bypassing the Objectify session cache.
|
// Mutate the saved objected, bypassing the Objectify session cache.
|
||||||
getDatastoreService().put(auditedOfy().saveWithoutBackup().toEntity(modifiedObject));
|
getDatastoreService()
|
||||||
|
.put(auditedOfy().saveWithoutBackup().toEntity(modifiedObject.asHistoryEntry()));
|
||||||
// Normal loading should come from the session cache and shouldn't reflect the mutation.
|
// Normal loading should come from the session cache and shouldn't reflect the mutation.
|
||||||
assertThat(auditedOfy().load().entity(someObject).now()).isEqualTo(someObject);
|
assertThat(auditedOfy().load().entity(someObject).now()).isEqualTo(someObject.asHistoryEntry());
|
||||||
// Loading inside doWithFreshSessionCache() should reflect the mutation.
|
// Loading inside doWithFreshSessionCache() should reflect the mutation.
|
||||||
boolean ran =
|
boolean ran =
|
||||||
auditedOfy()
|
auditedOfy()
|
||||||
.doWithFreshSessionCache(
|
.doWithFreshSessionCache(
|
||||||
() -> {
|
() -> {
|
||||||
assertThat(auditedOfy().load().entity(someObject).now())
|
assertAboutImmutableObjects()
|
||||||
.isEqualTo(modifiedObject);
|
.that(auditedOfy().load().entity(someObject).now())
|
||||||
|
.isEqualExceptFields(modifiedObject, "contactBase");
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
assertThat(ran).isTrue();
|
assertThat(ran).isTrue();
|
||||||
// Test the normal loading again to verify that we've restored the original session unchanged.
|
// Test the normal loading again to verify that we've restored the original session unchanged.
|
||||||
assertThat(auditedOfy().load().entity(someObject).now()).isEqualTo(someObject);
|
assertThat(auditedOfy().load().entity(someObject).now()).isEqualTo(someObject.asHistoryEntry());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ import static java.nio.charset.StandardCharsets.UTF_8;
|
||||||
import google.registry.model.EntityTestCase;
|
import google.registry.model.EntityTestCase;
|
||||||
import google.registry.model.contact.ContactResource;
|
import google.registry.model.contact.ContactResource;
|
||||||
import google.registry.model.domain.DomainBase;
|
import google.registry.model.domain.DomainBase;
|
||||||
|
import google.registry.model.domain.DomainHistory;
|
||||||
import google.registry.model.domain.Period;
|
import google.registry.model.domain.Period;
|
||||||
import google.registry.model.eppcommon.Trid;
|
import google.registry.model.eppcommon.Trid;
|
||||||
import google.registry.model.reporting.HistoryEntry;
|
import google.registry.model.reporting.HistoryEntry;
|
||||||
|
@ -56,8 +57,8 @@ public class PollMessageTest extends EntityTestCase {
|
||||||
domain = persistResource(newDomainBase("foo.foobar", contact));
|
domain = persistResource(newDomainBase("foo.foobar", contact));
|
||||||
historyEntry =
|
historyEntry =
|
||||||
persistResource(
|
persistResource(
|
||||||
new HistoryEntry.Builder()
|
new DomainHistory.Builder()
|
||||||
.setParent(domain)
|
.setDomain(domain)
|
||||||
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
||||||
.setPeriod(Period.create(1, Period.Unit.YEARS))
|
.setPeriod(Period.create(1, Period.Unit.YEARS))
|
||||||
.setXmlBytes("<xml></xml>".getBytes(UTF_8))
|
.setXmlBytes("<xml></xml>".getBytes(UTF_8))
|
||||||
|
|
|
@ -27,6 +27,7 @@ import static org.junit.Assert.assertThrows;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
import google.registry.model.EntityTestCase;
|
import google.registry.model.EntityTestCase;
|
||||||
|
import google.registry.model.contact.ContactHistory;
|
||||||
import google.registry.model.domain.DomainBase;
|
import google.registry.model.domain.DomainBase;
|
||||||
import google.registry.model.domain.DomainHistory;
|
import google.registry.model.domain.DomainHistory;
|
||||||
import google.registry.model.domain.Period;
|
import google.registry.model.domain.Period;
|
||||||
|
@ -96,7 +97,7 @@ class HistoryEntryTest extends EntityTestCase {
|
||||||
assertThrows(
|
assertThrows(
|
||||||
IllegalArgumentException.class,
|
IllegalArgumentException.class,
|
||||||
() ->
|
() ->
|
||||||
new HistoryEntry.Builder()
|
new ContactHistory.Builder()
|
||||||
.setId(5L)
|
.setId(5L)
|
||||||
.setModificationTime(DateTime.parse("1985-07-12T22:30:00Z"))
|
.setModificationTime(DateTime.parse("1985-07-12T22:30:00Z"))
|
||||||
.setClientId("TheRegistrar")
|
.setClientId("TheRegistrar")
|
||||||
|
@ -111,7 +112,7 @@ class HistoryEntryTest extends EntityTestCase {
|
||||||
assertThrows(
|
assertThrows(
|
||||||
IllegalArgumentException.class,
|
IllegalArgumentException.class,
|
||||||
() ->
|
() ->
|
||||||
new HistoryEntry.Builder()
|
new ContactHistory.Builder()
|
||||||
.setId(5L)
|
.setId(5L)
|
||||||
.setType(HistoryEntry.Type.CONTACT_CREATE)
|
.setType(HistoryEntry.Type.CONTACT_CREATE)
|
||||||
.setClientId("TheRegistrar")
|
.setClientId("TheRegistrar")
|
||||||
|
@ -126,7 +127,7 @@ class HistoryEntryTest extends EntityTestCase {
|
||||||
assertThrows(
|
assertThrows(
|
||||||
IllegalArgumentException.class,
|
IllegalArgumentException.class,
|
||||||
() ->
|
() ->
|
||||||
new HistoryEntry.Builder()
|
new ContactHistory.Builder()
|
||||||
.setId(5L)
|
.setId(5L)
|
||||||
.setType(HistoryEntry.Type.CONTACT_CREATE)
|
.setType(HistoryEntry.Type.CONTACT_CREATE)
|
||||||
.setModificationTime(DateTime.parse("1985-07-12T22:30:00Z"))
|
.setModificationTime(DateTime.parse("1985-07-12T22:30:00Z"))
|
||||||
|
@ -141,7 +142,7 @@ class HistoryEntryTest extends EntityTestCase {
|
||||||
assertThrows(
|
assertThrows(
|
||||||
IllegalArgumentException.class,
|
IllegalArgumentException.class,
|
||||||
() ->
|
() ->
|
||||||
new HistoryEntry.Builder()
|
new ContactHistory.Builder()
|
||||||
.setId(5L)
|
.setId(5L)
|
||||||
.setType(HistoryEntry.Type.SYNTHETIC)
|
.setType(HistoryEntry.Type.SYNTHETIC)
|
||||||
.setModificationTime(DateTime.parse("1985-07-12T22:30:00Z"))
|
.setModificationTime(DateTime.parse("1985-07-12T22:30:00Z"))
|
||||||
|
|
|
@ -1147,9 +1147,9 @@ class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDomainSear
|
||||||
assertThat(generateActualJson(RequestType.NAME, "domain*.lol"))
|
assertThat(generateActualJson(RequestType.NAME, "domain*.lol"))
|
||||||
.isEqualTo(
|
.isEqualTo(
|
||||||
jsonFileBuilder()
|
jsonFileBuilder()
|
||||||
.addDomain("domain100.lol", "A7-LOL")
|
.addDomain("domain100.lol", "AC-LOL")
|
||||||
.addDomain("domain150.lol", "75-LOL")
|
.addDomain("domain150.lol", "7A-LOL")
|
||||||
.addDomain("domain200.lol", "43-LOL")
|
.addDomain("domain200.lol", "48-LOL")
|
||||||
.addDomain("domainunused.lol", "unused-LOL")
|
.addDomain("domainunused.lol", "unused-LOL")
|
||||||
.load("rdap_incomplete_domain_result_set.json"));
|
.load("rdap_incomplete_domain_result_set.json"));
|
||||||
assertThat(response.getStatus()).isEqualTo(200);
|
assertThat(response.getStatus()).isEqualTo(200);
|
||||||
|
@ -1165,10 +1165,10 @@ class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDomainSear
|
||||||
runSuccessfulTestWithFourDomains(
|
runSuccessfulTestWithFourDomains(
|
||||||
RequestType.NAME,
|
RequestType.NAME,
|
||||||
"domain*.lol",
|
"domain*.lol",
|
||||||
"46-LOL",
|
"4B-LOL",
|
||||||
"45-LOL",
|
"4A-LOL",
|
||||||
"44-LOL",
|
"49-LOL",
|
||||||
"43-LOL",
|
"48-LOL",
|
||||||
"rdap_nontruncated_domains.json");
|
"rdap_nontruncated_domains.json");
|
||||||
verifyMetrics(SearchType.BY_DOMAIN_NAME, Optional.of(4L));
|
verifyMetrics(SearchType.BY_DOMAIN_NAME, Optional.of(4L));
|
||||||
}
|
}
|
||||||
|
@ -1179,10 +1179,10 @@ class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDomainSear
|
||||||
runSuccessfulTestWithFourDomains(
|
runSuccessfulTestWithFourDomains(
|
||||||
RequestType.NAME,
|
RequestType.NAME,
|
||||||
"domain*.lol",
|
"domain*.lol",
|
||||||
"47-LOL",
|
"4C-LOL",
|
||||||
"46-LOL",
|
"4B-LOL",
|
||||||
"45-LOL",
|
"4A-LOL",
|
||||||
"44-LOL",
|
"49-LOL",
|
||||||
"name=domain*.lol&cursor=ZG9tYWluNC5sb2w%3D",
|
"name=domain*.lol&cursor=ZG9tYWluNC5sb2w%3D",
|
||||||
"rdap_domains_four_truncated.json");
|
"rdap_domains_four_truncated.json");
|
||||||
verifyMetrics(SearchType.BY_DOMAIN_NAME, Optional.of(5L), IncompletenessWarningType.TRUNCATED);
|
verifyMetrics(SearchType.BY_DOMAIN_NAME, Optional.of(5L), IncompletenessWarningType.TRUNCATED);
|
||||||
|
@ -1197,8 +1197,8 @@ class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDomainSear
|
||||||
jsonFileBuilder()
|
jsonFileBuilder()
|
||||||
.addDomain("cat.lol", "C-LOL")
|
.addDomain("cat.lol", "C-LOL")
|
||||||
.addDomain("cat2.lol", "17-LOL")
|
.addDomain("cat2.lol", "17-LOL")
|
||||||
.addDomain("domain1.lol", "46-LOL")
|
.addDomain("domain1.lol", "4B-LOL")
|
||||||
.addDomain("domain2.lol", "45-LOL")
|
.addDomain("domain2.lol", "4A-LOL")
|
||||||
.setNextQuery("name=*.lol&cursor=ZG9tYWluMi5sb2w%3D")
|
.setNextQuery("name=*.lol&cursor=ZG9tYWluMi5sb2w%3D")
|
||||||
.load("rdap_domains_four_truncated.json"));
|
.load("rdap_domains_four_truncated.json"));
|
||||||
verifyMetrics(SearchType.BY_DOMAIN_NAME, Optional.of(5L), IncompletenessWarningType.TRUNCATED);
|
verifyMetrics(SearchType.BY_DOMAIN_NAME, Optional.of(5L), IncompletenessWarningType.TRUNCATED);
|
||||||
|
@ -1213,8 +1213,8 @@ class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDomainSear
|
||||||
jsonFileBuilder()
|
jsonFileBuilder()
|
||||||
.addDomain("cat2.lol", "17-LOL")
|
.addDomain("cat2.lol", "17-LOL")
|
||||||
.addDomain("cat.lol", "C-LOL")
|
.addDomain("cat.lol", "C-LOL")
|
||||||
.addDomain("domain1.lol", "46-LOL")
|
.addDomain("domain1.lol", "4B-LOL")
|
||||||
.addDomain("domain2.lol", "45-LOL")
|
.addDomain("domain2.lol", "4A-LOL")
|
||||||
.setNextQuery("name=*.lol&cursor=ZG9tYWluMi5sb2w%3D")
|
.setNextQuery("name=*.lol&cursor=ZG9tYWluMi5sb2w%3D")
|
||||||
.load("rdap_domains_four_truncated.json"));
|
.load("rdap_domains_four_truncated.json"));
|
||||||
verifyMetrics(SearchType.BY_DOMAIN_NAME, Optional.of(5L), IncompletenessWarningType.TRUNCATED);
|
verifyMetrics(SearchType.BY_DOMAIN_NAME, Optional.of(5L), IncompletenessWarningType.TRUNCATED);
|
||||||
|
@ -1228,10 +1228,10 @@ class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDomainSear
|
||||||
runSuccessfulTestWithFourDomains(
|
runSuccessfulTestWithFourDomains(
|
||||||
RequestType.NAME,
|
RequestType.NAME,
|
||||||
"domain*.lol",
|
"domain*.lol",
|
||||||
"4B-LOL",
|
"50-LOL",
|
||||||
"4A-LOL",
|
"4F-LOL",
|
||||||
"49-LOL",
|
"4E-LOL",
|
||||||
"48-LOL",
|
"4D-LOL",
|
||||||
"name=domain*.lol&cursor=ZG9tYWluNC5sb2w%3D",
|
"name=domain*.lol&cursor=ZG9tYWluNC5sb2w%3D",
|
||||||
"rdap_domains_four_truncated.json");
|
"rdap_domains_four_truncated.json");
|
||||||
verifyMetrics(SearchType.BY_DOMAIN_NAME, Optional.of(5L), IncompletenessWarningType.TRUNCATED);
|
verifyMetrics(SearchType.BY_DOMAIN_NAME, Optional.of(5L), IncompletenessWarningType.TRUNCATED);
|
||||||
|
@ -1244,10 +1244,10 @@ class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDomainSear
|
||||||
assertThat(generateActualJson(RequestType.NAME, "domain*.lol"))
|
assertThat(generateActualJson(RequestType.NAME, "domain*.lol"))
|
||||||
.isEqualTo(
|
.isEqualTo(
|
||||||
jsonFileBuilder()
|
jsonFileBuilder()
|
||||||
.addDomain("domain12.lol", "55-LOL")
|
.addDomain("domain12.lol", "5A-LOL")
|
||||||
.addDomain("domain18.lol", "4F-LOL")
|
.addDomain("domain18.lol", "54-LOL")
|
||||||
.addDomain("domain24.lol", "49-LOL")
|
.addDomain("domain24.lol", "4E-LOL")
|
||||||
.addDomain("domain30.lol", "43-LOL")
|
.addDomain("domain30.lol", "48-LOL")
|
||||||
.setNextQuery("name=domain*.lol&cursor=ZG9tYWluMzAubG9s")
|
.setNextQuery("name=domain*.lol&cursor=ZG9tYWluMzAubG9s")
|
||||||
.load("rdap_domains_four_truncated.json"));
|
.load("rdap_domains_four_truncated.json"));
|
||||||
assertThat(response.getStatus()).isEqualTo(200);
|
assertThat(response.getStatus()).isEqualTo(200);
|
||||||
|
@ -1261,10 +1261,10 @@ class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDomainSear
|
||||||
assertThat(generateActualJson(RequestType.NAME, "domain*.lol"))
|
assertThat(generateActualJson(RequestType.NAME, "domain*.lol"))
|
||||||
.isEqualTo(
|
.isEqualTo(
|
||||||
jsonFileBuilder()
|
jsonFileBuilder()
|
||||||
.addDomain("domain12.lol", "55-LOL")
|
.addDomain("domain12.lol", "5A-LOL")
|
||||||
.addDomain("domain18.lol", "4F-LOL")
|
.addDomain("domain18.lol", "54-LOL")
|
||||||
.addDomain("domain24.lol", "49-LOL")
|
.addDomain("domain24.lol", "4E-LOL")
|
||||||
.addDomain("domain30.lol", "43-LOL")
|
.addDomain("domain30.lol", "48-LOL")
|
||||||
.setNextQuery("name=domain*.lol&cursor=ZG9tYWluMzAubG9s")
|
.setNextQuery("name=domain*.lol&cursor=ZG9tYWluMzAubG9s")
|
||||||
.load("rdap_domains_four_truncated.json"));
|
.load("rdap_domains_four_truncated.json"));
|
||||||
assertThat(response.getStatus()).isEqualTo(200);
|
assertThat(response.getStatus()).isEqualTo(200);
|
||||||
|
@ -1672,10 +1672,10 @@ class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDomainSear
|
||||||
runSuccessfulTestWithFourDomains(
|
runSuccessfulTestWithFourDomains(
|
||||||
RequestType.NS_LDH_NAME,
|
RequestType.NS_LDH_NAME,
|
||||||
"ns1.domain1.lol",
|
"ns1.domain1.lol",
|
||||||
"46-LOL",
|
"4B-LOL",
|
||||||
"45-LOL",
|
"4A-LOL",
|
||||||
"44-LOL",
|
"49-LOL",
|
||||||
"43-LOL",
|
"48-LOL",
|
||||||
"rdap_nontruncated_domains.json");
|
"rdap_nontruncated_domains.json");
|
||||||
verifyMetrics(SearchType.BY_NAMESERVER_NAME, Optional.of(4L), Optional.of(1L));
|
verifyMetrics(SearchType.BY_NAMESERVER_NAME, Optional.of(4L), Optional.of(1L));
|
||||||
}
|
}
|
||||||
|
@ -1686,10 +1686,10 @@ class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDomainSear
|
||||||
runSuccessfulTestWithFourDomains(
|
runSuccessfulTestWithFourDomains(
|
||||||
RequestType.NS_LDH_NAME,
|
RequestType.NS_LDH_NAME,
|
||||||
"ns1.domain1.lol",
|
"ns1.domain1.lol",
|
||||||
"47-LOL",
|
"4C-LOL",
|
||||||
"46-LOL",
|
"4B-LOL",
|
||||||
"45-LOL",
|
"4A-LOL",
|
||||||
"44-LOL",
|
"49-LOL",
|
||||||
"nsLdhName=ns1.domain1.lol&cursor=ZG9tYWluNC5sb2w%3D",
|
"nsLdhName=ns1.domain1.lol&cursor=ZG9tYWluNC5sb2w%3D",
|
||||||
"rdap_domains_four_truncated.json");
|
"rdap_domains_four_truncated.json");
|
||||||
verifyMetrics(
|
verifyMetrics(
|
||||||
|
@ -1705,10 +1705,10 @@ class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDomainSear
|
||||||
runSuccessfulTestWithFourDomains(
|
runSuccessfulTestWithFourDomains(
|
||||||
RequestType.NS_LDH_NAME,
|
RequestType.NS_LDH_NAME,
|
||||||
"ns1.domain1.lol",
|
"ns1.domain1.lol",
|
||||||
"4B-LOL",
|
"50-LOL",
|
||||||
"4A-LOL",
|
"4F-LOL",
|
||||||
"49-LOL",
|
"4E-LOL",
|
||||||
"48-LOL",
|
"4D-LOL",
|
||||||
"nsLdhName=ns1.domain1.lol&cursor=ZG9tYWluNC5sb2w%3D",
|
"nsLdhName=ns1.domain1.lol&cursor=ZG9tYWluNC5sb2w%3D",
|
||||||
"rdap_domains_four_truncated.json");
|
"rdap_domains_four_truncated.json");
|
||||||
verifyMetrics(
|
verifyMetrics(
|
||||||
|
@ -1727,10 +1727,10 @@ class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDomainSear
|
||||||
assertThat(generateActualJson(RequestType.NS_LDH_NAME, "ns*.domain1.lol"))
|
assertThat(generateActualJson(RequestType.NS_LDH_NAME, "ns*.domain1.lol"))
|
||||||
.isEqualTo(
|
.isEqualTo(
|
||||||
jsonFileBuilder()
|
jsonFileBuilder()
|
||||||
.addDomain("domain1.lol", "8A-LOL")
|
.addDomain("domain1.lol", "8F-LOL")
|
||||||
.addDomain("domain2.lol", "89-LOL")
|
.addDomain("domain2.lol", "8E-LOL")
|
||||||
.addDomain("domain3.lol", "88-LOL")
|
.addDomain("domain3.lol", "8D-LOL")
|
||||||
.addDomain("domain4.lol", "87-LOL")
|
.addDomain("domain4.lol", "8C-LOL")
|
||||||
.load("rdap_nontruncated_domains.json"));
|
.load("rdap_nontruncated_domains.json"));
|
||||||
assertThat(response.getStatus()).isEqualTo(200);
|
assertThat(response.getStatus()).isEqualTo(200);
|
||||||
verifyMetrics(SearchType.BY_NAMESERVER_NAME, Optional.of(4L), Optional.of(36L));
|
verifyMetrics(SearchType.BY_NAMESERVER_NAME, Optional.of(4L), Optional.of(36L));
|
||||||
|
@ -1743,8 +1743,8 @@ class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDomainSear
|
||||||
assertThat(generateActualJson(RequestType.NS_LDH_NAME, "ns*.domain1.lol"))
|
assertThat(generateActualJson(RequestType.NS_LDH_NAME, "ns*.domain1.lol"))
|
||||||
.isEqualTo(
|
.isEqualTo(
|
||||||
jsonFileBuilder()
|
jsonFileBuilder()
|
||||||
.addDomain("domain1.lol", "92-LOL")
|
.addDomain("domain1.lol", "97-LOL")
|
||||||
.addDomain("domain2.lol", "91-LOL")
|
.addDomain("domain2.lol", "96-LOL")
|
||||||
.load("rdap_incomplete_domains.json"));
|
.load("rdap_incomplete_domains.json"));
|
||||||
assertThat(response.getStatus()).isEqualTo(200);
|
assertThat(response.getStatus()).isEqualTo(200);
|
||||||
verifyMetrics(
|
verifyMetrics(
|
||||||
|
@ -1909,10 +1909,10 @@ class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDomainSear
|
||||||
runSuccessfulTestWithFourDomains(
|
runSuccessfulTestWithFourDomains(
|
||||||
RequestType.NS_IP,
|
RequestType.NS_IP,
|
||||||
"5.5.5.1",
|
"5.5.5.1",
|
||||||
"46-LOL",
|
"4B-LOL",
|
||||||
"45-LOL",
|
"4A-LOL",
|
||||||
"44-LOL",
|
"49-LOL",
|
||||||
"43-LOL",
|
"48-LOL",
|
||||||
"rdap_nontruncated_domains.json");
|
"rdap_nontruncated_domains.json");
|
||||||
verifyMetrics(SearchType.BY_NAMESERVER_ADDRESS, 4, 1);
|
verifyMetrics(SearchType.BY_NAMESERVER_ADDRESS, 4, 1);
|
||||||
}
|
}
|
||||||
|
@ -1923,10 +1923,10 @@ class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDomainSear
|
||||||
runSuccessfulTestWithFourDomains(
|
runSuccessfulTestWithFourDomains(
|
||||||
RequestType.NS_IP,
|
RequestType.NS_IP,
|
||||||
"5.5.5.1",
|
"5.5.5.1",
|
||||||
"47-LOL",
|
"4C-LOL",
|
||||||
"46-LOL",
|
"4B-LOL",
|
||||||
"45-LOL",
|
"4A-LOL",
|
||||||
"44-LOL",
|
"49-LOL",
|
||||||
"nsIp=5.5.5.1&cursor=ZG9tYWluNC5sb2w%3D",
|
"nsIp=5.5.5.1&cursor=ZG9tYWluNC5sb2w%3D",
|
||||||
"rdap_domains_four_truncated.json");
|
"rdap_domains_four_truncated.json");
|
||||||
verifyMetrics(
|
verifyMetrics(
|
||||||
|
@ -1942,10 +1942,10 @@ class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDomainSear
|
||||||
runSuccessfulTestWithFourDomains(
|
runSuccessfulTestWithFourDomains(
|
||||||
RequestType.NS_IP,
|
RequestType.NS_IP,
|
||||||
"5.5.5.1",
|
"5.5.5.1",
|
||||||
"4B-LOL",
|
"50-LOL",
|
||||||
"4A-LOL",
|
"4F-LOL",
|
||||||
"49-LOL",
|
"4E-LOL",
|
||||||
"48-LOL",
|
"4D-LOL",
|
||||||
"nsIp=5.5.5.1&cursor=ZG9tYWluNC5sb2w%3D",
|
"nsIp=5.5.5.1&cursor=ZG9tYWluNC5sb2w%3D",
|
||||||
"rdap_domains_four_truncated.json");
|
"rdap_domains_four_truncated.json");
|
||||||
verifyMetrics(
|
verifyMetrics(
|
||||||
|
|
|
@ -36,6 +36,7 @@ import google.registry.model.contact.PostalInfo;
|
||||||
import google.registry.model.domain.DesignatedContact;
|
import google.registry.model.domain.DesignatedContact;
|
||||||
import google.registry.model.domain.DomainAuthInfo;
|
import google.registry.model.domain.DomainAuthInfo;
|
||||||
import google.registry.model.domain.DomainBase;
|
import google.registry.model.domain.DomainBase;
|
||||||
|
import google.registry.model.domain.DomainHistory;
|
||||||
import google.registry.model.domain.GracePeriod;
|
import google.registry.model.domain.GracePeriod;
|
||||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||||
|
@ -67,8 +68,8 @@ final class RdeFixtures {
|
||||||
.build();
|
.build();
|
||||||
HistoryEntry historyEntry =
|
HistoryEntry historyEntry =
|
||||||
persistResource(
|
persistResource(
|
||||||
new HistoryEntry.Builder()
|
new DomainHistory.Builder()
|
||||||
.setParent(domain)
|
.setDomain(domain)
|
||||||
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
||||||
.setModificationTime(clock.nowUtc())
|
.setModificationTime(clock.nowUtc())
|
||||||
.setClientId("TheRegistrar")
|
.setClientId("TheRegistrar")
|
||||||
|
|
|
@ -71,6 +71,7 @@ import google.registry.model.billing.BillingEvent;
|
||||||
import google.registry.model.billing.BillingEvent.Flag;
|
import google.registry.model.billing.BillingEvent.Flag;
|
||||||
import google.registry.model.billing.BillingEvent.Reason;
|
import google.registry.model.billing.BillingEvent.Reason;
|
||||||
import google.registry.model.contact.ContactAuthInfo;
|
import google.registry.model.contact.ContactAuthInfo;
|
||||||
|
import google.registry.model.contact.ContactHistory;
|
||||||
import google.registry.model.contact.ContactResource;
|
import google.registry.model.contact.ContactResource;
|
||||||
import google.registry.model.domain.DesignatedContact;
|
import google.registry.model.domain.DesignatedContact;
|
||||||
import google.registry.model.domain.DesignatedContact.Type;
|
import google.registry.model.domain.DesignatedContact.Type;
|
||||||
|
@ -540,9 +541,9 @@ public class DatabaseHelper {
|
||||||
ContactResource contact, DateTime requestTime, DateTime expirationTime, DateTime now) {
|
ContactResource contact, DateTime requestTime, DateTime expirationTime, DateTime now) {
|
||||||
HistoryEntry historyEntryContactTransfer =
|
HistoryEntry historyEntryContactTransfer =
|
||||||
persistResource(
|
persistResource(
|
||||||
new HistoryEntry.Builder()
|
new ContactHistory.Builder()
|
||||||
.setType(HistoryEntry.Type.CONTACT_TRANSFER_REQUEST)
|
.setType(HistoryEntry.Type.CONTACT_TRANSFER_REQUEST)
|
||||||
.setParent(persistResource(contact))
|
.setContact(persistResource(contact))
|
||||||
.setModificationTime(now)
|
.setModificationTime(now)
|
||||||
.setClientId(contact.getCurrentSponsorClientId())
|
.setClientId(contact.getCurrentSponsorClientId())
|
||||||
.build()
|
.build()
|
||||||
|
@ -1085,8 +1086,7 @@ public class DatabaseHelper {
|
||||||
() -> {
|
() -> {
|
||||||
tm().put(resource);
|
tm().put(resource);
|
||||||
tm().put(
|
tm().put(
|
||||||
new HistoryEntry.Builder()
|
HistoryEntry.createBuilderForResource(resource)
|
||||||
.setParent(resource)
|
|
||||||
.setClientId(resource.getCreationClientId())
|
.setClientId(resource.getCreationClientId())
|
||||||
.setType(getHistoryEntryType(resource))
|
.setType(getHistoryEntryType(resource))
|
||||||
.setModificationTime(tm().getTransactionTime())
|
.setModificationTime(tm().getTransactionTime())
|
||||||
|
@ -1158,10 +1158,9 @@ public class DatabaseHelper {
|
||||||
public static <T extends EppResource> HistoryEntry createHistoryEntryForEppResource(
|
public static <T extends EppResource> HistoryEntry createHistoryEntryForEppResource(
|
||||||
T parentResource) {
|
T parentResource) {
|
||||||
return persistResource(
|
return persistResource(
|
||||||
new HistoryEntry.Builder()
|
HistoryEntry.createBuilderForResource(parentResource)
|
||||||
.setType(getHistoryEntryType(parentResource))
|
.setType(getHistoryEntryType(parentResource))
|
||||||
.setModificationTime(DateTime.now(DateTimeZone.UTC))
|
.setModificationTime(DateTime.now(DateTimeZone.UTC))
|
||||||
.setParent(parentResource)
|
|
||||||
.setClientId(parentResource.getPersistedCurrentSponsorClientId())
|
.setClientId(parentResource.getPersistedCurrentSponsorClientId())
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
|
|
@ -385,18 +385,16 @@ public final class FullFieldsTestEntityHelper {
|
||||||
Period period,
|
Period period,
|
||||||
String reason,
|
String reason,
|
||||||
DateTime modificationTime) {
|
DateTime modificationTime) {
|
||||||
HistoryEntry.Builder builder =
|
return HistoryEntry.createBuilderForResource(resource)
|
||||||
new HistoryEntry.Builder()
|
.setType(type)
|
||||||
.setParent(resource)
|
.setPeriod(period)
|
||||||
.setType(type)
|
.setXmlBytes("<xml></xml>".getBytes(UTF_8))
|
||||||
.setPeriod(period)
|
.setModificationTime(modificationTime)
|
||||||
.setXmlBytes("<xml></xml>".getBytes(UTF_8))
|
.setClientId(resource.getPersistedCurrentSponsorClientId())
|
||||||
.setModificationTime(modificationTime)
|
.setTrid(Trid.create("ABC-123", "server-trid"))
|
||||||
.setClientId(resource.getPersistedCurrentSponsorClientId())
|
.setBySuperuser(false)
|
||||||
.setTrid(Trid.create("ABC-123", "server-trid"))
|
.setReason(reason)
|
||||||
.setBySuperuser(false)
|
.setRequestedByRegistrar(false)
|
||||||
.setReason(reason)
|
.build();
|
||||||
.setRequestedByRegistrar(false);
|
|
||||||
return builder.build();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,8 +128,7 @@ class DedupeOneTimeBillingEventIdsCommandTest
|
||||||
|
|
||||||
private HistoryEntry persistHistoryEntry(EppResource parent) {
|
private HistoryEntry persistHistoryEntry(EppResource parent) {
|
||||||
return persistResource(
|
return persistResource(
|
||||||
new HistoryEntry.Builder()
|
HistoryEntry.createBuilderForResource(parent)
|
||||||
.setParent(parent)
|
|
||||||
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
||||||
.setPeriod(Period.create(1, Period.Unit.YEARS))
|
.setPeriod(Period.create(1, Period.Unit.YEARS))
|
||||||
.setXmlBytes("<xml></xml>".getBytes(UTF_8))
|
.setXmlBytes("<xml></xml>".getBytes(UTF_8))
|
||||||
|
|
|
@ -33,6 +33,7 @@ import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
import com.google.common.truth.Truth8;
|
import com.google.common.truth.Truth8;
|
||||||
import google.registry.model.domain.DomainBase;
|
import google.registry.model.domain.DomainBase;
|
||||||
|
import google.registry.model.domain.DomainHistory;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.reporting.HistoryEntry;
|
import google.registry.model.reporting.HistoryEntry;
|
||||||
import google.registry.schema.domain.RegistryLock;
|
import google.registry.schema.domain.RegistryLock;
|
||||||
|
@ -127,11 +128,11 @@ class BackfillRegistryLocksCommandTest extends CommandTestCase<BackfillRegistryL
|
||||||
DateTime ursTime = fakeClock.nowUtc();
|
DateTime ursTime = fakeClock.nowUtc();
|
||||||
DomainBase ursDomain = persistLockedDomain("urs.tld");
|
DomainBase ursDomain = persistLockedDomain("urs.tld");
|
||||||
HistoryEntry historyEntry =
|
HistoryEntry historyEntry =
|
||||||
new HistoryEntry.Builder()
|
new DomainHistory.Builder()
|
||||||
.setBySuperuser(true)
|
.setBySuperuser(true)
|
||||||
.setClientId("adminreg")
|
.setClientId("adminreg")
|
||||||
.setModificationTime(ursTime)
|
.setModificationTime(ursTime)
|
||||||
.setParent(ursDomain)
|
.setDomain(ursDomain)
|
||||||
.setReason("Uniform Rapid Suspension")
|
.setReason("Uniform Rapid Suspension")
|
||||||
.setType(HistoryEntry.Type.DOMAIN_UPDATE)
|
.setType(HistoryEntry.Type.DOMAIN_UPDATE)
|
||||||
.setRequestedByRegistrar(false)
|
.setRequestedByRegistrar(false)
|
||||||
|
|
|
@ -106,8 +106,7 @@ class KillAllEppResourcesActionTest extends MapreduceTestCase<KillAllEppResource
|
||||||
persistActiveHost("ns.foo.tld1"),
|
persistActiveHost("ns.foo.tld1"),
|
||||||
persistActiveHost("ns.foo.tld2"))) {
|
persistActiveHost("ns.foo.tld2"))) {
|
||||||
HistoryEntry history =
|
HistoryEntry history =
|
||||||
new HistoryEntry.Builder()
|
HistoryEntry.createBuilderForResource(resource)
|
||||||
.setParent(resource)
|
|
||||||
.setClientId(resource.getCreationClientId())
|
.setClientId(resource.getCreationClientId())
|
||||||
.setModificationTime(resource.getCreationTime())
|
.setModificationTime(resource.getCreationTime())
|
||||||
.setType(HISTORY_ENTRY_CREATE_TYPES.get(resource.getClass()))
|
.setType(HISTORY_ENTRY_CREATE_TYPES.get(resource.getClass()))
|
||||||
|
|
|
@ -23,8 +23,10 @@ import static google.registry.testing.DatabaseHelper.persistActiveDomain;
|
||||||
import com.google.appengine.api.datastore.DatastoreService;
|
import com.google.appengine.api.datastore.DatastoreService;
|
||||||
import com.google.appengine.api.datastore.DatastoreServiceFactory;
|
import com.google.appengine.api.datastore.DatastoreServiceFactory;
|
||||||
import com.google.appengine.api.datastore.Entity;
|
import com.google.appengine.api.datastore.Entity;
|
||||||
|
import google.registry.model.contact.ContactHistory;
|
||||||
import google.registry.model.contact.ContactResource;
|
import google.registry.model.contact.ContactResource;
|
||||||
import google.registry.model.domain.DomainBase;
|
import google.registry.model.domain.DomainBase;
|
||||||
|
import google.registry.model.domain.DomainHistory;
|
||||||
import google.registry.model.reporting.HistoryEntry;
|
import google.registry.model.reporting.HistoryEntry;
|
||||||
import google.registry.testing.FakeResponse;
|
import google.registry.testing.FakeResponse;
|
||||||
import google.registry.testing.mapreduce.MapreduceTestCase;
|
import google.registry.testing.mapreduce.MapreduceTestCase;
|
||||||
|
@ -58,22 +60,24 @@ class ResaveAllHistoryEntriesActionTest extends MapreduceTestCase<ResaveAllHisto
|
||||||
auditedOfy()
|
auditedOfy()
|
||||||
.save()
|
.save()
|
||||||
.toEntity(
|
.toEntity(
|
||||||
new HistoryEntry.Builder()
|
new DomainHistory.Builder()
|
||||||
.setParent(domain)
|
.setDomain(domain)
|
||||||
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
||||||
.setModificationTime(domain.getCreationTime())
|
.setModificationTime(domain.getCreationTime())
|
||||||
.setClientId(domain.getCreationClientId())
|
.setClientId(domain.getCreationClientId())
|
||||||
.build());
|
.build()
|
||||||
|
.asHistoryEntry());
|
||||||
Entity contactEntry =
|
Entity contactEntry =
|
||||||
auditedOfy()
|
auditedOfy()
|
||||||
.save()
|
.save()
|
||||||
.toEntity(
|
.toEntity(
|
||||||
new HistoryEntry.Builder()
|
new ContactHistory.Builder()
|
||||||
.setParent(contact)
|
.setContact(contact)
|
||||||
.setType(HistoryEntry.Type.CONTACT_CREATE)
|
.setType(HistoryEntry.Type.CONTACT_CREATE)
|
||||||
.setClientId(contact.getCreationClientId())
|
.setClientId(contact.getCreationClientId())
|
||||||
.setModificationTime(contact.getCreationTime())
|
.setModificationTime(contact.getCreationTime())
|
||||||
.build());
|
.build()
|
||||||
|
.asHistoryEntry());
|
||||||
|
|
||||||
// Set raw properties outside the Objectify schema, which will be deleted upon re-save.
|
// Set raw properties outside the Objectify schema, which will be deleted upon re-save.
|
||||||
domainEntry.setProperty("clientId", "validId");
|
domainEntry.setProperty("clientId", "validId");
|
||||||
|
|
|
@ -287,7 +287,10 @@ class google.registry.model.domain.DomainHistory {
|
||||||
java.lang.String clientId;
|
java.lang.String clientId;
|
||||||
java.lang.String otherClientId;
|
java.lang.String otherClientId;
|
||||||
java.lang.String reason;
|
java.lang.String reason;
|
||||||
|
java.util.Set<google.registry.model.domain.GracePeriod$GracePeriodHistory> gracePeriodHistories;
|
||||||
|
java.util.Set<google.registry.model.domain.secdns.DomainDsDataHistory> dsDataHistories;
|
||||||
java.util.Set<google.registry.model.reporting.DomainTransactionRecord> domainTransactionRecords;
|
java.util.Set<google.registry.model.reporting.DomainTransactionRecord> domainTransactionRecords;
|
||||||
|
java.util.Set<google.registry.persistence.VKey<google.registry.model.host.HostResource>> nsHosts;
|
||||||
org.joda.time.DateTime modificationTime;
|
org.joda.time.DateTime modificationTime;
|
||||||
}
|
}
|
||||||
class google.registry.model.domain.GracePeriod {
|
class google.registry.model.domain.GracePeriod {
|
||||||
|
@ -298,6 +301,16 @@ class google.registry.model.domain.GracePeriod {
|
||||||
long gracePeriodId;
|
long gracePeriodId;
|
||||||
org.joda.time.DateTime expirationTime;
|
org.joda.time.DateTime expirationTime;
|
||||||
}
|
}
|
||||||
|
class google.registry.model.domain.GracePeriod$GracePeriodHistory {
|
||||||
|
google.registry.model.domain.rgp.GracePeriodStatus type;
|
||||||
|
google.registry.persistence.BillingVKey$BillingEventVKey billingEventOneTime;
|
||||||
|
google.registry.persistence.BillingVKey$BillingRecurrenceVKey billingEventRecurring;
|
||||||
|
java.lang.Long domainHistoryRevisionId;
|
||||||
|
java.lang.Long gracePeriodHistoryRevisionId;
|
||||||
|
java.lang.String clientId;
|
||||||
|
long gracePeriodId;
|
||||||
|
org.joda.time.DateTime expirationTime;
|
||||||
|
}
|
||||||
class google.registry.model.domain.Period {
|
class google.registry.model.domain.Period {
|
||||||
google.registry.model.domain.Period$Unit unit;
|
google.registry.model.domain.Period$Unit unit;
|
||||||
java.lang.Integer value;
|
java.lang.Integer value;
|
||||||
|
@ -330,6 +343,14 @@ class google.registry.model.domain.secdns.DelegationSignerData {
|
||||||
int digestType;
|
int digestType;
|
||||||
int keyTag;
|
int keyTag;
|
||||||
}
|
}
|
||||||
|
class google.registry.model.domain.secdns.DomainDsDataHistory {
|
||||||
|
byte[] digest;
|
||||||
|
int algorithm;
|
||||||
|
int digestType;
|
||||||
|
int keyTag;
|
||||||
|
java.lang.Long domainHistoryRevisionId;
|
||||||
|
java.lang.Long dsDataHistoryRevisionId;
|
||||||
|
}
|
||||||
class google.registry.model.domain.token.AllocationToken {
|
class google.registry.model.domain.token.AllocationToken {
|
||||||
@Id java.lang.String token;
|
@Id java.lang.String token;
|
||||||
boolean discountPremiums;
|
boolean discountPremiums;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue