Add TTL configs to Registry object (#1968)

* Add TTL configs to Registry object

* Change A and AAAA records TTL field name
This commit is contained in:
sarahcaseybot 2023-03-22 13:56:11 -04:00 committed by GitHub
parent d1676dfee9
commit 273a633847
2 changed files with 53 additions and 0 deletions

View file

@ -275,6 +275,26 @@ public class Registry extends ImmutableObject implements Buildable, UnsafeSerial
} }
} }
/**
* The time to live for DNS A and AAAA records.
*
* <p>When this field is null, the "dnsDefaultATtl" value from the config file will be used.
*/
Duration dnsAPlusAaaaTtl;
/**
* The time to live for DNS NS records.
*
* <p>When this field is null, the "dnsDefaultNsTtl" value from the config file will be used.
*/
Duration dnsNsTtl;
/**
* The time to live for DNS DS records.
*
* <p>When this field is null, the "dnsDefaultDsTtl" value from the config file will be used.
*/
Duration dnsDsTtl;
/** /**
* The unicode-aware representation of the TLD associated with this {@link Registry}. * The unicode-aware representation of the TLD associated with this {@link Registry}.
* *
@ -647,6 +667,21 @@ public class Registry extends ImmutableObject implements Buildable, UnsafeSerial
return numDnsPublishLocks; return numDnsPublishLocks;
} }
/** Returns the time to live for A and AAAA records. */
public Duration getDnsAPlusAaaaTtl() {
return dnsAPlusAaaaTtl;
}
/** Returns the time to live for NS records. */
public Duration getDnsNsTtl() {
return dnsNsTtl;
}
/** Returns the time to live for DS records. */
public Duration getDnsDsTtl() {
return dnsDsTtl;
}
public ImmutableSet<String> getAllowedRegistrantContactIds() { public ImmutableSet<String> getAllowedRegistrantContactIds() {
return nullToEmptyImmutableCopy(allowedRegistrantContactIds); return nullToEmptyImmutableCopy(allowedRegistrantContactIds);
} }
@ -737,6 +772,21 @@ public class Registry extends ImmutableObject implements Buildable, UnsafeSerial
return this; return this;
} }
public Builder setDnsAPlusAaaaTtl(Duration dnsAPlusAaaaTtl) {
getInstance().dnsAPlusAaaaTtl = dnsAPlusAaaaTtl;
return this;
}
public Builder setDnsNsAtl(Duration dnsNsAtl) {
getInstance().dnsNsTtl = dnsNsAtl;
return this;
}
public Builder setDnsDsAtl(Duration dnsDsAtl) {
getInstance().dnsDsTtl = dnsDsAtl;
return this;
}
public Builder setAddGracePeriodLength(Duration addGracePeriodLength) { public Builder setAddGracePeriodLength(Duration addGracePeriodLength) {
checkArgument( checkArgument(
addGracePeriodLength.isLongerThan(Duration.ZERO), addGracePeriodLength.isLongerThan(Duration.ZERO),

View file

@ -716,6 +716,9 @@
creation_time timestamptz not null, creation_time timestamptz not null,
currency text not null, currency text not null,
default_promo_tokens text[], default_promo_tokens text[],
dns_a_plus_aaaa_ttl interval,
dns_ds_ttl interval,
dns_ns_ttl interval,
dns_paused boolean not null, dns_paused boolean not null,
dns_writers text[] not null, dns_writers text[] not null,
drive_folder_id text, drive_folder_id text,