Add a batched [] for DNS refreshing on host renames

This will replace the existing DnsRefreshForHostRenameAction.

This is stage one of a three stage migration process. It adds the new queue and
[] but doesn't call them yet. Stage two will cut over to using the new
functionality, and stage three will remove the old functionality.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134793963
This commit is contained in:
mcilwain 2016-09-30 09:52:13 -07:00 committed by Ben McIlwain
parent e5c0854ae6
commit e192c11adf
14 changed files with 522 additions and 5 deletions

View file

@ -126,6 +126,13 @@ public class DatastoreHelper {
domainName, generateNewDomainRoid(getTldFromDomainName(domainName)), contact);
}
public static DomainResource newDomainResource(String domainName, HostResource host) {
return newDomainResource(domainName)
.asBuilder()
.setNameservers(ImmutableSet.of(Key.create(host)))
.build();
}
public static DomainResource newDomainResource(
String domainName, String repoId, ContactResource contact) {
Key<ContactResource> contactKey = Key.create(contact);

View file

@ -19,6 +19,7 @@ import static org.joda.time.DateTimeZone.UTC;
import static org.joda.time.Duration.millis;
import google.registry.util.Clock;
import java.io.Serializable;
import java.util.concurrent.atomic.AtomicLong;
import javax.annotation.concurrent.ThreadSafe;
import org.joda.time.DateTime;
@ -27,7 +28,9 @@ import org.joda.time.ReadableInstant;
/** A mock clock for testing purposes that supports telling, setting, and advancing the time. */
@ThreadSafe
public final class FakeClock implements Clock {
public final class FakeClock implements Clock, Serializable {
private static final long serialVersionUID = 675054721685304599L;
// Clock isn't a thread synchronization primitive, but tests involving
// threads should see a consistent flow.

View file

@ -18,12 +18,15 @@ import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import google.registry.util.Sleeper;
import java.io.Serializable;
import javax.annotation.concurrent.ThreadSafe;
import org.joda.time.ReadableDuration;
/** Sleeper implementation for unit tests that advances {@link FakeClock} rather than sleep. */
@ThreadSafe
public final class FakeSleeper implements Sleeper {
public final class FakeSleeper implements Sleeper, Serializable {
private static final long serialVersionUID = -8975804222581077291L;
private final FakeClock clock;